Repository navigation
Conversation
Derive the issue verdict from the current phase slots instead of pinning `failed`/`partial` forever, so a run that fails a quality-loop phase and recovers on a later iteration reads passed on the live card, the summary table, and the JSON log alike. - Shared `pipelineHasFailed` helper (status-derivation.ts) drives both the orchestrator card and the renderer; `loop` is excluded from the verdict. - `deriveIssueLogStatus` derives the log's issue status from the latest attempt of each phase; `partial` gets its own summary bucket so an all-partial run isn't `0 passed · 0 failed`. - Loop phases are now written to the run log (phase/status/duration/error). - A #762-style all-failed run with no verdict stays failed everywhere. Entire-Checkpoint: aceb380aa394
Closed
8 tasks
… producer Closes the two QA gaps on #766. 1. `run-display.ts` picked the summary detail cell's reason with `.find()` over `phaseResults`, which accumulates every attempt across every quality-loop iteration — so it rendered the FIRST failure and pinned a stale reason. This is the loose end in #766's Notes: #762's cell read `Timeout after 1800s` when its real last failure was an API drop. The Notes attributed the cell to `run-renderer.ts:288` (genuinely last-wins, but it feeds the live card, not the summary), so the actual line was never looked at. It now scans back for the last failing non-loop attempt, excluding `loop` via the shared LOOP_PHASE rule the card and log already use — a trailing loop failure must not mask the phase that actually failed. `qaVerdict` and `unmetCount` hang off the same entry and were stale for the same reason. Reverse scan rather than `findLast`: tsconfig pins `lib: ES2022` and `findLast` is ES2023 (TS2550), though the >=22.12 engine would run it. 2. AC-6's producer had no coverage: the test named "(AC-6)" hand-writes the loop entry via `writer.logPhase`, so it passed even with the batch-executor call site deleted (verified by mutation — the mutant survived 57 tests). Added three cases driving `runIssueWithLogging` through a real fail -> loop -> recover sequence, asserting the loop log reaches `logPhase` with phase/status/duration/error, plus the timeout status mapping. Renamed the integration test to describe what it actually covers. Both fixes verified by re-running the mutations: each now fails, including with #762's exact symptom ("expected 'Timeout after 1800s' to be 'API Error: Connection closed mid-response'"). Suites: 52 files / 1230 tests pass. Build and lint clean.
admarble
deleted the
feature/766-fix-recovered-phase-failure-still-reports-failed-l
branch
July 16, 2026 03:05
This was referenced Jul 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
A run whose phase failed and then recovered on a later quality-loop iteration disagreed across all three outputs — live card
✘ failed, summary table✔ passed, JSON log0 passed · 0 failed/status: partial. This fixes the three independent bugs behind that (#766).failednever recovers — both status state machines (run-orchestrator+run-renderer) pinnedfailedon any phase failure and never de-escalated. They now derive the verdict from the current phase slots via a sharedpipelineHasFailedhelper. Phase slots are keyed by name, so a retried phase already holds its latest attempt; the one phase not overwritten on recovery is the auxiliaryloop, which is excluded from the verdict (excluding it never hides a genuine failure — an unrecovered pipeline failure always leaves a non-loop phase failed too).partialcounted in neither bucket — the log pinnedpartialon any timeout andfinalizeRunLogcounted onlysuccess/failure. Issue status now derives from the latest attempt of each phase (deriveIssueLogStatus, so a timeout a later iteration recovers from clears), andpartialgets its own summary bucket (surfaced insequant logsand the MCPrunresponse).A
#762-style run where all attempts die with no verdict staysfailedacross all three outputs (locked in by a negative test).Acceptance Criteria
run-state.test.tsrecovery test;pipelineHasFailedstatus-derivation.ts#pipelineHasFailedused by orchestrator + rendererrecovered-failure.integration.test.ts(all three → passed)partialrun not0 passed · 0 failedpartialbucket; integration test +finalizeRunLogpartialnot pinned by a recovered timeoutderiveIssueLogStatus; log-writer de-escalation testbatch-executor.tslooplogPhase; integration testTest plan
npm run build,npm run lintcleanstatus-derivation.test.ts,recovered-failure.integration.test.ts, orchestrator/renderer/log-writer recovery + negative testssrc/lib/workflow/,src/lib/cli-ui/,src/mcp/,src/commands/suites pass (pre-existing unrelated flake inprompt-wait.test.ts, fails identically on base tree)Notes
Loose end from the issue (#762 detail cell showed
Timeout after 1800svs the API-drop last failure) was not reproducible —failureReasonis already last-wins atrun-renderer.ts:283. Left untouched.Closes #766