Skip to content

refactor(scripts): reuse dependency report CLI helpers - #132866

Merged
vincentkoc merged 1 commit into
mainfrom
refactor/dependency-report-cli-helpers
Aug 29, 2026
Merged

vincentkoc merged 1 commit into
mainfrom
refactor/dependency-report-cli-helpers

Conversation

@vincentkoc

Copy link
Copy Markdown
Member

What Problem This Solves

The dependency change report maintained its own argument parser and artifact writer even though repository-owned helpers already implement those contracts. That duplicated policy could drift as the shared script tooling evolves.

Why This Change Was Made

Reuse the canonical flag parser and report artifact writer while preserving the dependency report's existing defaults, errors, duplicate handling, option separator behavior, and mutually exclusive base selection.

User Impact

No user-visible behavior changes. Maintainers get one canonical implementation for these script contracts and less duplicate tooling code.

Evidence

  • node scripts/run-vitest.mjs test/scripts/dependency-changes-report.test.ts test/scripts/report-cli-helpers.test.ts test/scripts/arg-utils.test.ts (84 tests passed)
  • git diff --check
  • focused formatting, lint, and semantic checks passed
  • autoreview: no accepted/actionable findings
  • tooling LOC: +30/-64 (net -34); tests: +37/-0

@clawsweeper

clawsweeper Bot commented Aug 29, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

@vincentkoc vincentkoc self-assigned this Aug 29, 2026
@openclaw-barnacle openclaw-barnacle Bot added scripts Repository scripts size: S maintainer Maintainer-authored PR labels Aug 29, 2026
@vincentkoc
vincentkoc marked this pull request as ready for review August 29, 2026 21:58
@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Aug 29, 2026
@clawsweeper

clawsweeper Bot commented Aug 29, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 29, 2026, 6:04 PM ET / 22:04 UTC.

ClawSweeper review

What this changes

The PR replaces dependency-report-local flag parsing and artifact writes with existing shared script helpers and adds focused coverage for the full option set.

Merge readiness

⚠️ Ready for maintainer review - 1 item remains

No blocking findings. This focused maintainer-authored cleanup preserves the dependency-report CLI contract while removing duplicated parser and artifact-writing code; current main still has the local implementations.

Priority: P3
Reviewed head: dbfccd64fc1152a8c4633a586625a6f1379b3133

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A small, clean consolidation with source-backed contract preservation and focused tests has no blocking defect.
Proof confidence 🌊 off-meta tidepool Not applicable: This MEMBER-authored PR changes a non-user-facing repository script, so the external-contributor real-behavior-proof gate does not apply; source-level tests exercise the changed parser contract.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This MEMBER-authored PR changes a non-user-facing repository script, so the external-contributor real-behavior-proof gate does not apply; source-level tests exercise the changed parser contract.
Evidence reviewed 5 items Introduced refactor: The verified PR delta replaces only the report-local parser and artifact writer with established local helpers.
Parser contract retained: Each report option remains split-only, rejects missing or short-option values, preserves custom duplicate errors, and keeps the package-manager separator behavior supplied by the shared parser.
Artifact behavior retained: The shared artifact helper has the same no-path guard, parent-directory creation, and UTF-8 write behavior as the removed local function.
Findings None None.
Security None None.

How this fits together

The dependency-change report compares lockfiles and dependency-related Git changes, then writes JSON and Markdown artifacts. Release-evidence tooling invokes this CLI through the package script and consumes those artifacts in release review.

flowchart LR
  A[Release evidence tool] --> B[Dependency report CLI]
  B --> C[Shared flag parser]
  B --> D[Lockfile and Git comparison]
  D --> E[JSON and Markdown artifacts]
  C --> B
Loading

Before merge

  • Complete next step (P2) - No repair lane is needed: this is a focused maintainer-authored refactor with no discrete automated fix to perform.
Agent review details

Security

None.

PR surface

Tests +37, Other -34. Total +3 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 1 37 0 +37
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 1 30 64 -34
Total 2 67 64 +3

Review metrics

Metric Value Why it matters
Production versus test delta production +30/-64 (net -34); tests +37/-0 The production change removes duplicated parser and writer code, while the test increase specifies the retained report-CLI contract.

Stored data model

Persistent data-model change detected: serialized state: scripts/dependency-changes-report.mts, unknown-data-model-change: scripts/dependency-changes-report.mts. Confirm migration or upgrade compatibility proof before merge.

Technical review

Best possible solution:

Land the behavior-preserving consolidation with its focused CLI contract coverage, keeping parser and artifact behavior owned by the shared script helpers.

Do we have a high-confidence way to reproduce the issue?

Not applicable: this is a behavior-preserving script refactor; source comparison and focused tests cover the retained CLI contract.

Is this the best way to solve the issue?

Yes. Reusing the existing parser and artifact owner removes duplicate policy while keeping report-specific error wording and base-selection validation local.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against ca9f6315ae15.

Labels

Label changes:

  • add P3: This is a small internal tooling cleanup with no user-visible behavior change.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This MEMBER-authored PR changes a non-user-facing repository script, so the external-contributor real-behavior-proof gate does not apply; source-level tests exercise the changed parser contract.

Label justifications:

  • P3: This is a small internal tooling cleanup with no user-visible behavior change.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This MEMBER-authored PR changes a non-user-facing repository script, so the external-contributor real-behavior-proof gate does not apply; source-level tests exercise the changed parser contract.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

@vincentkoc

Copy link
Copy Markdown
Member Author

Rank-up move disposition:

  • Complete next step (P2): skipped because ClawSweeper reports no findings and explicitly says no repair lane is needed. Maintainer review artifacts are validated, exact-head CI is green, and native prepare-run passed on dbfccd64fc1152a8c4633a586625a6f1379b3133.
  • The stored-data-model note is not applicable: this change only consolidates repository script argument parsing and optional artifact writes; it does not alter persisted runtime state, schemas, migrations, or upgrade behavior.

@vincentkoc
vincentkoc merged commit 10da9ac into main Aug 29, 2026
153 checks passed
@vincentkoc
vincentkoc deleted the refactor/dependency-report-cli-helpers branch August 29, 2026 22:06
@vincentkoc

Copy link
Copy Markdown
Member Author

Merged via squash.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintainer Maintainer-authored PR P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. scripts Repository scripts size: S status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant