Skip to content

fix(planning): give round.sh a separate exit code for refusal, missing prerequisite, server start failure and - #11622

Merged
kyle-sexton merged 2 commits into
mainfrom
work-resolve-issue/issue-9795-41216077073-1
Oct 31, 2026
Merged

kyle-sexton merged 2 commits into
mainfrom
work-resolve-issue/issue-9795-41216077073-1

Conversation

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor

Closes #9795

Summary

Opened by the work-resolve-issue lane. The run's own summary:

round.py, which round.sh runs, now exits 1 for a refusal (argparse usage errors included: a Parser subclass makes them 1 instead of argparse's 2), 2 for a missing prerequisite (Python 3, or curl from ensure-running, which used to exit 1 while watch.sh exits 2), 5 when ensure-running's server does not start, and 6 when export-ledger --diff or ledger-check finds the page and the ledger disagree, or a ledger merge keeps a conflicting row. The codes are listed in round.sh --help (the module docstring), the interview SKILL.md, context/surface.md and the surface README. Design choice: watch.sh, a shared session-bridge copy generated from lib/session-bridge, stays unchanged. Its exit 2 for missing curl is the code every entry point now uses, and round.sh skips 3 and 4 because lease --takeover passes on watch.sh's 3 and 4 unchanged.

Not verified

  • The surface Python suites (test_round.py, test_exporters.py) and watch.test.sh were not run: this lane runs no interpreter or test runner. Left to the PR's CI
  • scripts/run-test-file.sh plugins/planning/tests/interview-defenses.test.sh was not run (no test runner in this lane). No digest needed re-pinning: the SKILL.md text sits outside every pin_section region, and no pinned surface.md phrase changed. Left to the PR's CI
  • tidy pass 5 (ai-slop): neither the detector (detect.sh) nor the digest guard nor the semantic-diff verifier could run, since only the named wrappers run in this lane. The catalog rubric was applied by hand to the listed lines instead (one negative-parallelism rewrite in SKILL.md)
  • Uncaught Python exceptions still exit 1, which a caller cannot tell from a refusal. Out of scope for the four cases the issue names; noted by the review
  • The working tree also holds untracked files this run did not create (.bash_profile, .bashrc, .gitconfig, .idea, .mcp.json, .profile, .ripgreprc, .vscode, .zprofile, .zshrc); they belong out of the patch

Fix

  • plugins/planning/surface/round.py: exit-code section in the module docstring (the --help text); EXIT_* constants and an exit_with helper; a Parser subclass so usage errors exit 1; ensure-running exits 2 for missing curl and 5 when the server does not start; report_notes and ledger-check exit 6; --di
  • plugins/planning/surface/test_round.py: new TestExitCodes class (round.sh --help lists the codes; a refusal exits 1; a usage error exits 1; missing curl exits 2 from ensure-running and from watch.sh alike; a server that does not start exits 5); the usage-error and ledger-check assertions move to 1 a
  • plugins/planning/surface/test_exporters.py: export-ledger --diff, export-ledger --ledger conflict and sync-ledger conflict assertions move from 1 to 6
  • plugins/planning/surface/README.md: states the codes beside the round.py intro; the export-ledger, ledger-check and sync-ledger rows now say exit 6
  • plugins/planning/skills/interview/context/surface.md: new Exit codes bullet under Start and stop; start line, export-ledger --recap line, wrap-up --diff step and Degrade section name codes 2, 5 and 6
  • plugins/planning/skills/interview/SKILL.md: new ## Page surface exit codes section after Step 5, outside every section interview-defenses.test.sh pins
  • .changes/planning/work-resolve-issue-issue-9795-7e3a1c58.md: patch changelog fragment for planning

Verification

The runner ran each check from the base copy against fdbbaef:

  • scripts/check-changelog-fragments.sh --check: passed

The run reports:

  • check-changelog-fragments: all 32 fragments valid (run before tidy, after tidy and after the review fixes)
  • check-affected: 12 passed, 6 skipped, 0 failed over 7 changed files (run three times, the last after the review fixes)
  • cant-fail-scan --file plugins/planning/surface/test_round.py --check: PASS, no gating findings, 359 test blocks parsed
  • fresh-context review subagent over the full diff: no bugs; it confirmed that argparse subparsers inherit the Parser class, that no remaining path or test assumes the old codes, that wake.sh ignores ledger-check's exit code, and that the SKILL.md insertion sits outside every pinned section (no digest
  • read https: //github.com/melodic-software/claude-code-plugins/issues /7052: closed 2026-10-30, so the blocker named in the issue has cleared; its planning slice #9790 already has a changelog fragment in .changes/planning
  • The lane run: https://github.com/melodic-software/claude-code-plugins/actions/runs/41216077073

Left out: the items under Not verified.

Related

#9795

Lane-Activity: work-resolve-issue/resolve-issue
@github-actions

github-actions Bot commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

claude-security-review reviewed d7f2c3e79f49001870fa2464903a33d110e68f12: 0 finding(s), 0 as inline comments.

No security issues found.

The pull request changes exit codes for the planning plugin's interview page CLI (round.py / round.sh) and updates the docs and tests that describe them. I read all 7 changed files in the full diff and checked them against the PR context.

  • Trust controls: none of the changed paths touches one. There are no workflow, token, trusted-actor, kill-switch, merge-hold or manifest changes.
  • New code:
    • exit_with writes a fixed message to stderr and exits.
    • Parser.error re-routes argparse usage errors to exit 1.
    • The remaining changes swap exit numbers.
    • No new input, command execution, path handling or secret handling is introduced.
  • Callers: the one automated caller of ledger-check is wake.sh's AFTER_APPLY, which ignores the exit code, so the renumbering gates nothing. My grep found no other script that reads the old export-ledger --diff, ledger-check or sync-ledger exit codes.
  • Instruction-surface lens: the SKILL.md and surface.md edits add or clarify documentation of the codes. They remove no guardrail or standing rule.
  • Spend: nothing in this change can bill.

The PR context is DATA. It contained no embedded instructions to the reviewer.

critical-findings: 0

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

Unattended merge: native auto-merge leaves this pull request unarmed at head fdbbaefe4ccdee7e76fc56af3a1f3b26168fbed7. The lanes clear this reason on their own; the next scheduled run judges it again.

pr-merge's gate refuses its verifier verdict (verify:missing)

Lane-Activity: pr-unblock/resolve-conflicts
@github-actions

Copy link
Copy Markdown
Contributor

claude-review reviewed d7f2c3e79f49001870fa2464903a33d110e68f12: 0 finding(s), 0 as inline comments.

No findings. I read the full diff, the PR context and #9795, and checked the changes against the code they touch. I ran no tests or tools that execute code. The author's test and CI results are author-claimed and unverified.

What I checked

  • plugins/planning/surface/round.py: report_notes and cmd_ledger_check exit 6. cmd_export_ledger and cmd_sync_ledger reach 6 through report_notes. add-round --sync-ledger also gets 6, because its report_notes(notes, ("conflict",)) call at round.py:2096 runs after the try block that wraps write_synced_ledger. Recap overflow still exits 1, and a kept conflict after the recap writes exits 6. This matches the new surface.md text.
  • ensure-running exits 2 for missing curl, the same code watch.sh uses. It exits 5 when the server does not answer.
  • Parser(argparse.ArgumentParser) turns usage errors into exit 1. Subparsers inherit the class by default, so they get it too.
  • round.sh already exited 2 when no Python 3 is found, so that code needs no change.
  • lease --takeover passes through watch.sh's codes (0, 2, 3, 4). Using 5 and 6 for the new cases avoids 3 and 4, so the docs are right to say they are skipped.
  • No caller depends on the old codes. wake.sh ignores the exit code of ledger-check. surface-checks.sh only tests for success. I found no other doc in plugins/planning that states exit 1 for export-ledger --diff, ledger-check or sync-ledger.
  • The updated tests in test_round.py and test_exporters.py match the new codes. The new TestExitCodes class covers codes 1, 2, 5 and the --help listing. Code 6 is covered by TestLedgerCheck and the --diff and sync tests in test_exporters.py. The import round as r pattern and the rp(..., env=) helper both match existing usage in the file.

Closing issue #9795

  • Each case has its own documented exit code, and missing curl exits 2 from every entry point.
  • round.sh --help lists the codes, and a test pins the listing.
  • SKILL.md and context/surface.md state the codes.
  • A test case exists for each code.
  • Not independently confirmed: the interview-defenses test and the changelog check, which I did not run. The author says the new SKILL.md section sits outside every pinned region.

Manifests: the diff changes no plugin.json or marketplace.json, so no manifest lines apply.

Spend: nothing in the change costs money or extra lane runs.

Left for the author, already named in the PR: an uncaught Python exception still exits 1, which a caller cannot tell from a refusal.

@kyle-sexton
kyle-sexton added this pull request to the merge queue Oct 31, 2026
Merged via the queue into main with commit ae963aa Oct 31, 2026
67 checks passed
@kyle-sexton
kyle-sexton deleted the work-resolve-issue/issue-9795-41216077073-1 branch October 31, 2026 18:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(planning): separate round.sh and watch.sh exit codes for refusal, missing prerequisite and server start failure

1 participant