Repository navigation
Conversation
Arguments after the script path were silently ignored, so `exec.sh <script> --help` (an agent checking usage) applied the script to the model. Outside --patch, --help/-h now print usage and exit 0, and any other trailing argument exits 2 before the lock, commit, snapshot, BUILD-LOG and mxcli. --patch args still pass through. Fixture: tests/wave2/test-exec-lock-watch.sh (master 134 pass / 18 fail, branch 152 / 0). Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01HXpQSjXefSNicGGqP4aiSC
|
Review: MERGE-AFTER-FIX — the fix is correct and breaks no caller, but
So a synced project gets no new exit 2 from any toolkit caller. The check is plain arg parsing that runs before
The On the
Generated by Claude Code |
Exit 0 means "applied, gate passed" when a script is named, so usage printed after a script now exits 2 (the script is still not run). A bare or leading `exec.sh --help` keeps exit 0. Header exit-code table and the NO LINE note document both; fixture updated (+ bare --help case). Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01HXpQSjXefSNicGGqP4aiSC
|
Review: MERGE — re-review at 90d6e5d: both MERGE-AFTER-FIX items are fixed. A trailing
The check is plain arg parsing that runs before
No new bugs. Generated by Claude Code |
Fixes #820
Direct lane
What changed and why (one paragraph):
project-bin/exec.shrefused an unknown--flagonly when it came before the script. Anything after the script path was ignored, soexec.sh mdlsource/NNN-x.mdl --help(an agent checking usage, seen in a simulated build run on 2026-11-20) applied the script to the model. The script also landed in BUILD-LOG. Now, once the leading flags and the script are parsed and--patchis not in use:--help/-hafter the script prints usage and exits 2 (the script is NOT run; exit 0 means "applied, gate passed" once a script is named), and any other argument after the script exits 2 with✗ unexpected argument after the script: '<arg>' — nothing was executed.Both happen before the lock,--commit-first, the snapshot, the BUILD-LOG write and any mxcli call. A bare or leadingexec.sh --help/--commit-first --help(no script before it) prints usage and exits 0. Both cases are documented in the header's exit-code table and its NO LINE note.--patch <script> [args...]is unchanged: its args go to the patch script, including a--help. The advisory modes (--change-class,--watch-compat,--subjects) take one script, so they also refuse a trailing argument. This is a deliberate new exit 2 for a misuse that used to run. After the independent review (MERGE-AFTER-FIX),<script> --helpexits 2, so the PR now follows the issue's proof line.Impact
exec.sh <script> <anything>outside--patchnow exits 2 (a usage error per the header's exit-code table) instead of running. It touches nothing. `<script> --helpproject-bin/exec.sh(arg parsing, ~20 lines, right after the leading-flag loop). It may need a rebase against other open exec.sh PRs, but there is no logical dependency. It uses bash${@:2}, which bash 3.2 (macOS) supports. No new tools and no new artifact reads.render-routing.sh --check: baseline 65568 words / budget 80000, unchanged).[ $# -gt 1 ]test per exec, with no process start.Time cost: per exec · ~0 s (one shell test, no fork) on Linux container · can force rework: n · offset: maintainer OK
Field evidence:
No field run against a real model: mxcli is not available in this environment (the download returned 403). The evidence is the simulated-run finding in #820, where
exec.sh <script> --helpre-applied the script, plus a fixture whose stubbedmxclirecords every call:tests/wave2/test-exec-lock-watch.sh, new#820section:exec.sh s.mdl --help,exec.sh s.mdl -handexec.sh --commit-first s.mdl --helpeach exit 2 and print usage. mxcli is not called, BUILD-LOG is unchanged and no snapshot is taken.exec.sh --helpexits 0 and prints usage. mxcli is not called, BUILD-LOG is unchanged and no snapshot is taken.exec.sh s.mdl --bogusexits 2 and names the argument. mxcli is not called, BUILD-LOG is unchanged, no snapshot is taken and no lock is left.--subjects s.mdl extraalso exits 2.exec.sh s.mdlexits 0, reachesmxcli execand writes its BUILD-LOG row.--patch args-patch.sh --help --x 1: the patch script receives--help --x 1, and exec.sh prints no usage of its own.checkwas called, BUILD-LOG changed, a snapshot was taken,--bogusexit 0)--helpcase was added)The other fixtures that target exec.sh, all green on the branch: test-exec-approval (47/0), change-class (21/0), check-refusal (10/0), cr-brief-warn (19/0), crash-rollback (13/0), gate-kind (32/0), gate-log (24/0), gate-retry (52/0, including the L usage cases), hash-verify (49/0,
--patch, rerun after the review fix), lint-autorestore (17/0), lint-diff (9/0), process-budget (4/0), result-line (72/0), step-times (7/0), subjects (6/0).Also run:
bin/check-scripts.sh(145/145 parse),bin/check-pr-discipline.sh origin/master(clean), the leak guard (clean) andbin/check-portability.sh(clean).find_mprand is layout-independent. Both platforms are considered:${@:2}is bash 3.2-safe and there is no new external tool. The golden input is the CLI argument line itself; there is no tool output to capture.CHANGELOG.mdline appended, credited to the simulated requirements-driven build run (2026-11-20)Review: MERGE-AFTER-FIX — the fixes are pushed (90d6e5d) and await re-review
https://claude.ai/code/session_01HXpQSjXefSNicGGqP4aiSC
Generated by Claude Code