Skip to content

issueCardForTask is dead code after #1370 removed its only consumer #1376

Closed

Description

@Birfy

Leftover from #1370 (merged as ed89efc4), spotted while reviewing that PR. Filing it so the finding is recorded rather than only living in review comments.

Fact. core/src/shared/issue-ref.js:69 still exports issueCardForTask(task, issues). Its only consumer was core/src/client/delivery-view.js:17 (the #1360/#1361 nesting view), and #1370 deleted that whole file. On main today the name appears in exactly three places:

  • core/src/shared/issue-ref.js:69 — the definition
  • patches/ds-bot/files/src/shared/issue-ref.js — the byte-identical patch mirror
  • docs/subsystems/core-host.md:56 — still lists it as one of the four exports of the matcher

Code search over repo:ThinkFlowLab/FlyBot shows no call site and no test: core/test/delivery-view.test.js (deleted) held the only coverage of the nesting path it served.

Why it matters. An exported helper with no consumer and no test rots silently: nothing fails if someone changes it, and the host doc advertises an API the product no longer uses. Either delete issueCardForTask and its line in core-host.md:56 (plus the patches/ds-bot/files/ mirror), or keep it and say in the doc why the matcher still needs it — but as it stands the docs and the code disagree with the tree that shipped.

Not urgent, and not a regression: #1370 is a deliberate removal, this is the tail it left behind.

Discovered while acting as reviewer on #1363 / #1370; no code written for this.

Activity

  1. Birfy commented on Oct 27, 2026

    @Birfy
    CollaboratorAuthor

    Triaged on main 18d567bb (read 2026-10-27T09:45Z). Both halves still stand; only the line numbers moved.

    Duplicate check — none. search is:issue issueCardForTask → this issue only; is:issue in:title "dead code" → this issue only. Not #1392: that merged as 06bed53b and touched core/src/shared/issue-ref.js only in the bare-number regex and its comment (+12/−3). issueCardForTask was not touched by it — it drifted 69 → 78 because #1392 added nine comment lines above ISSUE_REF.

    Still true, verified at 18d567bb (identical at 06bed53b):

    • core/src/shared/issue-ref.js:78 export function issueCardForTask(task, issues), plus the four private pieces only it uses: MENTION :45, mentionOf :47-52, cardMentions :56 (also exported, also imported by nothing), asNumber :72.
    • Code search issueCardForTask → 3 hits: the definition; patches/ds-bot/files/src/shared/issue-ref.js:78 (byte-identical mirror — both blobs are 48316b46); docs/subsystems/core-host.md:56. No call site, no test. cardNamesIssue still has live consumers (core/src/host/work-dispatch.js:8 re-export, core/src/host/tasks.js assignFromDispatch), so this really is only the nesting half.
    • Docs: core-host.md:56 — #1370 already rewrote that sentence, so it no longer claims the board calls issueCardForTask; it now says the hang is not drawn (Remove the delivery board (GitHub repo metrics panel) #1363). What is left is that it still lists the name as one of the matcher's exports. Fix = drop the name and the trailing clause; no new justification sentence needed.

    Expected behaviour after the change. core/src/shared/issue-ref.js exports exactly refOf, issueRefs, namesIssue, cardNamesIssue, issueRefPattern. issueCardForTask, cardMentions, mentionOf, MENTION and asNumber are gone together, and nothing in the tree names any of them.

    Scope — four files and one fragment:

    1. core/src/shared/issue-ref.js — delete :42-100 (the MENTION block through issueCardForTask); keep ISSUE_REF, refOf … cardNamesIssue, issueRefPattern, and the file's header comment.
    2. patches/ds-bot/files/src/shared/issue-ref.js — regenerate with node scripts/ds-bot-patches.mjs generate; never hand-edit. Both mirrors must carry the same blob.
    3. docs/subsystems/core-host.md:56 — remove and \issueCardForTask` from the export list and the closing clause *\issueCardForTask` answers which GitHub issue card a task would hang under; that hang was the delivery board and is not drawn (Remove the delivery board (GitHub repo metrics panel) #1363)*. The rest of the row stays.
    4. core/test/no-delivery-board.test.js — this file is exactly the #1363 "must not come back" guard, so the removal is pinned there: one test asserting read('src/shared/issue-ref.js') does not match /issueCardForTask|cardMentions/, and that no other src/** or test/** file names them (the test already reads files by relative path).
    5. changelog.d/1376.removed.md — one line, same shape as changelog.d/1363.removed.md.

    Acceptance, run at the tip:

    • node --test core/test/no-delivery-board.test.js core/test/issue-ref.test.js core/test/work-dispatch.test.js green, and npm test green.
    • Restoring only step 1 (put the export back, leave the new test in place) turns the new assertion red — that is the proof it pins the removal rather than merely passing.
    • node scripts/ds-bot-patches.mjs generate leaves git diff --stat empty afterwards (mirror and *.patch in sync, no unrelated churn).
    • git grep -n "issueCardForTask\|cardMentions" -- ':!patches/ds-bot/*.patch' | wc -l → 0.

    Labels stay enhancement + area:automation — not a regression: #1370 was a deliberate removal and this is the tail it left.

    Owner: Dev4 (Lead's pick, 09:44Z).

  2. added
    agent-readyMaintainer-approved spec: an agent may take it. Only maintainers set this; never in a template
    on Oct 27, 2026
  3. Birfy commented on Oct 27, 2026

    @Birfy
    CollaboratorAuthor

    Owner correction, per Lead 2026-10-27T09:52Z: Dev2, not Dev4.

    Dev4 takes #1388 (branch dev4/1388-reap-running, in flight since 09:49Z), one pull request each. Everything else in my triage comment above — line numbers 78 on main 18d567bb, the deletion set (issueCardForTask, cardMentions, mentionOf, MENTION, asNumber), the doc line, the no-delivery-board.test.js guard, the changelog.d/1376.removed.md fragment, the regenerate-the-mirror rule and the four acceptance items — stands unchanged.

  4. added
    agent-workingAn agent has claimed this issue (the claim comment names the branch)
    on Oct 27, 2026
  5. Birfy commented on Oct 27, 2026

    @Birfy
    CollaboratorAuthor

    Dev2 claims this: branch dev2/1376-issuecardfortask-dead-code from base 5123a872, draft pull request #1417.

    Deleting issueCardForTask with cardMentions, mentionOf, MENTION and asNumber; cardNamesIssue stays (its callers are work-dispatch.js and tasks.js).

  6. removed
    agent-readyMaintainer-approved spec: an agent may take it. Only maintainers set this; never in a template
    on Oct 27, 2026
  7. 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 automationenhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions