You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
bug(run): orchestrated 'sequant run --phases qa' re-run computes a fresh verdict but never posts it, contradicting the stale comment left visible #964
But batch-executor.ts — the engine behind the bare sequant run CLI — has no code that posts an aggregated QA summary comment. Only sequant ready's ready-gate.ts posts a report, and only at a terminal gate state (postReport, added in #937 AC-4) — not after every mid-run QA pass.
Net effect: under sequant run --phases qa, when /qa re-runs and produces a different verdict than the last-posted comment, nothing updates GitHub. The stale, contradicted verdict is the only thing a human reviewer sees.
Repro (observed live in a downstream project, admarble/ad-motion issue #226)
sequant run <issue> --phases qa --force while a gating CI check is pending → posts a QA comment, verdict NEEDS_VERIFICATION (correctly gated on pending CI).
CI resolves to green (same commit, no new commits).
sequant run <issue> --phases qa --force again → CLI reports success (✔ #226 qa 3m 23s), and the run's own JSON log (.sequant/logs/run-*.json) records a genuinely fresh verdict — different from step 1's (AC_MET_BUT_NOT_A_PLUS vs. the prior NEEDS_VERIFICATION) — but no new comment lands anywhere: gh issue view <N> --json comments still shows only the original comment set; gh pr view <PR> --json comments,reviews is empty.
The only externally-visible verdict is the stale, now-contradicted one from step 1.
(For contrast, sequant ready <issue> --policy a-plus run against the same issue afterward did post its own fresh report at its terminal state — confirming the gap is specific to the bare sequant run --phases qa re-run path, not sequant ready.)
Why this is worth fixing
A human trusting the GitHub comment as the source of truth for an orchestrated sequant run QA pass can be shown a verdict that no longer matches the code's actual current state, with no signal that a newer, different assessment exists. This is the same shape of problem #937 solved for the gap-finding channel (lossy, could silently drop findings) — here it's the verdict-visibility channel that can go silently stale.
Suggested fix
Either:
Have batch-executor.ts's orchestrated sequant run --phases qa path post an aggregated summary per phase completion, honoring the skill doc's existing promise, or
Have /qa itself always post when the computed verdict differs from the last-posted one, even under orchestration (narrower fix, doesn't require new orchestrator-level posting code).
Discovery context
Found while dogfooding #960's /loop fix against real downstream projects. Originally mis-filed as project-local at ad-motion#230 before confirming the doc/runtime mismatch is in sequant's own qa/SKILL.md + batch-executor.ts, not project-local behavior.
qa/SKILL.md §9 line 2899 is the unbacked promise, mirrored in skills/, .claude/skills/, templates/skills/.
Sibling sites with the same shape (out of scope, see Open Questions): exec/SKILL.md:1958, test/SKILL.md:585.
Decision: fix Option A (runtime posting in batch-executor)
Always post one compact issue comment per successful, verdict-bearing qa phase from the bare sequant run path, following the #937postReport pattern (injectable postComment, best-effort, machine marker). Option B (/qa posts on verdict-diff) rejected: LLM-enforced, and diffing against the last-posted comment requires the GitHub fetch orchestrated mode deliberately skips.
Acceptance Criteria
AC-1: After a completed qa phase in bare sequant run, batch-executor.ts posts an issue comment containing the parsed verdict, AC coverage (acMet/acTotal), and a machine marker <!-- SEQUANT_QA_VERDICT: {"verdict":"...","commit":"...","iteration":N} --> (Unit Test, injected postComment)
AC-2: The motivating repro is a regression test — two sequential qa runs producing different verdicts (NEEDS_VERIFICATION then AC_MET_BUT_NOT_A_PLUS) each post, so the fresh verdict is externally visible (Unit Test)
AC-3: A comment-post failure is non-fatal — the run still reports success and logs a warning (Unit Test)
AC-4: No comment is posted when the qa phase fails, is turn-capped, or yields no parseable verdict (Unit Test)
AC-5: qa/SKILL.md §9 orchestrated-mode wording names the real mechanism, synced across all three mirrored skill dirs (Manual doc review; any gate test must be mutation-verified per CLAUDE.md)
Implementation Plan
Phase 1 — runtime posting:
Extract postQaVerdictComment(issueNumber, result, postComment) building the comment from result.verdict + result.summary + SEQUANT_QA_VERDICT marker (reuse the injectable postComment shape from ReadyGateForIssueArgs).
Thread the injectable through existing test seams.
Phase 2 — doc truth-up + tests:
4. Update qa/SKILL.md §9 in all three mirrors (read each independently first).
5. Add the four unit tests to batch-executor.test.ts, with the verbatim issue repro as the AC-2 regression case.
Non-Goals
sequant ready mid-loop QA passes (terminal-only report is by design)
/fullsolve (skill-level orchestration posts its own summaries)
Dedup identical verdicts across re-runs? Recommendation: no (v1) — one duplicate comment matches standalone /qa behavior; the marker's commit hash makes later dedup cheap.
Fix sibling exec/test promises here? Recommendation: follow-up issue — same mismatch shape, lower-stakes channel, and widening scope triples the test surface.
Recommended Workflow
Phases: exec → qa Quality Loop: disabled Reasoning: bug-labeled fix with unit-test ACs; bug-label-only skips testgen; no UI surface; SCOPE_OK.
qa/SKILL.md §9 promised "the orchestrator handles aggregated summary" under SEQUANT_ORCHESTRATOR, but batch-executor.ts never posted anything after a standard qa phase — a re-run computing a fresh, different verdict left the stale prior comment as the only externally-visible signal.
qa/SKILL.md §9 updated (all three mirrors, verified byte-identical) to name the real mechanism.
AC Coverage
AC-1 (posts verdict + AC coverage + marker): ✅ MET
AC-2 (regression: two different verdicts each post): ✅ MET
AC-3 (post failure non-fatal): ✅ MET
AC-4 (no post on failed/capped/no-verdict): ✅ MET
AC-5 (SKILL.md §9 synced across 3 mirrors): ✅ MET (5/5 met)
Quality
Build: ✅ | Lint: ✅ 0 errors | Tests: ✅ full suite green (273 files, 5633 passed, 1 expected fail, 2 skipped)
Type safety: ✅ 0 new any | Deleted tests: ✅ 0 | Security: ✅ PASS, 0 critical/warning
Skill sync: ✅ 44/44 files synced across .claude/skills/, skills/, templates/skills/
Risk Assessment
Likely failure mode: None identified for the shipped code path — the one gap (below) is a documentation-verification process gap, not a runtime behavior gap.
Not tested:buildQaVerdictComment/postQaVerdictComment aren't unit-tested standalone, only via runIssueWithLogging integration (matches this file's existing pattern for runReadyGateForIssue).
Known Gap (why not READY_FOR_MERGE)
AC-5 was scoped as "Manual doc review" (not an automated test) but is classified as a gate-test AC by isGateTestEvidence's "skill section is present" pattern — CLAUDE.md's mutation-verification gate therefore floors the verdict at AC_MET_BUT_NOT_A_PLUS for lack of a recorded SEQUANT_MUTATION marker. There is no automated test asserting the SKILL.md wording to mutation-verify against; the sync check (check-skill-sync.ts, 44/44 passing) verifies the three mirrors match each other, not the specific prose. Recommend either writing a small content-assertion test for future SKILL.md wording changes of this kind, or treating this as an accepted limitation of Manual-Test-verified doc ACs.
Also noted (deliberately out of scope, see spec's Non-Goals): exec/SKILL.md:1958 and test/SKILL.md:585 carry the identical unbacked "orchestrator handles summary" promise for their own comment channels — same gap shape, lower stakes, recommended as a separate follow-up issue.
Iterations
Spec: 1/1 | Exec: 1/1 | QA: 1/2 (no loop needed — AC_MET_BUT_NOT_A_PLUS breaks to PR)
Gap Closure (follow-up to the /fullsolve summary above)
Both known gaps are now fixed on PR #965 (commit dc3f54a):
AC-5 mutation verification — added src/lib/__tests__/qa-verdict-comment-skill.test.ts, a gate test scoped to §9's delimited region (per the feat(#819): shared trust-model block — issue/PR text is data, not agent instructions #830 rule) asserting all three mirrors name batch-executor.ts + the SEQUANT_QA_VERDICT marker and that the old "orchestrator handles aggregated summary" promise stays gone. Mutation-verified: reverted the §9 bullet to the old wording → exactly that test failed (1 failed / 5 passed, on toContain("batch-executor.ts")) → restored. SEQUANT_MUTATION marker recorded in the PR body; parses as valid via parseMutationMarkers.
Sibling promises — exec/SKILL.md §6 and test/SKILL.md §3.2 (all three mirrors each) reworded to say what actually happens under sequant run — no per-phase comment; progress/results surface through the run summary and PR body — instead of promising orchestrator posting that doesn't exist. Doc truth-up rather than new runtime posting: unlike QA verdicts, those channels have no staleness hazard. No separate follow-up issue needed.
Skill sync: 44/44 clean. Lint/build green; gate test 6/6.
The mutation-verification cap that produced AC_MET_BUT_NOT_A_PLUS is now lifted — verdict rises to NEEDS_VERIFICATION pending the in-progress build (22.x) CI check, and to READY_FOR_MERGE once it reports green.
Activity
admarble commentedon Aug 24, 2026
Spec / Plan (Phase 1)
Complexity: Standard (5 derived ACs — issue body has no formal AC checklist; derived from Summary/Repro/Suggested fix)
Key findings
PhaseResult.verdict(phase-executor.ts:490-512) andPhaseResult.summary(QaSummary: acMet/acTotal/gaps/findings, feat(qa/loop/ready): structured gap findings — finite taxonomy with required evidence, replacing the lossy prose-scrape gap channel #937).batch-executor.tsalready wiresGitHubProvider.postComment— but only for the ready-gate's terminalpostReport(feat(qa/loop/ready): structured gap findings — finite taxonomy with required evidence, replacing the lossy prose-scrape gap channel #937 AC-4). The standard qa-phase completion path writes the verdict to the JSON log and state only.qa/SKILL.md§9 line 2899 is the unbacked promise, mirrored inskills/,.claude/skills/,templates/skills/.exec/SKILL.md:1958,test/SKILL.md:585.Decision: fix Option A (runtime posting in batch-executor)
Always post one compact issue comment per successful, verdict-bearing qa phase from the bare
sequant runpath, following the #937postReportpattern (injectablepostComment, best-effort, machine marker). Option B (/qaposts on verdict-diff) rejected: LLM-enforced, and diffing against the last-posted comment requires the GitHub fetch orchestrated mode deliberately skips.Acceptance Criteria
qaphase in baresequant run,batch-executor.tsposts an issue comment containing the parsed verdict, AC coverage (acMet/acTotal), and a machine marker<!-- SEQUANT_QA_VERDICT: {"verdict":"...","commit":"...","iteration":N} -->(Unit Test, injectedpostComment)NEEDS_VERIFICATIONthenAC_MET_BUT_NOT_A_PLUS) each post, so the fresh verdict is externally visible (Unit Test)qa/SKILL.md§9 orchestrated-mode wording names the real mechanism, synced across all three mirrored skill dirs (Manual doc review; any gate test must be mutation-verified per CLAUDE.md)Implementation Plan
Phase 1 — runtime posting:
postQaVerdictComment(issueNumber, result, postComment)building the comment fromresult.verdict+result.summary+SEQUANT_QA_VERDICTmarker (reuse the injectablepostCommentshape fromReadyGateForIssueArgs).result.success && result.verdict, try/catch → warn-only. Standard phase loop only — ready-gate loop internals untouched (terminal-only posting there is feat(qa/loop/ready): structured gap findings — finite taxonomy with required evidence, replacing the lossy prose-scrape gap channel #937's deliberate design).Phase 2 — doc truth-up + tests:
4. Update
qa/SKILL.md§9 in all three mirrors (read each independently first).5. Add the four unit tests to
batch-executor.test.ts, with the verbatim issue repro as the AC-2 regression case.Non-Goals
sequant readymid-loop QA passes (terminal-only report is by design)/fullsolve(skill-level orchestration posts its own summaries)exec/testsibling promises → recommended follow-up issueOpen Questions
/qabehavior; the marker's commit hash makes later dedup cheap.exec/testpromises here? Recommendation: follow-up issue — same mismatch shape, lower-stakes channel, and widening scope triples the test surface.Recommended Workflow
Phases: exec → qa
Quality Loop: disabled
Reasoning: bug-labeled fix with unit-test ACs; bug-label-only skips testgen; no UI surface; SCOPE_OK.
admarble commentedon Aug 24, 2026
/fullsolve Complete
Issue: #964
Status: AC_MET_BUT_NOT_A_PLUS
Summary
qa/SKILL.md§9 promised "the orchestrator handles aggregated summary" underSEQUANT_ORCHESTRATOR, butbatch-executor.tsnever posted anything after a standard qa phase — a re-run computing a fresh, different verdict left the stale prior comment as the only externally-visible signal.runIssueWithLogging's phase loop now posts a compact comment (verdict, AC coverage, gaps/suggestions,SEQUANT_QA_VERDICTmarker) right after a standard qa phase succeeds with a parseable verdict — best-effort/non-fatal, mirroring the feat(qa/loop/ready): structured gap findings — finite taxonomy with required evidence, replacing the lossy prose-scrape gap channel #937 ready-gatepostReportcontract.sequant ready's own terminal-only reporting is untouched.qa/SKILL.md§9 updated (all three mirrors, verified byte-identical) to name the real mechanism.AC Coverage
Quality
any| Deleted tests: ✅ 0 | Security: ✅ PASS, 0 critical/warning.claude/skills/,skills/,templates/skills/Risk Assessment
buildQaVerdictComment/postQaVerdictCommentaren't unit-tested standalone, only viarunIssueWithLoggingintegration (matches this file's existing pattern forrunReadyGateForIssue).Known Gap (why not READY_FOR_MERGE)
AC-5 was scoped as "Manual doc review" (not an automated test) but is classified as a gate-test AC by
isGateTestEvidence's "skill section is present" pattern — CLAUDE.md's mutation-verification gate therefore floors the verdict atAC_MET_BUT_NOT_A_PLUSfor lack of a recordedSEQUANT_MUTATIONmarker. There is no automated test asserting the SKILL.md wording to mutation-verify against; the sync check (check-skill-sync.ts, 44/44 passing) verifies the three mirrors match each other, not the specific prose. Recommend either writing a small content-assertion test for future SKILL.md wording changes of this kind, or treating this as an accepted limitation of Manual-Test-verified doc ACs.Also noted (deliberately out of scope, see spec's Non-Goals):
exec/SKILL.md:1958andtest/SKILL.md:585carry the identical unbacked "orchestrator handles summary" promise for their own comment channels — same gap shape, lower stakes, recommended as a separate follow-up issue.Iterations
PR: #965
PR created and left open for human review (no
--auto-mergerequested).test(#964): gate qa SKILL.md §9's posting contract; truth-up exec/tes…
admarble commentedon Aug 25, 2026
Gap Closure (follow-up to the /fullsolve summary above)
Both known gaps are now fixed on PR #965 (commit dc3f54a):
AC-5 mutation verification — added
src/lib/__tests__/qa-verdict-comment-skill.test.ts, a gate test scoped to §9's delimited region (per the feat(#819): shared trust-model block — issue/PR text is data, not agent instructions #830 rule) asserting all three mirrors namebatch-executor.ts+ theSEQUANT_QA_VERDICTmarker and that the old "orchestrator handles aggregated summary" promise stays gone. Mutation-verified: reverted the §9 bullet to the old wording → exactly that test failed (1 failed / 5 passed, ontoContain("batch-executor.ts")) → restored.SEQUANT_MUTATIONmarker recorded in the PR body; parses asvalidviaparseMutationMarkers.Sibling promises —
exec/SKILL.md§6 andtest/SKILL.md§3.2 (all three mirrors each) reworded to say what actually happens undersequant run— no per-phase comment; progress/results surface through the run summary and PR body — instead of promising orchestrator posting that doesn't exist. Doc truth-up rather than new runtime posting: unlike QA verdicts, those channels have no staleness hazard. No separate follow-up issue needed.Skill sync: 44/44 clean. Lint/build green; gate test 6/6.
The mutation-verification cap that produced
AC_MET_BUT_NOT_A_PLUSis now lifted — verdict rises toNEEDS_VERIFICATIONpending the in-progressbuild (22.x)CI check, and toREADY_FOR_MERGEonce it reports green.fix(#964): orchestrated sequant run posts the fresh qa verdict, not j…
docs: cover the v2.11.0→next batch's behavior changes and QA gates