Skip to content

fix(#1254): a ladder halt is recorded nowhere: the halting phase reads success, failureCategory is empty, and the bundle exists only on stdout - #1304

Merged
admarble merged 2 commits into
mainfrom
feature/1254-fix-run-a-ladder-halt-is-recorded-nowhere-the-halt
Oct 4, 2026
Merged

admarble merged 2 commits into
mainfrom
feature/1254-fix-run-a-ladder-halt-is-recorded-nowhere-the-halt

Conversation

@admarble

@admarble admarble commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

Summary

A ladder halt (SPEC_DIVERGENCE, DIVERGENCE_SUSPECT, TOP_OF_LADDER) used to be recorded only in stdout. The halting phase read success, the issue result was success: false with no failureCategory, and the evidence bundle never reached the run log, state or the MCP result. Runs on released sequant still behave this way. This PR's own first spec run halted with SPEC_DIVERGENCE, and the MCP result reported the issue and the phase as success.

The fix belongs at the place an issue's outcome is assembled. This is the fifth recurrence of the same gap, after #739, #856, #879 and #920. Per the owner's decision on #1254, it reuses existing fields and adds no new one-off field:

  • One owner for all four halt producers. ladderHaltOutcome(bundle) is spread into both runIssueWithLogging return sites (the spec-path early return and the final return). It sets failureCategory: "ladder_halt" (new value in ERROR_CATEGORIES, which the run-log and metrics enums mirror), an abortReason such as ladder halt: SPEC_DIVERGENCE in exec (AC-2), and evidenceBundle on IssueResult.
  • The run log closes the class. recordIssueCompletion now forces failure for any failure that no failed phase explains (a PR-creation failure, a ladder halt, an abort before any phase ran). It writes abortReason and the bundle on the issue entry, so the next stop outside a phase needs no new field. An issue whose phase failed keeps the status its phases give it (a timeout still records partial).
  • One decision for every phase writer. phaseRecordFor(result) records a phase that declared SPEC_DIVERGENCE as failed, whatever its exit status, with outcome and divergenceAcs. State, the run-log phase row and the progress event all read it, for both the spec path and the phase loop.
  • MCP. The sequant_run per-issue result carries abortReason, haltReason and declaredAcs. The last two are read from the bundle in the run log, not stored separately.

AC verification

AC Status Evidence
AC-1 MET batch-executor.test.ts: spec path and loop SPEC_DIVERGENCE. The DIVERGENCE_SUSPECT and TOP_OF_LADDER cases are in batch-executor.model-ladder.test.ts, which has the configured-ladder harness they need; see the note below
AC-2 MET batch-executor.test.ts: state, run-log row and progress event are failed for a clean-exit SPEC_DIVERGENCE. Mutation-verified below
AC-3 MET src/mcp/tools/run.test.ts: haltReason and declaredAcs are carried from a halted issue's bundle

AC-1's evidence command, as written, doesn't reach two of its four paths. It names only batch-executor.test.ts. The two halts that happen only inside the ladder need a configured model ladder, and that harness lives in the sibling file. The behaviour is covered, and the runner ran both files.

Mutation-verified: AC-2 — phaseRecordFor made to ignore specDivergence; src/lib/workflow/batch-executor.test.ts > #1254: a ladder halt is recorded, not only printed > phaseRecordFor: a declared divergence is a failure whatever the exit status failed (3 failed / 142 passed); restored.

Test plan

  • npx vitest run on batch-executor.test.ts, batch-executor.model-ladder.test.ts, run.test.ts, log-writer.test.ts, state-manager.test.ts, error-capture.test.ts and run-orchestrator.test.ts: 434 passed (run by the runner)
  • npx tsc --noEmit: clean
  • CI green on 550977f

Fixes #1254

🤖 Generated with Claude Code

…and MCP result

Entire-Checkpoint: 4ab7287eab9f
…s and the ladder_halt category

Entire-Checkpoint: d47912fe7c87
@admarble
admarble merged commit cbc2fce into main Oct 4, 2026
7 checks passed
@admarble
admarble deleted the feature/1254-fix-run-a-ladder-halt-is-recorded-nowhere-the-halt branch October 4, 2026 22:10
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.

fix(run): a ladder halt is recorded nowhere: the halting phase reads success, failureCategory is empty, and the bundle exists only on stdout

1 participant