Repository navigation
Description
Problem
A run whose phase fails and then recovers on a later quality-loop iteration is reported as failed in the live card, passed in the summary table, and neither in the JSON log. All three disagree about the same run.
Observed on sequant run 760 -q (run 49298cbd-af1b-49ed-a944-61a9f6848c22):
| Output | Said | Reads |
|---|---|---|
| Live card | ✘ failed (✗ loop 34:11) |
sticky state.status |
| Summary table | ✔ passed · 1 passed · 0 failed |
batch result (completedSuccessfully) |
| JSON log | 0 passed · 0 failed, status: "partial" |
issue.status === "success" only |
Ground truth: #760 succeeded. QA posted AC_MET_BUT_NOT_A_PLUS, PR #765 opened, mergeable, all 5 checks green. The red card was wrong.
This matters because recovering-after-failure is precisely what the quality loop exists to do, so the reporting is wrong on the loop's success path — the case it was built for. A green run that prints failed trains us to ignore the status line.
Root cause
Three independent bugs, each confirmed by reading the code and the run log.
1. Phase failure is sticky and never recovers (the main one)
state.status = "failed" is set on any phase failure and nothing ever unsets it:
src/lib/workflow/run-orchestrator.ts:416src/lib/cli-ui/run-renderer.ts:280(second copy of the same bug)
findOrAppendPhase keys phases by name, so retries overwrite the same slot. #760's loop phase failed on an early iteration; iteration 3 ran clean and shipped the PR, but the card stayed red for the remaining ~34 minutes — showing a green ✓ qa 11:05 (the successful third attempt) next to a permanently red ✗ loop.
The recompute at run-orchestrator.ts:446-450 only runs inside the allDone branch and still ORs in any historically-failed phase, so it can't clear the flag either.
2. "partial" is counted as neither passed nor failed
src/lib/workflow/log-writer.ts:145 pins the issue to "partial" on any timeout — also sticky, also never cleared on a successful retry. finalizeRunLog (src/lib/workflow/run-log-schema.ts:403-408) then counts only success and failure, so "partial" falls into neither bucket and the run vanishes from both columns: 0 passed · 0 failed for a 1-issue run.
3. Loop phases are never written to the run log
src/lib/workflow/batch-executor.ts:1055 pushes loopResult into phaseResults but never calls logWriter.logPhase() — unlike spec (:655) and the regular phases (:982). #760's log records 7 phases (spec, exec, qa, exec, qa, exec, qa) and no loop entry, even though the card tracked a loop phase that failed. The phase that decided the card's verdict is absent from the log you'd use to debug it.
Acceptance Criteria
- A phase that fails and later succeeds on a subsequent quality-loop iteration does not leave the issue in
failed— the live card reflects the recovered state - The sticky-status fix covers both copies (
run-orchestrator.ts:416andrun-renderer.ts:280), or the two are consolidated onto one source of truth - Live card, summary table, and JSON log agree on pass/fail for the same run
- A run whose issues are all
"partial"does not report0 passed · 0 failed—"partial"is counted in exactly one bucket, or surfaced as its own column -
"partial"is not pinned by a timeout that a later iteration recovers from - Loop phases appear in the run log with phase, status, duration, and error
- Regression test: quality-loop run where qa fails twice then succeeds → asserts passed in all three outputs
- Regression test: loop phase failure followed by a successful iteration → asserts not-failed
Notes
Run log: .sequant/logs/run-2026-07-15T05-16-04-49298cbd-af1b-49ed-a944-61a9f6848c22.json
For contrast, sequant run 762 (06927df2-0cc2-40b8-ae2e-4412f0aaa5ed) reported failed correctly — all three QA attempts died (two 1800s timeouts, then API Error: Connection closed mid-response), no verdict was ever produced, and no QA comment exists on the issue. Any fix must keep that case red: PR #764 exists and is green, but it's unreviewed exec output, not an approved change. Don't infer success from PR existence.
One loose end not diagnosed: #762's summary detail cell read Timeout after 1800s, but its last failure was the API drop. failureReason is last-wins at run-renderer.ts:283, so the displayed reason should have been the API error. Worth a look while in here; not reproduced.
Activity
admarble commentedon Jul 15, 2026
Assessment
→ PROCEED — All three root causes confirmed by reading the code and the cited run log.
run-2026-07-15T05-16-04-49298cbd...jsonexists.log-writer.ts:145pinspartialon timeout and never clears it;run-log-schema.ts:403-408counts onlysuccess/failure, sopartiallands in neither bucket.logWriter.logPhase()is called only atbatch-executor.ts:655and:982— no loop-phase call site, matching the "loop phases never logged" finding.Workflow:
spec → exec → qawith quality loopSpec added despite the bug label: three distinct bugs across five files, plus an explicit design call in AC-2 ("or the two are consolidated onto one source of truth").
Order: before #767 — shared file
batch-executor.ts.admarble commentedon Jul 16, 2026
📋 Plan — recovered phase failure still reports failed
Complexity: Standard (8 ACs, 2 source dirs) · verified all three root causes against the code.
AC Quality Check
ACs are unnumbered checkbox items (parser found 0 — analyzed inline). Quality is high: each is measurable and names the disagreeing outputs. AC-7/AC-8 are explicit regression tests with clear pass conditions. No vague/unmeasurable/open-ended flags. Numbered them AC-1..AC-8 below in body order.
Scope Assessment
Non-Goals: No explicit section, but the Notes carve out a hard boundary: #762's all-failed run must stay red — don't infer success from PR existence. Treat as a Non-Goal / negative test.
workflow/,cli-ui/)Verdict: ✅ SCOPE_OK — three tightly-related bugs on one symptom (status disagreement); cohesive single PR.
Root-Cause Confirmation (read the code)
failed, never recoversrun-orchestrator.ts:477+:509OR-in;run-renderer.ts:280(second copy)"partial"counted in neither bucketlog-writer.ts:145pins it;run-log-schema.ts:403-408counts onlysuccess/failurebatch-executor.ts:1055pushesloopResultbut nologWriter.logPhase()(cf.:655spec,:982phases)Note both status machines only ever escalate (
start→running,failed→failed) and never de-escalate a stale failure/partial when a later attempt of the same phase recovers.Acceptance Criteria
AC-1: Recovered phase → live card reflects recovered state
Verification: Unit Test · Scenario: Given a phase marked
failed, When a later iteration of the same phase completes → Then issue status is notfailed.AC-2: Sticky-status fix covers both copies (or consolidated)
Verification: Unit Test · Scenario: Given both
run-orchestratorandrun-rendererstate machines, When the same failure→recovery sequence is applied → Then both derive the identical non-failed status. Design decision — see Open Questions.AC-3: Card, summary table, and JSON log agree
Verification: Integration Test · Scenario: Given a run that recovers, When it finalizes → Then
state.status, batchcompletedSuccessfully, andissue.statusall report passed.AC-4: All-
partialrun isn't0 passed · 0 failedVerification: Unit Test (
finalizeRunLog) · Scenario: Given a run whose only issue is"partial", When finalized → Then it lands in exactly one bucket (or its ownpartialcolumn), never neither.AC-5:
"partial"not pinned by a timeout a later iteration recoversVerification: Unit Test (
log-writer) · Scenario: Given an issue pinned"partial"by a timeout, When a later phase of the same issue succeeds → Then status clears (unless a realfailureexists).AC-6: Loop phases appear in the run log
Verification: Unit Test · Scenario: Given a quality-loop run with a
loopphase, When the log is written → Then aloopentry exists with phase, status, duration, and error.AC-7: Regression — qa fails twice then succeeds → passed in all three outputs
Verification: Integration Test · Scenario: Given qa failing iterations 1-2 then passing iteration 3 → Then card, summary, and log all read passed.
AC-8: Regression — loop phase failure then successful iteration → not-failed
Verification: Unit/Integration Test · Scenario: Given a
loopphase failure followed by a successful iteration → Then issue is notfailed.Negative test (Non-Goal guard): #762-style run where all attempts die with no verdict → must stay
failed.Implementation Plan
Phase 1: Derive status instead of pinning it (Bugs 1 & 2 — AC-1/2/4/5)
deriveIssueStatus(phases)(e.g. inrun-log-schema.tsor a smallstatus-derivation.ts) → returnsfailedonly if a phase's latest slot is failed, elsepassed/running. Keys already dedupe by name (findOrAppendPhase), so the slot holds the last attempt.run-orchestrator.ts: onphase_failedkeep the emit, but computestate.statusvia the helper on both the failed andallDonebranches (:477,:504-511) so a recovered phase clears.run-renderer.ts:280: replace the directstate.status = "failed"with the same helper — one source of truth satisfies AC-2.log-writer.ts:143-147: when asuccessphaseLog arrives, de-escalateissue.statusfrompartial(only when nofailurephase exists) — mirrors the card fix (AC-5).run-log-schema.ts:403-408(finalizeRunLog): stop droppingpartial— either count it inpassedwhen the run recovered, or add apartialsummary field/column (AC-4). Recommend own column — most honest, keeps#762distinguishable.Phase 2: Log loop phases (Bug 3 — AC-6)
batch-executor.tsafter:1055: build aPhaseLogfor the loop (phase=loop, status fromloopResult.success, durationloopDurationSec, errorloopResult.error) and calllogWriter.logPhase(...), mirroring the:982construction.Phase 3: Tests (AC-7, AC-8, negative guard)
finalizeRunLog/log-writerde-escalation; integration test for the qa-fails-twice-then-succeeds path; negative test that a no-verdict all-failed run stays failed.Design Review
run-orchestrator/run-renderer.maybeMarkIssueDone(run-renderer.ts:299) which already derives from phases and guards onfailed— extend that idea to un-pin, don't invent a new mechanism.partial/failedrisk hiding a genuine terminal failure?" — Guard: only clear when the latest attempt of every phase is non-failed and a verdict/PR exists; the feat: lightweight content pre-flight for --chain (AC presence, dependency-order sanity) #762 negative test locks this in.Open Questions
deriveIssueStatushelper called by both machines (functional consolidation without merging the twoIssueStatetypes). Impact if wrong: a full state-machine merge is far larger and risks regressing the renderer.partialcolumn. Impact if wrong: folding intopassedwould blur the feat: lightweight content pre-flight for --chain (AC presence, dependency-order sanity) #762 all-failed case the Notes insist must stay visible.Timeout after 1800sbut last failure was the API drop (run-renderer.ts:283is last-wins). Recommendation: investigate opportunistically in Phase 1 while touching that line; file a follow-up only if not a one-liner. Not reproduced — don't block on it.Recommended Workflow
Phases: spec → exec → qa · Quality Loop: enabled
Reasoning: Matches the
/assessrecommendation. Bug fix across 5 files with an explicit design call (AC-2) → spec justified. AC-7/AC-8 regression tests are tightly coupled to the state transitions the implementer builds, so they're exec deliverables rather than pre-stubbed — testgen not recommended (would leave loosely-coupled stubs; bug-label default also skips it). Quality loop on: multi-file status logic benefits from the QA→fix iteration. Order: land before #767 (sharedbatch-executor.ts).admarble commentedon Jul 16, 2026
✅ Exec complete — PR #772
All three root causes fixed; the live card, summary table, and JSON log now agree on the same run.
AC coverage
run-state.test.tsrecovery teststatus-derivation.ts#pipelineHasFailedconsumed by orchestrator and rendererrecovered-failure.integration.test.tspartialrun ≠0 passed · 0 failedpartialsummary bucket +finalizeRunLogpartialnot pinned by a recovered timeoutderiveIssueLogStatus(latest-per-phase); log-writer testbatch-executor.tslooplogPhase; integration testDesign
Both status machines used to pin
failed/partialand only ever escalate. Introduced a single pure source of truth,pipelineHasFailed(phases), consumed by the orchestrator card and the renderer (satisfies AC-2 without merging the twoIssueStatetypes).loopis excluded from the verdict — it's auxiliary recovery, and an unrecovered failure always leaves a non-loop phase failed, so excluding it never hides a real failure. The log mirrors this withderiveIssueLogStatus(latest attempt of each phase wins) and gains apartialcolumn (surfaced insequant logs+ the MCPrunresponse).Key files changed
src/lib/workflow/status-derivation.ts(new) —pipelineHasFailedshared helpersrc/lib/workflow/run-orchestrator.ts— card derives (failed-event + allDone recompute)src/lib/cli-ui/run-renderer.ts— renderer derives;maybeMarkIssueDonecan de-escalatesrc/lib/workflow/run-log-schema.ts—deriveIssueLogStatus+partialbucketsrc/lib/workflow/log-writer.ts— derive issue status per phase logsrc/lib/workflow/batch-executor.ts— log the loop phasesrc/mcp/tools/run.ts,src/commands/logs.ts— surfacepartialChecks
npm run build✅ ·npm run lint✅ (0 warnings)src/lib/workflow/,src/lib/cli-ui/,src/mcp/,src/commands/suites pass. One pre-existing unrelated flake (prompt-wait.test.ts, relay-inbox timer race) fails identically on the base tree.Known gaps / notes
Timeout after 1800svs the API-drop last failure): not reproducible —run-renderer.ts:283is already last-wins. Left untouched.partialissue as failed (IssueResult.success === false); AC-4's0 passed · 0 failedsymptom was specific to the JSON log summary, which is fixed. Live-table partial styling was out of scope.admarble commentedon Jul 16, 2026
QA Review for Issue #766
Verdict: AC_MET_BUT_NOT_A_PLUS — all 8 ACs functionally met, CI fully green, clean well-documented code. One concrete test-coverage improvement recommended (AC-6 call site) before this is A+.
AC Coverage
failedpipelineHasFailedderive;run-state.test.tsrecovery test →passedstatus-derivation.ts#pipelineHasFailedused by bothrun-orchestrator(failed-event + allDone) andrun-renderer(failed-event +maybeMarkIssueDone); grep confirms no other issue-status pin sitesrecovered-failure.integration.test.tsasserts card=passed, renderer=done, log=success for one sequencepartialrun ≠0 passed · 0 failedpartialsummary bucket (finalizeRunLog), surfaced inlogs.ts+ MCPrunresponse; integration testpartialnot pinned by a recovered timeoutderiveIssueLogStatuslatest-per-phase; log-writer de-escalation testbatch-executor.tslooplogPhase+ integration test asserts fields — see coverage note belowCoverage: 8/8 ACs met + Non-Goal guarded.
Quality Metrics
any) addedCI Status (PR #772)
All checks green. Local
npm run build,npm run lintclean; 298 tests pass across the 8 affected suites.Test Coverage Analysis
status-derivation.tsstatus-derivation.test.tsrun-orchestrator.tsrun-state.test.ts(recovery + #762 guard)run-renderer.tsrun-renderer.test.ts(recovery + #762 guard)run-log-schema.tsrun-log-schema.test.ts+status-derivation.test.tslog-writer.tslog-writer.test.tsbatch-executor.ts(loop logPhase)mcp/tools/run.tsrun.test.tscommands/logs.ts(partial display)logs.test.tsAll changed files are Standard tier (workflow / cli-ui / logging) — no auth/payment/security/admin paths.
Code Review
Strengths:
pipelineHasFailedhelper is the single source of truth for both live state machines; the loop-exclusion rationale is documented and correct (an unrecovered failure always leaves a non-loop phase failed, so excludingloopnever hides a real failure).deriveIssueLogStatus(latest-per-phase, failure > timeout > success) mirrors the live-card rule, giving genuine three-way agreement rather than three ad-hoc fixes.partialadded with.default(0)— backward-compatible with logs written before the field (verified:validRunLogfixture withoutpartialstill parses).Issues: None blocking.
Risk Assessment
running(from thefailed-event branch); safe because a loop only runs wheniteration < maxIterations, so a subsequent iteration always fires a terminal event. Traced — no stuck-runningpath.batch-executorloop-logging call site (AC-6). The integration test validates a loop entry at the writer/schema layer by callingwriter.logPhasedirectly, but nothing drivesrunIssueWithLoggingthrough a fail→loop→recover sequence and asserts the loop was logged — so deleting the new block would not fail any test.IssueResult.success(completedSuccessfully), which was already correct; no third sticky-status machine exists.startsetsrunning, and every terminal/allDone path now routes through the shared helper.Adversarial Re-Read
Findings: Traced loop-exclusion correctness end-to-end (loop always followed by a terminal iteration; qa failure always logged before its loop, so
deriveIssueLogStatusnever mislabels a loop-only log); confirmedpartial/passed/failedpartitiontotalIssuesexactly (IssueStatus is a 3-value enum) so no consumer invariant breaks; verified the #762 Non-Goal is guarded in all three suites and the fix never infers success from PR existence. One gap: AC-6's producer (thebatch-executor.tslogWriter.logPhase(loopPhaseLog)block) is not exercised by any test — the mock infrastructure to assert it already exists inbatch-executor.test.ts(logPhase/createPhaseLogFromTimingspies, lines 598/685).Status: Gaps Found
Documentation
[Unreleased]entry added (fix: recovered phase failure still reports failed — live card, summary, and log disagree #766)Next Steps
batch-executor.test.tscase that drivesrunIssueWithLoggingthrough a qa-fail → loop → recover sequence (scriptmockExecutePhasefail-then-succeed) and assertscreatePhaseLogFromTiming/logPhasewas called withphase: "loop"— locks AC-6's call site, not just the writer-level behavior.logs.tsdisplay test for the, N partialrendering./docs 766if desired (internal fix — likely N/A).Neither item blocks merge; both are polish that would take this to READY_FOR_MERGE.
admarble commentedon Jul 16, 2026
QA Review for Issue #766 (second pass — fresh session)
Verdict: AC_MET_BUT_NOT_A_PLUS — confirms the prior verdict, but the AC-6 coverage gap is now proven by mutation test rather than asserted, and it is sharper than previously described: the test labelled
(AC-6)does not exercise AC-6's production code at all.What I re-verified independently (not taken from the prior QA)
The load-bearing claim of this PR is the loop-exclusion rule — "excluding
loopnever hides a genuine failure, since an unrecovered pipeline failure always leaves a non-loop phase failed too." If that claim is wrong, this fix turns red runs green, which is worse than the bug it fixes. I traced it end-to-end againstbatch-executor.tsrather than trusting the comment:elsebranch ofif (result.success)(:1018), so a non-loop phase's slot is alreadyfailedat the moment any loop event fires. ThenowFailed ? "failed" : "running"fallback in both machines is therefore unreachable for a loop failure — it cannot strand a card inrunning.completedSuccessfully(:1119) is set only when an iteration completes with!phasesFailed— precisely when every non-loop slot isdoneand every phase's latest log entry issuccess. So the summary table cannot disagree with the two derived verdicts.whileexits, work unverified) → qa slot staysfailed→ red on card, table, and log. Correct.failure→ stays red.IssueStatusis a 3-value enum, sopassed + failed + partial === totalIssuesexactly — the new bucket doesn't break the partition.The claim holds. The loop-exclusion rule is sound, and the three-way agreement is real rather than three coincidentally-aligned fixes.
Also confirmed locally: build ✅, lint ✅ (0 warnings), 255 tests pass across the 7 affected suites, CI 5/5 green, PR #772 MERGEABLE, 0 commits behind main.
AC Coverage
failedpipelineHasFailedderive;run-state.test.tsrecovery teststatus-derivation.ts#pipelineHasFailedconsumed by orchestrator (:481,:517) and renderer (:282,:310); no other issue-status pin site remainsrecovered-failure.integration.test.tspartial≠0 passed · 0 failedpartialbucket infinalizeRunLog;logs.tsalready labels this runPARTIALand now prints, 1 partialpartialnot pinned by a recovered timeoutderiveIssueLogStatuslatest-per-phaseCoverage: 8/8 met.
Finding — AC-6's producer is unverified (proven, not suspected)
I commented out the one new line in
batch-executor.tsthat satisfies AC-6:and re-ran
batch-executor.test.ts+recovered-failure.integration.test.ts+status-derivation.test.ts:The mutant survives. Deleting AC-6's entire implementation breaks nothing. (File restored; tree clean.)
The reason is worth naming, because it's the more useful half of the finding: the test named
it("logs the loop phase with phase/status/duration/error (AC-6)")callswriter.logPhase(phaseLog(issue, "loop", ...))by hand. It asserts the schema round-trips a loop entry the test itself wrote — it never invokes the batch-executor block that is supposed to write one in production. The test's name claims coverage the test does not provide, which is worse than a plainly absent test: it makes the gap invisible to the next reader.The mock infrastructure to close this already exists in
batch-executor.test.ts(logPhase/createPhaseLogFromTimingspies at:598/:685).Secondary note (non-blocking)
recovered-failure.integration.test.tshand-drives the event sequence into the three machines rather than running them throughbatch-executor. I checked the assumed order against the real emission order (qafailurelogged at:982before the loop entry at:1057) and it matches, so the model is faithful today — but it would not catch a future divergence in batch-executor's emission order. Reasonable as-is; noting it so the coverage boundary is on record.On AC-3 and
partial: a timeout-only run readspartialin the log butfailedon the card and table. That is not a disagreement about pass/fail — all three agree the run did not pass — and AC-4 explicitly permitspartialas its own column, so I score AC-3 as met.Self-Evaluation
pipelineHasFailedwould failstatus-derivation.test.tsimmediately); zero for AC-6's call site.logPhaseand no test notices — reintroducing bug Doctor: Add Claude Code CLI check #3 exactly as it shipped originally.Next Steps
batch-executor.test.tscase drivingrunIssueWithLoggingthrough qa-fail → loop → recover, assertingcreatePhaseLogFromTiming/logPhasewas called withphase: "loop". Verify it by re-running the mutation above — it must fail.(AC-6)integration test so it no longer claims producer coverage it doesn't have.logs.tsdisplay test for the, N partialrendering.Neither the code nor the design needs changing — this is test-coverage polish that would take #766 to READY_FOR_MERGE.
admarble commentedon Jul 16, 2026
QA addendum — correcting my previous comment
My prior comment ended with "neither the code nor the design needs changing — this is test-coverage polish." That was wrong, and I'm correcting it. Pushing on the one thing I'd left as inherited-by-default — the loose end in the issue's own Notes — turned up a real bug in a file this PR never touched.
The loose end is real, and it was mis-dispositioned
The issue asked:
Exec dispositioned this as "not reproducible —
run-renderer.ts:283is already last-wins. Left untouched." That conclusion is correct aboutrun-renderer.ts:288and irrelevant to the symptom, because the summary detail cell is not fed by that line. There are two independentfailureReasonpaths:run-renderer.ts:288:1236,:1273)run-display.ts:87→toIssueSummary:1496).find()returns the first failing entry, andphaseResultsaccumulates every attempt across every quality-loop iteration (pushed atbatch-executor.ts:582,:888,:1055). So for #762 — qa timeout, qa timeout, qa API-drop — the cell renders the first timeout and the last failure is never shown. That reproduces the reported symptom exactly. The issue author mis-attributed the cell to the renderer; exec then investigated that attribution rather than the symptom, and the real line was never looked at.This is the same bug family as #766 itself — stale first-attempt data surviving later attempts — in a fourth location, sitting in the summary table this PR is specifically making trustworthy. Fixing three sticky-status sites while the summary cell still prints a stale first-iteration reason leaves the headline goal ("all three outputs agree") half-delivered in practice.
failedPhasealso drivesqaVerdictandunmetCount(:101-106), so those are stale first-iteration values too — and when the first failure is anexec(no verdict), a later qa's verdict is dropped from the summary entirely.The fix is small but not the one-liner the spec assumed
The spec said "file a follow-up only if not a one-liner." Two constraints make
findLastunavailable:findLastdoes not typecheck here.tsconfig.jsonsets"lib": ["ES2022"];findLastis ES2023. Verified:>=22.12.0, so it's fine at runtime — this is purely the TS lib floor. Bumpinglibis a wider change than this PR should make; a reverse scan keeps it local.)loopmust be excluded, or a trailing loop failure becomes the displayed reason. This PR already owns that rule — reuseLOOP_PHASEfromstatus-derivation.tsso the summary cell obeys the same loop-exclusion as the card and the log.Roughly:
run-display.test.tsalready exists and currently asserts nothing aboutfailureReason, so there's a home for the regression test.Either land it here (it's in scope — the issue asked, and it's the same bug family) or file a follow-up. What shouldn't stand is the current record saying "not reproducible," because it is reproducible and now root-caused.
Revised A+ gap list
run-display.ts:87first-winsfailureReason— real bug, root-caused above. Fix or file a follow-up with this attribution.(AC-6)hand-writes the loop entry and never invokes the batch-executor block.logs.ts's, N partialrendering.Verdict unchanged: AC_MET_BUT_NOT_A_PLUS (all 8 ACs still met — none of the above is an AC failure; #1 is a Notes item, #2 is coverage). But #1 means this is no longer "test polish only."
fix(#766): summary reason tracks the last attempt; cover the loop-log…
admarble commentedon Jul 16, 2026
Both gaps closed —
8d77d19(PR #772)Verdict: READY_FOR_MERGE.
1.
run-display.ts:87— first-wins failure reason (the real bug)Two details worth recording:
loopis excluded, reusing this PR's ownLOOP_PHASEconstant. Without it, a trailing loop failure becomes the displayed reason and masks the phase that actually failed — the summary would contradict the card and log, which already excludeloop. The fix now obeys one rule in all four places.findLast.findLastis ES2023 andtsconfig.jsonpins"lib": ["ES2022"], so it doesn't compile (TS2550) even though the>=22.12.0engine runs it fine. This is why the spec's "one-liner" estimate didn't hold.qaVerdict/unmetCountread from the same entry, so they tracked the first iteration too — a run that closed 2 of 3 gaps still reported 3. Fixed by the same change.2. AC-6's producer — now actually covered
Three cases in
batch-executor.test.tsdriverunIssueWithLoggingthrough a real fail → loop → recover sequence and assert the loop log reacheslogPhasewith phase/status/duration/error, plus theTimeout→timeoutstatus mapping. The misleading integration test is renamed to "round-trips a hand-written loop entry through the writer and schema" — what it actually does — with a pointer to the producer test.Verified by mutation, not assertion
Both fixes were re-mutated to confirm the new tests fail:
The first assertion is #762's reported symptom, now reproduced in a test — the loose end the issue asked about is no longer just root-caused, it's locked.
Checks
8d77d19; PR fix(#766): recovered phase failure no longer reports failed #772 MERGEABLE, 0 commits behind mainRemaining (non-blocking)
Only the cosmetic item from before: no test for
logs.ts's, N partialrendering. Not worth holding the PR.fix(#766): recovered phase failure no longer reports failed (#772)
docs: sync reference/feature docs for the next release (#792)
fix(#866): don't freeze a running issue's clock; harden the AC-4/6/8 …
fix(#866): freeze TUI ElapsedTimer at completedAt instead of counting…