Skip to content

State/merge error-path remediation moves from resident contract prose into the binary's own failure output#465

Merged
clkao merged 8 commits into
mainfrom
spacedock-ensign/error-path-guidance-in-binary-output
Jul 2, 2026
Merged

State/merge error-path remediation moves from resident contract prose into the binary's own failure output#465
clkao merged 8 commits into
mainfrom
spacedock-ensign/error-path-guidance-in-binary-output

Conversation

@clkao

@clkao clkao commented Jul 2, 2026

Copy link
Copy Markdown
Collaborator

Resident FO-contract prose paid boot and terminal tokens restating what shipped commands do on failure — guidance the binary can emit at fire time instead.

What changed

  • state commit/ready exit-3 stderr carries HALT remediation + the peer commit
  • state sweep distinguishes gh-unavailable UNKNOWN from truly empty; names the mod-pointer next step
  • merge guard armed/blocked/finalized lines name the FO's next steps
  • Refuse (exit 1, no mutation) a mod-block naming a missing merge mod in the no-sentinel case — fixing a real silent-finalize bug
  • Shrink shared-core and fo-merge-core per an audited coverage map

Evidence

  • go test ./... all packages passed; contractlint anchors intact
  • Validator drove the built binary: real two-writer conflict, all merge-guard phases, and a pre-fix-binary comparison proving the D5 bug then its refusal

s0

T1: dedicated test for the no-merge-hook-registered-at-all shape (the
deleted mod file was the workflow's only hook) — distinct from the
existing missing-mod test, which fixtures a workflow with a DIFFERENT
hook still registered. Catches a mutant that special-cases
modBlockNamesMissingMergeMod on len(mergeHooks)==0.

T2: pin the full remediation tail on the existing missing-mod refusal
test, not just the mod-name + "is missing" fragment.

Both mutants verified RED locally before landing, then reverted.
…t a JSON envelope

Root cause: ghRunnerExec called `gh pr view PR --json state` and
json.Unmarshal'd the result, while boot.go's already-proven PR_STATE
probe uses `gh pr view PR --json state --jq .state` (bare, jq-extracted
text). Against a `gh` whose output matches the latter shape — including
the shared ensigncycle shallow-boot fixture's stub gh, which PR #465's
codex-live scenario runs against — the JSON unmarshal fails and a
working probe was counted as an error by D2's gh-unavailable
classifier, making `state sweep` report UNKNOWN instead of advancing
the merged entity.

Fix: align ghRunnerExec with boot.go's proven invocation exactly (same
flags, same leading-"#" trim, same --jq extraction). The two probes now
agree on what "gh can answer" means.

Reproduced offline against the exact shared fixture shape before
fixing; regression tests pin both the direct probe
(TestGhRunnerExecParsesJqExtractedState) and the end-to-end sweep
(TestSweepWithRealGhStubDoesNotReportUnknown) using the real production
GhRunnerExec. Both verified RED against the pre-fix ghRunnerExec,
reverted, GREEN restored.
@clkao
clkao temporarily deployed to CI-E2E-OPUS July 2, 2026 07:38 — with GitHub Actions Inactive
@clkao
clkao temporarily deployed to CI-E2E-CODEX July 2, 2026 08:17 — with GitHub Actions Inactive
@clkao
clkao merged commit 7cb5555 into main Jul 2, 2026
11 of 13 checks passed
clkao pushed a commit that referenced this pull request Jul 2, 2026
…23.0 / v0.24.0-pre1 / HEAD)

Boot-resident core -22.0% v0.23.0→HEAD; terminal/merge load -56.7% (#465);
trimmed content relocates to failure-triggered deferred skills rather than
deleting, so the full-surface byte sum is flat (+0.4%).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.

1 participant