Repository navigation
Closed
Labels
bugSomething isn't workinggraph-2026-09-prereleasePre-release graph before the release after 2.18.0plannedImplementation plan approved
Description
Tier: mechanical Graph: tracker #1236 (wave 3) Found: 2026-09-29, field graph wave 3 (tracker #1203)
Problem. A PR that sequant run opens has two defects that a human has to fix by hand before merging:
- Doubled title prefix.
createPRbuilds${prefix}(#${issueNumber}): ${issueTitle}(src/lib/workflow/worktree-manager.ts:1866) and never strips a conventional-commit prefix that the issue title already has. An issue titledfeat(adopt): …getsfeat(#1209): feat(adopt): …. Seen on feat(#1198): run log records each phase's model and the sequant version #1220 and feat(#1209):init --manifest-onlyandsync --only skills— cheap, documented adoption #1221 (2026-09-29), and long-standing: feat(#740): feat(assess): emitsequant runwhen a global install is present, not alwaysnpx sequant run#743feat(#740): feat(assess): …, feat(#932): fix(run): manifest fallback?? "npm"bypasses resolvePackageManager — pnpm worktrees getnpm ci(surviving #870 site) #1000feat(#932): fix(run): …. The second example also shows the label-derived prefix (feat) contradicting the title's own type (fix). - Placeholder body.
buildAutomatedPRBody(worktree-manager.ts:1740) emits onlyAutomated PR for issue #N.plus the closing line and the QA note. There is no summary of the change, even though exec's own summary is available. Squash-merging such a PR puts the placeholder into the commit message onmain.
Not previously filed (searched "Automated PR", "doubled title", "PR title prefix").
AC
- AC-1: When the issue title starts with a conventional-commit prefix (
type:ortype(scope):), the PR title uses that type, puts#Nwhere the scope was (this repo'stype(#N):convention), and does not repeat the prefix. For examplefeat(adopt): xbecomesfeat(#1209): x, andfix(run): yon an issue labelled enhancement becomesfix(#932): y. Titles without a prefix keep today's label-derived behaviour. Evidence:npx vitest run src/lib/workflow/worktree-manager.test.ts - AC-2: The automated PR body includes a summary of the change taken from the exec phase's output (its
## Summarysection, when present), and still has the closing line and QA note. It falls back to today's text only when no summary is available. Evidence:npx vitest run src/lib/workflow/worktree-manager.build-pr-body.test.ts - AC-3: Closing keywords inside the imported exec summary (
close[sd]?,fix(e[sd])?,resolve[sd]?followed by#N) are rewritten toRefs #N, so only the body's own trailer (Fixes #N, orRefs #Nunder feat(pr): opt out of closing keywords —Refs #Nfor issues a PR should not close #1197'sprIssueLink: "refs") can close an issue. Evidence:npx vitest run src/lib/workflow/worktree-manager.build-pr-body.test.ts, including a summary that containsCloses #279
Graph metadata
- Blocked by: (none)
May touch
src/lib/workflow/worktree-manager.tssrc/lib/workflow/worktree-manager.test.ts,src/lib/workflow/worktree-manager.build-pr-body.test.tssrc/lib/workflow/batch-executor.ts(to pass the exec summary intocreatePR)
Metadata
Metadata
Assignees
Labels
bugSomething isn't workinggraph-2026-09-prereleasePre-release graph before the release after 2.18.0plannedImplementation plan approved
Activity
admarble commentedon Sep 30, 2026
Context for the run (graph tracker #1236, wave 3; re-checked after #1233 lands)
Body changes:
#N:feat(adopt): x→feat(#1209): x. Keeping the scope as well would break this repo'stype(#N):convention.Current code:
src/lib/workflow/worktree-manager.ts:1953-1954:const prefix = isBug ? "fix" : "feat"; const prTitle = \${prefix}(#${issueNumber}): ${issueTitle}`;`worktree-manager.ts:1813:buildAutomatedPRBody(issueNumber, opts)emits the placeholderAutomated PR for issue #N., then the closing line (Fixes #N, orRefs #Nunder feat(pr): opt out of closing keywords —Refs #Nfor issues a PR should not close #1197'slinkMode: "refs"), then the QA note.src/lib/workflow/batch-executor.ts(thecreatePR(call, about:2343onmain) passes positional args. The exec phase's text is onPhaseResult.output(phaseResults.find(p => p.phase === "exec")?.output).AC-1, the title: match a leading
type(scope)!?:ortype:using the conventional-commit types. Take the type from the title, even when the labels disagree (fix(run): yon an enhancement →fix(#932): y). Titles without a prefix keep today's label-derivedfeat/fix. Don't match mid-title colons (Docs: fooisn't a type; keep the list to real types: feat, fix, docs, chore, refactor, test, perf, build, ci, style, revert).AC-2, the body: take the last
## Summarysection from exec's output (up to the next##heading or the end), trimmed. Cap its length (for example 4 KB) so a runaway section can't bloat the body. When there's no summary, keep today's placeholder. Keep the closing line and the QA note exactly as they are now. Thread the summary throughcreatePRas an options field, not another positional arg. The signature already has 11 positional parameters.AC-3, why it's needed: GitHub reads a closing keyword anywhere in a PR body. Agent-written summaries do contain lines like "Close #279 with the AC mapping comment after this merges", and that one auto-closed an issue in a downstream repo (the case behind #1197). Imported summary text must never close anything. Rewrite
\b(close[sd]?|fix(e[sd])?|resolve[sd]?)\s*:?\s+#(\d+)(case-insensitive) toRefs #$Nin the imported text only, never in the trailer. Test it with a summary containingCloses #279and one containingfixes #1223(the issue itself: the trailer still closes it, and the summary line must not).Standard block:
npm testin exec or in qa. This applies to the qa phase as well as exec. Run targeted suites in the foreground with a timeout:timeout 600 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. Global setup runsnpm run buildfirst.failedTeststarts with the test file path.Closes #1223. UseRefsonly for the tracker, tracker(graph): pre-release fixes before the next release after 2.18.0 (4 nodes) #1236.### Fixedentry under[Unreleased].admarble commentedon Sep 30, 2026
Complexity: Standard (3 ACs, 1 directory)
AC Quality Check
All three AC are single-line, each carries a concrete
Evidence:command, and AC-1/AC-3 include literal before/after examples. No vague/unmeasurable/open-ended language detected.Evidence:commands point at whole test files (worktree-manager.test.ts,worktree-manager.build-pr-body.test.ts) that currently pass — they only gate the fix once exec adds the new assertions those ACs describe; running the unchanged file today proves nothing. Flagging so exec doesn't mistake "file exists and passes" for AC coverage.Scope Assessment
Non-Goals: Not present in the issue body. Scope is implicitly bounded by the graph tracker (#1236 wave 3) and the "May touch" file list, so this isn't blocking, but consider adding one if a follow-up broadens it.
src/lib/workflow/)Verdict: ✅ SCOPE_OK
Conflict Risk Analysis
A worktree for #1223 already exists (
feature/1223-fix-pr-...) at the same commit asmain— no work started yet, safe to reuse. Two in-flight worktrees touchworktree-manager.tsbut in disjoint regions: #1199 editsresolveWorktreeRoot/ensureWorktree(s)(~lines 722–1150) and #1222 editsshouldPreserveWorktree/shutdown logic (~lines 396–480); this issue's target (createPR/buildAutomatedPRBody, ~1737–1970) doesn't overlap either. #1233 editsbatch-executor.tsaround theqaVerdict/finalStatusblock (~2233–2290), adjacent to but not overlapping this issue'screatePR(call site (~2360–2380). Low conflict risk; no action needed beyond normal merge order.Acceptance Criteria
AC-1: PR title takes the issue title's conventional-commit type,
#Nreplaces the scope, never doubledVerification: Unit Test
Scenario: Given issue title
feat(adopt): x→ WhencreatePRbuilds the title → Thenfeat(#1209): x(type from the title wins over the label-derived prefix; titles without a recognizedtype(scope)!?:/type:prefix keep today'sisBug ? "fix" : "feat"behavior).Assumptions: Type list is limited to real conventional-commit types (feat, fix, docs, chore, refactor, test, perf, build, ci, style, revert) so
Docs: foo(capitalized, not a real prefix) isn't mistaken for one.createPRitself isn't unit-testable today (shells out togh/git) — extract the title-building logic into a new pure, exported function (parallel tobuildAutomatedPRBody) so AC-1 is testable without mocking process calls.AC-2: PR body carries exec's own
## Summary, falling back to today's placeholderVerification: Unit Test
Scenario: Given exec's captured
PhaseResult.outputcontains a## Summarysection → WhenbuildAutomatedPRBodyruns → Then the body's## Summaryuses that text (trimmed, capped ~4KB) instead ofAutomated PR for issue #N.; closing line and QA note are unchanged. Given no## Summaryin the output → Then today's placeholder text is kept.Assumptions: "Last"
## Summarysection wins if exec's output contains more than one (e.g. a template example earlier in the transcript). Runs up to the next##heading or end of string.AC-3: Closing keywords inside the imported summary never auto-close an issue
Verification: Unit Test
Scenario: Given an imported summary containing
Closes #279→ When the body is built (regardless oflinkMode) → Then it readsRefs #279. Given a summary containingfixes #1223(the PR's own issue) → Then that line also becomesRefs #1223, while the body's own trailer (Fixes #1223/Refs #1223under #1197) still carries the real close.Assumptions: This is a new, unconditional sanitizer scoped to any issue number (
#(\d+)), applied only to the imported summary text — distinct from the existingrewriteClosingKeywordsToRefs(body, issueNumber), which stays scoped to the currentissueNumberand gated onlinkMode === "refs"(#1197, unchanged). Reusing the existing function here would missCloses #279since it only ever rewrites references to the PR's own issue.Implementation Plan
Phase 1: Title construction (AC-1)
worktree-manager.ts, add aCONVENTIONAL_COMMIT_TYPESlist and an exported pure function (e.g.buildPRTitle(issueTitle, issueNumber, labels)) that matches a leading^(type)(\([^)]*\))?!?:\s*against the real types, strips it, and emitstype(#N): <rest>; falls back toisBug ? "fix" : "feat"when no match.createPR's inlineprefix/prTitlelines for a call to the new function.Phase 2: Body summary + sanitizer (AC-2, AC-3)
worktree-manager.ts, addextractExecSummary(execOutput: string): string | undefined(last## Summary→ next##/EOF, trimmed, capped) and a separate unconditional sanitizer (e.g.sanitizeImportedClosingKeywords) implementing\b(close[sd]?|fix(e[sd])?|resolve[sd]?)\s*:?\s+#(\d+)→Refs #$2, applied to the extracted summary only.buildAutomatedPRBody'soptswithexecOutput?: string; whenextractExecSummaryreturns text, sanitize it and use it in place of the placeholder line.Phase 3: Wiring (AC-2)
batch-executor.ts(~line 2364), readphaseResults.find(p => p.phase === "exec")?.outputand pass it throughcreatePRas a trailing options object (e.g.opts?: { execOutput?: string }), not another positional argument —createPRalready has 11.Phase 4: Tests, CHANGELOG
worktree-manager.test.ts; AC-2/AC-3 cases (includingCloses #279andfixes #1223) toworktree-manager.build-pr-body.test.ts. Runtimeout 600 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— no fullnpm test.### Fixedentry under[Unreleased].Design Review
worktree-manager.ts, alongsidebuildAutomatedPRBody/resolvePrLinkMode— same module already owns PR title/body construction and is already structured for pure, testable helpers.optsobject tocreatePRfor the new field rather than refactoring all 11 existing positional params into an options object. Rejected the full refactor: it's a single call site, and reshaping every existing param is unrelated churn for a mechanical-tier fix — not an architectural decision, so no ADR.buildAutomatedPRBody's existing shape: pure,@internal Exported for testinghelpers thatcreatePRcomposes, keeping thegh/git-shelling code thin.rewriteClosingKeywordsToRefs?" — because that one is scoped to the current issue number and gated onlinkMode; reusing it would silently fail theCloses #279case AC-3 exists to cover.Feature Quality Planning
All standard checks pass. Notable items:
Docs: foo) and multi-word titles with colons elsewhere in them.Open Questions
feat!:with no scope)? — Recommendation: yes, treat!as optional independent of scope, matching conventional-commits generally. Impact if wrong: a raretype!:title keeps the label-derived prefix instead of using its own type — low severity, easy follow-up.Recommended Workflow
Phases: exec → qa
Quality Loop: disabled
Reasoning: Mechanical-tier, fully-specified fix (owner's comment already pins exact line numbers, regexes, and test files) with SCOPE_OK and no design ambiguity worth a quality-loop retry.
testgenskipped —bug-only label, and the owner's comment already names the exact test files and cases; stub generation would just be redone by exec.Label Review
Current: bug, graph-2026-09-prerelease
Recommended: bug, graph-2026-09-prerelease, planned
Reason: Standard post-spec marker; no other label change warranted — not
ui/frontend(no browser test), notcomplex/refactor(mechanical fix).Quality Loop: Won't auto-enable — SCOPE_OK, no complexity trigger.
→
gh issue edit 1223 --add-label planned--- DRAFT GITHUB ISSUE COMMENT (PLAN) ---
Plan for #1223
AC checklist
#Nreplacing the scope, never doubled — extract a purebuildPRTitlehelper so it's testable without mockinggh/git.## Summarypulls from exec'sPhaseResult.output(last## Summarysection, capped ~4KB), falling back to today's placeholder.#Ninside the imported summary toRefs #N— distinct from the existing issue-scoped,linkMode-gatedrewriteClosingKeywordsToRefs. Covers both an unrelated issue (Closes #279) and the PR's own issue (fixes #1223) appearing inside the summary text.Implementation plan: title-building in
worktree-manager.ts(newbuildPRTitle+ type list) → summary extraction + sanitizer (newextractExecSummary/sanitizeImportedClosingKeywords, wired intobuildAutomatedPRBody) → thread exec output throughcreatePRvia a trailing options object inbatch-executor.ts(not another positional arg) → tests inworktree-manager.test.ts/worktree-manager.build-pr-body.test.ts→ CHANGELOG### Fixedentry.Key decision: new options object on
createPRfor the exec-summary field, instead of refactoring its existing 11 positional params — scoped to this fix, not a broader signature cleanup.Open question: should the title regex also accept a scope-less breaking marker (
feat!:)? Recommend yes; low-severity if deferred.Testing:
timeout 600 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(no fullnpm test, per graph tracker #1236 standard block).Workflow: exec → qa, quality loop disabled.
admarble commentedon Sep 30, 2026
QA Verdict: AC_MET_BUT_NOT_A_PLUS
fix(#1223): read ### Summary as well as ## Summary from exec output
fix(#1223): a bug(scope): issue title becomes fix(#N):, not a doubled…
docs(#1223): changelog covers the bug alias and ### Summary
admarble commentedon Sep 30, 2026
QA Verdict: AC_MET_BUT_NOT_A_PLUS
AC coverage: 3/3 met
Gaps:
fix(#1223): latest exec pass feeds the PR body; cross-repo refs sanit…
docs(#1223): changelog covers latest-pass summary, cross-repo refs an…
docs(run,abort): --no-pr help and PR-creation page match the after-ex…