Skip to content

chore(issue-ref): drop the dead delivery-board nesting helper (#1376) - #1417

Open
Birfy wants to merge 1 commit into
mainfrom
dev2/1376-issuecardfortask-dead-code
Open

Birfy wants to merge 1 commit into
mainfrom
dev2/1376-issuecardfortask-dead-code

Conversation

@Birfy

@Birfy Birfy commented Oct 27, 2026 •

Copy link
Copy Markdown
Collaborator

Fixes #1376
Owner: Dev2
Reviewer: Reviewer
Written-by: Dev-2
Tip SHA: 68cfd97a95fb4767f6efa9abf0e350fba1cde07f
Base: 5123a872 (main, #1399)
Tree: 8f7ee402ad33f0e87a86ab14e8faca21d1eadfc9

Reproduce

At base 5123a872, grep -rn "issueCardForTask" (excluding patches/ds-bot/*.patch, which never held it) finds exactly three places and no fourth: the export at core/src/shared/issue-ref.js:78, its byte-identical mirror patches/ds-bot/files/src/shared/issue-ref.js:78, and the export list in docs/subsystems/core-host.md:56. No call site, no test: the reader was core/src/client/delivery-view.js, deleted with the delivery board (#1363/#1370).

One place the triage list did not name: core/test/issue-ref.test.js:7 imported cardMentions and asserted it twice (:51-57), so the private half could not go without that file. That is why this diff is eight files rather than five.

What changed

issue-ref.js now exports exactly refOf, issueRefs, namesIssue, cardNamesIssue and issueRefPattern. Deleted: issueCardForTask, and the private half only it used — cardMentions (exported, imported by nothing after the test edit), mentionOf, MENTION, asNumber. cardNamesIssue is untouched: work-dispatch.js re-exports it and tasks.js assignFromDispatch calls it.

  • core/test/issue-ref.test.js: dropped the cardMentions import and the one test that covered it. The seven accepted/rejected shapes and namesIssue stay.
  • core/test/no-delivery-board.test.js: the Remove the delivery board (GitHub repo metrics panel) #1363 "must not come back" guard now also pins this removal — the matcher may not name issueCardForTask|cardMentions, and no other file under core/src or core/test may either (its own regex is skipped by path).
  • docs/subsystems/core-host.md:56: the export list drops the name and the closing clause about the removed hang is gone; no new justification sentence.
  • patches/ds-bot/files/src/shared/issue-ref.js, .../test/issue-ref.test.js, .../test/no-delivery-board.test.js: byte-identical mirrors (cmp clean, and check's third line below).
  • changelog.d/1376.removed.md: one paragraph, same shape as 1363.removed.md.

What I ran

  • node scripts/ds-bot-patches.mjs check at this tree — exit 0, three lines:
skipped pin (no git): the tree hash cannot be computed here
ok   10 patches apply cleanly in order
ok   core/ equals ds-bot/ + patches/ds-bot/
  • cd core && TZ=UTC node --import ./test/harness-resolve.mjs --test test/no-delivery-board.test.js test/issue-ref.test.js test/work-dispatch.test.js — 37/37 pass (4 + 14 + 19), 0.64 s.
  • node .github/scripts/changelog.mjs check — 15 fragment(s) in changelog.d/ are well formed.

Red without the source change

Restoring only core/src/shared/issue-ref.js at the base (implementation back, the new guard kept) turns the guard red:

not ok 4 - #1376: the dead nesting helper is gone and nothing names it
  error: The input was expected to not match the regular expression /issueCardForTask|cardMentions/

Second knife, on the mirrors: reverting only patches/ds-bot/files/src/shared/issue-ref.js to its base blob makes check red with core/src/shared/issue-ref.js: differs from ds-bot/ + patches — so the third check line is what holds the mirror to the source, not a hand copy that happens to look right.

Not run

  • generate: this sandbox has no git, and the script states generate needs it (it asks git for the diff). The two mirrors are byte-identical copies of the files they mirror (cmp exits 0), which is what generate writes for files/; no *.patch names issue-ref.js, so nothing else could churn. check's third line is the machine proof.
  • npm run verify / core/scripts/lint.mjs: no oxlint on this box. node core/scripts/build-client.mjs --check: needs esbuild, not installed here; no client file is touched and core/client.js never named either deleted helper (grep), so there is nothing to rebuild.
  • node core/scripts/check-arch-docs.mjs: it diffs against origin/main and this box has no git; the doc change is inside the row it already owns.
  • Full core suite: covered by CI tests-ok at this tip rather than locally.

Risk

Low and local. The module is shared, but only by removing exports nothing imports: work-dispatch.js and tasks.js keep cardNamesIssue, and the dispatch protocol and card shape are unchanged. The one real coverage loss is the two cardMentions assertions in issue-ref.test.js, which asserted a helper that no longer exists; the removal itself is now pinned by the guard, and issueRefs/namesIssue coverage (the seven accepted shapes, six rejected, namesIssue) is untouched. No *.patch hunk, no policy file, no client bundle. Reverting means restoring the block in issue-ref.js, the sentence in core-host.md, the two assertions, and dropping the guard.

Checkpoint

{"pr":1417,"claim":"Dev2","issue":1376,"summary":"`issueCardForTask` and the private half only it used (cardMentions, mentionOf, MENTION, asNumber) are deleted: the delivery board was the only reader and #1370 removed it. The matcher now exports refOf, issueRefs, namesIssue, cardNamesIssue and issueRefPattern; cardNamesIssue keeps its callers in work-dispatch.js and tasks.js. core-host.md no longer lists the dead export, the patches/ds-bot files mirrors follow byte for byte, and the #1363 guard now pins the names as gone.","files":["core/src/shared/issue-ref.js","core/test/issue-ref.test.js","core/test/no-delivery-board.test.js","docs/subsystems/core-host.md","patches/ds-bot/files/src/shared/issue-ref.js","patches/ds-bot/files/test/issue-ref.test.js","patches/ds-bot/files/test/no-delivery-board.test.js","changelog.d/1376.removed.md"],"checks":{"ran":"ds-bot-patches check; node --test no-delivery-board/issue-ref/work-dispatch (37/37); changelog.mjs check","result":"green","at":"68cfd97a95fb4767f6efa9abf0e350fba1cde07f"},"next":"none — ready for review"}

issueCardForTask and the private half only it used (cardMentions, mentionOf,
MENTION, asNumber) went with the delivery board in #1363/#1370. cardNamesIssue
keeps its callers in work-dispatch.js and tasks.js. core-host.md no longer lists
the dead export, and the #1363 guard now pins the removal.
@Birfy Birfy added the agent-pr Pull request opened by an agent label Oct 27, 2026
@Birfy
Birfy marked this pull request as ready for review October 27, 2026 10:29
@Birfy

Birfy commented Oct 27, 2026

Copy link
Copy Markdown
Collaborator Author

Verdict: PASS at 68cfd97
Written-by: Reviewer
Attestation: 68cfd97 role=Reviewer

写这条前现读:head 68cfd97a…、base 7a4fa61e…、1 commit、8 文件 +38/−141、0 条评论 0 条 review(该 tip 上还没有任何 Verdict)、labels agent-pr;17 条 run 全 completed = 15 success + 1 cancelled(judge #122127282103,重复件)+ 1 enqueue-guard failure(#122127356277,10:06:07Z,缺 PASS 的常规红)。树对得上:commit tree 8f7ee402ad33f0e87a86ab14e8faca21d1eadfc9 = 正文 Tree:,Tip SHA = head,mergeable_state: unstable 就是那条 guard 红,不是代码问题。

删除集是对的,保留集也没动。base 的导出是 refOf/issueRefs/namesIssue/cardNamesIssue/issueRefPattern + cardMentions + issueCardForTask;tip 只剩前五个,cardNamesIssue 那一段 diff 里逐字未动。(mentionOf/MENTION/asNumber 本来就是私有,随 issueCardForTask 一起消失。)读者还在:core/src/host/work-dispatch.js:8 重导出 cardNamesIssue,core/src/host/tasks.js:21,522 的 assignFromDispatch 照旧调用;core/test/work-dispatch.test.js:12,190-193 仍从 work-dispatch 导入并通过。

无残留引用:在 tip 整树上 grep issueCardForTask|cardMentions,core/src、core/test、core/client.js、plugins/、scripts/、dev/、docs/ 里只剩两处命中——新守卫测试自己(core/test/no-delivery-board.test.js:44-54,按路径跳过),以及它的镜像 patches/ds-bot/files/test/no-delivery-board.test.js(不在扫描范围)。core/client.js 从来没出现这两个名字,所以没有生成物要重建。

红先绿后(自己跑,不引正文数字):只把 core/src/shared/issue-ref.js 还原成 base、其余留 tip,no-delivery-board.test.js 恰好红在第 4 条(#1376: the dead nesting helper is gone and nothing names it,assert.doesNotMatch 命中),# pass 3 / # fail 1;还原后同命令 4/4、exit 0。再做一次反证,确认这条守卫不是空扫描:往 core/src/scratch-probe.js 里只写一个 cardMentions → 又是 not ok 4。base 树本身 no-delivery-board + issue-ref 是 18/18 绿(3 + 15),tip 上三件套 no-delivery-board + issue-ref + work-dispatch 是 37/37 绿(4 + 14 + 19),与正文自报一致。

镜像与生成物:三份 patches/ds-bot/files/** 与对应 core/ 文件 cmp 逐字节相同;ds-bot-patches check 三行全过、exit 0——这台机器有 git,所以 pin 那行不是 skip,是真的核了:ok ds-bot/ = Fei2411/DeepSeek-Bot@2b10c70 (tree 5834c00, v0.1.5) / ok 10 patches apply cleanly in order / ok core/ equals ds-bot/ + patches/ds-bot/。正文里写的 skipped pin (no git) 是作者沙箱的读数,不是本树的读数;两种环境下第三行都成立。generate 未跑(本单不需要:没有 *.patch 命中 issue-ref.js,files/ 两份镜像就是 cmp 同源,第三行才是机器证明)。

附带面:changelog.d/1376.removed.md 在册,changelog.mjs check → 15 fragment(s) in changelog.d/ are well formed,形状与 1363.removed.md 一致;docs/subsystems/core-host.md:56 只删了名字和末句「answers which GitHub issue card…」,没加新的辩解句。

两条低,不阻断:

  • 覆盖损失是真实的、也已披露:issue-ref.test.js 里那两条 cardMentions 断言(owner/repo#1360 带 repo、#3366ff 不算)随助手一起删了。助手不存在就没有可测对象,而 issueRefs/namesIssue 的 7 个接受形状、6 个拒绝形状、namesIssue 断言都原样留着——我不把这条算阻断。
  • 守卫只扫 core/src 与 core/test,不扫 patches/ds-bot/files/** 镜像、也不扫生成的 core/client.js。往镜像里把代码抄回来不会被它抓住,但 check 第三行会红(正文第二把 knife 就是这个方向),所以另有机器兜底;低。若以后想更严,把 patches/ds-bot/files 也纳入扫描即可,本单不必。

Ran:

$ cd r1417/head/core && node --import ./test/harness-resolve.mjs --test test/no-delivery-board.test.js
# tip: 4/4 pass, exit 0
$ cd r1417/head/core && cp ../../base/core/src/shared/issue-ref.js src/shared/issue-ref.js && node --import ./test/harness-resolve.mjs --test test/no-delivery-board.test.js
# 只还原源文件: pass 3 / fail 1, not ok 4 (#1376 guard), exit 1
$ cd r1417/head/core && cp ../../knife-head-issue-ref.js src/shared/issue-ref.js && node --import ./test/harness-resolve.mjs --test test/no-delivery-board.test.js test/issue-ref.test.js test/work-dispatch.test.js
# 还原后 + 三件套: 37/37 pass, exit 0
$ cd r1417/head && echo 'cardMentions' > core/src/scratch-probe.js && (cd core && node --import ./test/harness-resolve.mjs --test test/no-delivery-board.test.js)
# 反证: not ok 4, pass 3 / fail 1; 随后删除探针
$ cd r1417/base/core && node --import ./test/harness-resolve.mjs --test test/no-delivery-board.test.js test/issue-ref.test.js
# base 树: 18/18 pass, exit 0
$ cd r1417 && for f in src/shared/issue-ref.js test/issue-ref.test.js test/no-delivery-board.test.js; do cmp head/core/$f head/patches/ds-bot/files/$f; done
# 三项静默相同; cmp 还原后的 issue-ref.js 与备份: identical
$ cd r1417/head && node scripts/ds-bot-patches.mjs check
# ok ds-bot/ = Fei2411/DeepSeek-Bot@2b10c70 (tree 5834c00, v0.1.5) / ok 10 patches apply cleanly in order / ok core/ equals ds-bot/ + patches/ds-bot/, exit 0
$ cd r1417/head && node .github/scripts/changelog.mjs check
# changelog: 15 fragment(s) in changelog.d/ are well formed
$ grep -rn "issueCardForTask|cardMentions" head/{core/src,core/test,core/client.js,plugins,scripts,dev,docs}
# 仅守卫测试自身 + 镜像测试文件
$ grep -rn "cardNamesIssue" head/core/src head/core/test
# work-dispatch.js:8 重导出, tasks.js:21,522 调用, work-dispatch.test.js:12,190-193 使用
$ node main5f15/api.mjs /repos/ThinkFlowLab/FlyBot/commits/68cfd97a…  # tree 8f7ee402…, parents 5123a872…
$ node main5f15/api.mjs /repos/ThinkFlowLab/FlyBot/pulls/1417/check-runs  # 17 全 completed

Not run: generate(无 *.patch 触及本模块;镜像 cmp 同源 + check 第三行覆盖);npm run verify / core/scripts/lint.mjs(本机无 oxlint 与完整根依赖,本单只删导出、不动客户端);check-arch-docs(core-host.md 改动落在它自己那一行)。

结论:68cfd97a95fb4767f6efa9abf0e350fba1cde07f 上 PASS,无阻断项;两条低如上。不入队、不打标签、不改正文。

@github-actions github-actions Bot added the pass label Oct 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agent-pr Pull request opened by an agent pass

Projects

None yet

Development

Successfully merging this pull request may close these issues.

issueCardForTask is dead code after #1370 removed its only consumer

1 participant