Skip to content

feat(run): fresh-session QA — never resume the exec session into qa; expose run.fullQa (#982) - #1033

Merged
admarble merged 4 commits into
mainfrom
feature/982-feat-run-fresh-session-qa-never-resume-the-exec-se
Sep 10, 2026
Merged

admarble merged 4 commits into
mainfrom
feature/982-feat-run-fresh-session-qa-never-resume-the-exec-se

Conversation

@admarble

@admarble admarble commented Sep 10, 2026 •

Copy link
Copy Markdown
Contributor

Closes #982. W2 node 02 (docs/internal/graph-2026-09-w2/issues/02-982-fresh-session-qa.md).

What

  1. qa never resumes the implementer's session. The one qa dispatch site in batch-executor.ts passes undefined instead of the carried resumeHandle; exec and loop keep theirs. qa's own fresh-session handle is also never captured, so exec continuity across quality-loop iterations is unchanged (first-pass QA found the capture regression; fixed in a361ed3).
  2. run.fullQa is reachable. run.fullQa setting (schema, defaults, KNOWN_KEYS), --full-qa on sequant run, and the fullQa param on MCP sequant_run (description names the minimum server version) all set config.fullQa through buildExecutionConfig. ready-gate.ts still forces fullQa: true regardless. Default stays off.

OQ-2 — every executePhaseWithRetry( site in batch-executor.ts

Site Dispatches qa? Change
:913 ready-gate runPhase no (already passes undefined) none
:1122 spec-only dispatch no none
:1638 per-phase loop yes (first qa and every quality-loop re-qa) phase === "qa" ? undefined : resumeHandle
:1957 loop phase no (distinct phase; its resume continuity is intentional, #488 env carries verdict context) none

First-pass QA findings (AC_NOT_MET) and their fixes

AC verification (all commands run verbatim in the worktree)

AC Command Result
AC-1 npx vitest run src/lib/workflow/batch-executor.test.ts -t "982" 1 passed
AC-2 npx vitest run src/lib/workflow/full-qa.test.ts 4 passed
AC-3 node dist/bin/cli.js run --help | grep -c -- '--full-qa' → 1; npx vitest run src/mcp/tools/run.test.ts -t "fullQa" → 3 passed; grep -c "fullQa" src/lib/workflow/types.ts → 4 ✅
AC-4 grep -n "fullQa" src/lib/settings.ts | grep -c "default(true)" → 0; full suite: see below ✅
AC-5 npx vitest run src/lib/workflow/ready-gate.test.ts -t "fullQa" 2 passed
AC-6 git diff origin/main --stat -- src/lib/workflow/drivers/ | wc -l → 0 ✅
AC-7 grep -c "full-qa|fullQa" README.md → 2; grep -c "resume" CHANGELOG.md → 24 ✅
AC-4 suite npm run build && npm test 303/305 files, 6212 passed, 2 failed at ~8s each (batch-executor.test.ts label-shortcut case, skills-preflight.test.ts #933 abort case) — both unrelated to this diff and both pass in isolation (94/94, 24/24); the failures reproduce only under the 10-minute worktree suite's load. Not settled against the base commit yet — say the word and I will.

Mutation verification

Mutation-verified: AC-1 — removed the phase === "qa" ? undefined : conditional at the qa dispatch; batch-executor.test.ts > AC-1: exec dispatch carries the resume handle, every qa dispatch … does not failed; restored.

Mutation-verified: AC-4 — dropped && phase !== "qa" from the resume-handle capture so qa's handle was captured again; the same AC-1 test failed (exec received "QA1" instead of "H1"); restored.

Mutation-verified: AC-2 — removed "fullQa" from KNOWN_KEYS.run; full-qa.test.ts > run.fullQa is a registered settings key failed; restored.

Mutation-verified: AC-3 — deleted the fullQa: mergedOptions.fullQa ?? … mapping in config-resolver.ts; run-options-dead-surface.test.ts > fullQa live-surface guard > maps RunOptions.fullQa into ExecutionConfig failed; restored.

Post-QA follow-ups (verdict AC_MET_BUT_NOT_A_PLUS, 2facf50)

QA's five notes, all addressed in place rather than looped:

  • Capture-guard comment now states where the guard bites: the next phase (loop, or the retried exec when no loop runs) would otherwise resume qa's fresh session. Disclosed consequence (CHANGELOG): a quality-loop loop phase now resumes the exec session rather than the former exec+qa session; loop still gets the verdict via SEQUANT_LAST_VERDICT/SEQUANT_FAILED_ACS (Quality loop retries misclassified as cold-start failures, wasting retry budget #488).
  • AC-1 test's loop mock returns a handle like production; assertions now model exec → loop → exec and check loop received exec's handle ("H1"), not qa's.
  • runToolInputSchema exported (@internal) with a tripwire: fullQa key present + minimum-version note.
  • docs/reference/run-command.md: --full-qa row, run.fullQa key + paragraph.

Mutation-verified: AC-1 — re-run after the test change: dropped the qa-dispatch conditional; the AC-1 test failed; restored.

Mutation-verified: AC-4 — re-run after the test change: dropped && phase !== "qa" from the capture; the AC-1 test failed (loop received "QA1"); restored.

Mutation-verified: AC-3 — removed the fullQa entry from runToolInputSchema; run.test.ts > sequant_run fullQa live-surface tripwire > declares fullQa in runToolInputSchema failed; restored.

Not in this PR

No driver or canResume change (AC-6). No default flip of fullQa. The loop phase keeps resume.

🤖 Generated with Claude Code

admarble and others added 4 commits September 10, 2026 08:33
…e-surface guard

QA findings on the first pass (AC_NOT_MET):
- qa's fresh-session handle overwrote exec's in the #674 capture, severing
  exec continuity across quality-loop iterations — a second behavior change
  AC-4 does not license. Guard the capture with `phase !== "qa"`.
- The AC-1 test's qa mock returned no handle, so its exec-continuity half
  was not gated. The mock now returns a handle like the real driver does.
- `run.fullQa` was missing from KNOWN_KEYS.run, so the documented setting
  emitted a false "Unknown key ... (ignored)" warning. Registered + tested.
- Added the `fullQa` live-surface guard (readyGate/#817 convention).
- Commits the previously uncommitted README/CHANGELOG lines, the MCP
  buildRunArgs test and the AC-2 wiring test (full-qa.test.ts).

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_0147heJNRw8wBBujPGMqxDpR
Entire-Checkpoint: ea2bbd00bf04
…AC-1 test, MCP schema tripwire, flag reference docs

QA (AC_MET_BUT_NOT_A_PLUS) notes, all addressed in place:
- The capture guard's comment now states where it bites: the next phase
  (loop, or the retried exec) would otherwise resume qa's fresh session;
  the loop-resume consequence is disclosed in the CHANGELOG.
- The AC-1 test's loop mock returns a handle like production, so the
  assertions model the exec -> loop -> exec chain and check that loop
  resumes exec's session, not qa's.
- runToolInputSchema is exported (@internal) with a tripwire asserting
  the fullQa key and its minimum-version note.
- docs/reference/run-command.md gains the --full-qa row and run.fullQa.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_0147heJNRw8wBBujPGMqxDpR
@admarble
admarble merged commit d56ca2d into main Sep 10, 2026
6 checks passed
@admarble
admarble deleted the feature/982-feat-run-fresh-session-qa-never-resume-the-exec-se branch September 10, 2026 22:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(run): fresh-session QA — never resume the exec session into qa; expose run.fullQa (setting + --full-qa + MCP param)

1 participant