Skip to content

fix(#1223): sequant run PR titles reuse the issue's own type, and the body carries exec's summary - #1240

Merged
admarble merged 6 commits into
mainfrom
feature/1223-fix-pr-sequant-run-prs-double-the-conventional-pre
Sep 30, 2026
Merged

admarble merged 6 commits into
mainfrom
feature/1223-fix-pr-sequant-run-prs-double-the-conventional-pre

Conversation

@admarble

@admarble admarble commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • buildPRTitle (new, pure, exported) reuses the issue title's own conventional-commit type and replaces the scope with #N — feat(adopt): x → feat(#1209): x — instead of prepending a label-derived feat/fix in front of a title that already has one. Titles without a recognized type(scope)!?:/type: prefix keep today's isBug ? "fix" : "feat" behavior.
  • buildAutomatedPRBody now pulls the last ## Summary section from the exec phase's captured output (extractExecSummary), capped at ~4KB, falling back to the old placeholder text only when exec produced no summary.
  • A new, unconditional sanitizer (sanitizeImportedClosingKeywords) rewrites any closing keyword (closes, fixes, resolves) + #N inside the imported summary to Refs #N — scoped to any issue number, applied only to imported text, never the body's own trailer. This is distinct from the existing rewriteClosingKeywordsToRefs, which is scoped to the PR's own issue and gated on linkMode.
  • createPR now builds its title via buildPRTitle and threads the exec phase's output through a new trailing opts: { execOutput? } parameter (not another positional arg — it already had 11). batch-executor.ts passes phaseResults.find(p => p.phase === "exec")?.output through.

AC Verification

AC Status Evidence
AC-1 ✅ Implemented buildPRTitle + tests in worktree-manager.test.ts
AC-2 ✅ Implemented extractExecSummary + buildAutomatedPRBody + tests in worktree-manager.build-pr-body.test.ts
AC-3 ✅ Implemented sanitizeImportedClosingKeywords + tests covering Closes #<n>, lowercase fixes #<n> and cross-repo / URL references

Runner verification (tracker #1236)

QA verdict: AC_MET_BUT_NOT_A_PLUS. The run log's QA summary was null, and the issue comment carries only the verdict line, so the runner verified the change against real data:

Mutation-verified: AC-2 — reverted the heading match to ## only; src/lib/workflow/worktree-manager.build-pr-body.test.ts > extractExecSummary (#1223 AC-2) > reads a real exec ending that uses ### Summary failed, along with the ###-stop case (2 failed / 36 passed); restored.

Mutation-verified: AC-1 — emptied PREFIX_TYPE_ALIASES; src/lib/workflow/worktree-manager.test.ts > #1223 buildPRTitle: conventional-commit prefix reuse > maps a \bug(scope):` title to fix without doubling it (this repo's #1232–#1234 shape)` failed (1 failed / 8 passed); restored.

  • Forced QA re-run on 4bb5a71c: AC_MET_BUT_NOT_A_PLUS, 3/3. Its four findings were all fixed in 2bdc0253:
    • (fix_now) After a quality-loop iteration the body imported the first exec pass's summary, which describes code the loop has since changed. It now uses the latest exec pass, and a run-path test drives a two-pass loop and asserts that createPR receives the second pass's output.
    • Fixes owner/repo#<n> and Resolves https://github.com/<owner>/<repo>/issues/<n> passed the sanitizer. Cross-repo and issue-URL references are now rewritten to Refs too.
    • feat!: x dropped its breaking-change !. It's kept now (feat(#N)!: x); this repo's commit validator accepts (!)?. The agent's two tests that asserted the drop were updated to match.

Mutation-verified: AC-2 — reverted the exec-output pick to the first exec result; src/lib/workflow/batch-executor.test.ts > #1223: the PR body gets the latest exec pass's output > hands createPR the second exec pass after a quality-loop iteration, not the first failed (1 failed / 109 passed); restored.

Mutation-verified: AC-3 — narrowed the sanitizer's reference pattern back to #N; src/lib/workflow/worktree-manager.build-pr-body.test.ts > sanitizeImportedClosingKeywords (#1223 AC-3) > rewrites cross-repo and URL references, which close other repos' issues too failed (1 failed / 38 passed); restored.

  • Not changed, pre-existing: qaVerdict (both the PR-body note and bug(state): a successful spec-only run marks the issue ready_for_merge, so a later --phases exec skips it #1233's status) is also taken from the first qa result. After a loop iteration that can be an earlier verdict. That's outside this issue; it's a follow-up candidate.
  • Every test file naming createPR, buildAutomatedPRBody, buildPRTitle or the placeholder text (9 files, 448 tests after the re-QA fixes) passes. tsc and npm run lint are clean.
  • Follow-up candidate, not in scope: 13 of the 20 real exec runs print no summary heading, so their PRs still get the placeholder. The exec skill's orchestrated-mode output could end with a ## Summary section to close that gap.

Test plan

  • npx vitest run src/lib/workflow/worktree-manager.test.ts src/lib/workflow/worktree-manager.build-pr-body.test.ts src/lib/workflow/batch-executor.test.ts — 177 passed
  • npx vitest run src/commands/run.test.ts (existing createPR tests) — 145 passed
  • npm run build — clean
  • npm run lint — clean

Closes #1223
Refs #1236

🤖 Generated with Claude Code

…carries exec's summary

buildPRTitle reuses the issue title's own conventional-commit type with #N replacing the scope, instead of prepending a label-derived feat/fix. buildAutomatedPRBody pulls the last ## Summary section from exec's phase output, capped ~4KB, falling back to the old placeholder when absent. Any closing keyword inside the imported summary is rewritten to Refs #N unconditionally so it can't auto-close an unrelated issue.

Entire-Checkpoint: 0dd704943d7f
Runner check against 20 real exec transcripts (2026-09-30): 3 end with '## Summary', 4 with '### Summary', 13 with none. The ##-only match found 3 of 7; it now finds all 7. Adds the real #1222 exec ending as a fixture.

Entire-Checkpoint: dd372b184809
… prefix

bug is this repo's third most common issue-title prefix (32 of the last 400). The strict conventional-type list left 'fix(#1233): bug(state): ...'. It maps to fix, as a bug label does.

Entire-Checkpoint: 3195cd163dce
@admarble admarble changed the title fix(#1223): sequant run PRs double the conventional prefix in the title and ship a placeholder body fix(#1223): sequant run PR titles reuse the issue's own type, and the body carries exec's summary Sep 30, 2026
…ized; breaking ! kept

Forced re-QA findings: after a quality-loop iteration the body imported the first exec pass's (stale) summary; 'Fixes owner/repo#12' and issue URLs passed the sanitizer; feat!: dropped its breaking marker. Adds a run-path test that createPR receives the last exec output.

Entire-Checkpoint: 057c9d258a92
…d the kept breaking marker

Entire-Checkpoint: db1637952ffa
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(pr): sequant run PRs double the conventional prefix in the title and ship a placeholder body

1 participant