Repository navigation
Closed
Labels
enhancementNew feature or requestmulti-agentMulti-agent backend support and agent-agnostic architectureplannedImplementation plan approvedready-for-reviewReady for code review
Description
Problem
#733 made ClaudeCodeDriver treat error_max_turns as a soft outcome: it returns { success: false, capped: true, output: <partial> } instead of a hard error (claude-code.ts:233-246). This is fully wired for sub-agent caps (the /qa and /exec skills read it). But at the orchestrator level the flag is dead data:
cappedis read nowhere insrc/outside the driver that sets it.phase-executor.ts:754-767(the!agentResult.successreturn) drops both thecappedflag and the partialoutput— so when a top-level phase query (not a spawned sub-agent) hits its turn cap, the partial work is discarded exactly as before Graceful error_max_turns handling for subagents #733.PhaseResult(types.ts:209) has nocappedfield (it gainedstructuredError?in feat(driver): surface structured rate-limit/credits errors from SDK message stream (replaces #592 fallback noise) #732 but notcapped).
So #733's AC-1 ("don't fail the phase") holds for sub-agent caps but not for orchestrator-level query caps. This was explicitly carved out of #733 with sign-off in the spec ("confine to driver + skills… file a follow-up. Confirm?") — this issue is that follow-up.
Proposed approach
Mirror the #732 structured-error retry-gating pattern (phase-executor.ts:870-872 gates retry on typedError.isRetryable; MCP fallback at :910):
- Add
capped?: booleantoPhaseResult(types.ts), additive — same pattern asstructuredError?. - In
phase-executor.ts:754, propagatecappedand the partialoutputon the failure return (todayoutputis omitted entirely on failure). - Treat a capped phase as incomplete-but-not-hard-failed: skip the cold-start retry and MCP fallback (a retry cannot un-cap a turn limit — same rationale as the billing skip in feat(driver): surface structured rate-limit/credits errors from SDK message stream (replaces #592 fallback noise) #732), and surface a clear "phase capped, partial output preserved" signal.
- Decide run-loop semantics (the open design question): does a capped phase auto-continue with partial output, or halt cleanly for the user to resume? (Leaning: surface + halt, since silently continuing on partial work is risky.)
- Tests in
phase-executor.test.tsfor the capped path: partial output preserved, no MCP-fallback retry, correct downstream signal.
Acceptance Criteria
- AC-1 —
PhaseResultcarriescappedand the partialoutputwhen the driver returns a capped result. - AC-2 — A capped phase does not trigger the cold-start retry or the MCP fallback.
- AC-3 — The run loop surfaces the cap clearly and preserves partial work (exact continue-vs-halt semantics decided during design).
- AC-4 —
phase-executor.test.tscovers the capped path end-to-end.
References
- Follow-up to Graceful error_max_turns handling for subagents #733 (driver + skills slice; PR feat(#733): graceful error_max_turns handling for subagents #737)
- Retry-skip pattern to mirror: feat(driver): surface structured rate-limit/credits errors from SDK message stream (replaces #592 fallback noise) #732
- Turn caps live on every agent: Migrate subagent patterns to declarative .claude/agents/ definitions #484
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestmulti-agentMulti-agent backend support and agent-agnostic architectureplannedImplementation plan approvedready-for-reviewReady for code review
Activity
admarble commentedon Jun 22, 2026
Complexity: Standard (4 ACs, 1 directory)
AC Quality Check
capped+outputpresent on PhaseResult when driver caps.phase-executor.test.tscovers the capped path.No vague/unmeasurable/open-ended smells beyond the deliberately-deferred AC-3 design decision.
Scope Assessment
Non-Goals:⚠️ No explicit Non-Goals section in the issue, but the body scopes tightly: orchestrator-level (top-level phase query) caps only; sub-agent caps already handled in #733. Implicit non-goal: do not change driver-level (
claude-code.ts) or skill-level behavior.src/lib/workflow/)Verdict: ✅ SCOPE_OK — single cohesive change in one module, mirroring the established #732 retry-gating pattern.
Acceptance Criteria
AC-1:
PhaseResultcarriescapped+ partialoutputfrom a capped driver resultVerification: Unit Test
Scenario: Given the driver returns
{ success:false, capped:true, output:<partial> }→ WhenexecutePhasemaps the failure result (phase-executor.ts:754-767) → Then the returnedPhaseResulthascapped: trueandoutput: <partial>.Assumptions:
AgentPhaseResult.capped(agent-driver.ts:78) is already set by the driver (#733/#737, confirmed). Today the failure return at:754omitsoutputentirely and has nocappedfield.AC-2: A capped phase skips the cold-start retry AND the MCP fallback
Verification: Unit Test
Scenario: Given a capped result from
executePhaseFn→ WhenexecutePhaseWithRetryruns → Then exactly one phase invocation occurs (no cold-start re-spawn at:844, no no-MCP retry at:919-924, and — forspec— no spec-extra retry at:972).Assumptions: A retry cannot un-cap a turn limit, so skipping is correct — same rationale as the
BillingErrorskip (:918). Note capped must skip even cold-start retries, unlike billing which still cold-start-retries in the <60s window — so a flag check alone at the MCP gate is insufficient; an explicit early return is needed (see Implementation Plan).AC-3: Run loop surfaces the cap clearly and preserves partial work
Verification: Integration Test (batch-executor loop) + Manual
Scenario: Given a phase returns capped → When the batch run loop processes it (
batch-executor.ts:867-887,:967-1041) → Then a distinct "capped — partial output preserved" signal is emitted (not a genericfailed), the partialoutputreaches the phase log / state, and the run halts cleanly for user resume (recommended semantics — see Open Questions).Assumptions: A capped result is already
success:false, so it already hits thebreakat:1040(halt). The gap is the signal (currently logged as a plain failure) and the droppedoutput.AC-4:
phase-executor.test.tscovers the capped path end-to-endVerification: Unit Test
Scenario: Given the capped-path tests → When the suite runs → Then partial-output preservation, no-retry/no-MCP-fallback, and the downstream signal are all asserted.
Assumptions: Mirror the existing billing tests at
phase-executor.test.ts:649-708(makeResult+ injectedexecutePhaseFn+ call-count assertions).Implementation Plan
Phase 1: Type + propagation (AC-1)
src/lib/workflow/types.ts(~:233) — add/** Set when the phase hit its turn cap... */ capped?: boolean;toPhaseResult, additive, same shape asstructuredError?.src/lib/workflow/phase-executor.ts:754-767— on the failure return, propagatecapped: agentResult.cappedandoutput: agentResult.output(todayoutputis dropped on failure).Phase 2: Retry gating (AC-2)
phase-executor.tsexecutePhaseWithRetry— after eachexecutePhaseFncall (both theskipColdStartRetrybranch ~:837and the cold-start loop ~:853), add an explicit short-circuit:if (lastResult.capped) return lastResult;. This skips cold-start retries, the MCP fallback, and the spec-extra retry in one move.const failureIsCapped = lastResult!.capped === true;and include!failureIsCappedin the MCP-fallback guard at:919-924, alongside!failureIsBilling. (The early return in step 3 already covers this; the guard documents intent and protects against future code paths.)Phase 3: Run-loop signal (AC-3)
src/lib/workflow/batch-executor.ts:879-887— whenresult.capped, emit a distinct progress status (e.g."capped") instead of"failed", and ensure the partialresult.outputis persisted to the phase log (createPhaseLogFromTiming~:923, add status"capped"if the log schema allows, else log as failure with acappednote) and/or state. Keep the existingbreak(halt) at:1040.Phase 4: Tests (AC-4)
phase-executor.test.ts— add adescribe/itblock mirroring:649-708: (a) capped result →result.capped === trueandresult.outputpreserved; (b) capped →executePhaseFncalled exactly once, nomcp:falsecall; (c) cappedspecphase → no spec-extra retry. Add a batch-executor-level assertion for the distinct signal if feasible.Design Review
phase-executor.ts(the success/failure mapper at:373/:754), retry-gating inexecutePhaseWithRetry, and run-loop signalling inbatch-executor.ts. Type lives intypes.ts. This matches exactly wherestructuredError/BillingErrorgating already lives (feat(driver): surface structured rate-limit/credits errors from SDK message stream (replaces #592 fallback noise) #732).CappedResultwrapper type or a new exception — overkill;capped?: booleanparallelsstructuredError?and keeps the change additive/backward-compatible.failureIsBilling→ skip MCP fallback). Capped is the second member of that "soft, non-retryable outcome" family.capped/new status?" — verify before adding; fall back to logging as failure + note if not.Feature Quality Planning
All standard checks pass. Notable items:
:844), MCP fallback (:919), spec-extra retry (:972) — must all respect capped. The single early-return in step 3 covers all three; the!failureIsCappedguard (step 4) is belt-and-suspenders. Don't fix only the MCP gate and leave the spec retry live (the bug the issue calls out forspec).capped?is optional/additive — no existing consumer breaks.outputnow present on capped failures where it was previously absent; verify no consumer assumesoutput === undefinedimplies failure."capped"status tocreatePhaseLogFromTimingmay require a run-log-schema change; if so, keep it minimal or log-as-failure-with-note to stay in scope.Open Questions
success:false→break). Auto-continuing on partial work risks downstream phases acting on incomplete output. Impact if wrong: minimal — halt is reversible (user resumes); auto-continue is not. Decision is reversible later via thecappedflag now being first-class.createPhaseLogFromTiming/ the run-log schema accept a new"capped"status, or should capped log as"failure"with acappedmarker? Recommendation: reuse"failure"+ acappedboolean in the log entry if the schema is rigid; add"capped"only if trivially additive.Recommended Workflow
Phases: exec → qa
Quality Loop: disabled (SCOPE_OK, single module, well-bounded)
Reasoning: Tight, pattern-mirroring change in one already-well-tested module. AC-4 is the test work and the billing tests give a verbatim template, so a separate
testgenphase is redundant — fold test authoring intoexec. No UI (no browser test), no new security surface.Label Review
Current:
enhancement,multi-agentRecommended: keep
enhancement,multi-agent; addplannedReason: Orchestrator turn-cap handling for multi-agent runs —
multi-agentfits. Nocomplex/breakingwarranted (additive, single module).Quality Loop: Won't auto-enable (SCOPE_OK, no SCOPE_WARNING).
admarble commentedon Jun 22, 2026
Exec Progress Update
Implementation complete. PR: #741
AC Coverage
PhaseResultcarriescapped+ partialoutputphase-executor.test.tscovers the capped path end-to-endKey files changed
src/lib/workflow/types.ts— additivecapped?: booleanonPhaseResultsrc/lib/workflow/phase-executor.ts— propagatecapped+ partialoutputon failure; early-return retry gating +!failureIsCappedMCP guardsrc/lib/workflow/batch-executor.ts— distinct capped progress signal,cappedlog marker, skip inner /loop + outer quality-loop (surface + halt)src/lib/workflow/run-log-schema.ts— additive optionalcappedonPhaseLogSchema(status stays"failure")src/lib/workflow/log-writer.ts— threadcappedthroughcreatePhaseLogFromTimingphase-executor.test.ts/batch-executor.test.ts— capped-path coverageCHANGELOG.md—[Unreleased] > ChangedentryDesign decisions (resolving spec Open Questions)
/loopspawn and the outer quality-loop retry — re-running can't un-cap, and acting on partial work is the risk this path avoids. Reversible later via the now-first-classcappedflag."failure"+ an additivecappedboolean rather than a newPhaseStatusenum value, keeping the persisted-log schema stable.Checks
npm run build✅ ·npm run lint✅ (0 warnings)npx vitest run src/lib/workflow/→ 943 passed, 2 skipped__tests__/run-orchestrator*.test.ts→ 48 passedQuality Plan Alignment
!failureIsCappedguard documents intentcapped?additive/optional;outputnow present on capped failures — audited consumers, none assumeoutput===undefinedimplies failurerun-log-schema.test.tsgreenNotes
package-lock.jsonchurn (npmlibcfield artifact) from the commit.success:false → break, but the quality-loop branch precedes that break. Added explicit skips for both the inner/loopand the outer quality-loopwhileso a capped phase truly halts.admarble commentedon Jun 22, 2026
QA Review for Issue #739
PR: #741 · Commit:
cb16422b74c34531baf6d2fe535152dd276e3e68· Reviewer: /qa (inline review — diff < 600 LOC)AC Coverage
PhaseResultcarriescapped+ partialoutputfrom a capped driver resulttypes.tsaddscapped?: boolean;phase-executor.ts:764-766propagatescappedandoutputon the failure return (output was previously dropped). Test asserts both.phase-executor.ts:851,880) +!failureIsCappedguard at the MCP gate (:946). Tests prove single invocation, nomcp:falsecall, no spec-extra retry.cappedlog marker, skips inner /loop + outer quality-loop, halts. Gap: the spec-phase block (:589-639) preserves output + halts but does not emit the distinct signal or log marker — see Adversarial Re-Read.phase-executor.test.tscovers the capped path end-to-endphase-executor.test.ts(flag+output, no MCP fallback, no spec-extra retry) + 2 integration cases inbatch-executor.test.ts(distinct signal/log marker/halt, quality-loop skip).Coverage: 4/4 AC items met (one with a non-blocking sibling-site consistency gap).
CI Status
build (22.x)typecheckvalidate-skillsvalidate-pluginnode-floor-guardCI Summary: 5 passed, 0 pending, 0 failed.
mergeable: MERGEABLE.Quality Metrics
any)Test Coverage Analysis
phase-executor.tsphase-executor.test.ts(3 new capped cases)batch-executor.tsbatch-executor.test.ts(2 new AC-3 cases)run-log-schema.tsrun-log-schema.test.tsgreenlog-writer.tslog-writer.test.tsgreentypes.tsCoverage: runtime-behavior files (phase-executor, batch-executor) both have dedicated capped-path tests. New tests invoke the real functions with injected
executePhaseFnand assert call-counts + result fields — not tautological.Code Review
Strengths:
BillingErrorretry-skip pattern;capped?is additive/optional, same shape asstructuredError?— backward-compatible."failure"phase-log status + an additivecappedboolean rather than expanding thePhaseStatusenum — keeps the persisted run-log schema stable (no migration).while, not just the inner /loop spawn — without this a capped phase under quality-loop would re-run 3× and act on partial work. Good catch, well-tested.Issues:
batch-executor.ts:589-639) was not updated alongside the main phase loop. See Adversarial Re-Read for specifics + fix.Suggestions:
Risk Assessment
"unknown"progress message (the driver returns noerrorstring on a cap), so the user can't tell a turn cap from a real failure for that one phase. Partial spec output is still preserved and the run still halts — so no data loss or wrong-continuation; the impact is observability only.cappedpropagation lives in phase-agnosticphase-executor.ts, so AC-1/AC-2 cover every phase uniformly. The only sibling is intra-file (below).:598signal,:637log) is an intra-file sibling of the main-loop failure branch (:891signal,:952log) that was updated. The main loop now emits the distinct capped signal +cappedlog marker; the spec block does not. Confirmed by reading both branches.Adversarial Re-Read
Findings: Surfaced one gap by tracing the capped path through both failure-handling sites in
batch-executor.ts. The spec phase runs in its own block (:530-690), distinct from the main phase loop (:809-1059) where the AC-3 distinct-signal +cappedlog-marker changes were applied. For a capped spec phase:phaseResults.push(specResult)at:582)returnat:669, beforeparseRecommendedWorkflowat:679— so partial spec output is never mis-parsed as a workflow)specResult.error ?? "unknown"(:598), not the distinct"turn cap reached — partial output preserved"messagecapped(:637passes only{ error, errorContext })Checked and cleared other concerns: (1)
outputnow present on capped failures does not mislead any consumer —buildLoopContext(:126) is only reached via the quality loop, which capped now skips;parseRecommendedWorkflow(:679) is only reached on spec success (after the:654early return). (2)capped ⟹ success:falseinvariant holds (driver sets it only on theerror_max_turnsbranch). (3) No Non-Goals expanded into scope; noany/type erosion.Suggested fix (fold into PR): in the spec failure branch, mirror the main loop —
plus a batch-executor test for a capped spec phase asserting the distinct signal + log marker.
Status: Gaps Found
Verdict: AC_MET_BUT_NOT_A_PLUS
All 4 ACs are substantively met — the heart of the issue (preserve partial output + skip the un-fixable retries) lives in phase-agnostic
phase-executor.tsand is correct, well-tested, and backward-compatible; CI is fully green. The one gap is a sibling-site consistency miss: the spec phase's separate failure handling doesn't surface the distinct capped signal or thecappedlog marker that the main loop now does, so a capped spec phase is observationally indistinguishable from a generic failure (partial work is still preserved and the run still halts — so it's an observability gap, not a correctness one). Recommend folding the ~4-line spec-block fix + one test into this PR before merge.Documentation
[Unreleased] > Changedentry present and accurate (feat(orchestrator): preserve partial output for turn-capped phases in phase-executor #739)Next Steps
batch-executor.ts:598+:637) so AC-3's "surface the cap clearly" holds for every phase, including spec.cappedlog marker)./qa 739(or/loop) — with the sibling site fixed this is a cleanREADY_FOR_MERGE.fix(#739): surface capped signal + log marker on the spec-phase sibli…
admarble commentedon Jun 22, 2026
Quality Loop — Iteration 1/3
Addressed the single
AC_MET_BUT_NOT_A_PLUSfinding from QA (sibling-site consistency gap).Fix applied
batch-executor.ts:598— spec-phase failure signal now emits the distinct"turn cap reached — partial output preserved (resume to continue)"message whenspecResult.capped(was generic"unknown").batch-executor.ts:637— spec phase log now passescapped: specResult.capped(matching the main phase loop).batch-executor.test.ts— added a capped-spec-phase test asserting the distinct signal,cappedlog marker, clean halt, and preserved partial output.A capped spec phase already preserved partial output and halted; this closes the observability gap so AC-3's "surface the cap clearly" now holds for every phase, including spec.
Re-validation
npm run build✅ ·npm run lint✅ (0 warnings)npx vitest run src/lib/workflow/→ 944 passed, 2 skipped (+1 new test, no regressions)Status
FIXED — all AC-3 sibling sites now consistent. Commit
7ff268fpushed to PR #741. Recommend re-running/qa 739for a finalREADY_FOR_MERGEpass.admarble commentedon Jun 22, 2026
QA Review for Issue #739 (re-review @
7ff268f)Incremental re-review after the
/loopfix (7ff268f) that closed the sibling-site gap flagged in the prior QA (cb16422, AC_MET_BUT_NOT_A_PLUS).AC Coverage
PhaseResultcarriescapped+ partialoutputphase-executor.ts:764-766!failureIsCappedguard; tests assert single invocation:891/:952) and the spec-phase block (:605/:648). Distinct signal +cappedlog marker + clean halt + partial output preserved.phase-executor.test.tscovers the capped pathCoverage: 4/4 met. The prior sibling-site gap is resolved.
CI Status
build (22.x)typecheckvalidate-skills/validate-plugin/node-floor-guardCI Summary: 5 passed, 0 pending, 0 failed.
mergeable: MERGEABLE.Quality Metrics
any)Test Coverage Analysis
phase-executor.tsphase-executor.test.ts(3 capped cases)batch-executor.tsbatch-executor.test.ts(3 capped cases incl. spec sibling)run-log-schema.ts/log-writer.tstypes.tsCode Review
Strengths:
/loopfix is a faithful mirror of the main-loop logic — same distinct message string, samecappedlog-marker plumbing — so the two failure-handling paths are now symmetric.autoDetectPhases:true) and asserts the signal, log marker, halt, and preserved output — non-tautological.Issues: None blocking.
Risk Assessment
cappedpropagation is phase-agnostic inphase-executor.ts."failed"emit sites inbatch-executor.ts: spec block (:609) ✅ fixed, main phase loop (:912) ✅ fixed, and the loop phase (:1061) which still emitsloopResult.error ?? "unknown"(not capped-aware). Assessed as out of scope / non-blocking: the loop phase is a conditional recovery sub-phase reached only in quality-loop mode after a non-capped primary failure; a capped loop result is still preserved (phaseResults.push) and still halts (breakat:1058) — only the cosmetic distinct-signal string is absent. Outside AC-3's cited run-loop range (:867-887, :967-1041). Optional follow-up below.Adversarial Re-Read
Findings: Traced the capped path through all three
"failed"emit sites inbatch-executor.tsplus the phase-agnostic propagation inphase-executor.ts. The spec sibling flagged last round is now closed and verified by reading both fix sites. Confirmed: (1)outputon capped failures still misleads no consumer —buildLoopContext/parseRecommendedWorkfloware unreachable on the capped paths (loop skipped via!result.capped+haltedByCap; spec parse gated behind the:670early return on failure); (2)capped ⟹ success:falseinvariant holds; (3) noany/type erosion, no deleted tests, no Non-Goals expanded. One residual sibling (loop-phase emit:1061) surfaced and assessed as a low-value optional follow-up, not an AC gap.Status: Clean (residual loop-phase observation is a recommendation, not a gap)
Verdict: READY_FOR_MERGE
All 4 ACs are met, the sibling-site consistency gap from the prior review is closed, CI is fully green, and local build/lint/tests pass (275 affected). The implementation is additive, backward-compatible, and well-tested. The lone residual observation (loop-phase emit not capped-aware) is a rarely-reached, out-of-AC-scope edge where partial work is still preserved and the run still halts — recommended as an optional follow-up, not a merge blocker.
Documentation
[Unreleased] > Changedentry present (feat(orchestrator): preserve partial output for turn-capped phases in phase-executor #739)Next Steps
batch-executor.ts:1061) for full cross-phase symmetry. Low priority — quality-loop-only, partial work already preserved.admarble commentedon Jun 22, 2026
QA Review for Issue #739
AC Coverage
PhaseResultcarriescapped+ partialoutputfrom a capped driver resultcapped?: booleanadded toPhaseResult(types.ts) andPhaseLogSchema(run-log-schema.ts);executePhase's failure return now propagatescappedandoutput(previously dropped) — phase-executor.ts:766-767.skipColdStartRetrybranch (:854) and the cold-start loop (:882), positioned before the MCP fallback (:934) and spec-extra retry (:991). Belt-and-suspenders!failureIsCappedguard added at the MCP gate.turn cap reached — partial output preserved (resume to continue); partialoutputpreserved inphaseResults; additivecappedlog marker (status stays"failure", no new enum);haltedByCapshort-circuits the quality loop and outer retry. Spec-phase sibling site covered in commit 7ff268f.phase-executor.test.tscovers the capped path end-to-endCoverage: 4/4 AC items fully met
CI Status
CI Summary: 5 passed, 0 pending, 0 failed (PR #741)
Quality Metrics
any)as never/as PhaseResultcasts)Test Coverage Analysis
phase-executor.tsphase-executor.test.ts(3 new #739 tests)batch-executor.tsbatch-executor.test.ts(3 new #739 tests)types.tsrun-log-schema.tslog-writer.tscappedto aPick<>allow-list (no logic)Coverage: 2/2 logic files have corresponding tests.
Code Review
Strengths:
capped?is additive/optional, same shape asstructuredError?— zero impact on existing consumers.executePhaseWithRetryare guarded (skip-cold-start branch + cold-start loop), with a defensive!failureIsCappedguard at the MCP gate documented as belt-and-suspenders.Issues: None blocking.
Suggestions: None material.
Risk Assessment
outputon the failure return (previously dropped). Traced both consumers: error-context builder (batch-executor.ts:126) — strictly beneficial;parseRecommendedWorkflow(specResult.output)(:695) — unreachable on failure because the spec failure path early-returns at :670. No behavior change for non-capped failures.ClaudeCodeDriverreturningerror_max_turns(driver→phase-executor wiring is unit-mocked) — acceptable; the driver slice was covered in Graceful error_max_turns handling for subagents #733/PR feat(#733): graceful error_max_turns handling for subagents #737.capped(claude-code.ts),/qa&/execskills consume it (Graceful error_max_turns handling for subagents #733); this PR adds the orchestrator consumers (phase-executor + batch-executor). No other orchestrator-level site drops the flag.executePhaseWithRetryaudited and guarded; themapAgentSuccessToPhaseResultreturns (lines 401/415) are on thesuccess===truepath wherecappedis necessarily false, so correctly omitted; spec-phase failure block in batch-executor audited and handled.Adversarial Re-Read
Findings: No gaps found because: (1) ran all 166 tests in both touched test files — green, and the new capped progress signal is observable in the emitted
SEQUANT_PROGRESSlines; (2) traced the newly-unconditionaloutputpropagation to both consumers and confirmed the spec-recommendation parser is unreachable on a failed/capped spec (early return at :670); (3) inspected all foursuccess:falsereturn sites in phase-executor and confirmed the two non-propagating ones are on the success-mapping path; (4) verified continue-vs-halt is decided (surface+halt) and the outer quality-loop retry is also short-circuited viahaltedByCap; (5) no Non-Goals from the issue body have crept into scope — change is confined to PhaseResult plumbing + retry-gating + run-loop signal.Status: Clean
Verdict: READY_FOR_MERGE
All 4 ACs met, CI green across all 5 checks, tests pass locally (166), CHANGELOG
[Unreleased]entry present, and the implementation cleanly mirrors the established #732/#733 patterns with strong sibling-site coverage and adversarial re-read clean.Documentation
[Unreleased] → Changed, references feat(orchestrator): preserve partial output for turn-capped phases in phase-executor #739)Next Steps
fix(#739): gate failure-path output on capped + persist capped to state
feat(#739): preserve partial output for turn-capped phases in phase-e…
fix(#799): close remaining gaps — spec-phase billing symmetry + doc a…
fix(#799): fail-fast the -Q quality loop on billing / rate-limit-wind…
fix(#856): surface externally-terminated runs as aborts; stop logging…
fix(#856): surface externally-terminated runs as aborts; stop logging…