Skip to content

fix(dispatch): a # glued to a colour, version or URL fragment is not an issue reference #1391

Closed

Description

@HugoXK

Written-by: Dev Lead

Symptom

A group line that contains a # glued to a word, a version or a URL fragment is read as an issue reference. The dispatch then writes a card for a phantom issue, and because the card was written the round's speakers is emptied — nobody answers the line.

'@Dev-2 set the accent colour to #3366ff' → a card for issue #3366 is written, and the message goes unanswered.

Reproduction

At base 7b37b88b (main, #1386), importing core/src/shared/issue-ref.js directly and calling issueRefs(line):

line now returns should return
@Dev-2 set the accent colour to #3366ff ["#3366"] []
@Dev-2 fix C#7 codegen ["#7"] []
version in 1.2#3 ["#3"] []
see abc#12 for details ["#12"] []
#1360abc ["#1360"] []
https://example.com/help/#123 ["#123"] []

These four must keep resolving, unchanged:

line must still return
@Dev-2 rebase #1360 ["#1360"]
owner/repo#1360 ["#1360"]
https://github.com/o/r/issues/1360 ["#1360"]
(#1360), #1361. ["#1360", "#1361"]

Cause: ISSUE_REF in core/src/shared/issue-ref.js is #(\d{1,7})(?![0-9]) — it guards only the character after the digits, so # may follow any word character, ., - or /. MENTION (used by cardMentions, and by withoutMentions in work-dispatch.js) carries the same hole on its bare-number branch.

Chain to the user-visible effect

  • core/src/host/work-dispatch.js:29 issueRefPattern(), :32 issue = '#' + (match[1] ?? match[2]) — the phantom id becomes the dispatch's issue.
  • core/src/host/groups.js:826 speakers = dispatch && wrote !== undefined ? [] : lastFirst(...) — once the card is written, the round has no speakers, so the line gets no answer.
  • core/src/host/tasks.js assignFromDispatch — writes the card for the phantom issue and can overwrite a member's card note.

Why it went unnoticed

core/test has zero hits for issueRefs / namesIssue / issueRefPattern: the only test of this matcher was deleted with delivery-view.test.js in #1370. Nothing pins the boundary between "a number named on purpose" and "a # that happens to be in a word".

Expected behaviour

  1. A bare #N counts only when the # is not glued to a word character, ., - or / on the left, and the digits are not followed by a word character on the right.
  2. owner/repo#N keeps its own branch and is tried first — a lookbehind on the bare branch must not kill it (# there follows o).
  3. github.com/<o>/<r>/(issues|pull)/<N> keeps its own branch with the same right-hand rule.
  4. cardMentions / MENTION follows the same three shapes, so a card title carrying #3366ff names no issue either.
  5. A URL fragment (help/#123) stops parsing. The PR body must state this explicitly — it is a deliberate behaviour change, not an oversight.

Scope

core/src/shared/issue-ref.js + a new core/test/issue-ref.test.js; patches/ds-bot/files/** mirrors come from node scripts/ds-bot-patches.mjs generate, never by hand. .github/** untouched. No change to enqueue-guard's reference rules (#1160) and no change to the dispatch protocol itself.

Activity

  1. added
    area:automationScheduled tasks and automation
    bugSomething isn't working
    on Oct 27, 2026
  2. Birfy commented on Oct 27, 2026

    @Birfy
    Collaborator

    Written-by: Triage

    分诊(读物 api.github.com,main d4bd1b9b):类型与区域已打 bug + area:automation。

    没有打 agent-ready:#1392 已经在开 PR(dev2/fix/1391-issue-ref-false-positives,Fixes #1391)。按不变式 agent-ready ⇒ 无 PR,等 PR 关了再补。

  3. added a commit that references this issue on Oct 27, 2026
    06bed53
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