Skip to content

fix(ci): reject invalid changed-scope arguments - #120913

Merged
steipete merged 3 commits into
openclaw:mainfrom
qingminglong:fix/ci-changed-scope-args
Sep 1, 2026
Merged

steipete merged 3 commits into
openclaw:mainfrom
qingminglong:fix/ci-changed-scope-args

Conversation

@qingminglong

@qingminglong qingminglong commented Aug 9, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Malformed changed-scope CLI calls silently selected an empty CI matrix. Missing --base became an empty changed-path list; unknown options were ignored.

Why This Change Was Made

Validate arguments at the existing parser boundary so malformed calls reach the established full-scope error handler. Consolidating the duplicated base/head branches keeps the repair at one owner, with no new validation layer. Valid empty diffs still select no checks, and the PR merge-head first-parent path retains its current behavior.

This intentionally spends full CI capacity when an invocation is malformed instead of reporting success while skipping coverage. All three workflow invocation branches already supply a base and head, so normal CI calls retain their selection behavior. Production delta: +9/-8 (net +1); tests: +79/-66 (net +13, mostly indentation from extending the existing fixture table). The remaining production line supports the required-base/unknown-option contract after merging the duplicate option branches.

User Impact

CI configuration mistakes produce conservative coverage and a diagnostic instead of a successful no-op. Thanks @qingminglong.

Evidence

  • Before the fix, actual node scripts/ci-changed-scope.mjs invocations with --head HEAD or --base HEAD --head HEAD --mystery exited successfully and wrote run_node=false with changed_paths_json=[].
  • After the fix, those same commands write run_node=true and changed_paths_json=null. Valid --base HEAD --head HEAD, with and without --merge-head-first-parent, still write empty scope.
  • The regression produced three expected failures before the repair: parser validation and two zero-install CLI scenarios. All six changed-scope test files then passed, 182 tests total, covering platform routing, native/localization and contract-fixture siblings.
  • node scripts/check-changed.mjs -- scripts/ci-changed-scope.mjs src/scripts/ci-changed-scope.test.ts completed successfully, including core test types, script/core lint, all dead-export scans and dependency/boundary guards. The temp-directory report emitted existing-main advisory findings and passed.
  • Current-main Chromium UI-routing improvements are retained. The integrated owner/control-UI pair passed all101tests, including both newly added Chromium path cases.
  • Independent Codex P0 review of the complete integrated candidate passed with no findings; the full staged inventory and both changed files were included across two complete review chunks.
  • Node24.20.0 was used with synthetic temporary repositories and no dependency installation in the zero-install cases.

Provenance: commit 59567a8c5dcb introduced the permissive script parser, but empty-path execution still selected full scope then. The inspected raw-parent patch for da9700903c72 changed that empty path to the no-op scope and made malformed invocations skip coverage. The fix restores argument validation without removing the useful valid-empty-diff optimization.

Published head: 0467784ede926f51b9331dc7e7acae507fd4db49. Hosted CI is running; it must pass before landing.

@openclaw-barnacle openclaw-barnacle Bot added scripts Repository scripts size: XS labels Aug 9, 2026
@qingminglong
qingminglong marked this pull request as ready for review August 9, 2026 05:18
@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P2 Normal backlog priority with limited blast radius. labels Aug 9, 2026
@clawsweeper

clawsweeper Bot commented Aug 9, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 1, 2026, 5:43 AM ET / 09:43 UTC.

ClawSweeper review

What this changes

The PR makes the CI changed-scope script treat a missing base or unknown flag as a full-scope fallback instead of silently selecting an empty CI matrix.

Merge readiness

⚠️ Ready for maintainer review - 2 items remain

Keep this PR open: current main still accepts a missing base and ignores unknown flags, while the proposed parser-boundary repair covers both paths. Exact-head CI is still in progress and the available test merge is stale.

Priority: P2
Reviewed head: 0467784ede926f51b9331dc7e7acae507fd4db49

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) The repair is focused, source-supported, and backed by direct command evidence; only current-main merge-candidate validation remains.
Proof confidence 🐚 platinum hermit (4/6) Sufficient (terminal): The PR body supplies before/after direct Node command results for the changed production entrypoint in synthetic Git repositories, and the committed fixture executes the same command path for missing-base and unknown-flag cases with observed full-scope outputs.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (terminal): The PR body supplies before/after direct Node command results for the changed production entrypoint in synthetic Git repositories, and the committed fixture executes the same command path for missing-base and unknown-flag cases with observed full-scope outputs.
Evidence reviewed 6 items Current-main behavior: Fetched current main still has a permissive parser: it leaves base empty and ignores unrecognized arguments before direct execution turns an empty path list into EMPTY_SCOPE.
Introduced repair: The verified merge-base-to-head patch adds unknown-argument rejection and a required-base check at the parser owner.
Workflow callers: The push, pull-request, and dispatch branches all provide both base and head arguments, with the pull-request branch retaining first-parent handling.
Findings None None.
Security None None.

How this fits together

CI workflows pass base and head revisions to the changed-scope script, which turns their diff into a set of test lanes. Invalid input must select conservative full coverage rather than suppressing checks.

flowchart LR
  A[CI workflow revisions] --> B[Changed-scope command]
  B --> C[Argument parser]
  C --> D{Base and flags valid?}
  D -->|yes| E[Diff and lane selection]
  D -->|no| F[Full-scope fallback]
  E --> G[CI test jobs]
  F --> G
Loading

Before merge

  • Resolve merge risk (P1) - The branch targets an older base and the supplied test merge is stale; refresh the merge candidate and let the exact-head CI-routing check complete before merge.
  • Complete next step (P2) - No repair job is needed: no actionable patch defect was found; the remaining action is normal exact-head CI and maintainer merge review.
Agent review details

Security

None.

PR surface

Tests +13, Other +1. Total +14 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 1 79 66 +13
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 1 9 8 +1
Total 2 88 74 +14

Review metrics

Metric Value Why it matters
Production vs test delta production +1 net (+9/-8); tests +13 net (+79/-66) The small production increase is limited to parser validation; the test delta adds malformed-command coverage while restructuring the existing fixture table.

Merge-risk options

Maintainer options:

  1. Refresh the merge candidate (recommended)
    Rebase or otherwise refresh against current main and verify the CI-routing result on the resulting exact merge candidate before merge.
  2. Accept the conservative fallback
    After exact-head validation succeeds, accept that malformed private CI invocation inputs intentionally consume full CI capacity rather than silently skipping coverage.

Technical review

Best possible solution:

Keep validation at the parser boundary so malformed calls take the existing conservative fallback, then validate the refreshed merge candidate against current main.

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

Yes—source-reproducible: current main leaves a missing base empty and ignores unknown flags, then converts the empty path result into an empty CI scope.

Is this the best way to solve the issue?

Yes. Parser-boundary validation funnels both malformed forms through the existing full-scope catch path while leaving valid empty diffs unchanged.

AGENTS.md: found and applied where relevant.

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

Labels

Label justifications:

  • P2: Malformed CI scope arguments can suppress intended test coverage, but normal workflow callers already provide valid arguments.
  • merge-risk: 🚨 automation: The PR intentionally changes CI lane selection for malformed command input from empty scope to full scope.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (terminal): The PR body supplies before/after direct Node command results for the changed production entrypoint in synthetic Git repositories, and the committed fixture executes the same command path for missing-base and unknown-flag cases with observed full-scope outputs.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR body supplies before/after direct Node command results for the changed production entrypoint in synthetic Git repositories, and the committed fixture executes the same command path for missing-base and unknown-flag cases with observed full-scope outputs.

Evidence

What I checked:

  • Current-main behavior: Fetched current main still has a permissive parser: it leaves base empty and ignores unrecognized arguments before direct execution turns an empty path list into EMPTY_SCOPE. (scripts/ci-changed-scope.mjs:744, 7b435825b947)
  • Introduced repair: The verified merge-base-to-head patch adds unknown-argument rejection and a required-base check at the parser owner. (scripts/ci-changed-scope.mjs:747, 0467784ede92)
  • Workflow callers: The push, pull-request, and dispatch branches all provide both base and head arguments, with the pull-request branch retaining first-parent handling. (.github/workflows/ci.yml:976, 7b435825b947)
  • Regression coverage: The added parser assertions and synthetic zero-install command cases verify that malformed inputs write full-scope outputs while existing valid empty-diff cases remain distinct. (src/scripts/ci-changed-scope.test.ts:92, 0467784ede92)
  • Feature history: Local commit metadata shows the same contributor authored both the original tested changed-scope script and the later no-op fanout optimization; raw-parent source comparison was unavailable from this partial clone, so this is routing context rather than an introduction claim. (scripts/ci-changed-scope.mjs:744, 59567a8c5dcb)
  • Real command proof: The PR body reports before/after direct Node executions of this production entrypoint in synthetic Git repositories, including full-scope output for the two malformed cases; this aligns with the committed end-to-end fixture. (0467784ede92)

Likely related people:

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

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Refresh against current main and confirm the exact merge candidate passes the CI-routing check.

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.

History

Review history (10 earlier review cycles; latest 8 shown)
  • reviewed 2026-08-14T22:24:52.176Z sha 1dd80740580a0a14abf70175af3f10f3459b3e43 :: needs maintainer review before merge. :: none
  • reviewed 2026-08-15T06:46:09.577Z sha 1dd80740580a0a14abf70175af3f10f3459b3e43 :: needs maintainer review before merge. :: none
  • reviewed 2026-08-20T08:56:18.462Z sha f3b7be47cfdb2988966d0a2403d8792375f88d29 :: needs real behavior proof before merge. :: none
  • reviewed 2026-08-24T13:56:54.203Z sha f3b7be47cfdb2988966d0a2403d8792375f88d29 :: needs real behavior proof before merge. :: none
  • reviewed 2026-08-26T17:05:01.301Z sha 3c75946caea91dde513e1661fd0b3da28327c047 :: needs real behavior proof before merge. :: none
  • reviewed 2026-08-27T10:07:29.589Z sha e98997e :: needs real behavior proof before merge. :: none
  • reviewed 2026-08-27T10:25:28.299Z sha e98997e :: needs maintainer review before merge. :: none
  • reviewed 2026-08-27T11:09:01.650Z sha e98997e :: needs maintainer review before merge. :: none

@qingminglong
qingminglong force-pushed the fix/ci-changed-scope-args branch from 9c4f419 to 1dd8074 Compare August 9, 2026 15:01
@qingminglong

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Aug 9, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. 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. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. labels Aug 9, 2026
@vincentkoc
vincentkoc force-pushed the fix/ci-changed-scope-args branch from 1dd8074 to f3b7be4 Compare August 20, 2026 08:50
@clawsweeper clawsweeper Bot added merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. and removed proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Aug 20, 2026
@qingminglong
qingminglong force-pushed the fix/ci-changed-scope-args branch from f3b7be4 to aca8605 Compare August 26, 2026 14:51
@qingminglong
qingminglong force-pushed the fix/ci-changed-scope-args branch from 3c75946 to e98997e Compare August 27, 2026 10:00
@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. labels Aug 27, 2026
@qingminglong

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Aug 27, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. 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. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Aug 27, 2026
Consolidate base/head option handling and preserve full-scope error routing. Retain current main routing and prove malformed inputs plus valid empty diffs through the real zero-install command.

Co-authored-by: qingminlong <[email protected]>
@steipete

steipete commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Reviewed and improved the existing owner-boundary repair at 0467784ede926f51b9331dc7e7acae507fd4db49, preserving contributor credit. The PR body now contains the failing/passing real-command evidence, source history, production/test deltas, and focused validation. Exact-head hosted CI remains required before landing.

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Sep 1, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@steipete

steipete commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Exact-head CI is now green for 0467784ede926f51b9331dc7e7acae507fd4db49: https://github.com/openclaw/openclaw/actions/runs/33493164985 (required gate completed successfully).

The latest ClawSweeper review has no source findings. Its current-main rank-up is addressed by a clean merge-tree against a0866b51da278b0190b9fd64ccc76a0793009c41: resulting tree d01a6843ff1b19fa519809ce7c8641d486db3896 changes only the intended parser and test files, both byte-identical to the tested head. Skipping an additional rebase for unrelated main drift; the parser-boundary repair and valid-empty-diff control are unchanged. Malformed CI arguments intentionally use the established full-scope fallback.

@steipete
steipete merged commit de64e91 into openclaw:main Sep 1, 2026
87 checks passed
@steipete

steipete commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 2, 2026
* fix(ci): reject invalid changed-scope arguments

Punchcard-Session: frost-willow-valley-xh

* test(ci): distinguish full and fast scope fallbacks

---------

Co-authored-by: Peter Steinberger <[email protected]>
Co-authored-by: qingminlong <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. 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.

2 participants