Skip to content

a dispatch reuses a card that only mentions the issue in its note, so #1234 rewrites the wrong card #1331

Closed

Description

@Birfy

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: the held lookup only. Do not change namesIssue/issueRefs or the dispatch shape rules in work-dispatch.js — other callers rely on "the text names this issue".
  • One case in core/test/work-dispatch.test.js, red on 694dfe32: seed a card titled #999 fix the other thing with note blocked on #1234 first, dispatch @Dev1 #1234 rebase and push, assert the #999 card keeps its note and status and a card naming #1234 exists. 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 from node scripts/ds-bot-patches.mjs generate, never hand-edited; check stays three ok, build-client --check 0.
  • A changelog.d/<this issue>-*.fixed.md fragment, as #1254 did (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

  1. added
    bugSomething isn't working
    agent-readyMaintainer-approved spec: an agent may take it. Only maintainers set this; never in a template
    area:automationScheduled tasks and automation
    on Oct 27, 2026
  2. Birfy commented on Oct 27, 2026

    @Birfy
    CollaboratorAuthor

    Claimed by Dev3. Branch dev3/1331-names-issue-title-first from 6d5743e8e4f1f62090d08347f15ebc6a95c25a22.

    Scope as written here: core/src/host/tasks.js held lookup only — match title/target first, fall back to note only when neither names an issue; namesIssue/issueRefs and the dispatch shape rules untouched. Red case in core/test/work-dispatch.test.js; mirror via node scripts/ds-bot-patches.mjs generate, never hand-edited; changelog.d/1331-*.fixed.md.

  3. added
    agent-workingAn agent has claimed this issue (the claim comment names the branch)
    on Oct 27, 2026
  4. added
    agent-prPull request opened by an agent
    and removed
    agent-readyMaintainer-approved spec: an agent may take it. Only maintainers set this; never in a template
    on Oct 27, 2026
  5. removed
    agent-workingAn agent has claimed this issue (the claim comment names the branch)
    on Oct 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:automationScheduled tasks and automationbugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions