Repository navigation
refactor(scripts): share required option arguments - #133095
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 30, 2026, 1:57 AM ET / 05:57 UTC. ClawSweeper reviewWhat this changesThe PR consolidates duplicated required split-option validation into a shared scripts helper, updates 13 parser consumers, and carries the helper into isolated docs, Docker, CI, and OpenGrep runtime closures. Merge readinessNo blocking correctness finding. Current main has not absorbed this refactor, and MEMBER authorship plus the protected maintainer label require normal human review before merge. Priority: P3 Review scores
Verification
How this fits togetherRepository scripts parse command-line inputs for documentation publishing, Docker packaging, release validation, and CI routing. Their parsers either run in the repository or are copied into isolated runtime trees used by automation. flowchart LR
A[Script command line] --> B[Option parsers]
B --> C[Shared required-value helper]
C --> D[Repository automation]
D --> E[Copied runtime closures]
E --> F[CI publishing and packaging]
Decision needed
Why: The patch is authored by a MEMBER and carries the protected maintainer label, so this workflow must not close or merge it automatically. Before merge
Agent review detailsSecurityNone. PR surfaceTests +57, Config +1, Other -76. Total -18 across 21 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep one shared helper for the common split-option invariant, retain consumer-specific normalization and equals-form parsing, and merge after ordinary maintainer and exact-head CI review. Do we have a high-confidence way to reproduce the issue? Not applicable: this is a behavior-preserving refactor rather than a reported product defect. The relevant parser and copied-runtime paths are source-readable and covered by focused tests. Is this the best way to solve the issue? Yes. The affected callers share the exact required split-option invariant, while the patch deliberately leaves caller-specific trimming, validation, and equals-form parsing in place. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 5a5be1690599. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (3 earlier review cycles) |
|
Maintainer disposition for the August 30, 2026 ClawSweeper review: #133095 (comment)
Exact-head CI: https://github.com/openclaw/openclaw/actions/runs/33295343467 |
|
Merged via squash.
|
* refactor(scripts): share required option arguments * test(scripts): copy option helper into OpenGrep fixture
What Problem This Solves
Thirteen scripts duplicated the same strict split-option invariant: read exactly the next argument and reject missing, empty, or dash-prefixed values. The local wrappers could drift independently, including inside copied runtime closures.
Why This Change Was Made
The architectural owner is now
scripts/lib/arg-utils.runtime.mjs, which exportsrequireOptionArgument; its declaration lives beside it. The thirteen exact local wrappers were removed and their callers now use the shared helper without migrating different-contract siblings.All copied-runtime closures are complete:
.openclaw-sync/lib/, and its workflow path trigger includes the runtime source.Existing caller behavior is preserved, including equals-form parsing in Docker packaging, downstream normalization in the Claude usage debugger, and downstream trimming and validation in the code-mode matrix. This is an internal behavior-preserving refactor with no Codex protocol or runtime involvement.
User Impact
No user-visible behavior changes. Script option handling now has one owner, while existing diagnostics and caller-specific normalization remain unchanged.
Production/tooling:
+85/-160(net-75). Tests/test support:+57/-0.No changelog entry: this is an internal behavior-preserving refactor.
Evidence
The two new tests meet the test-audit value bar:
-,-h, and--nextwith the exact diagnostic.Validation:
node scripts/check-changed.mjs --dry-run -- <all 21 changed paths>selectedcoreTests,scripts,testRoot, andtooling. The bounded changed gate passed after running its remaining checks directly in the sparse worktree.The aggregate
node --import ./scripts/tsx.mjs scripts/check-workflows.mtscould not finish because its pinnedpre-commit==4.6.2was unavailable from the configured package index. Its actionlint stage passed, and the equivalent remaining checks passed:After rebasing onto
cfddfc2f700ea456c66b887d70716b83d3ac0ea2, stable patch ID, changed-path hash, numstat hash, andgit range-diffall confirmed the reviewed patch was unchanged.