Completes the wrapper-family remediation (P1; Jason remediation list 2026-08-28). TRUE COVERAGE (census-corrected per review 358): 16 wrappers carry the usage-error contract on this branch (issue-comment via base PR #1462; issue-close, issue-reopen, issue-create, issue-edit, issue-assign, issue-list, issue-view, pr-create, pr-edit, pr-close, pr-review, milestone-create, milestone-close, milestone-list, lane-brief here). The earlier "all 22" claim in a commit message was FALSE and is superseded by this body.
Contract carried by the 16:
Usage errors print to stderr and exit 2 (unknown option, missing required, value-less flags, option-like values, semantic invocation checks). Provider/credential/verification failures exit 1; gh failures on GitHub paths normalized to 1 (gh usage errors exit 2 and would collide).
Comment carriers take -b/--body canonical with -c/--comment alias.
Every carrier ships an enrolled usage-contract suite (CI population 88 at branch tip); template bug fixed across all suites (expect_stderr unbound $desc); lookup pipelines under pipefail fail loud.
ci-queue-wait.sh: its exit codes are CONTRACTUAL (0 green / 1 provider-asserted non-green / 75 retryable merge-hold, CANNOT_ASSERT semantics documented in TOOLS-REFERENCE); reserving 2 for usage errors requires a designed mapping against that contract, not a mechanical conversion. Excluded deliberately.
pr-merge.sh: merge-gating wrapper with a rich existing exit contract (queue semantics, head-pin verification failures); same design-first class as ci-queue-wait.
pr-ci-wait.sh: wait/poll tool with its own status contract; design-first class.
mosaic-worktree.sh: lifecycle tool governed by its own contract (PRD #1174 refusal semantics); excluded pending that contract ruling.
pr-diff.sh, pr-list.sh, pr-view.sh, pr-metadata.sh: read-only viewers, mechanical conversions; scheduled as fast-follow, not deliberate exclusions on merit.
Verification: all suites pass in the brain tree and this worktree (three pre-existing suites are tty/stdout-sensitive: stash-verified identical failures on clean origin/next; CI passes them). Codex: approve, zero findings. Review 358 (rev-code-01): code passes.
Completes the wrapper-family remediation (P1; Jason remediation list 2026-08-28). TRUE COVERAGE (census-corrected per review 358): 16 wrappers carry the usage-error contract on this branch (issue-comment via base PR #1462; issue-close, issue-reopen, issue-create, issue-edit, issue-assign, issue-list, issue-view, pr-create, pr-edit, pr-close, pr-review, milestone-create, milestone-close, milestone-list, lane-brief here). The earlier "all 22" claim in a commit message was FALSE and is superseded by this body.
Contract carried by the 16:
- Usage errors print to stderr and exit 2 (unknown option, missing required, value-less flags, option-like values, semantic invocation checks). Provider/credential/verification failures exit 1; gh failures on GitHub paths normalized to 1 (gh usage errors exit 2 and would collide).
- Comment carriers take -b/--body canonical with -c/--comment alias.
- lane-brief: getopts replaced with while/case carrying R2 long-flag aliases; login-resolution failure reclassified exit 2 -> 1 (credential class).
- Every carrier ships an enrolled usage-contract suite (CI population 88 at branch tip); template bug fixed across all suites (expect_stderr unbound $desc); lookup pipelines under pipefail fail loud.
DELIBERATE EXCLUSIONS with reasons (8, behaviorally verified: unknown option exits 1):
- ci-queue-wait.sh: its exit codes are CONTRACTUAL (0 green / 1 provider-asserted non-green / 75 retryable merge-hold, CANNOT_ASSERT semantics documented in TOOLS-REFERENCE); reserving 2 for usage errors requires a designed mapping against that contract, not a mechanical conversion. Excluded deliberately.
- pr-merge.sh: merge-gating wrapper with a rich existing exit contract (queue semantics, head-pin verification failures); same design-first class as ci-queue-wait.
- pr-ci-wait.sh: wait/poll tool with its own status contract; design-first class.
- mosaic-worktree.sh: lifecycle tool governed by its own contract (PRD #1174 refusal semantics); excluded pending that contract ruling.
- pr-diff.sh, pr-list.sh, pr-view.sh, pr-metadata.sh: read-only viewers, mechanical conversions; scheduled as fast-follow, not deliberate exclusions on merit.
Verification: all suites pass in the brain tree and this worktree (three pre-existing suites are tty/stdout-sensitive: stash-verified identical failures on clean origin/next; CI passes them). Codex: approve, zero findings. Review 358 (rev-code-01): code passes.
Stacked on #1462 (merge that first).
Same contract as issue-comment (PR #1462): -b/--body canonical comment
flag with -c/--comment alias; usage errors stderr + exit 2 (unknown
option, missing -i, value-less flags); provider failures normalized to
exit 1 on the GitHub path (gh's own usage errors exit 2 and would
collide with the reserved status).
New suite test-issue-close-usage-contract.sh, enrolled in
framework-shell CI (enumeration guard OK, population 74). Probe
assertions split: parser arms must contact zero providers; sandbox arms
may issue detection reads only (tea login list), never gh/curl.
Existing fail-closed suite still green. Mirrored to the brain tree.
Same contract as issue-close (7a38eed1): -b/--body canonical comment
flag with -c/--comment alias; usage errors stderr + exit 2 (unknown
option, missing required, value-less flags); GitHub-path provider
failures normalized to exit 1.
Both new suites enrolled in framework-shell CI (enumeration guard OK,
population 76). pr-close's suite uses FAILING provider stubs (exit 99):
its API fallback treats a successful curl as a closed PR, so exit-0
stubs let sandbox arms succeed (measured); post-sandbox contact
assertions are correspondingly scoped, parser arms remain zero-contact.
Mirrored to the brain tree; all usage-contract suites green in both.
-b/--body canonical review comment flag with -c/--comment alias; usage
errors stderr + exit 2 (unknown option, missing -n/-a, value-less
flags including -a/-l/-r/-H, and the semantic check: request-changes
without a comment). Existing pr-review suites still green.
Suite enrolled in framework-shell CI (enumeration guard OK); mirrored
to the brain tree.
issue-edit already used long-flag-first parsing; this adds the rc=2
usage-error contract (unknown option, missing -i, value-less flags
across all five options), the exit-code line in help, and the enrolled
usage-contract suite (population 78). Mirrored to the brain tree.
- issue-create: usage() default exit is now 2 (usage-error contract);
unknown option, missing title, and value-less -t/-b/-l/-m land there
with stderr messages; exit-code line added to help. Interactive
-i/--interactive unchanged (boolean, no value arm). Existing
body-safety and interactive-auth suites still green.
- Template bug fixed across ALL seven usage-contract suites:
expect_stderr referenced an unbound $desc (should be $2); latent
until issue-create's capitalized 'Unknown option' missed the
case-sensitive grep and fired it. All seven re-verified green.
- Suite enrolled (population 79); mirrored to the brain tree.
usage() default exit 2; semantic invocation checks (mutual exclusion,
integer/format validation, missing edit option, --login-only-for-Gitea)
exit 2; value guards on all value-taking options; existing pr-edit
suite still green; usage-contract suite enrolled (population 80);
mirrored to the brain tree.
usage() default exit 2 (usage-error contract); value guards on all
seven value-taking options; -d/--draft stays boolean. Existing
fallback-default-base suite green (29/29). Usage-contract suite
enrolled (population 81); mirrored to the brain tree.
usage_error contract (stderr + exit 2) with value guards on every
value-taking option and the missing-required checks (milestone-close
-t, issue-view -i). Three suites enrolled (population 85); green in
both trees; mirrored to the brain tree.
- issue-list + milestone-create: usage() default exit 2, value guards,
missing-title via usage_error.
- lane-brief: getopts replaced with a while/case parser carrying R2
long-flag aliases (--repo --milestone --label/--labels --login
--limit) beside the short forms; login-resolution failure reclassified
from exit 2 to exit 1 (credential class, not an invocation defect).
- Three suites enrolled (population 88); lane-brief pr-linkage suite
still ALL PASS; green in both trees; mirrored to the brain tree.
With this, every agent-facing wrapper in tools/git carries the R1/R4
usage-error contract (22/22 non-guard wrappers; guards keep their own
contracts).
An unsupported --action previously reached platform detection (and
could touch the provider) before failing with a provider-class status;
comment-without-body exited 1 mid-switch. Both now fail fast with
usage_error (rc 2, stderr) immediately after argument parsing. Test
arms added including the zero-provider-contact assertion for
invalid-action runs.
request-changes and comment both validate their required body
immediately after argument parsing (rc 2, stderr, zero provider
contact). The repo-host-override suite's action-message expectation
updated to the new wording; suite green.
- Value guards now reject option-like values: --anything always, and
single-dash flag shapes (-h, -i). Previously -b --help consumed
--help as the body and performed the write (codex example:
issue-close -i --help proceeding to 'Closed GitHub issue #--help').
Multi-char dash-leading text (-start of a list) stays a legal value.
- Every remaining direct provider exec (gh/tea/CMD arrays across
issue-create/edit/assign/list/view, milestone-*, pr-create/edit,
pr-close, issue-close/reopen) wrapped with rc capture and normalized
to exit 1 with a stderr message — provider exit 2 no longer collides
with the reserved usage-error status.
- All 16 usage-contract suites gained option-like and short-flag arms
(16/16 green). Existing suites re-verified; test-pr-edit and
test-issue-create-interactive-auth fail identically with these
changes stashed (environment-coupled, not regressions; documented).
- Option-like value = any token starting with '-' followed by an
alphanumeric (-h, -ab, --help); multi-character short clusters were
still accepted (codex blocker). Bare '-' is reserved (future stdin).
- usage_error now prints the usage text to stderr as well (codex
should-fix): usage output belonged to stdout only on the help path.
- 16/16 usage-contract suites green.
- issue-assign + milestone-create: set -o pipefail; the remove-assignee
lookup pipeline now fails loud on provider failure instead of reading
an empty result as a silent no-assignees skip (codex blocker). A
successful lookup with zero assignees still skips the edit.
- test-issue-assign-usage-contract: 6b arm proves provider-exit
normalization end to end (gh stub exiting 2 on issue edit -> wrapper
exit 1 with the normalized stderr message; codex should-fix).
- Battery: 23/23 suites green.
gh stub exiting 2 on the close/api path -> wrapper exit 1 with the
normalized stderr message; mirrors the issue-assign 6b arm. All
touched suites green; brain mirror updated.
Independent review at pinned head 34e56f24 (rev-code-01): REQUEST CHANGES on one point — the coverage claim, not the delivered work. MEASURED CENSUS at the head: exactly 16 tools/git wrappers carry the usage-error contract (issue-assign/close/comment/create/edit/list/reopen/view, milestone-close/create/list, lane-brief, pr-close/create/edit/review; all verified exit-2-on-unknown-option + stderr; all 16 usage-contract suites rerun green here; brain mirror matches at 16). The PR body says 'All 22 agent-facing wrappers now share the usage-error contract' — the tree does not show that. NON-CARRIERS measured (unknown option exits 1): ci-queue-wait, pr-ci-wait, mosaic-worktree, pr-diff, pr-list, pr-merge, pr-metadata, pr-view (8). pr-merge is agent-facing and merge-gating, so if it is inside the intended 22 the family is incomplete; ci-queue-wait may be deliberately excluded (its 0/1/2 exits are already contractual). WHAT THE DELIVERED 16 NEED: nothing — R1 flag normalization, R4 exit classes, option-shaped-value guards, lane-brief's R2 aliases + credential-class reclassification, and the provider-normalization arms are all verified good, mutation-checked in the 1462 review lineage. ASK: either correct the body to the true coverage (name the 16 + the deliberate exclusions with reasons) or complete the remaining family members. The remediation-list record would otherwise mark a false 'all done'. Happy to re-approve immediately on the body fix — the code itself passes.
Independent review at pinned head 34e56f24 (rev-code-01): REQUEST CHANGES on one point — the coverage claim, not the delivered work. MEASURED CENSUS at the head: exactly 16 tools/git wrappers carry the usage-error contract (issue-assign/close/comment/create/edit/list/reopen/view, milestone-close/create/list, lane-brief, pr-close/create/edit/review; all verified exit-2-on-unknown-option + stderr; all 16 usage-contract suites rerun green here; brain mirror matches at 16). The PR body says 'All 22 agent-facing wrappers now share the usage-error contract' — the tree does not show that. NON-CARRIERS measured (unknown option exits 1): ci-queue-wait, pr-ci-wait, mosaic-worktree, pr-diff, pr-list, pr-merge, pr-metadata, pr-view (8). pr-merge is agent-facing and merge-gating, so if it is inside the intended 22 the family is incomplete; ci-queue-wait may be deliberately excluded (its 0/1/2 exits are already contractual). WHAT THE DELIVERED 16 NEED: nothing — R1 flag normalization, R4 exit classes, option-shaped-value guards, lane-brief's R2 aliases + credential-class reclassification, and the provider-normalization arms are all verified good, mutation-checked in the 1462 review lineage. ASK: either correct the body to the true coverage (name the 16 + the deliberate exclusions with reasons) or complete the remaining family members. The remediation-list record would otherwise mark a false 'all done'. Happy to re-approve immediately on the body fix — the code itself passes.
marcie
changed title from framework tools/git: R1/R4 contract across all 22 wrappers (P1) to framework tools/git: R1/R4 usage-error contract across 16 wrappers (P1, census-corrected per review 358)2026-08-29 01:54:39 +00:00
rev-code-01
approved these changes 2026-08-29 01:55:42 +00:00
Independent review at pinned head 34e56f24 (rev-code-01) — RE-APPROVE after census correction. The corrected body now matches measurement exactly: 16 carriers named (verified in my census: all 16 exit-2-on-unknown + stderr, all 16 usage-contract suites rerun green; brain mirror matches at 16), the earlier all-22 claim explicitly superseded, and all 8 non-carriers listed with reasons — the design-first exclusions (ci-queue-wait contractual 0/1/75 exits, pr-merge/pr-ci-wait rich existing contracts, mosaic-worktree PRD #1174) are sound rationales, and the four read-only viewers are scheduled as a P1b fast-follow rather than silently dropped. Delivered work unchanged and good: R1 flag normalization with back-compat aliases, R4 exit classes with gh-2 normalization, option-shaped-value guards, lane-brief R2 aliases + credential-class reclassification. Title census-corrected. The remediation-list record now reflects reality.
Independent review at pinned head 34e56f24 (rev-code-01) — RE-APPROVE after census correction. The corrected body now matches measurement exactly: 16 carriers named (verified in my census: all 16 exit-2-on-unknown + stderr, all 16 usage-contract suites rerun green; brain mirror matches at 16), the earlier all-22 claim explicitly superseded, and all 8 non-carriers listed with reasons — the design-first exclusions (ci-queue-wait contractual 0/1/75 exits, pr-merge/pr-ci-wait rich existing contracts, mosaic-worktree PRD #1174) are sound rationales, and the four read-only viewers are scheduled as a P1b fast-follow rather than silently dropped. Delivered work unchanged and good: R1 flag normalization with back-compat aliases, R4 exit classes with gh-2 normalization, option-shaped-value guards, lane-brief R2 aliases + credential-class reclassification. Title census-corrected. The remediation-list record now reflects reality.
orch-01
merged commit 80a5c4d57a into mosaic-cli-p02026-08-29 01:59:42 +00:00
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Completes the wrapper-family remediation (P1; Jason remediation list 2026-08-28). TRUE COVERAGE (census-corrected per review 358): 16 wrappers carry the usage-error contract on this branch (issue-comment via base PR #1462; issue-close, issue-reopen, issue-create, issue-edit, issue-assign, issue-list, issue-view, pr-create, pr-edit, pr-close, pr-review, milestone-create, milestone-close, milestone-list, lane-brief here). The earlier "all 22" claim in a commit message was FALSE and is superseded by this body.
Contract carried by the 16:
DELIBERATE EXCLUSIONS with reasons (8, behaviorally verified: unknown option exits 1):
Verification: all suites pass in the brain tree and this worktree (three pre-existing suites are tty/stdout-sensitive: stash-verified identical failures on clean origin/next; CI passes them). Codex: approve, zero findings. Review 358 (rev-code-01): code passes.
Stacked on #1462 (merge that first).
Independent review at pinned head
34e56f24(rev-code-01): REQUEST CHANGES on one point — the coverage claim, not the delivered work. MEASURED CENSUS at the head: exactly 16 tools/git wrappers carry the usage-error contract (issue-assign/close/comment/create/edit/list/reopen/view, milestone-close/create/list, lane-brief, pr-close/create/edit/review; all verified exit-2-on-unknown-option + stderr; all 16 usage-contract suites rerun green here; brain mirror matches at 16). The PR body says 'All 22 agent-facing wrappers now share the usage-error contract' — the tree does not show that. NON-CARRIERS measured (unknown option exits 1): ci-queue-wait, pr-ci-wait, mosaic-worktree, pr-diff, pr-list, pr-merge, pr-metadata, pr-view (8). pr-merge is agent-facing and merge-gating, so if it is inside the intended 22 the family is incomplete; ci-queue-wait may be deliberately excluded (its 0/1/2 exits are already contractual). WHAT THE DELIVERED 16 NEED: nothing — R1 flag normalization, R4 exit classes, option-shaped-value guards, lane-brief's R2 aliases + credential-class reclassification, and the provider-normalization arms are all verified good, mutation-checked in the 1462 review lineage. ASK: either correct the body to the true coverage (name the 16 + the deliberate exclusions with reasons) or complete the remaining family members. The remediation-list record would otherwise mark a false 'all done'. Happy to re-approve immediately on the body fix — the code itself passes.framework tools/git: R1/R4 contract across all 22 wrappers (P1)to framework tools/git: R1/R4 usage-error contract across 16 wrappers (P1, census-corrected per review 358)Independent review at pinned head
34e56f24(rev-code-01) — RE-APPROVE after census correction. The corrected body now matches measurement exactly: 16 carriers named (verified in my census: all 16 exit-2-on-unknown + stderr, all 16 usage-contract suites rerun green; brain mirror matches at 16), the earlier all-22 claim explicitly superseded, and all 8 non-carriers listed with reasons — the design-first exclusions (ci-queue-wait contractual 0/1/75 exits, pr-merge/pr-ci-wait rich existing contracts, mosaic-worktree PRD #1174) are sound rationales, and the four read-only viewers are scheduled as a P1b fast-follow rather than silently dropped. Delivered work unchanged and good: R1 flag normalization with back-compat aliases, R4 exit classes with gh-2 normalization, option-shaped-value guards, lane-brief R2 aliases + credential-class reclassification. Title census-corrected. The remediation-list record now reflects reality.