Skip to content

fix(#1297): PR body falls back to the placeholder when exec writes no "## Summary" heading, dropping exec's mutation markers and AC table - #1300

Merged
admarble merged 7 commits into
mainfrom
feature/1297-fix-run-pr-body-falls-back-to-the-placeholder-when
Oct 4, 2026
Merged

admarble merged 7 commits into
mainfrom
feature/1297-fix-run-pr-body-falls-back-to-the-placeholder-when

Conversation

@admarble

@admarble admarble commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

Summary

The PR body no longer depends on exec writing a ## Summary heading.

  • composeExecSummary (src/lib/workflow/worktree-manager.ts) carries:

    • exec's capped Summary, or, when there is none, its AC table;
    • every SEQUANT_MUTATION marker found anywhere in exec's final output, fenced ones included, through a new parseMutationMarkersFromExecOutput in mutation-marker.ts.

    The markers sit outside the length cap, are de-duplicated against the Summary text, and are re-rendered through renderMutationMarker.

  • Cuts inside a marker: a cut that lands inside a marker leaves no dangling <!--. Both caps (Summary and AC table) share capImportedText.

  • Placeholder warning: the run warns when the body falls back to the placeholder (AC-3, batch-executor.ts).

  • Fixture: the real 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, recovered from its session transcript, is the fixture: src/lib/workflow/__fixtures__/exec-output/1245-fenced-markers.txt.

Mutation-verified: AC-1 — parseMutationMarkersFromExecOutput stopped reading fenced blocks; the verbatim #1245 fixture test failed (1 failed, 56 passed); restored.

Runner fixes (fe14c52)

  • QA's last-iteration AC-2 gap was real on the AC-table path. With ## Acceptance criteria and no Summary, a cut at offsets 3973 to 3975 dropped AC-1's marker. The Summary path was already guarded (dd5c9ca8); the table cap had no guard. The new test AC-2e sweeps cut offsets 3940 to 4010 on the table path. It fails without the fix and passes with it.
  • ready-gate-run.test.ts mocked worktree-manager without composeExecSummary. 9 cases failed, and no phase ran that file. The mock now includes it. All 7 test files that mock worktree-manager pass (133 tests).
  • Checks: worktree-manager.build-pr-body.test.ts 58/58. The other workflow tests (batch-executor, mutation-marker, ready-gate-run, src/mcp/tools/run) pass. tsc --noEmit and eslint are clean.
  • Body restored: in the quality loop, an exec pass rewrote this PR's body directly, at QA's suggestion, and dropped the sequant run trailer, so the orchestrator stopped updating it. The runner restored this body. Filed as fix(exec): under the orchestrator, a loop exec rewrites the PR body itself (gh api PATCH), so later sequant updates are dropped as "edited by hand" #1302.

QA re-run (qa-only) and runner fix (ae7c25c)

  • Result: the qa-only re-run met all 3 ACs (AC_MET_BUT_NOT_A_PLUS) and found one more gap. A marker exec fenced inside its ## Summary was de-duplicated against the fenced copy, which QA's code-stripped parseMutationMarkers ignores, so the body carried none.
  • Fix: the de-dup seed now uses parseMutationMarkers. The new test AC-2f fails without the fix and passes with it.
  • Checks: worktree-manager.build-pr-body.test.ts 59/59. batch-executor, ready-gate-run, mutation-marker and src/mcp/tools/run tests: 273 passed. tsc and eslint are clean.
  • This body was overwritten once more: the qa-only run rebuilt it from the issue state's execSummary, which is empty because no exec pass ever produced a Summary, so it fell back to the placeholder. That state-fallback case goes away once this PR lands, because batch-executor stores the composed summary.

Fixes #1297

QA verdict: AC_MET_BUT_NOT_A_PLUS (qa-only re-run). Its fix_now gap was fixed afterwards in ae7c25c.


🤖 Generated by sequant run

…as no Summary

Entire-Checkpoint: c60a1951c977
Entire-Checkpoint: c37af128f2b8
… the re-appended marker

Entire-Checkpoint: 73f0f508b967
…y-gate-run mock gains composeExecSummary

QA's last-iteration repro: the AC-table path capped at EXEC_SUMMARY_MAX_LENGTH with no comment guard, so a cut at offsets 3973-3975 dropped AC-1's marker. Both caps now share capImportedText. ready-gate-run.test.ts mocked worktree-manager without composeExecSummary, failing 9 cases.

Entire-Checkpoint: efcff03b558a
@admarble admarble changed the title fix(#1297): PR body falls back to the placeholder when exec writes no "## Summary" heading, dropping exec's mutation markers and AC table fix(#1297): the PR body keeps exec's mutation markers and AC table when exec writes no "## Summary" or the summary is cut Oct 4, 2026
@admarble admarble changed the title fix(#1297): the PR body keeps exec's mutation markers and AC table when exec writes no "## Summary" or the summary is cut fix(#1297): PR body falls back to the placeholder when exec writes no "## Summary" heading, dropping exec's mutation markers and AC table Oct 4, 2026
…ere QA's parse sees it

QA re-run finding: composeExecSummary de-duplicated against the Summary's fenced markers, which QA's code-stripped parseMutationMarkers ignores, so the body carried none. The seed now uses parseMutationMarkers.

Entire-Checkpoint: be6a33fca918
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.

fix(run): PR body falls back to the placeholder when exec writes no "## Summary" heading, dropping exec's mutation markers and AC table

1 participant