Repository navigation
Description
What happens
postQaVerdictComment is called only when the qa phase succeeded:
// src/lib/workflow/batch-executor.ts:1758
if (phase === "qa" && result.success && result.verdict) {
A qa phase that returns AC_NOT_MET is reported as a phase failure (status: "failure", exit 1), so result.success is false and no comment is posted. The verdict and its findings exist only in .sequant/logs/run-*.json.
The blocking reviews are exactly the ones that stay invisible. A passing review announces itself; a review that says "do not merge this" does not.
Observed
Three consecutive qa dispatches on #1059 (2026-09-15/16, sequant 2.15.1, sequant_run over MCP):
| Round | Verdict | Phase status | Comment posted |
|---|---|---|---|
| 1 | AC_NOT_MET |
failure | ❌ none |
| 2 | AC_NOT_MET |
failure | ❌ none |
| 3 | AC_MET_BUT_NOT_A_PLUS |
success | ✅ full verdict + gaps |
Round 3's comment is on #1059 at 01:58:42Z, so the posting path itself works. Rounds 1 and 2 left the issue with no record at all; their findings — including a real Windows defect where createSymlink's failure return was discarded — were recovered by hand from the run log:
jq -r '..|strings|select(length>300)' .sequant/logs/run-<id>.json
Why it matters
.sequant/logs is gitignored and rotates at 100 files, so a blocked review's evidence is perishable and invisible to anyone not on that machine. An issue thread showing "no QA comment" reads identically to "QA never ran", and the one case where a human most needs the findings — the review that blocks a merge — is the case that produces nothing.
Prior art
#964 / PR #965 fixed the adjacent half of this: a re-run computing a fresh verdict left the stale prior comment as the only visible signal. That fix added this call site and its result.success gate, whose comment explains the gate as excluding "turn-capped and unparseable-verdict phases (AC-4)". Excluding AC_NOT_MET looks like collateral damage of that intent rather than a decision — an unparseable verdict has nothing to post, whereas AC_NOT_MET has a complete findings payload.
Suggested fix
Gate on result.verdict alone, or on result.success || result.verdict === "AC_NOT_MET". A verdict that parsed is a verdict worth publishing, whatever the phase's exit status.
Correction
An earlier version of this issue said the phase posted nothing in all three runs. That was wrong: round 3 did post. The bug is narrower and sharper than first reported — failing verdicts are suppressed, passing ones are not.
Acceptance criteria
- AC-1: a qa phase whose parsed verdict is
AC_NOT_METposts the verdict comment with its findings even though the phase status isfailure— Verify:npx vitest run src/lib/workflow/batch-executor.test.ts -t "1070"→ caseposts AC_NOT_METsees one comment call with the verdict and gaps. Mutation-verified per CLAUDE.md §Testing: restore theresult.successgate → the case fails; restore. - AC-2: a turn-capped or unparseable-verdict phase still posts nothing (the bug(run): orchestrated 'sequant run --phases qa' re-run computes a fresh verdict but never posts it, contradicting the stale comment left visible #964 AC-4 intent) — Verify: same command, case
no verdict posts nothing. - AC-3:
npm run build && npm testgreen.
Release-graph plan — guard-2026-09 (2026-09-20)
Graph: guard-2026-09 Tier: mechanical Wave: 1
May touch: src/lib/workflow/batch-executor.ts (the postQaVerdictComment call-site gate at ~1758 only — #1095 edits buildQaVerdictComment in the same wave), src/lib/workflow/batch-executor.test.ts, CHANGELOG.md
The npm run build && npm test AC is verified by the runner from a clean shell after the PR opens (PLAN I-1); the agent runs only the test files its ACs name. Mutation markers use failedTest starting with the test file path (I-4).
Activity
[-]bug(qa): the qa phase posts no review comment to the issue — 3/3 runs silent, findings only in .sequant/logs[/-][+]bug(qa): a failing qa verdict (AC_NOT_MET) is never posted to the issue — posting is gated on phase success[/+]admarble commentedon Sep 20, 2026
Runner context — guard-2026-09 launch, 2026-09-20. Base:
origin/mainatda9ed6e8(2.16.0 plus the plan docs). These rules override the exec skill's defaults for this run:npm testin the worktree. Run only the test files this issue's ACs name. The runner runs the full suite once per PR from a clean shell. Undersequant runthe suite is not hermetic againstSEQUANT_*(bug(test): suite isn't hermetic against the SEQUANT_* env phases inject — exec sees red tests it didn't cause and opens no PR #1086), so a full run shows red files you did not cause.env -u SEQUANT_ORCHESTRATOR -u SEQUANT_WORKTREE -u SEQUANT_PHASE -u SEQUANT_ISSUE -u SEQUANT_RELAY -u SEQUANT_RELAY_FRAME npx vitest run <file>. If it is still red, the PR body names the issue number and the base-vs-head result for that test.<!-- SEQUANT_MUTATION: {"ac":"AC-N","mutation":"<what you deleted>","failedTest":"<test file path> > <describe> > <case>"} -->in the PR body.failedTestMUST start with the test file path, or the qa classifier reports it Failed. Commit before mutating.timeout.git commit -m "...", noCo-Authored-By. Never rebase or force-push after pushing. One AC per line in the PR body, idsAC-Nonly.Issue-specific:
src/lib/workflow/batch-executor.test.tsis one of the files that goes red under the orchestrator env leak (#1086): establish its base state with theenv -ure-run above before attributing any failure to your change. Edit only thepostQaVerdictCommentcall-site gate inbatch-executor.ts; #1095 editsbuildQaVerdictCommentin the same file concurrently.admarble commentedon Sep 20, 2026
Complexity: Standard (3 ACs, 2 directories)
AC Quality Check
No vague/unmeasurable/open-ended AC. AC-1 and AC-2 each name a runnable command and a case name. One constraint:
-t "1070"filters on the full test name (describe + case), so the newdescribemust contain1070and the cases must be named exactlyposts AC_NOT_MET…/no verdict posts nothing…for the Verify commands to select them.Scope Assessment
Non-Goals: none stated in the body. The runner's "May touch" list is the boundary: only the
postQaVerdictCommentcall-site gate inbatch-executor.ts(notbuildQaVerdictComment, which #1095 edits concurrently),batch-executor.test.ts,CHANGELOG.md.src/lib/workflow/, rootCHANGELOG.md)Verdict: ✅ SCOPE_OK
Acceptance Criteria
AC-1:
AC_NOT_METverdict is posted despitestatus: failureVerification: Unit Test (
npx vitest run src/lib/workflow/batch-executor.test.ts -t "1070", caseposts AC_NOT_MET) — gate test, mutation-verifiedScenario: Given qa returns
{success:false, verdict:"AC_NOT_MET", summary:{gaps:[…]}}→ WhenrunIssueWithLoggingruns the qa phase → ThenpostCommentis called once, body containsAC_NOT_MET, the gap text, and theSEQUANT_QA_VERDICTmarker.Assumptions: verified in code —
phase-executor.ts:1042-1057is the only place asuccess:falseresult carriesverdict(AC_NOT_MET). The call site (batch-executor.ts:1758) sits after theif (result.success) … else …progress block, and nobreak/continueprecedes it, so failed phases do reach it.AC-2: turn-capped / unparseable-verdict phases still post nothing
Verification: Unit Test (same command, case
no verdict posts nothing)Scenario: Given qa returns
{success:false, error:"QA completed without a parseable verdict"}and, separately,{success:false, capped:true}(neither hasverdict) → ThenpostCommentis not called.Assumptions: neither path sets
verdict(phase-executor.ts:1060-1078; capped returns before the qa branch). The existing#964 AC-4test already covers this shape; the new case re-asserts it under the widened gate so the widening can't silently regress it.AC-3:
npm run build && npm testgreenVerification: Integration (runner, clean shell, after PR opens — per PLAN I-1; the exec agent runs only
batch-executor.test.ts)Implementation Plan
Phase 1: Widen the gate (1 line)
src/lib/workflow/batch-executor.ts:1758—if (phase === "qa" && result.success && result.verdict)→if (phase === "qa" && result.verdict).successgate "excludes turn-capped and unparseable-verdict phases"; the true invariant isresult.verdictis only set once a verdict parsed, so the verdict check alone excludes them. Keep the comment stating intent (whysuccessis deliberately absent:AC_NOT_METissuccess:falsebut has a full payload).Phase 2: Tests (
batch-executor.test.ts)describe("#1070: failing qa verdict is posted", …)next to the bug(run): orchestrated 'sequant run --phases qa' re-run computes a fresh verdict but never posts it, contradicting the stale comment left visible #964 block (~line 1836), reusingmakeCtx+mockPostComment. Cases:posts AC_NOT_MET…(AC-1) andno verdict posts nothing…(AC-2, both sub-shapes).{success:false, verdict:"AC_NOT_MET"}for the first qa and does not injectpostComment, so after the widening it would call the realnew GitHubProvider().postComment("658", …)— i.e.gh issue comment 658against the live repo. AddpostComment: mockPostCommentto itsmakeCtx(see Feature Quality).Phase 3: Mutation verification + changelog
result.success &&→posts AC_NOT_METmust fail (and only it, among the bug(qa): a failing qa verdict (AC_NOT_MET) is never posted to the issue — posting is gated on phase success #1070 cases); restore. Mutation B (AC-2, optional but cheap): change gate tophase === "qa"→no verdict posts nothingmust fail; restore. Record with<!-- SEQUANT_MUTATION: {"ac":"AC-1","mutation":"restored result.success gate at batch-executor.ts:1758","failedTest":"src/lib/workflow/batch-executor.test.ts > #1070: … > posts AC_NOT_MET…"} -->—failedTestmust start with the file path.CHANGELOG.mdunder[Unreleased]→### Fixed.Design Review
batch-executor.ts;postQaVerdictCommentitself stays untouched (andbuildQaVerdictCommentis off-limits this wave).result.success. Rejected:result.success || result.verdict === "AC_NOT_MET"— it encodes today's coincidence that onlyAC_NOT_METfails-with-verdict, and would silently suppress any future failing verdict. Recommended per the issue's own "a verdict that parsed is a verdict worth publishing".postCommenttest seam (ctx.postComment).AC_NOT_METround?" Yes, by design — each round has a distinct iteration/commit in theSEQUANT_QA_VERDICTmarker, and round-by-round visibility is the observed need (feat(#497): sequant init --agent codex — .agents/skills symlink, .codex hooks wrapper, doctor, README #1059 rounds 1-2). No dedupe added; not in scope.Feature Quality Planning
Notable items:
ghleak in existing tests (the main risk). The gate widening changes behavior for every test that drivesrunIssueWithLoggingwith asuccess:false+verdict:"AC_NOT_MET"qa result and no injectedpostComment. Confirmed:batch-executor.test.ts:586-600(fix(cli): renderer pause/resume is dead code — batch-executor never passes spinner argument #656). Also driving the same shape without injectingpostComment:model-ladder.test.ts(lines ~305, 343, 378, 496, 896, 1001 →runIssueWithLoggingat 1016) and possiblybatch-executor.model-ladder.test.ts. None mockplatforms/github.js. Exec must grep these before pushing; where a worktree path is set the realresolveDiffBasemock may also be missing an export. Those two files are outside the runner's "May touch" list — see Open Questions.batch-executor.test.tsgoes red underSEQUANT_*; establish base state with theenv -u …re-run from the runner comment before attributing failures.postQaVerdictCommenthas one call site; the ready-gate path (runReadyGateForIssue) posts its own report and is a different mechanism — no siblings.Open Questions
model-ladder.test.ts(and possiblybatch-executor.model-ladder.test.ts) needpostCommentinjection, but are outside "May touch". — Recommendation: extend the boundary by those test files only (test-only, mechanical), or have exec first run them at base vs head to see if they actually reach the call site (worktree/mocks may keep them from it). Impact if ignored: those suites make realgh issue commentcalls or throw on missing mock exports.result.verdictalone (recommended) vssuccess || AC_NOT_MET. Impact if wrong: none today (behaviorally identical); differs only for a future failing verdict.Recommended Workflow
Phases: exec → qa
Quality Loop: disabled
Reasoning: one-line production change plus tests, declared
buglabel; testgen skipped (bug-fix, test cases fully specified by the ACs). No UI, no security surface. QA must confirm the mutation marker (gate-test AC) and check the test-leak sweep from Open Question 1.Label Review
Current: bug
Recommended: bug, planned
Reason: correctly labeled;
plannedmarks spec completion.Quality Loop: won't auto-enable (SCOPE_OK, simple change).
test(#1070): every test ctx defaults to the mocked comment poster so …
test(#1070): model-ladder ctx carries a no-op comment poster
chore(#1070): merge origin/main
chore(#1070): merge origin/main
chore(#1070): merge origin/main
chore(#1070): merge origin/main
fix(#1070): post failing qa verdicts — gate on the parsed verdict alo…