git wrappers: -h/--help prints help but exits 1 (7 scripts) — phantom tool errors fleet-wide #701
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Defect
usage()in 7 framework git wrappers hard-codesexit 1(one deployed-only script exits 2), so the documented-h/--helpflags print correct help text but return a failure exit code.Affected (verified on stack
main@4df38f7e,packages/mosaic/framework/tools/git/):usage()exitAll other wrappers in the directory already exit 0 on
-h/--help.Evidence (fleet impact, 2026-07-11 nightly digest)
3 worker sessions (pi runtime, coder lanes restarted 2026-07-10 18:00) ran
~/.config/mosaic/tools/git/pr-create.sh --helpas due diligence before first use. Help printed correctly, exit was 1, so the runtime recordedisError:true— 7 phantom tool-error records in one night attributed to a wrapper that behaved exactly as documented. Transcript proof:/home/hermes/.pi/agent/sessions/--src-jarvis-brain--/2026-07-10T18-00-27-202Z_019f4d30-1f42-*.jsonl(calls at 20:19:01Z, 21:22:54Z).Why it matters (blast radius)
--helpbefore first use → each check logs a failure.set -edies on a help call.Proposed fix (trivial, mechanical)
In each affected script: give
usage()a parameterized exit —usage() { cat <<EOF ... EOF; exit "${1:-1}"; }— and change the help branch to-h|--help) usage 0 ;;while error paths keepusage(defaults to 1). Same convention several sibling wrappers already use.lane-brief.shneeds the same treatment in its deployed copy (no SSOT home — flagging separately to Mos; candidate for import like auto-submit-drafts.sh in #697).Effort: ~8 two-line edits + a smoke loop (
for s in *.sh; do bash $s --help; doneasserting exit 0). No behavior change for error paths.Found by enhance nightly pass 2026-07-11 (digest-20260711T084859Z).