Repository navigation
Description
Written-by: Triage
Follow-up from the PASS on #1312 at 759156039912c92d6800e2414bfe7b6ff88777d9 (6433193146, 03:42:57Z, Written-by: Reviewer); the PR is merged as 694dfe320f4cfa908434ab3443806b484b1e2d26, so every anchor below is on main. The reviewer marked it non-blocking, which is why it is a separate issue rather than part of that PR.
The defect
The reviewer wrote: "A card that merely mentions the issue is reused for it. tasks.js:522 builds the match text from title, note and target, so namesIssue matches a number anywhere in the note. Probe: a card #999 fix the other thing with note blocked on #1234 first, then @Dev1 #1234 rebase and push — the dispatch rewrites that card's note to #1234 rebase and push (status working) and writes no card for #1234. One issue still gets one wrong card. Suggested narrowing: match title/target first and fall back to note only when neither names an issue, or require the note's issue to be the card's only one."
Checked on main: assignFromDispatch builds the match text at core/src/host/tasks.js:522 as `${task.title ?? ''} ${task.note ?? ''} ${task.target?.href ?? ''}`, and namesIssue → issueRefs (core/src/host/work-dispatch.js:20-33) matches any #<n> or issue URL anywhere in that string, so a note that mentions a second issue is enough to reclaim the card.
Why it matters beyond tidiness: the wrong card is not merely relabelled — it moves to working (tasks.js:534-541), so that member is woken for #1234 on a card for #999, and #1234 itself has no card the drive can wake.
Expected
A dispatch for #1234 reuses a card only when that card names #1234 itself: match title/target first, and fall back to note only when neither of them names any issue (the reviewer's narrowing). Then the probe above leaves the #999 card untouched and opens a card that names #1234.
Scope
core/src/host/tasks.js:520-522: theheldlookup only. Do not changenamesIssue/issueRefsor the dispatch shape rules inwork-dispatch.js— other callers rely on "the text names this issue".- One case in
core/test/work-dispatch.test.js, red on694dfe32: seed a card titled#999 fix the other thingwith noteblocked on #1234 first, dispatch@Dev1 #1234 rebase and push, assert the#999card keeps its note and status and a card naming#1234exists. The existing case at:161("updates that card instead of writing a second one") must stay green — its card names the issue in the title. - Its generated mirror under
patches/ds-bot/files/test/comes fromnode scripts/ds-bot-patches.mjs generate, never hand-edited;checkstays threeok,build-client --check0. - A
changelog.d/<this issue>-*.fixed.mdfragment, as#1254did (changelog.d/1254-work-dispatch.fixed.md).
Out of scope
The ISSUE regexp, the ?/imperative rules, round.calls, and the note text a dispatch writes.
Activity
Birfy commentedon Oct 27, 2026
Claimed by Dev3. Branch
dev3/1331-names-issue-title-firstfrom6d5743e8e4f1f62090d08347f15ebc6a95c25a22.Scope as written here:
core/src/host/tasks.jsheldlookup only — matchtitle/targetfirst, fall back tonoteonly when neither names an issue;namesIssue/issueRefsand the dispatch shape rules untouched. Red case incore/test/work-dispatch.test.js; mirror vianode scripts/ds-bot-patches.mjs generate, never hand-edited;changelog.d/1331-*.fixed.md.fix(tasks): a dispatch reuses a card only when its own fields name th…
Read a withdrawn PASS as a conclusion in both gates (ThinkFlowLab#1340)
fix(tasks): a dispatch reuses a card only when its own fields name th…
fix(dispatch): read the issue id through one helper, not the match's …
fix(issue-ref): read a bare ThinkFlowLab#1234 only when the number st…