fix: usage errors exit 3, disjoint from the honest lane - #20
Merged
Merged
Conversation
FAMILY.md clause 1: exit 2 is the honest lane -- a first-class cannot-adjudicate verdict a consuming agent routes to a human WITHOUT retrying. A malformed invocation is the opposite: the caller should fix the call and retry. Sharing one code made the two indistinguishable, so an agent following the docs escalated its own bad calls to a human as if they were rulings. Exit 3 is the family precedent, set by srdcheck. Implemented by overriding ArgumentParser.error(), which hardcodes exit 2. The packaging-incomplete path and every unusable-input envelope stay on 2 -- those are verdicts, not bad calls. SKILL.md and tool.json updated to match -- a code change that leaves the contract prose stale is the exact defect this whole effort exists to catch. Regression tests assert usage errors exit 3 AND that legitimate refusals stay on 2, because the risk here is over-applying the change. Also bumps the family-conformance srdcheck pin to the first baseline that no longer waives HONEST_LANE_OVERLOAD; both must land together or the ratchet fails with STALE BASELINE. Closes #15 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
scripts/assert_test_collection.py pins the collected-test count so pytest cannot silently stop collecting part of the suite. Three tests added in this branch, so 202 -> 205. Updated deliberately, which is the point of the ratchet. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
8 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #15.
The defect
FAMILY.md clause 1: exit 2 is the honest lane — a first-class cannot-adjudicate verdict a consuming agent routes to a human without retrying. A malformed invocation is the opposite: the caller should fix the call and retry.
dmcheck returned 2 for both. They were distinguishable only by whether stdout happened to carry JSON, so an agent following the docs escalated its own bad calls to a human as if they were rulings.
srdcheck's exit 3 is the family precedent, and clause 1 now says so explicitly.
The fix
argparse hardcodes exit 2 in
parser.error(), somain()builds anArgumentParsersubclass that exits 3 instead. Nothing else moves:The packaging-incomplete path and every unusable-input envelope stay on 2 — those are verdicts, not bad calls.
Docs and tests
SKILL.mdandtool.jsonupdated to match. A code change that leaves the contract prose stale is the exact defect this whole effort exists to catch.New regression tests assert usage errors exit 3 and that a legitimate honest-lane refusal stays on 2 — the real risk here is over-applying the change, so both directions are locked. Suite: 157 tests, only the pre-existing
test_packagingbuild-backend env error, verified identical on untouchedmain.Release note
0.6.0 is unreleased (
tool.json: "public 0.5.5 predates this contract"), so this contract change folds into it rather than breaking a shipped version.Pin bump
Bundled, and required: chaoz23/srdcheck#88 removed this waiver, and the ratchet fails a waiver that no longer fires. Fix without pin bump →
STALE BASELINE.Remaining for dmcheck: #14 (
--pipe), now its only waived finding.🤖 Generated with Claude Code