Repository navigation
Description
Context
The #604 forensics showed 3 of the 5 recorded chain failures (two rate-limit cascades, one QA API timeout) killed the whole chain even though earlier links had completed and checkpointed — a rerun the next day of one of them (f317530c → b9c08e29) succeeded. Chain mode already writes a checkpoint(#N): QA passed commit after each successful link (createCheckpointCommit, worktree-manager.ts) and describes it as a "recovery point if later issues fail", but nothing consumes it: on any link failure the loop does an unconditional break (run-orchestrator.ts) and a re-run redoes completed issues from scratch.
This is the highest-leverage chain improvement identified: it converts "chain dead, 1–3 hours wasted" into "re-run picks up at the failed link" for the dominant failure classes.
Proposal
Re-running sequant run A B C --chain after a partial failure should skip links that already completed (state.json status ready_for_merge + existing worktree/branch with checkpoint) and resume execution at the first incomplete link, re-establishing the successor rebase chain from the last good link's committed tip (the #748-fixed rebaseOntoLocalBranch path). Whether this is automatic on re-run or an explicit --resume-chain flag is a design decision for /spec — automatic detection must not silently skip an issue the user intended to redo.
Acceptance Criteria
- Re-running the same
--chaininvocation after a mid-chain failure does not re-execute links whose issues areready_for_mergewith an intact worktree; execution resumes at the first incomplete link, rebased onto the last completed link's local committed tip. - Skipped links are reported explicitly in output (issue number, why it was skipped, which commit the resume point is).
- A completed link whose worktree/branch has been destroyed (e.g. merged + cleaned mid-way) is handled: either re-established from the merged base or the chain fails fast with a clear message — no silent wrong-base execution.
-
createCheckpointCommitfailure is no longer silent (currently warns and continues,worktree-manager.ts~1094-1102): if the recovery point can't be written, the run says so prominently, since resume depends on it. - Integration test with real git: run a 3-link chain, force link 2 to fail, re-run, assert link 1 is skipped and link 2 branches from link 1's tip (
merge-base --is-ancestor, same pattern as the fix(#748): --chain successors branch from predecessor's committed work, not main #752 test).
Out of scope
Automatic retry within the same run (separate concern), rate-limit detection/backoff (companion issue), --stacked PR-base rewriting on resume beyond what the normal path already does.
References
docs/reference/chain-mode-analysis-2026-05.md(investigate(metrics): chain mode 29% success rate vs 92% single-issue — failure forensics #604) — failure taxonomy; per-issue success 61.5% when the chain reaches an issue vs 17% whole-chain at length≥3- fix(chain): --chain successors branch from main, not predecessor's committed work (up-front worktree provisioning) #748 / PR fix(#748): --chain successors branch from predecessor's committed work, not main #752 — successor rebase mechanics this must reuse
- fix(run): pre-flight guard misses in_progress issues already merged on GitHub (gap in #305/#423) #592 — known pre-flight gap for in_progress-but-merged issues, relevant to skip detection
Activity
admarble commentedon Jul 15, 2026
📋 /spec Plan — #760 Resume a partially-completed chain
Complexity: Standard (5 ACs, 1 primary directory:
src/lib/workflow)AC Quality Check
The 5 ACs are unlabeled checkboxes (no
AC-N:IDs) — the parser returns 0, so downstream state storage will need IDs. All 5 are measurable and testable (each names a concrete file, state, or git assertion). No vague/unmeasurable language. Recommend addingAC-1…AC-5labels so/execand/qacan track them individually.Scope Assessment
Non-Goals: ✅ Present ("Out of scope" section: intra-run retry, rate-limit backoff,
--stackedbase rewriting beyond the normal path).src/lib/workflow)Verdict: ✅ SCOPE_OK — focused, single-module change with clean boundaries.
Key Finding (read before implementing)
The skip-detection this issue asks for already exists — the pre-flight state guard at
run-orchestrator.ts:635filters any issue that isready_for_merge/mergedout ofissueNumbers(unless--force) and even printsalready ready_for_merge — skipping. But that guard is chain-unaware and actively breaks the chain contract on resume:ensureWorktreesChain(line ~770). So a completed link is dropped from the list the chain is provisioned from → the first incomplete link is provisioned frombaseBranch/main, not the completed predecessor's committed tip.executeSequential, the fix(chain): --chain successors branch from main, not predecessor's committed work (up-front worktree provisioning) #748 successor-rebase only fires fori > 0. Once the completed prefix is dropped, the first-incomplete link sits at index 0, so it never rebases onto the predecessor's tip — it silently builds onmain, missing the completed link's work (exactly the fix(chain): --chain successors branch from main, not predecessor's committed work (up-front worktree provisioning) #748 failure mode).So the real work is not "add skip logic" — it's making the existing skip chain-correct: preserve the completed prefix as chain context and rebase the first-incomplete link onto the last completed link's local checkpoint tip.
Acceptance Criteria + Verification
AC-1 — Re-run skips completed links; resumes at first incomplete, rebased onto last-completed tip.
ready_for_mergewith an intact worktree/checkpoint → When re-runningrun A B C --chain→ Then #A is not re-executed and #B's branch has #A's checkpoint tip as an ancestor (merge-base --is-ancestor).AC-2 — Skipped links reported explicitly (issue #, why, resume commit).
#A, reason (ready_for_merge), and the commit #B resumes from.AC-3 — Completed link with destroyed worktree/branch: re-establish from merged base OR fail fast — no silent wrong-base.
merged, worktree gone → successor rebases ontoorigin/main(work is there). Scenario B (ready_for_mergebut worktree/checkpoint gone): tip is unreconstructable → fail fast with a clear message, do not run the successor.AC-4 —
createCheckpointCommitfailure is loud (not verbose-gated).AC-5 — Integration test: 3-link chain, force link 2 to fail, re-run, assert link 1 skipped & link 2 branches from link 1's tip.
chain-rebase.integration.test.tspattern (real worktrees,isAncestorhelper).Implementation Plan
Phase 1 — Chain-aware resume base
run-orchestrator.ts:635), whenoptions.chain: instead of silently dropping completed links, record them as skipped-but-part-of-chain (issue → branch, checkpoint tip). Keep them out of execution but keep them in chain topology.resumeBase= the last completed link's local branch tip (checkpoint commit). Provision the first-incomplete link fromresumeBaserather thanbaseBranch(feed the completed prefix's tail branch intoensureWorktreesChainas itsbaseBranch, or splice the completed branch intoworktreeMapso the existingi>0rebase path finds a predecessor).Phase 2 — Rebase correctness + integrity (AC-1, AC-3)
3. Ensure
executeSequential's successor-rebase (rebaseOntoLocalBranch, #748 path) fires for the first-incomplete link against the last-completed predecessor's tip — even though the predecessor didn't execute this run. Reuse the existing "chain link broken → stop" handling for failures.4. Add the AC-3 integrity check: before trusting a completed link as the resume base, verify its worktree/branch + checkpoint commit exist.
merged→ rebase successor ontoorigin/main.ready_for_mergebut tip gone → fail fast (clear message), no wrong-base execution.Phase 3 — Reporting + checkpoint hardening (AC-2, AC-4)
5. Upgrade the skip message to name each skipped link, its reason, and the resume commit the next link branches from.
6. In
batch-executor.ts:1129, capturecreateCheckpointCommit's return value (currently discarded); onfalse, emit a prominent warning regardless ofconfig.verboseand reflect it in the issue result (resume depends on this commit). Consider promoting the internal verbose-only warnings increateCheckpointCommit(worktree-manager.ts:1076/1099) to always-on for chain mode.Phase 4 — Tests (AC-5)
7. Extend
chain-rebase.integration.test.ts(or a newchain-resume.integration.test.ts): 3-link chain, complete link 1 (checkpoint), simulate link 2 failure, re-run, assert link 1 skipped + link 2's base is link 1's tip viamerge-base --is-ancestor. Add AC-3 destroyed-worktree cases and an AC-4 checkpoint-failure case.Design Review
run-orchestrator.ts; resume-base wiring inensureWorktreesChain/executeSequential; checkpoint hardening inbatch-executor.ts+worktree-manager.ts. No new module needed.rebaseOntoLocalBranchpath — the only new mechanism is preserving the completed prefix's tail branch as the resume base. Reject: a brand-new--resume-chainflag with a parallel code path (duplicates the guard + rebase logic already present).ready_for_mergeskip guard; the "chain link broken → stop, don't wrong-base" handling already inexecuteSequential.--forceis the existing, tested 'redo everything' escape hatch (satisfies the issue's 'must not silently skip an issue the user intended to redo'). "Does squash-merge break the ancestor assertion?" → yes for AC-3 merged-case; that's why merged links resume ontoorigin/main, not the (gone) local tip.Feature Quality Planning
Notable items:
merged(resume ontoorigin/main) fromready_for_merge-but-worktree-gone (fail fast). Squash-merge means the local checkpoint tip is not an ancestor oforigin/main, so never rebase a successor onto a stale local tip after merge.--forceinteraction:--forcebypasses the guard → re-runs the whole chain from scratch. Confirm resume logic sits inside the!mergedOptions.forcebranch so force still means "redo everything."mainat the same commit. Low conflict risk; coordinate final merge order via/mergerif both land together.Open Questions
--resume-chainflag? — Recommendation: automatic (reuse the existing skip guard);--forceremains the "redo everything" override. Impact if wrong: a user re-running to redo a completed link would need--force— acceptable and already the documented behavior for non-chain runs.ready_for_merge(not merged)? — Recommendation: fail fast with a clear message (tip is unreconstructable; wrong-base is worse than stopping). Impact if wrong: user re-provisions manually; safe.Recommended Workflow
Phases: exec → qa
Quality Loop: enabled (chain/git-mechanics change with real-git integration tests — worth the extra QA pass)
testgen: optional — the ACs are integration/real-git verified, not unit-pure; skip auto-testgen and hand-author the integration test in Phase 4.
Reasoning: CLI/git-mechanics enhancement, single module, no UI (
no-browser-testnot needed — no components). Not security-sensitive.Label Review
Current:
enhancement,cliRecommended: add
planned; considerchainif that label exists for grouping.Quality Loop: will auto-enable via recommendation above (git-mechanics risk), independent of scope verdict (SCOPE_OK).
admarble commentedon Jul 15, 2026
✅ /exec complete — #760 chain resume
PR: #765 · Branch:
feature/760-feat-resume-a-partially-completed-chain-from-its-lAC Coverage
chain-resume.tsplan +executeSequentialfirst-active-link rebase; integration test assertsmerge-base --is-ancestor↻ Resuming chain at #N from <sha> (<branch>)+ per-link skip linescomputeChainResumePlanbranches; unit + integration coverage (destroyed branch, merged)createCheckpointCommit+ call-site warning +checkpointFailedonIssueResult; test forces commit failure via pre-commit hookchain-resume.integration.test.ts(#752 real-git pattern)Key implementation
The skip already existed but was chain-unaware (the exact finding in the /spec plan): dropping completed links before provisioning left the first incomplete link at index 0, where the #748 successor-rebase never fires → it silently rebuilt on
main. Fix = make the skip chain-correct:chain-resume.ts— purecomputeChainResumePlan(): peels the contiguous completed prefix, computesresumeBase(last completed link's local branch forready_for_merge; base branch formerged), fails fast when aready_for_mergelink's branch is destroyed.run-orchestrator.ts— chain-aware pre-flight guard reports skips + resume commit, provisions the incomplete tail fromresumeBase, andexecuteSequentialexplicitly rebases the first active link ontoresumeBasewith fail-fast (the authoritative correctness gate — provisioning-time rebase only warns).batch-executor.ts+worktree-manager.ts— capturecreateCheckpointCommitresult, warn prominently (non-verbose), recordcheckpointFailed.--forcestill bypasses resume (redo whole chain). Non-chain skip guard unchanged.Files changed
chain-resume.ts(new),chain-resume.test.ts(new),chain-resume.integration.test.ts(new),run-orchestrator.ts,batch-executor.ts,worktree-manager.ts,types.ts,checkpoint.integration.test.ts,CHANGELOG.mdChecks
npm run build✅ ·npm run lint✅ (0 warnings) ·npx vitest run src/lib/workflow/→ 972 passed, 2 skipped, 0 failuresRecommended next step
/qa 760— quality loop enabled per the /spec recommendation (git-mechanics change with real-git integration tests).admarble commentedon Jul 15, 2026
QA Review for Issue #760
Note: prior QA passes completed all checks but timed out at the comment-post step (1800s wall-clock). This is the synthesized verdict at commit
8249128— all checks green, no code changes since.AC Coverage
computeChainResumePlan(chain-resume.ts) +executeSequentiali===0 rebase (run-orchestrator.ts:1112). Integration test assertsmerge-base --is-ancestor(link1Checkpoint, link2HEAD)after resume rebasealready <status> — skippinglines +↻ Resuming chain at #N from <sha8> (<branch>)(run-orchestrator.ts:744-761); asserted in integration test (skipped,resumeBaseCommit)computeChainResumePlanmerged branch (resumeBase=baseBranch) vs fail-fast on unresolvable branch tip; unit tests (destroyed branch, no-branch-recorded, merged) + integration tests (branch-D, merged-to-main)createCheckpointCommitfailure loud + reflected in resultverbose(worktree-manager.ts:1096-1104) + always-on call-site warning (batch-executor.ts:1139) +checkpointFailedonIssueResult; integration test forces failure via pre-commit hook and asserts the non-verbose warningchain-resume.integration.test.ts— real git, #752isAncestorpatternCoverage: 5/5 AC items fully met. Original ACs: 5/5. Derived ACs: none in spec.
CI Status
build (22.x)node-floor-guardtypecheckvalidate-skillsvalidate-pluginCI Summary: 5 passed, 0 pending, 0 failed.
Quality Metrics
any/as any/@ts-ignore)src/lib/workflow/+ CHANGELOG)Sub-agent checks (type-safety, scope, security) all returned PASS.
Test Coverage Analysis
chain-resume.tschain-resume.test.ts(unit, 7) +chain-resume.integration.test.ts(real git, 5)worktree-manager.ts(checkpoint warning)checkpoint.integration.test.ts(AC-4 pre-commit-hook case)batch-executor.ts(checkpointFailed)batch-executor.test.tsgreen)run-orchestrator.ts(resume wiring)types.tsFull workflow suite: 972 passed, 2 skipped, 0 failed. Lint clean.
Code Review
Strengths:
computeChainResumePlanis a pure, injected-resolver function (unit-testable without git); the real rebase reuses the fix(chain): --chain successors branch from main, not predecessor's committed work (up-front worktree provisioning) #748rebaseOntoLocalBranchpath rather than duplicating logic.executeSequential's i===0 resume rebase is the authoritative fail-fast gate (provisioning-time rebase only warns) — directly satisfies "no silent wrong-base execution."--forcestill bypasses resume — resume sits inside the!forcebranch.spawnSync("git", [array])form; no shell-string interpolation of branch names.Minor (non-blocking) observations:
checkpointFailedis set onIssueResult(satisfies AC-4's "reflect it in the result") but has no downstream consumer yet — user-facing prominence comes from the always-on warnings. Surfacing it in the final run summary would be a natural follow-up.run-orchestrator.tsresume wiring (pre-flight guard + i===0 rebase) is exercised indirectly via the integration test's plan+rebase path rather than a direct orchestrator test (the repo has no orchestrator test harness).Risk Assessment
baseBranch(main); if localmainlagsorigin/mainthe successor could branch from stale main. Mitigated —reconcileStateAtStartupruns first, and this is the same base a fresh first link uses. Documented inchain-resume.ts.executeSequentiali===0 branch (thin wiring over already-tested functions).Adversarial Re-Read
Findings: Traced the resume path end-to-end: (1) fresh runs are unaffected —
chainResumeis only set whenskipped.length > 0, so the i===0 block is skipped; (2) fail-fast path mirrors the existingallCompleteearly-return (shutdown.dispose()+ return), no new leak; (3) state is read afterreconcileStateAtStartup, so a just-merged link is correctly treated as merged; (4) locks/issueInfo operate on the narrowed active tail — completed links don't claim locks. Two minor improvement opportunities surfaced (checkpointFailed summary surfacing; direct orchestrator-wiring test), both beyond the literal ACs. No verbatim motivating-example fixture unrun, no bug-repro-as-evidence, no Non-Goal scope creep.Status: Gaps Found (minor, non-blocking → verdict floors at AC_MET_BUT_NOT_A_PLUS)
Verdict: AC_MET_BUT_NOT_A_PLUS
All 5 acceptance criteria are literally MET, all CI checks pass, security/type/scope checks are clean, and the change is well-tested (pure-logic unit tests + real-git integration tests). Two minor, optional improvements keep it from a strict A+: surface
checkpointFailedin the run summary, and add a direct orchestrator-wiring test if a harness is introduced. Neither blocks merge — this breaks to PR for the human merge gate (no quality loop needed).Documentation
[Unreleased] → Addedentry present (feat: resume a partially-completed chain from its last good link #760)docs/reference/run-command.md(optional) — run/docs 760before merge if desired.Next Steps
checkpointFailedin the run summary output.admarble commentedon Jul 15, 2026
QA Review for Issue #760 (PR #765)
AC Coverage
computeChainResumePlanpeels the contiguous completed prefix;run-orchestrator.tssetsissueNumbers = plan.active, passesresumeBaseaschainBasetoensureWorktreesChain, and adds an expliciti === 0rebase inexecuteSequential. Integration test assertsmerge-base --is-ancestor.already <status> — skippinglines plus↻ Resuming chain at #N from <sha> (<branch>).merged→resumeBase = baseBranch;ready_for_mergewith missing/unrecorded branch →failFast, orchestrator aborts with exit 1 before any execution. Both covered by unit + real-git integration tests.createCheckpointCommitfailure no longer silentworktree-manager.ts:1094-1105; call-site warning +checkpointFailedonIssueResult. Tested via a failing pre-commit hook withverbose=false. See finding #1 — the AC is met, but the warning's content is wrong.chain-resume.integration.test.ts— real git worktrees,merge-base --is-ancestor, the #752 pattern the AC explicitly names.Coverage: 5/5 AC items fully met
Original ACs: 5/5 met · Derived ACs: None found
CI Status
build (22.x)typechecknode-floor-guardvalidate-pluginvalidate-skillsCI Summary: 5 passed, 0 pending, 0 failed.
mergeable: MERGEABLE, 0 commits behindorigin/main.Quality Metrics
any)Of +653 added, 425 lines (65%) are tests. Production change is ~228 lines across 5 files, confined to
src/lib/workflow/— matches the spec's SCOPE_OK assessment.Test Coverage Analysis
chain-resume.tschain-resume.test.ts(8),chain-resume.integration.test.ts(4)run-orchestrator.tsbatch-executor.tscheckpoint.integration.test.tscoverscreateCheckpointCommit, not the call siteworktree-manager.tscheckpoint.integration.test.tsAC-4 casetypes.tsCoverage: 3/5 changed source files have direct tests. Local run: 17/17 passed in the three touched test files.
Code Review
Strengths:
--resume-chainpath. Preserving the completed prefix as chain topology (rather than dropping it) is exactly what prevents the fix(chain): --chain successors branch from main, not predecessor's committed work (up-front worktree provisioning) #748 wrong-base regression from reappearing on resume.i === 0rebase inexecuteSequentialis correctly justified in the comment: provisioning-time rebase only warns, so putting the hard gate here means a link can never silently execute on the wrong base. The non-chain guard is left byte-identical, so blast radius is contained to--chain.ready_for_mergesplit is the sharp edge, and it's handled correctly. Resuming a merged prefix frombaseBranchrather than the local tip is the right call — squash-merge orphans the local checkpoint, and rebasing onto it would be the silent wrong-base AC-3 forbids.--forcecorrectly sits outside the resume branch, preserving "redo everything" semantics.Issues:
The AC-4 warning tells the user the opposite of what happens (
batch-executor.ts:1141-1147— medium). The message reads "chain resume from this link is unavailable. Re-running the chain will redo #N." Both clauses are false.updateIssueStatus(issueNumber, "ready_for_merge")runs at line 1121, before the checkpoint attempt at 1132. So on re-run,computeChainResumePlanseesstatus: "ready_for_merge"with an existing branch, skips #N, and setsresumeBaseto its branch tip. Resume is not unavailable and #N is not redone.The consequence is more than cosmetic:
createCheckpointCommitonly returnsfalsewhen there is in-scope dirty work it failed to commit (it returnstruewhen there's nothing to checkpoint). So the successor gets rebased onto a tip that is missing exactly the work the checkpoint would have captured — and the warning tells the user a re-run will take care of it, so they take no action. Two possible fixes:--forceor a manual commit.ready_for_mergeonly after a successful checkpoint in chain mode, so a failed checkpoint leaves #Nin_progressand the re-run genuinely redoes it — which is what the message already promises.The second is truer to AC-4's intent ("resume depends on it"), but it changes status semantics and deserves its own discussion rather than a drive-by change.
checkpointFailedis written but never read (types.ts:276,batch-executor.ts:1241— low). Nothing consumes the field: it doesn't reach the run summary, the PR body, or the exit code. AC-4 is satisfied by the console warning, so this isn't a gap in the AC — but as shipped it's a dead field. Either surface it in the run summary or drop it.Suggestions:
The orchestrator resume wiring has no test coverage (low). The planner is well covered and the rebase contract is proven with real git, but the glue —
issueNumbers = plan.active,chainBase = chainResume?.resumeBase ?? baseBranch, thei === 0rebase block, and the fail-fast early return — is untested. This is the layer where the original fix(chain): --chain successors branch from main, not predecessor's committed work (up-front worktree provisioning) #748 bug lived. AC-5 explicitly blesses the fix(#748): --chain successors branch from predecessor's committed work, not main #752 reconstruction pattern, so this is not an AC failure, but a mocked-stateManagertest over the guard would cheaply lock theplan.active/chainBasehandoff.A completed link after an incomplete one is now re-executed (low). Previously the flat guard skipped any
ready_for_mergeissue regardless of position; the prefix-only rule means a mid-chain completed link gets re-run. The PR documents this as the conservative choice and chain-breaks-on-first-failure makes it rare (it needs manual completion or reordered args). Worth a line in the docs so re-execution of aready_for_mergelink doesn't read as a bug.Anti-Pattern Detection
No
anytypes, no empty catches, no hardcoded secrets, noawait-in-loop introduced (the state lookup loop is pre-existing shape). Nopackage.jsonchanges.revParseRefusesspawnSyncwithoutcwd, resolving refs from the process cwd. Correct here — refs are shared across worktrees, andsequant runexecutes from the main repo — but it is the one spot that would break if the resolver were ever reused from a worktree-relative context.Call-Site Review
New exported functions: 1
computeChainResumePlanrun-orchestrator.ts:696stateManager && !dryRun && !force→if (mergedOptions.chain)--forcecorrectly bypasses resumeThe
i === 0guard on the resume rebase is the correct iteration scope: the completed prefix is already removed fromissueNumbers, so index 0 is the resume point, and links ati > 0are handled by the pre-existing #748 successor-rebase.Execution Evidence
npx vitest run src/lib/workflow/chain-resume.test.ts chain-resume.integration.test.ts checkpoint.integration.test.tsEvidence status: Complete. No
scripts/changes →/verifynot required.Skill Command Verification
N/A — no
.claude/skills/**/*.mdfiles changed.CLI Registration Verification
N/A — no
RunOptionsfields added.chainResumeis onOrchestratorConfig(internal, populated by the orchestrator, never user-supplied), so it correctly requires nobin/cli.tsregistration.Self-Evaluation
--chainrun was performed (it needs GitHub + dep installs), so theplan.active→ensureWorktreesChain→executeSequentialhandoff is verified by reading, not by execution.chain-resume.ts(fail-fast, merged, prefix, and fresh-run branches all asserted with real git). Low for the orchestrator glue — a regression in thechainBasehandoff would not fail any test.ready_for_mergewith uncommitted work, so resume bases the successor on an incomplete tip while the warning claims the opposite (finding feat: Complete remaining v1.0 features (AC-10, AC-13, AC-14) #1). Second most likely: stale localmainin the merged-resume path — though that matches how the rest of the system already provisions frombaseBranch, so it's not new here.origin/main.Verdict: AC_MET_BUT_NOT_A_PLUS
All 5 ACs are literally met, CI is fully green, and the core design is right — the implementation correctly identified that the real work was making the existing skip chain-correct rather than adding parallel resume machinery, and the AC-3 merged-vs-local-tip distinction is handled properly.
Held back from READY_FOR_MERGE by finding #1: the AC-4 warning states that resume is unavailable and that #N will be redone, when the code does neither — status is already
ready_for_mergeby the time the checkpoint is attempted, so resume skips #N and bases the successor on a tip missing the uncommitted work. AC-4's letter ("no longer silent") is satisfied, but a warning that misdescribes the recovery path undercuts its purpose. Finding #2 (deadcheckpointFailedfield) is a small loose end in the same area.Neither blocks merge — the message can be corrected in this PR, or the status-ordering change tracked as a follow-up if it warrants its own discussion.
Documentation
[Unreleased] → Addedwith issue number--chainresume beyond the CHANGELOGNext Steps
batch-executor.ts:1141-1147to describe what actually happens on re-run (#N skipped, resumed from a tip missing the uncommitted work), or gate theready_for_mergestatus write on checkpoint success so the existing message becomes true.checkpointFailedin the run summary, or remove the field.plan.active/chainBasehandoff with a mocked-stateManagerorchestrator test./mergerif both land together (spec flagged low conflict risk, no file overlap).fix(#760): close QA gaps — honest checkpoint warning + dirty-tip fail…
admarble commentedon Jul 15, 2026
QA Gap Fixes — #760 (PR #765, commit
33bd40e)All four findings from the previous QA review are addressed.
1. AC-4 warning stated the opposite of what happens → fixed (message + guard)
Was: "chain resume from this link is unavailable. Re-running the chain will redo #N." Both clauses false —
updateIssueStatus(…, "ready_for_merge")runs atbatch-executor.ts:1121, before the checkpoint attempt, so a re-run skips #N and takes its branch tip as the resume base. And becausecreateCheckpointCommitonly returnsfalsewhen it has in-scope dirty work it couldn't commit, that tip is missing exactly the work the checkpoint would have captured — while the warning told the user a re-run would handle it.Now, per the agreed design (truthful message + dirty-tip fail-fast):
ready_for_merge, and resume will stop here until it's committed (or--force).computeChainResumePlanno longer trusts the tip: aready_for_mergeresume base whose worktree is dirty now fails fast, symmetric with the existing destroyed-branch fail-fast. No silent wrong-base execution.Scoping decisions worth noting, each locked by a test:
Known trade-off: a benignly-dirty worktree (stray edits) now stops a resume until committed or
--force. Deliberate — an incomplete resume base is the exact failure this issue exists to prevent, and the message names the file and both ways out.2. Dead
checkpointFailedfield → now consumedRestated in the run summary (
displaySummary), where the user is actually looking by the time a multi-hour chain ends and the per-issue warning has scrolled away. Newrun-display.test.ts(3 tests) locks the consumption so it can't silently go dead again.3. Untested orchestrator seam → made testable, then tested
There were no orchestrator tests at all — which is why the layer the original #748 bug lived in went uncovered. Rather than stand up a full orchestrator harness to lock three assignments, I extracted
planChainResumeFromState(the state→plan step) intochain-resume.tsand covered it directly, including the previously untested rule that a failed state lookup treats a link as incomplete rather than skipping it. What's left in the orchestrator is three trivial assignments.4. Contiguous-prefix-only rule → documented
CHANGELOG now states that a completed link sitting after an incomplete one is re-executed rather than silently dropped, and why.
Verification
npm run buildnpm run lintnpx vitest run)Ran the full suite rather than targeted runs because
CompletedLinkResolveris an exported interface and gained a method.Self-Evaluation
displaySummaryitself. Still not verified end-to-end: no live--chainrun (needs GitHub + dep installs).--force.Verdict: READY_FOR_MERGE
All 5 ACs met, all 4 QA findings closed, CI green, branch current with
origin/main.feat(#760): resume a partially-completed chain from its last good link (
fix(#769): section-aware path extraction; drop background-only citati…
docs(#761): document failureCategory in analytics.md and the rate-lim…
fix(#761): classify rate limits mid-phase — skip doomed retries, labe…
docs: sync reference/feature docs for the next release (#792)
chore(assess): sync chain flag references and add chain-resume rule (#…
chore(#810): delete two unreachable option fields; mutation-test the …
fix(worktree): frozen installs so provisioning cannot dirty the lockf…
fix(#826): frozen install in new-feature.sh so provisioning cannot di…
fix: close three pre-2.10.0 gaps found by release verification (#851)
fix(#769): section-aware path extraction; drop background-only citations
feat(#760): resume a partially-completed chain from its last good link
fix(#760): close QA gaps — honest checkpoint warning + dirty-tip fail…
fix(#826): frozen install in new-feature.sh so provisioning cannot di…