Repository navigation
Description
What happens
Two producers name the feature branch for an issue, and they disagree once the title slug exceeds 45 characters:
| Producer | Rule | Example for #1123 |
|---|---|---|
templates/scripts/new-feature.sh:84-90 (standalone /exec, /fullsolve) |
slugify the title, then cut the whole branch at 58 chars | feature/1123-fix-init-yes-init-replaces-a-user-modified-agen |
src/lib/workflow/worktree-manager.ts slugify() (sequant run) |
slugify the title, cut the slug at 50 chars | feature/1123-fix-init-yes-init-replaces-a-user-modified-agents- |
ensureWorktree looks an existing branch up by exact name (findExistingWorktree(branch)), so a branch created by the script for a long-titled issue is not found by a later sequant run phase, which creates a second feature/1123-… branch. sequant worktree resolve keys on the issue number and is unaffected, so the two branches then resolve as WORKTREE_AMBIGUOUS.
Evidence
Measured during #1136's QA (2026-09-24): recomputing the branch name from the issue title for the 10 most recently merged feature/ PRs gives 0/10 matches under the script's rule and 10/10 under slugify() — every recent branch came from sequant run. The #1136 in-place block was corrected to the slugify() rule for the same reason (PR #1139, commit 283560c1→7f6d0ba1), and slugify is now exported @internal so a gate can assert parity.
Expected
One rule. new-feature.sh (both templates/scripts/ and the scripts/ symlink) cuts the slug at 50 like slugify(), with a gate test that compares the script's output to slugify() for a title whose slug exceeds 50 characters, mutation-verified. Existing worktrees are unaffected; only new branches for long titles change.
Related
#1136 (the in-place block already uses the slugify() rule) · #899 (resolver keys on issue number) · #1123 (the branch that surfaced it)
Acceptance criteria
Tier: mechanical · Graph: 2026-09-w3 (docs/internal/graph-2026-09-w3/issue-graph.md)
- AC-1:
new-feature.shderives the branch asfeature/<N>-<slug>where slug is exactlyslugify(title)— lowercase, runs of non-[a-z0-9]→-, strip leading/trailing-, then cut at 50 with no trailing-dash strip afterwards — and the whole-branch cut at 58 is removed — Verify:npx vitest run src/lib/workflow/__tests__/new-feature-branch-parity.test.ts - AC-2: a gate test executes the script's naming logic in a real bash subprocess (not a regex-literal comparison, PM_CONFIG.yarn.ciInstall uses Yarn 2+
--immutable, which Yarn 1 rejects — no berry detection exists #871) and compares it to exportedslugify()for a title whose slug exceeds 50 chars with-at position 50, a short title, and a title with leading punctuation — Verify:npx vitest run src/lib/workflow/__tests__/new-feature-branch-parity.test.ts - AC-3: the PR body carries a
SEQUANT_MUTATIONmarker for AC-2 (mutation: restorecut -c1-58;failedTestbegins with the test file path) — Verify:/qa§6i resolves the marker
Exec decides the network-free entry point for the test (e.g. a branch_name_for function behind a --print-branch <N> <title> flag); the AC only requires real bash execution.
Activity
admarble commentedon Sep 25, 2026
Runner context (graph 2026-09-w3,
docs/internal/graph-2026-09-w3/issue-graph.md, PR #1154) — these rules apply to the spec, exec AND qa phases:npm test. Verify each AC with its own verify command and run only the named test files. The runner runs the full suite once per PR, serially — three phase agents share this machine and a full-suite call inside a phase can hit the 30-minute no-progress wall.timeout; neverrun_in_background.<!-- SEQUANT_MUTATION: {...} -->marker needsfailedTestto start with the test file path (src/.../x.test.ts > describe > case), or /qa §6i floors it to AC_NOT_MET.[Unreleased]line.admarble commentedon Sep 25, 2026
Complexity: Standard (3 ACs, 3 directories)
AC Quality Check
No vague/unmeasurable patterns. Two notes: (1) AC-1/AC-2 name
src/lib/workflow/__tests__/new-feature-branch-parity.test.ts, but that directory does not exist. Workflow tests here are co-located (src/lib/workflow/*.test.ts) and the script's tests live in root__tests__/*.integration.test.ts. The path is fine to create as written. (2) A file without.integration.in its name runs in theunitproject (5s timeout, #842). Bash subprocesses are fast, but a.integration.name is safer, and it would change the Verify path in AC-1/AC-2. See Open Questions.Scope Assessment
Non-Goals: Existing worktrees are unaffected; only new branches for long titles change (from the issue body).
templates/scripts,src/lib/workflow, PR body)Verdict: ✅ SCOPE_OK
Acceptance Criteria
AC-1: new-feature.sh derives
feature/<N>-<slug>exactly asslugify()Verification: Integration Test
Scenario: Given a title whose slug is >50 chars → When the script names the branch → Then the branch equals
feature/<N>-+slugify(title)(cut at 50, no trailing-dash strip afterwards), and the 58-char whole-branch cut is gone.Assumptions:
scripts/new-feature.shis a symlink totemplates/scripts/new-feature.sh(verified), so one edit covers both.AC-2: gate test runs the script's naming logic in real bash and compares to
slugify()Verification: Integration Test
Scenario: Given three titles (slug >50 with
-at position 50, short, leading punctuation) → When bash computes the branch and TS callsslugify()→ Then outputs are equal for each.Assumptions:
slugifyis exported (worktree-manager.ts:112, verified).AC-3: PR body carries a SEQUANT_MUTATION marker for AC-2
Verification: Manual Test (
/qa§6i resolves the marker)Scenario: Given the marker names mutation "restore
cut -c1-58" → When /qa parses it → ThenfailedTeststarts with the test file path and resolves.Implementation Plan
Phase 1: Script
templates/scripts/new-feature.sh:84-90, extract abranch_name_for <N> <title>function that returnsfeature/<N>-<slug>. The slug pipeline stays as is (tr,sedcollapse, strip lead/trail-), thencut -c1-50on the slug only. Delete the 58-char branch cut and its stale comment.--print-branch <N> <title>, handled in the arg loop before thegh, auth and fetch checks. It prints the branch and exits 0. The function must be defined above the arg loop, or the flag handler must call it after the definition.cutat 50 may leave a trailing-, which is intentional parity withslugify(). Do not re-strip.cut -con multibyte input. The slug is ASCII-only aftersed, so this is a non-issue.Phase 2: Gate test
src/lib/workflow/__tests__/new-feature-branch-parity.test.ts. For each of the 3 titles, spawnbash templates/scripts/new-feature.sh --print-branch <N> <title>viaspawnSyncand compare stdout tofeature/<N>-${slugify(title)}. Importslugifyfrom../worktree-manager.js.cut -c1-58on the branch, confirm only the long-slug case fails, restore. Commit before mutating. Record theMutation-verified:line plus theSEQUANT_MUTATIONmarker in the PR body.failedTestmust besrc/lib/workflow/__tests__/new-feature-branch-parity.test.ts > <describe> > <case>.[Unreleased]CHANGELOG line. Stop at the PR, do not merge.Design Review
slugify(), which is the canonical source (sequant runproduced 10/10 recent branches).slugify()match the script (would rename branches for every existing long-titled issue and breakfindExistingWorktreelookups for them).exec/SKILL.md:234already applies the 50-slug rule. Its slug pipeline already strips before cutting, so it matchesslugify()and needs no change.slugify?" It runs in consumer repos with no sequantdistguaranteed. Parity is enforced by the gate test instead.Feature Quality Planning
All standard checks pass. Notable items:
feature/1145-bug-worktree-new-feature-sh-and-sequant-run-derivealready exists (created at aa865de). Its name is 58-cut style and is left as is; the fix only affects new branches.exec/SKILL.mdin-place block,slugify()) already use the 50 rule. No other 58-char cut was found in the skills, docs or README (grep).Rule Touchpoints
Behavior-rule detector not run: the ACs do not use ≥2 of the rule keywords, so the touchpoints section is omitted.
Open Questions
.integration.? — Recommendation: keep the path exactly as the AC states (the AC pins it), and set an explicittestTimeoutinside the file if it runs inunit. Impact if wrong: a 5s flake under full-suite load (fix(test): tsx-spawning integration tests blow vitest's 5s default — phase-registry should use the prebuilt dist like its five siblings #842).--print-branchinterface — Recommendation: as in the plan, since the AC leaves this to exec.Recommended Workflow
Phases: exec → qa
Quality Loop: disabled
Reasoning: Small mechanical bug fix, one script and one gate test. The Testgen skip rule for bug-only issues applies. The runner comment says qa must not run the full
npm test.Label Review
Current: bug · Recommended: bug, planned · Quality Loop: won't auto-enable.
admarble commentedon Sep 25, 2026
QA Review for Issue #1145 (Simple Fix)
Verdict: AC_NOT_MET — all three ACs are met, but the diff turns the required
canarycheck red. Settled mechanically: canary is 4/4 green atorigin/mainand 2/4 red atf2f9dbf4in the same worktree, and reverting onlytemplates/scripts/new-feature.sh(keeping the test + CHANGELOG) makes it green again.AC Coverage
branch_name_forcuts the slug at 50; the whole-branchcut -c1-58is gone (grep -rn 'c1-58|-gt 58'→ no hits repo-wide). Differential over 100 real issue titles (97 hit the 50-cap): 0 mismatches vs exportedslugify(). The issue's own example reproduces:feature/1123-fix-init-yes-init-replaces-a-user-modified-agents-.new-feature-branch-parity.test.tsspawns realbash(spawnSync, not a regex-literal compare, #871) for all three required cases; a 4th test pins that the long fixture really exceeds 50 with-at index 49.npx vitest run …new-feature-branch-parity.test.ts→ 4 passed.parseMutationMarkersclassifies the PR-body markervalid(failedTestbegins with the test file path).Regression — required
canarycheck (blocking)Live ruleset
CCrequirestestandcanary.Failure:
sequant syncpredictsscripts/dev/new-feature.shwill be rewritten but does not rewrite it, so the fixture is left permanently drifted and the nextsyncexits 1 withVersion current, but 1 file(s) differ from bundled content.Root cause is #1122 (
update/init/syncdon't write through an existing symlink at a sequant-owned destination) —scripts/dev/*.shis synced as symlinks (templates.ts:1111). This PR is simply the first change totemplates/scripts/new-feature.shcontent since the previous minor release, so it is the first to expose it. The defect is not in this diff's logic, but the red required check is caused by this diff.Remediation (either): land #1122 first and rebase, or fix the writer here.
Quality Metrics
any)Trust-Boundary Check
Finding: Clean — issue body contains no HTML comments and no agent-directed instruction; the diff implements only product requirements.
Status: Clean
Behavior-Rule Survival Check
Detector not triggered for AC-1/AC-2. Manual survival grep: no
cut -c1-58/-gt 58anywhere. All three exec SKILL.md mirrors already carry the cut-at-50 rule (#1136).Status: Clean
Declared-Evidence Execution
npx vitest run src/lib/workflow/__tests__/new-feature-branch-parity.test.ts/qa§6i marker resolutionvalidStatus: Complete
Mutation Verification
AC-2→src/lib/workflow/__tests__/new-feature-branch-parity.test.ts > new-feature.sh branch name parity with slugify() > long slug with dash at position 50— Verified. The gate also fails under the original bug (whole-branch cut at 58 yields a 45-char slug for #1123), not just the recorded mutation.Status: Verified
CHANGELOG Verification
Entry present under
[Unreleased] → Fixedwith(#1145). Result: met.Other findings (non-blocking)
templates/scripts/changed with no/verifyevidence and no approved override. Would floor atAC_MET_BUT_NOT_A_PLUSon its own.scripts/ruleset-main.sh --printlists onlytest; the liveCCruleset requirestestandcanary. The checked-in ruleset script has drifted from what is enforced — worth a follow-up.--print-branchis undocumented in the script's usage header, and--print-branchwith missing args printsfeature/-instead of erroring. The early-exit sits before argument validation.Risk Assessment
mainred on a required check, which per CLAUDE.md's Red-main rule blocks every other PR.--print-branchpath of the script (network + worktree creation) is unexercised; the parity test covers naming only.exec/SKILL.mdacross all three mirrors — already on the cut-at-50 rule (feat(exec/qa): explicit in-place checkout mode — run a phase on a branch in the current clone without creating or resolving a worktree #1136), verified identical. No other producer of afeature/<N>-<slug>name found.BRANCH_NAME=$(branch_name_for …)); no other truncation in the file.Next Steps
canarygoes green, then rebase this branch. Re-runnpx vitest run --project canarylocally before pushing —npm testexcludes thecanaryproject, which is why the PR body's "fullnpm testpasses" did not catch this.--print-branchin the usage header and make it error on missing args.admarble commentedon Sep 25, 2026
QA Verdict: AC_NOT_MET
admarble commentedon Sep 25, 2026
Runner verification (PR #1156). All 3 ACs pass per QA. The required
canarycheck fails on this branch, and I reproduced it:npx vitest run --project canaryat f2f9dbf → 2 failed | 2 passed (QA: base passes 4/4, and reverting onlytemplates/scripts/new-feature.shrestores green). The cause is #1122. The canary fixture'sscripts/dev/new-feature.shis a symlink, andsyncdoesn't write through it, so the fixture drifts once the template changes.New graph edge: #1145 must merge after #1122. When #1122 lands, merge
maininto this branch and re-run the canary.docs(#1153): graph w3 execution log — #1145 blocked by #1122, #1153 h…
admarble commentedon Sep 25, 2026
Correction to the runner comment above: this is not blocked by #1122. I merged #1122's branch (
aef6c9db) into this one and rannpx vitest run --project canary: the same 2 failures. The actual cause is #1159.syncpointsscripts/dev/new-feature.shat the older copy in the project'snode_modules, following the #991 design, while the drift check compares it against the running bundle. I reproduced this against a real[email protected]project.docs(#1159): graph w3 — #1145 blocked by #1159 not #1122; #1160 filed
fix(#1145): new-feature.sh derives the branch name with the slugify()…
docs(#1153): graph 2026-09-w3 plan for #1145, #1153, #1122 and #1141 (#…