Repository navigation
Description
Found: the #1245 run on 2026-10-03 (run 139f3382, sequant 2.19.0 MCP server). PR #1294's body is the placeholder "Automated PR for issue #1245." with no exec summary, AC table or mutation markers.
Cause, read from the exec session's transcript. Exec's final message has ## What changed, ## Acceptance criteria, ## Checks and ## Confidence, but no ## Summary. It wrote its three SEQUANT_MUTATION markers under ## Checks. extractExecSummary (src/lib/workflow/worktree-manager.ts) reads only the last ##/### Summary section, so it returned undefined. buildAutomatedPRBody then fell back to the placeholder, and nothing was recorded as execSummary on the issue's state.
This is the expected case, not an edge case. extractExecSummary's own comment records that 13 of 20 exec sessions on 2026-09-30 ended with no Summary heading. The exec skill's PR Creation step tells exec to put the AC table and every marker inside its final ## Summary (#1247), but that is a prose instruction the model often skips. #1247's promise depends on this path: "QA reads your summary, AC table and mutation markers from the PR body". With a placeholder body, QA's §6i finds no markers for gate-test ACs and floors the verdict, and the precheck's AC literal-diff has nothing to compare.
Prior fixes / producers
- Prior: fix(pr): sequant run PRs double the conventional prefix in the title and ship a placeholder body #1223 added
extractExecSummarywith## Summaryonly, and widened it to##/###after measuring. fix(run): sequant run has two PR producers — exec opens the PR itself and createPR returns it untouched, dropping the QA note, ready-gate report and summary #1247 made the orchestrator the only PR producer and moved the instruction into the exec skill. - Producers of the PR body's content: the exec final message (the only input) and
buildAutomatedPRBody. Consumers: QA §6i (SEQUANT_MUTATION), the precheck AC literal-diff, §2a settle evidence, and human reviewers.
AC
- AC-1: When exec's output has no Summary section, the PR body still carries every
SEQUANT_MUTATIONmarker found anywhere in exec's final output, plus the AC verification table if one is present. Marker text is passed through closing-keyword sanitization. Evidence:npx vitest run src/lib/workflow/worktree-manager.build-pr-body.test.tswith a fixture copied verbatim from the fix(run): status, PR-body QA note and MCP result use the first qa verdict — a looped AC_NOT_MET→NEEDS_VERIFICATION records ready_for_merge #1245 exec output's headings and markers - AC-2: A marker inside the Summary section is not duplicated, and truncation at
EXEC_SUMMARY_MAX_LENGTHnever drops a marker. Evidence: same test file - AC-3: The run log or the run output says when the body fell back to the placeholder, so the miss is visible without reading the PR. Evidence: a batch-executor test asserting the warning
Non-Goals
- Making the model write a
## Summaryheading more reliably. The prose instruction exists, and this issue removes the dependence on it.
Activity
admarble commentedon Oct 4, 2026
Runner context (2026-10-04, main @ 2f8dc07)
Where things are:
extractExecSummaryis atsrc/lib/workflow/worktree-manager.ts:1917, andEXEC_SUMMARY_MAX_LENGTH = 4000is at:1907.buildAutomatedPRBodyis at:2080.qaNotRunline inbuildAutomatedPRBodyand the "QA has reviewed the latest exec" rule inopenOrUpdatePR(batch-executor.ts). Keep both intact.src/lib/workflow/mutation-marker.tsalready parsesSEQUANT_MUTATIONmarkers;/qa§6i uses it. Reuse it, or match its exact grammar. Don't write a second marker regex: two parsers for one marker is the drift class feat(qa): mutation-verification becomes a parseable §7 gate instead of honor-system prose #939 closed.Second live example, beyond #1245. PR #1298 (#1246) had a real
## Summary, but the summary ran past 4,000 characters and was cut mid-sentence ("…the PR update after the sec"). The markers survived only because they came before the cut. AC-2's truncation case should use that shape: a marker after the cut point must still reach the body.State fallback:
openOrUpdatePRfalls back tostate.execSummaryfor a run with no exec pass (stateManager.updateExecSummary). If the markers live outside the summary, decide whether the state fallback carries them too. If not, a qa-only re-run's PR update drops them again. Either answer is fine; say which one in the PR.Prior fixes / producers:
extractExecSummaryhas one prior change (#1223), which isn't a class yet. The PR body has one producer,buildAutomatedPRBody.Launch constraints:
npm testin exec or QA; CI runs it. Run the AC test files, plusnpx tsc --noEmitandnpm run build.batch-executor.test.tsqueueschild_processmocks in order.## Summarysection that holds the AC table and everySEQUANT_MUTATIONmarker. Until this issue lands, that's the only way they reach the PR body.Refs, never a closing keyword, even in examples.admarble commentedon Oct 4, 2026
Complexity: Standard (3 ACs, 2 directories)
AC Quality Check
worktree-manager.build-pr-body.test.ts), but the cases do not, so the gate fails now and passes only with the work. Not vacuous.log(chalk.yellow(...))line inopenOrUpdatePR, which is run output. Plan below.Scope Assessment
Non-Goals: present (don't make the model write
## Summarymore reliably).src/lib/workflow/, tests alongside)Verdict: ✅ SCOPE_OK
Acceptance Criteria
AC-1: No-Summary exec output still yields markers and the AC table in the PR body
Verification: Unit Test (
worktree-manager.build-pr-body.test.ts)Scenario: Given exec output with
## What changed / ## Acceptance criteria / ## Checks / ## Confidenceand 3SEQUANT_MUTATIONmarkers under## Checks(headings and markers copied verbatim from the #1245 transcript) → WhenbuildAutomatedPRBody(1245, {execOutput})→ Then the body contains all 3 markers (parseable byparseMutationMarkers) and the AC table; a marker whose text saysCloses #99is rewritten toRefs #99.Assumptions: the fixture must be copied from the real transcript, not synthesized (motivating-example rule).
AC-2: No duplicate markers; truncation never drops one
Verification: Unit Test (same file)
Scenario: (a) marker inside the Summary section → appears once. (b) Summary over 4,000 chars with a marker after the cut point (the #1298 shape) → marker still in body. (c) summary-section marker plus the same marker elsewhere → once.
AC-3: Placeholder fallback is visible
Verification: Unit Test (
batch-executor.test.ts)Scenario: Given an exec result with no Summary and no markers, no state summary → When the PR is created → Then a
logwarning says the body fell back to the placeholder. No warning when a summary or markers exist, or when no exec ran (qa-only with a state fallback).Implementation Plan
Phase 1: One composer (
src/lib/workflow/)mutation-marker.ts: addrenderMutationMarker(marker), the inverse ofparseMarkersRaw, so the grammar lives in one file. No second regex. Collect markers with the existingparseMutationMarkers(execOutput); it already ignores fenced or inline-code markers, which is the right behavior for example text.worktree-manager.ts: addcomposeExecSummary(execOutput)next toextractExecSummary. It returns the (capped) Summary section; then an uncapped block of markers not already present in that capped text (compare byac+mutation+failedTest); and, when there is no Summary section, the## Acceptance criteriasection (or a table containingAC-Nrows) under a plain label. Cap applies only to the summary prose. Returnsundefinedwhen all three parts are empty.buildAutomatedPRBody: usecomposeExecSummary(execOutput) ?? opts.execSummary?.trim(), still passed throughsanitizeImportedClosingKeywords(covers marker text, AC-1).Phase 2: State fallback + visibility (
batch-executor.ts)updateExecSummary(issueNumber, composeExecSummary(result.output)). State then stores summary + markers, so the qa-only re-run's PR update keeps them. Decision recorded: the state fallback carries markers (no schema change,execSummarystays a string).openOrUpdatePR(~1204): when the body will be the placeholder (compose and state summary both empty),log(chalk.yellow("! PR body: exec output has no Summary or mutation markers; using placeholder")). Keep the decision(run): a sequant run where no qa ran still ends with a PR — draft+note, require qa, or unchanged (blocked by #1247) #1246qaNotRunand "QA reviewed latest exec" logic untouched.batch-executor.test.tsqueues child_process mocks in order; add the new case without adding git calls. Keep the existingextractExecSummarytests green.Design Review
worktree-manager.ts(the sole PR-body producer) plusmutation-marker.tsfor the render side of the marker grammar.EXEC_SUMMARY_MAX_LENGTH(still drops after any cap); a newexecMarkersstate field (schema change for no gain, since a string already round-trips).extractExecSummary: one prior change (fix(pr): sequant run PRs double the conventional prefix in the title and ship a placeholder body #1223), then the fix(run): sequant run has two PR producers — exec opens the PR itself and createPR returns it untouched, dropping the QA note, ready-gate report and summary #1247 caller change. Fewer than 2 prior fix issues, so not yet a class; this fix removes the dependence on the heading. Marker parsing ismutation-marker.ts(feat(qa): mutation-verification becomes a parseable §7 gate instead of honor-system prose #939), reused.extractExecSummaryis called fromworktree-manager.ts(buildAutomatedPRBody) andbatch-executor.ts:2073(state write). One body producer. Consumers: QA §6i, precheck AC literal-diff, humans. Both call sites switch tocomposeExecSummary, so the PR path and the state path cannot disagree.Feature Quality Planning
All standard checks pass. Notable:
Open Questions
Recommended Workflow
Phases: exec → qa
Quality Loop: disabled
Reasoning: Bug fix, 3 ACs, small surface. AC-1/AC-2 declare unit-test evidence, but the tests are the deliverable and exec writes them, so testgen adds nothing. Skip full
npm test(CI runs it); run the two test files,npx tsc --noEmit,npm run build. Gate tests (AC-1/AC-2) needMutation-verified:records naming the test file path.Label Review
Current: bug. Recommended: bug, planned. No
uilabels needed.admarble commentedon Oct 4, 2026
QA Verdict: AC_NOT_MET
AC coverage: 2/3 met
Gaps:
## Summarymore reliably.fix(#1297): a summary cut inside a mutation marker no longer swallows…
admarble commentedon Oct 4, 2026
QA Verdict: AC_NOT_MET
AC coverage: 2/3 met
Gaps:
renderMutationMarkerso malformed markers are dropped.fix(#1297): exec's fenced mutation markers reach the PR body
admarble commentedon Oct 4, 2026
QA Verdict: AC_NOT_MET
AC coverage: 3/3 met
Gaps:
fix(#1297): the no-Summary AC-table cap keeps whole markers too; read…
admarble commentedon Oct 4, 2026
QA Verdict: AC_MET_BUT_NOT_A_PLUS
AC coverage: 3/3 met
Gaps:
fix(#1297): a marker exec fenced inside its Summary is re-rendered wh…
admarble commentedon Oct 4, 2026
Runner verification and follow-up ledger (PR #1300)
Runner fixes
capImportedText, and the AC-2e test sweeps the cut offsets.ready-gate-run.test.tsmockedworktree-managerwithoutcomposeExecSummary, so 9 tests failed. The mock now includes it, and all 7 test files that mock it pass.parseMutationMarkers, and the AC-2f test covers it.Each new test fails without its fix and passes with it.
Ledger
batch-executorstores the composed summary (markers included) asexecSummary. Seen live: before this lands, a qa-only run on this PR fell back to the placeholder, since 2.19.0 stored nothing.mutation-marker.tshas no test file of its own: dropped.parseMutationMarkersFromExecOutputis covered through the build-pr-body tests (AC-1 verbatim fixture, AC-2f), and the existing mutation-marker tests pass.fix(#1305): escape only --> on render and keep multi-line markers par…
fix(#1305): a SEQUANT_MUTATION marker containing } now round-trips (#…