Repository navigation
Description
Parent: #497
Problem
AgentPhaseResult.sessionId / AgentExecutionConfig.sessionId are opaque strings with no record of the cwd the session was created in. The only safety net is canResume = sessionId && !worktreePath (phase-executor.ts:650), which disables resume whenever a worktree is active — correctness-preserving, but it means Claude Code resume never fires in normal operation, and it can't express the real constraint.
Claude Code and Codex resume are asymmetric:
- Claude Code binds a session to its origin cwd (rejects/ignores a different one).
- Codex (
codex exec resume <thread-id>) is cwd-independent and silently executes in whatever cwd is passed, with sandbox write-roots and AGENTS.md discovery following the new cwd (Resuming a session silently switches the agent cwd to the caller’s directory openai/codex#4791, #4703 — both closed without a runtime fix; only the interactive picker was filtered).
Collapsing both into one sessionId + one global boolean hides this. The moment Codex's thread_id is wired into sessionId and the guard relaxed to make resume useful, Codex silently runs a resumed phase in the wrong worktree against the wrong AGENTS.md while Claude Code self-protects. The AGENTS.md double-load question in #497 is the same root cause, not a separate one.
Recommended solution
Normalize resume semantics in the driver layer, keyed on actual cwd equality — not a single opaque id plus a global !worktreePath heuristic.
Acceptance Criteria
- Introduce
ResumeHandle { driver: string; token: string; originCwd: string }; carry it onAgentExecutionConfigandAgentPhaseResult(keepsessionIdas a deprecated alias for one release). -
ClaudeCodeDriverpopulatesoriginCwdfromconfig.cwdat session creation and returns it. - Add a driver-owned
canResume(handle, targetCwd)contract; move resume-eligibility out of the!worktreePathheuristic inphase-executor.ts. -
ClaudeCodeDriver: resume only whenhandle.originCwd === cwd; otherwise start fresh. -
CodexDriver(when added in feat: add OpenAI Codex CLI agent driver #497): same rule, enforced in the driver — never passresume <thread-id>when cwd differs. - Resume works across phases within the same worktree (regression fix — currently blocked by
!worktreePath). - AGENTS.md parity as a Codex resume precondition: divergent/missing AGENTS.md stack in the target cwd ⇒ no-resume (folds in feat: add OpenAI Codex CLI agent driver #497 open-question docs: Add pre-release checklist #2).
- Fixture test: a phase resumed against a different worktree is rejected for both drivers; a same-worktree resume succeeds; assert Codex cannot run in a mismatched cwd. Record per-behavior "preserved / advisory / skipped" so harness drift is visible, not silent.
- Verify empirically whether the Claude Code SDK crashes (exit 1) or silently resumes-in-place on cwd mismatch; reconcile the
phase-executor.ts:653comment with observed behavior.
Activity
admarble commentedon May 30, 2026
Empirical verification — Claude Code SDK cwd-mismatch resume
Ran a direct probe against
@anthropic-ai/[email protected]: created a session indirA, then resumed it (resume: <sessionId>) withcwd: dirB.Result — it does NOT crash, and does NOT silently resume-in-place. It fails to find the session:
Mechanism (confirmed on disk): Claude Code namespaces session storage by the encoded cwd —
~/.claude/projects/<encoded-cwd>/<session-id>.jsonl. The session was written under-private-tmp-seq-resume-probe-dirA/; resuming fromdirBmakes the SDK look underdirB'sproject dir, where the session doesn't exist → "No conversation found." No
dirBproject dir waseven created.
Reconciliation
phase-executor.ts:653comment ("Resuming from a different cwd crashes the SDK (exit code 1)") is imprecise. It's not a process crash — it's a recoverable, structurederror_during_executionwith a clear "No conversation found" message. Net effect is still a failed phase, so the guard's intent stands, but the framing should be corrected./resumepicker selecting a session from another worktree — a different code path from the SDKresume:option. Not applicable here.Design impact (sharpens the ACs above)
Because a cwd-mismatched Claude Code resume is a detectable, non-fatal error (not a crash), the driver-owned
canResume(handle, cwd)check should do more than refuse — onhandle.originCwd !== cwdit can transparently fall back to a fresh session instead of failing the phase. Two AC refinements:phase-executor.ts:653comment: cwd-mismatch yieldserror_during_execution/ "No conversation found", not an exit-1 crash (storage is cwd-namespaced under~/.claude/projects/<encoded-cwd>/).ClaudeCodeDriver.canResume: on cwd mismatch, start a fresh session (don't passresume) rather than erroring — the failure mode is recoverable.Verified 2026-05-30 with a throwaway probe; no repo changes.
docs(#674): correct resume cwd-mismatch comment — recoverable error, …
admarble commentedon May 30, 2026
→ PROCEED — Normalize agent-driver resume semantics (origin-cwd-bound ResumeHandle, driver-owned validation)
Workflow: spec → exec → qa (-Q)
Verified against codebase:
phase-executor.ts:660(const canResume = sessionId && !worktreePath), not :650/:653 as the body states — line drift only, scope unchanged.ResumeHandle/originCwdtype exists yet;sessionIdis the only resume token threaded through.⚠ Two ACs (CodexDriver same-cwd rule, Codex AGENTS.md parity) are gated on #497 adding
CodexDriver, which is not yet present. The Claude-Code-side ResumeHandle + driver-ownedcanResume+ same-worktree resume regression-fix all ship now; the Codex ACs become live once #497 lands.⚠ The final AC ("reconcile the :653 comment with observed behavior") is already satisfied by merged PR #675 (f6b8e40). Spec should mark it done rather than redo it; the empirical verification comment above documents the recoverable-error finding.
This is the foundational refactor #497 builds on, so PROCEED rather than PARK.
admarble commentedon May 30, 2026
Spec — Plan vs Acceptance Criteria
Tier: Complex (9 ACs, 1 primary directory). Workflow: spec → exec → qa with quality loop. Scope: SCOPE_WARNING (6 in-flight ACs after deferrals/done).
AC status
ResumeHandle { driver, token, originCwd }; carry onAgentExecutionConfig+AgentPhaseResult. KeepsessionIdas@deprecatedmirror for one release. (Unit Test)ClaudeCodeDriverpopulatesoriginCwdfromconfig.cwd; returns it on result. (Unit Test)canResume(handle, targetCwd); remove!worktreePathguard atphase-executor.ts:660. (Unit Test)ClaudeCodeDriver: resume only whenoriginCwd === cwd; transparent fallback to fresh session on mismatch (recoverable, per docs(#674): correct resume cwd-mismatch comment (recoverable error, not exit-1 crash) #675 empirical comment). (Unit Test)CodexDriver: same rule, enforced in driver — never passresume <thread-id>on cwd mismatch.!worktreePathblocks all worktree resume. (Integration Test)src/lib/agents-md.ts).it.skipuntil feat: add OpenAI Codex CLI agent driver #497. Log preserved/advisory/skipped status. (Integration Test)phase-executor.ts:653comment — done in PR docs(#674): correct resume cwd-mismatch comment (recoverable error, not exit-1 crash) #675 (f6b8e40).Implementation plan (compact)
ResumeHandle, extendAgentExecutionConfig+AgentPhaseResult, addcanResumetoAgentDriver.originCwdon init,canResumereturnsoriginCwd === cwd, dropresume:silently on mismatch (transparent fallback).canResumereturnsfalse(explicit, no session-resume concept).phase-executor.tsline 660 — swapsessionId && !worktreePathforhandle && driver.canResume(handle, cwd).resumeHandletoIssueStateSchema; keepsessionIdfor one release; old state withoutoriginCwd→ resume disabled (fail-safe).canResumetruth table + driver behavior; integration fixture (AC-8); regression test for same-worktree resume (AC-6).Key decisions
error_during_execution.~/.claude/projects/<encoded-cwd>/); normalizing risks false-positive resumes.sessionIdfor one release: avoids orphaning in-flight.sequant/state.jsonrecords across upgrade.canResumeon the driver, not free function: Codex's future AGENTS.md hash check is driver-specific; free function can't reach driver state.Open questions
ResumeHandle.tokenas plainstringvs driver-tagged union → recommendstring; driver discriminates viahandle.driver. Cosmetic if wrong.agentsMdHashonResumeHandle(shared optional) vs Codex-internal → recommend shared optional. Minor field bloat if wrong.sessionIdthis release? → no; one-release deprecation window to keep in-flight state migrating cleanly.Deferrals
Out-of-scope (non-goals, implicit)
This refactor does not add new resume call sites, change phase ordering, change worktree lifecycle, or rename the on-disk
sessionIdfield in.sequant/state.json.admarble commentedon May 30, 2026
/exec progress — PR #680 opened
Branch:
feature/674-refactor-normalize-agent-driver-resume-semantics-oPR: #680
AC coverage
ResumeHandleon configs +@deprecatedsessionId mirroragent-driver.ts:9-77ClaudeCodeDriverpopulatesoriginCwdclaude-code.ts:153-160, 230-237canResume; remove!worktreePathguardagent-driver.ts:97-113;phase-executor.ts:655-669claude-code.ts:42-45, 72-89CodexDriversame-cwd rule.skipplaceholder in fixturephase-executor.test.tsit.skip; preserved/advisory/skipped annotation)resume-semantics.test.ts(10 passed, 2 skipped)phase-executor.ts:653commentKey files changed
src/lib/workflow/drivers/agent-driver.ts— newResumeHandletype;canResumeon the interfacesrc/lib/workflow/drivers/claude-code.ts— byte-equal cwd gate; transparent fallbacksrc/lib/workflow/drivers/aider.ts—canResumereturns falsesrc/lib/workflow/phase-executor.ts— replacedsessionId && !worktreePathwith driver-owned checksrc/lib/workflow/batch-executor.ts— threadsResumeHandleacross phasessrc/lib/workflow/state-schema.ts+state-manager.ts— new optionalresumeHandlefield;updateResumeHandle()src/lib/workflow/drivers/resume-semantics.test.ts(new) — AC-8 fixtureCHANGELOG.md—[Unreleased]entry under### ChangedChecks
npm run build✅ cleannpm run lint✅ clean (0 warnings)npx vitest run src/lib/workflow/✅ 171 passed, 2.skip(Codex, gated on feat: add OpenAI Codex CLI agent driver #497)Known gaps
CodexDriver. The fixture test has twoit.skipcases ready to flip onceCodexDriverexists.IssueState.sessionIdis@deprecated-mirrored for one release. Plan: remove in the release after this one once in-flight state files have aged out. Not tracked as a separate issue — flagged in thestate-schema.tsandstate-manager.tsdocstrings.admarble commentedon May 30, 2026
QA Review for Issue #674
AC Coverage
ResumeHandle { driver, token, originCwd }onAgentExecutionConfig+AgentPhaseResult;sessionIdas@deprecatedmirroragent-driver.ts:17-24, 44-46, 62-68; deprecation JSDoc explicit; both fields populated byClaudeCodeDriver(claude-code.ts:153-157, 164-165).ClaudeCodeDriverpopulatesoriginCwdfromconfig.cwdclaude-code.ts:234-240(buildResumeHandle(token, originCwd)) called withconfig.cwdon every result branch (success, error, exception).canResume(handle, targetCwd); remove!worktreePathguard atphase-executor.ts:660agent-driver.ts:98-112; oldsessionId && !worktreePathheuristic deleted (phase-executor.ts:655-669), replaced withdriver.canResume(resumeHandle, cwd)gate.originCwd === cwd; transparent fallback on mismatchclaude-code.ts:42-45byte-equal check, includinghandle.driver === this.namecross-driver guard;claude-code.ts:79-89silently dropsresume:on mismatch (verified byresume-semantics.test.ts:111-121). Comment cites #675 empirical finding.CodexDriversame-cwd rule.skipplaceholder (resume-semantics.test.ts:183-190).originCwd === cwd. Regression test atphase-executor.test.ts:680-705asserts handle propagates toexecutePhase(4th arg).CodexDriver)..skip; preserved/advisory/skipped annotationsresume-semantics.test.tscoverscanResumetruth table (3 tests), executePhase resume gating (4 tests including legacysessionId-only fail-safe), Aider rejection (2 tests), Codex.skip× 2. Each test prefixed with PRESERVED/ADVISORY/SKIPPED comment. 10 passed, 2 skipped.phase-executor.ts:653commentphase-executor.ts:655-661re-cites #675 finding.Coverage: 7/7 in-flight AC items met; AC-5 and AC-7 deferred to #497.
Precheck Findings
Precheck Findings: unavailable — inline fallback used (
.sequant/gap-precheck.jsonnot present).CI Status
validate-skillstypecheckvalidate-pluginbuild (20.x)build (22.x)CI Summary: 3 passed, 2 pending, 0 failed
Markdown-only relaxation: Not applicable (.ts files dominate the diff — 10/11 files are TypeScript). Pending build matrix checks remain gating.
Quality Metrics
any)Test Coverage Analysis
src/lib/workflow/drivers/agent-driver.tsresume-semantics.test.ts(interface contract)src/lib/workflow/drivers/claude-code.tsresume-semantics.test.tssrc/lib/workflow/drivers/aider.tsresume-semantics.test.tssrc/lib/workflow/phase-executor.tsphase-executor.test.ts(AC-6 regression)src/lib/workflow/batch-executor.tsbatch-executor.test.tscovers other paths; resume-handle threading not separately assertedsrc/lib/workflow/state-schema.tssrc/lib/workflow/state-manager.tsupdateResumeHandlelacks a unit testsrc/lib/workflow/drivers/index.tsCoverage: Core driver logic and phase-executor handoff covered; batch-executor wiring and
updateResumeHandlerely on integration testing.Code Review
Strengths:
ResumeHandlecleanly separates the per-driver concerns: byte-equal cwd check on Claude Code (cwd-namespaced storage), unconditional false on Aider (no session concept), and a future hook for Codex's AGENTS.md parity in feat: add OpenAI Codex CLI agent driver #497.claude-code.ts:79-89) is the right call given docs(#674): correct resume cwd-mismatch comment (recoverable error, not exit-1 crash) #675's finding that the SDK error is recoverable — surfacing the per-phase failure would have been actionable noise.handle.driver !== this.name(claude-code.ts:43) is defensive and prevents a future Codex handle from ever activating on the Claude Code path.sessionId-only configs explicitly do NOT resume (claude-code.ts:85-89), encoded as a test (resume-semantics.test.ts:126-137). Matches the spec's fail-safe rule.[Unreleased] → Changedcites refactor: normalize agent-driver resume semantics (origin-cwd-bound ResumeHandle, driver-owned validation) #674, calls out the regression fix, and documents the deprecation window.Issues:
Suggestions:
state-manager.ts:497-519keepsupdateSessionIdas a deprecated entry point but adds no test that legacy callers writing through it produce a fail-safe-inert state record. A one-line test on the existing state-manager suite would lock in the documented contract.phase-executor.ts:680writes bothresumeHandle: eligibleHandleandsessionId: eligibleHandle?.tokeninto the agent config. The driver only ever consumes the handle when both are present (claude-code.ts:80-84), so thesessionIdmirror at this hop is dead — only thestate-schema.ts-level mirror matters for migration. Worth a comment, or drop the line.Test Quality Review
queryCalls[0].options.resume(the boundary), not internal state.@anthropic-ai/claude-agent-sdkmocked — the external boundary.queryCalls.length = 0reset per test prevents bleed.Anti-Pattern Detection
Dependency Audit
N/A — No
package.jsonchanges.Code Patterns
No critical or warning patterns detected in changed files. No new
anycasts, no hardcoded secrets, noawaitinside loops, no empty catches.Call-Site Review
New exported functions/types detected:
ResumeHandletype,canResumemethod onAgentDriver,updateResumeHandleonStateManager,buildResumeHandle(private) onClaudeCodeDriver.ResumeHandletypeagent-driver.ts,claude-code.ts,aider.ts,phase-executor.ts,batch-executor.ts,state-manager.ts,state-schema.ts, plus re-exportdriver.canResume(handle, cwd)phase-executor.ts:667resumeHandle && …stateManager.updateResumeHandlebatch-executor.ts:569(spec),batch-executor.ts:838(general phase)if (result.resumeHandle)buildResumeHandleclaude-code.ts(success, error, no-result, catch)if (!token) return undefinedFindings: No call-site mismatches.
Execution Evidence
N/A — No
scripts/or CLI files changed.Skill Command Verification
N/A — No
.claude/skills/**/*.mdfiles changed.Detection Pattern Verification
Precondition false (no skill markdown changes) — section omitted per §6c.
CLI Registration Verification
N/A — No
RunOptionsorbin/cli.tschanges.Smoke Test
Not Required — Internal type refactor; behavior covered by 887-test workflow suite (all passing).
Manual Test ACs
N/A — Spec plan does not flag any AC as Manual Test; all are Unit Test or Integration Test.
CHANGELOG Verification
CHANGELOG.mdexistsrefactor:commit detected)[Unreleased]entry### Changed, cites #674)Result: CHANGELOG requirements met.
Risk Assessment
handle.driver === this.nameincanResume, letting a Claude Code handle activate on (e.g.) a Codex path. Mitigated by the interface contract docstring, but not enforced at compile time.batch-executor.ts's handle threading across phases (spec → exec → qa) and the persistence round-trip throughstate-manager.updateResumeHandle. The unit tests verify the driver and the phase-executor argument, but the integration test that proves a resumed worktree phase actually reuses the session lives only as a fixture-mocked test — there is no end-to-end test against a real worktree.sessionId/resumeHandle/canResumereferences acrosssrc/. Only the documented call sites touch resume logic:state-hook.tsretains itsupdateSessionId(sessionId: string)skill-side API by design (writes legacy-only state which the new fail-safe correctly declines). No cross-file sibling code with the same root cause.phase-executor.ts:655-669; no adjacent intra-file resume logic carries the old!worktreePathheuristic.Adversarial Re-Read
Findings: No gaps found because: (1) verbatim motivating-example fixture from issue body (Claude Code SDK cwd-mismatch returns "No conversation found", verified in #675's empirical comment) is encoded in
resume-semantics.test.ts:111-121and the corresponding production code atclaude-code.ts:79-89matches the fixture; (2) evidence claims in the exec PR comment (171 workflow tests passing, build clean, lint clean) were re-validated locally — 887 workflow tests pass, build is clean, no surviving!worktreePathresume heuristic; (3) process state is clean (worktree on branch HEAD, no uncommitted changes, 0 commits behind origin/main); (4) sibling sites scanned via grep onsessionId|resumeHandle|canResume— onlystate-hook.tsretains a legacy entry point, which by design writes inert state under the new fail-safe; (5) Non-Goals from issue body (no new resume call sites, no phase ordering changes, no worktree lifecycle changes, no rename of on-disksessionId) all held — the deprecatedsessionIdfield is still present instate-schema.ts:271as a one-release mirror.Status: Clean
Behavior-Rule Survival Check
!worktreePathguard" is a behavior rule!worktreePathinphase-executor.tsreturns only the unrelated worktree-isolation passthrough at function signatures. The oldconst canResume = sessionId && !worktreePathis gone.Status: Clean
Verdict: NEEDS_VERIFICATION
All in-flight ACs (AC-1 through AC-4, AC-6, AC-8, AC-9) are MET. AC-5 and AC-7 are explicitly deferred to #497 (N/A). Implementation quality is high: driver-tagged handles, byte-equal cwd guard, cross-driver rejection, transparent fallback on mismatch, fail-safe for legacy
sessionId-only state, and PRESERVED/ADVISORY/SKIPPED test annotations per AC-8.The verdict is NEEDS_VERIFICATION rather than
READY_FOR_MERGEsolely because thebuild (20.x)andbuild (22.x)CI checks are stillIN_PROGRESS. The diff is not markdown-only (10/11 files are TypeScript), so the markdown-only build-matrix relaxation does not apply. Locally,npm run buildis clean andnpx vitest run src/lib/workflow/passes 887/887 (2.skipare the Codex placeholders gated on #497). Once the CI build matrix completes green, re-running/qa 674will short-circuit toREADY_FOR_MERGE.Documentation
### Changedunder[Unreleased])/docs 674before merge if anything user-facing is reconsideredNext Steps
build (20.x)andbuild (22.x)CI checks to complete./qa 674once CI is green → verdict will promote toREADY_FOR_MERGE.ResumeHandle+canResumecontract and will fill in AC-5, AC-7, and the Codex half of AC-8.updateSessionIdfail-safe behavior; clarify or drop the dual-write ofsessionIdmirror atphase-executor.ts:680.admarble commentedon May 30, 2026
QA Review for Issue #674 (PR #680)
AC Coverage
ResumeHandle{driver,token,originCwd}; carry on config + result; keepsessionIdas deprecated aliasagent-driver.ts: interface added; bothAgentExecutionConfigandAgentPhaseResultcarryresumeHandle;sessionIdkept + JSDoc@deprecated. Schema + state-manager mirror the token.ClaudeCodeDriverpopulatesoriginCwdfromconfig.cwdand returns itbuildResumeHandle(token, config.cwd)called at all 4 return sites (success / error-result / no-result / catch).canResume(handle, targetCwd); move eligibility out of!worktreePathheuristicphase-executor.tsnow resolves driver first and gates ondriver.canResume(resumeHandle, cwd). OldsessionId && !worktreePathremoved.originCwd === cwd, else freshhandle.driver === this.nameguard; mismatch silently dropsresume:and starts fresh.CodexDriversame rule, driver-enforcedcanResumecontract documents the Codex rule;.skipplaceholder test gates on #497.canResumeallows same-cwd;phase-executor.test.tsAC-6 test assertsresumeHandlethreads intoexecutePhase.canResumecontract.resume-semantics.test.ts: Claude + Aider cross-worktree rejection, same-worktree token pass-through, legacy-sessionId-no-resume, handle round-trip. PRESERVED/ADVISORY/SKIPPED annotations present; Codex assertion is.skip(can't assert a non-existent driver).phase-executor.tscommenterror_during_execution("No conversation found"), not exit-1 crash (the #675 docs precursor). New driver/comment text consistent against@anthropic-ai/[email protected].Coverage: 7/7 applicable ACs MET; AC-5 & AC-7 correctly deferred to #497 (Codex).
Quality Metrics
any)tsc)CI Status
CI Summary: 5 passed, 0 pending, 0 failed.
Test Coverage Analysis
drivers/agent-driver.ts(interface)resume-semantics.test.tsdrivers/claude-code.tsresume-semantics.test.ts(canResume + executePhase gating)drivers/aider.tsresume-semantics.test.ts(always-false)phase-executor.tsphase-executor.test.ts(AC-6 threading)batch-executor.tsstate-manager.ts(updateResumeHandle)updateSessionIdpatternstate-schema.tsTargeted run: 187 passed, 2 skipped (the 2 skips are the Codex
.skipplaceholders).Code Review
Strengths:
canResume) instead of a leaky!worktreePathheuristic in the orchestrator. This is the correct abstraction and directly unblocks the AC-6 same-worktree regression.sessionId(nooriginCwd) is treated as inert rather than blindly resumed. Documented in code, schema, state-manager, and CHANGELOG.buildResumeHandleapplied uniformly across all 4 driver return paths — no return site leaks a result without the handle.handle.driver === this.name) prevents a Codex handle from being honored by Claude Code once feat: add OpenAI Codex CLI agent driver #497 lands.Issues: None blocking.
Suggestions (non-blocking):
StateManager.updateResumeHandlehas no direct unit test. It's a 15-line mirror of the testedupdateSessionId, but a small test asserting it writesresumeHandle+ mirrorssessionId+ bumpslastActivity(and throws on unknown issue) would close the gap.phase-executor.tssetssessionId: eligibleHandle?.tokenalongsideresumeHandle. Harmless (driver prefersresumeHandle), but the duplicate could be dropped once the deprecation window closes.Risk Assessment
requiresWorktreecould changecwdbetween phases; sincecanResumeis byte-equal oncwd, this fails safe to a fresh session (never a wrong-cwd resume). The deprecation ofsessionIdis the main temporal risk — if a downstream consumer outside this repo readsresult.sessionIdfor resume it still works (mirror retained).updateResumeHandle(direct); cross-process resume seeding fromstate.json— but note that path was never wired (the in-memoryresumeHandlestartsundefinedandstate.resumeHandleis write-only, identical to the priorsessionIdbehavior — no regression introduced here).AiderDriverhandled (declines all resume);CodexDriveris feat: add OpenAI Codex CLI agent driver #497. No otherAgentDriverimplementers (build would have failed the interface otherwise).buildResumeHandleis invoked at everyClaudeCodeDriver.executePhasereturn site (success/error/no-result/catch); all passconfig.cwdconsistently. No adjacent return path leaks a result without a handle.Adversarial Re-Read
Findings: Walked the diff against all 9 ACs, ran build + targeted suite (187 passed), traced
resumeHandlefrom driver return →mapAgentSuccessToPhaseResult→executePhase→executePhaseWithRetry→batch-executorthreading + state persistence. Two non-blocking gaps surfaced: (1)updateResumeHandlelacks a direct test; (2) state-persistedresumeHandleis write-only (pre-existing parity, not a regression). No verbatim motivating-example fixture was left unrun; no "evidence" claim is a bug-repro; process state is clean (worktree intact, 0 behind main, mergeable). Codex ACs (5, 7) match their literal "when added in #497" text — not silent scope expansion.Status: Gaps Found (non-blocking)
Verdict: AC_MET_BUT_NOT_A_PLUS
All 7 applicable ACs are MET; the two Codex ACs are correctly scoped to #497 per their own text. Build and all 5 CI checks pass; core resume logic is well-tested with clear behavior annotations. This is a borderline-A+ refactor held just short of
READY_FOR_MERGEby one closeable gap:StateManager.updateResumeHandle(a new public method) has no direct unit test. Add a short test for it and this is A+.Documentation
[Unreleased]entry added (refactor: normalize agent-driver resume semantics (origin-cwd-bound ResumeHandle, driver-owned validation) #674)Next Steps
StateManager.updateResumeHandle(writesresumeHandle, mirrorssessionId, bumpslastActivity, throws on unknown issue)./docs 674before merge if you want the resume-semantics contract documented for maintainers.test(#674): cover StateManager.updateResumeHandle (QA gap)
admarble commentedon May 31, 2026
QA Update — Issue #674 (PR #680)
The one closeable gap from the prior QA is now resolved.
Added ([
1f24c30]): a direct unit test forStateManager.updateResumeHandle— asserts it writes the driver-taggedresumeHandle, mirrors the token into the deprecatedsessionId, bumpslastActivity, and throws on an unknown issue.state-manager.test.ts: 69 passed (+4).All 7 applicable ACs MET (AC-5/AC-7 deferred to #497 per their text). Build + 5 CI checks green. With
updateResumeHandlenow directly covered, the priorAC_MET_BUT_NOT_A_PLUSblocker is cleared.Verdict: READY_FOR_MERGE
Documentation: optionally run
/docs 674before merge to document the resume-semantics contract for maintainers.refactor(#674): driver-tagged ResumeHandle with cwd-bound resume (#680)
refactor(#674): driver-tagged ResumeHandle with cwd-bound resume
test(#674): cover StateManager.updateResumeHandle (QA gap)
feat(run): fresh-session QA — never resume the exec session into qa; …