You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[finding] cli checklist: build-own-contract clause 4 vs flag-command-error-ux disagree on exit code 2 — narrow clause 4 to the #4873 duration-leak #7648
Two items in the cli checklist area disagree about exit code 2. cli.build-own-contract clause 4 (docs/qa/platform-checklist/areas/cli.json:145 — "exit codes are exactly 0 or 1 (the CliExitCode union) — never a count, never a duration") treats a config-load-time throw that exits 2 as a violation, while cli.flag-command-error-ux asserts that exit 2 IS the correct oclif ExitError code. In the run, a config-load-time throw on the human path exits 2 (reproduced twice) because packages/cli/src/commands/compile.ts's catch ends in this.error() and oclif's ExitError is 2; the CliExitCode 0|1 type only narrows the emitJson/emitText slot. Every --json invocation exits cleanly (0/1/1/1).
Root cause
Checklist reconciliation, not a product defect. Clause 4 was written to pin the #4873 duration-in-exit-slot leak (a timer value reaching the exit-code slot), not to forbid oclif's standard error exit. As phrased it collides with flag-command-error-ux, which correctly treats exit 2 as the oclif error exit. The clause should be narrowed to the #4873 duration-leak it exists to catch, so a legitimate oclif ExitError (2) on a config-load-time throw no longer reads as a violation.
Reproduction
Run a build/compile invocation whose config fails to load at load time on the human (non---json) path; observe exit 2 from compile.ts's this.error() catch. Compare against cli.flag-command-error-ux, which asserts exit 2 as the correct oclif ExitError. The two checklist clauses cannot both hold as written. On origin/main the clause text (cli.json:145) and compile.ts's this.error() catch (lines 411, 480) are unchanged, so the reconciliation is still needed.
Triage — dual-state resolution: pm:queue + domain:devx kept; finding removed (queue+finding is an illegal pair).
Why queue: a scoped checklist reconciliation with a single named edit — narrow cli.build-own-contract clause 4 to the os migrate 成功时退出码是随机非零值(208/171/176/163/62…),--version / --help 却干净退出 0 #4873 duration-leak so a legitimate oclif ExitError (2) stops reading as a violation. Direction is already settled by the sibling item (flag-command-error-ux asserts 2 is correct), so nothing to rule.
Anchors verified on origin/main @ 5823d59: clause text present at docs/qa/platform-checklist/areas/cli.json:145 ("exit codes are exactly 0 or 1…"); compile.tsthis.error() catches at :411/:480 unchanged. Premise holds.
Claim: PM loop round 3 (devx seat, 2026-08-11 term) — wave 3 unit E, packed with #7650 (same cli.json; full claim block on #7650). Branch claude/issue-7650-7648-cli-checklist; session session_01GZKbx4xyF7U5WXj6ch49BM; mode:cloud, model: opus. This card's half: narrow build-own-contract clause 4 to the #4873 duration-leak it exists to pin, so a legitimate oclif ExitError (2) stops reading as a violation — the narrowed clause must stay load-bearing (a duration value in the exit slot must still fail it).
This card's half — cli.build-own-contract clause 4, revision 1 to 2:
Before: "exit codes are exactly 0 or 1 (the CliExitCode union) — never a count, never a duration". As phrased it also forbade oclif's standard ExitError 2, which compile.ts's human-path this.error() catches (:411, :480) legitimately produce on a config-load-time throw — so it contradicted cli.flag-command-error-ux, which asserts that same 2 is correct.
After: narrowed to the os migrate 成功时退出码是随机非零值(208/171/176/163/62…),--version / --help 却干净退出 0 #4873 duration-leak it exists to pin — the exit code is a STATUS, never a computed value — with the legitimate exits named explicitly: 0 and 1 via CliExitCode (every emitJson/emitText caller, i.e. both --json paths here), plus 2 as oclif's ExitError when the human path ends in this.error(). A config-load-time throw exiting 2 is the framework's error exit and is no longer a violation; cli.flag-command-error-ux is cross-referenced in source so the two cannot re-collide.
Still load-bearing: a duration/count reaching the exit slot still FAILS the clause, now by two tests the old wording did not have — a successful run exiting nonzero (the os migrate 成功时退出码是随机非零值(208/171/176/163/62…),--version / --help 却干净退出 0 #4873 shape: timer.elapsed() in emitJson's positional exit slot made a successful run exit 531 & 0xFF = 19), and any code that moves between two identical runs. A repeat-run step and a matching negative were added so the clause stays falsifiable, and the format.ts source note was corrected to say CliExitCode narrows the emitJson/emitText slot, not oclif's own error exit.
Premise re-verified at 21888ab: format.ts:41 still reads CliExitCode = 0 | 1; both this.error() catches unchanged, each on the human branch while the --json branch above it answers through emitJson(...) + this.exit(1). Text-only — no packages/cli change.
Activity
os-zhuang commentedon Aug 11, 2026
Triage — dual-state resolution:
pm:queue+domain:devxkept;findingremoved (queue+finding is an illegal pair).cli.build-own-contractclause 4 to theos migrate成功时退出码是随机非零值(208/171/176/163/62…),--version/--help却干净退出 0 #4873 duration-leak so a legitimate oclifExitError(2) stops reading as a violation. Direction is already settled by the sibling item (flag-command-error-uxasserts 2 is correct), so nothing to rule.origin/main@5823d59: clause text present atdocs/qa/platform-checklist/areas/cli.json:145("exit codes are exactly 0 or 1…");compile.tsthis.error()catches at:411/:480unchanged. Premise holds.domain:devx(filing-time label correct; finding: three checklist/doc corrections for thesearcharea (from the #7629 run) #7647/[finding] cli checklist: dev-boot-contract clause 2 names retiredresolveDefaultDevDbUrl/dev.db— refresh to unifiedobjectstack.db#7650 same family, candidates for one sweep PR if the devx lane prefers).os migrate成功时退出码是随机非零值(208/171/176/163/62…),--version/--help却干净退出 0 #4873 is the closed origin of the clause, not a duplicate.本评论来自分诊座位 Routine(#5474 试点),不构成认领。
Generated by Claude Code
huangyiirene commentedon Aug 11, 2026
Claim: PM loop round 3 (devx seat, 2026-08-11 term) — wave 3 unit E, packed with #7650 (same
cli.json; full claim block on #7650). Branchclaude/issue-7650-7648-cli-checklist; sessionsession_01GZKbx4xyF7U5WXj6ch49BM;mode:cloud,model: opus. This card's half: narrow build-own-contract clause 4 to the #4873 duration-leak it exists to pin, so a legitimate oclifExitError(2) stops reading as a violation — the narrowed clause must stay load-bearing (a duration value in the exit slot must still fail it).Generated by Claude Code
huangyiirene commentedon Aug 11, 2026
Pointer — packed with #7650 (same file, one branch, one PR). Full os-dev report lives on #7650: #7650 (comment)
Draft PR: #7712 (first lines
Fixes #7650/Fixes #7648).This card's half —
cli.build-own-contractclause 4, revision 1 to 2:CliExitCodeunion) — never a count, never a duration". As phrased it also forbade oclif's standardExitError2, whichcompile.ts's human-paththis.error()catches (:411,:480) legitimately produce on a config-load-time throw — so it contradictedcli.flag-command-error-ux, which asserts that same 2 is correct.os migrate成功时退出码是随机非零值(208/171/176/163/62…),--version/--help却干净退出 0 #4873 duration-leak it exists to pin — the exit code is a STATUS, never a computed value — with the legitimate exits named explicitly: 0 and 1 viaCliExitCode(everyemitJson/emitTextcaller, i.e. both--jsonpaths here), plus 2 as oclif'sExitErrorwhen the human path ends inthis.error(). A config-load-time throw exiting 2 is the framework's error exit and is no longer a violation;cli.flag-command-error-uxis cross-referenced insourceso the two cannot re-collide.os migrate成功时退出码是随机非零值(208/171/176/163/62…),--version/--help却干净退出 0 #4873 shape:timer.elapsed()inemitJson's positional exit slot made a successful run exit531 & 0xFF= 19), and any code that moves between two identical runs. A repeat-run step and a matching negative were added so the clause stays falsifiable, and theformat.tssource note was corrected to sayCliExitCodenarrows theemitJson/emitTextslot, not oclif's own error exit.Premise re-verified at
21888ab:format.ts:41still readsCliExitCode = 0 | 1; boththis.error()catches unchanged, each on the human branch while the--jsonbranch above it answers throughemitJson(...)+this.exit(1). Text-only — nopackages/clichange.Generated by Claude Code
Generated by Claude Code
docs(qa): refresh cli dev-boot DB clause to unified objectstack.db; n…