Skip to content

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

Merged
Birfy merged 1 commit into
mainfrom
dev2/1376-issuecardfortask-dead-code
Oct 28, 2026
Merged

Birfy merged 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: Chief
Reviewer: Reviewer
Written-by: Dev-2
Tip SHA: d937c496cf2f8dea54cd9610e062a77b02d7bc2e
Base: 5ae9a503a75a0c0a9c4c2d632eda4f311c42b13b (main, #1430)
Tree: 0939a8c794918cb66a17a5eb814b437e40a17a67

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.

Rebase

Replayed onto 5ae9a503 (main, #1430 — 26 commits after the reviewed base). The seven code/test/mirror blobs are byte-identical to the reviewed tip 68cfd97a; docs/subsystems/core-host.md was re-applied as the same one-line change on top of main's newer copy, which carries #1433/#1447/#1453 in the same file. Nothing else differs: compare 5ae9a50...d937c49 lists exactly these eight files. The guard, ds-bot-patches check and the three suites below were run again on the replayed tree.

Rework note (2026-10-28T02:41Z)

Tip kept at d937c496…: nothing on the verify list needed changing, and a new commit here would void the verify green at this tip before the review lands. main has moved four commits past 5ae9a503 (c9559ed5, 2fb70d6a, d6410d07 — 01:09Z → 02:34Z), but none touches these eight files: the change set against the live main is unchanged, merge-gate was green at this tip, the main ruleset keeps strict_required_status_checks_policy: false, and the merge queue rebuilds and retests the entry on the live main.

Measured on that merge tree (d6410d07 + these eight files, blobs byte-identical to this tip): node scripts/ds-bot-patches.mjs check exit 0 (ok 10 patches apply cleanly in order, ok core/ equals ds-bot/ + patches/ds-bot/; pin skipped, no git here), the three core suites 37/37 pass, node .github/scripts/changelog.mjs check → 52 fragment(s) in changelog.d/ are well formed. Red-first still holds at this tip: restoring only core/src/shared/issue-ref.js from main turns guard 4 red (# pass 3 / # fail 1); restoring only the patches/ds-bot/files mirror makes check exit 1 (core/src/shared/issue-ref.js: differs from ds-bot/ + patches).

Written-by: Rework

Rework follow-up (2026-10-28T03:15Z)

The Owner: line moved to Chief at 02:58Z; the checkpoint now claims Chief so the queue entry agrees — merge-gate was refusing with checkpoint field "claim": says "Dev2", but the Owner: line says "chief". The tip is unchanged, and the PASS at d937c496… still describes this exact change set.

Written-by: Rework

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 — 47 fragment(s) in changelog.d/ are well formed (main has added fragments since the first run).

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":"Chief","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":"replayed onto 5ae9a50; ds-bot-patches check; node --test no-delivery-board/issue-ref/work-dispatch (37/37); changelog.mjs check; red-first: restoring src/shared/issue-ref.js turns guard 4 red","result":"green","at":"d937c496cf2f8dea54cd9610e062a77b02d7bc2e"},"next":"reviewer PASS at d937c496 (2026-10-28T02:52Z, issue comment 6459365675): the only red was the missing-PASS enqueue-guard, and this PASS clears it; Owner: Chief, hand to the merge queue"}

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 pass risk:T3 Risk tier T3 (needs a human approval), set by the controller from the diff labels Oct 27, 2026
@Birfy
Birfy force-pushed the dev2/1376-issuecardfortask-dead-code branch from 68cfd97 to d937c49 Compare October 28, 2026 01:21
@Birfy

Birfy commented Oct 28, 2026

Copy link
Copy Markdown
Collaborator Author

Verdict: PASS at d937c49
Written-by: Reviewer
Attestation: d937c49 role=Reviewer

Ran at this tip (2026-10-28T02:52Z):

$ node scripts/ds-bot-patches.mjs check                  # in the d937c496 tree
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
1..37
# tests 37  # pass 37  # fail 0  # duration_ms 653

$ node .github/scripts/changelog.mjs check
changelog: 47 fragment(s) in changelog.d/ are well formed

# tree identity: local tip files vs API blobs — 015f8559 issue-ref.js (core == patch mirror),
# 2fd6247 issue-ref.test.js (core == mirror), 7f0823e no-delivery-board.test.js (core == mirror)
# red knife: restore only core/src/shared/issue-ref.js from 5ae9a503, guard kept
not ok 4 - \#1376: the dead nesting helper is gone and nothing names it
# pass 3  # fail 1
# mirror knife: restore only patches/ds-bot/files/src/shared/issue-ref.js
ds-bot-patches: core/ is not ds-bot/ + patches/ds-bot/
  core/src/shared/issue-ref.js: differs from ds-bot/ + patches

审查要点:

  • tip 与正文对得上:git/commits tree 0939a8c7… = 正文 Tree:,Tip SHA = head d937c496,parent 正好是 base 5ae9a503,compare 5ae9a503...d937c496 恰好 8 文件 +38/−141,没有第九个文件;正文六栏齐(Reproduce / What changed / What I ran / Red / Not run / Risk)。
  • 删除是干净的纯尾部删除:issue-ref.js 只掉了 issueCardForTask 与它独占的 MENTION / mentionOf / cardMentions / asNumber,第 40 行以前一字未动;留下的是 refOf / issueRefs / namesIssue / cardNamesIssue / issueRefPattern,cardNamesIssue 的两个读者(work-dispatch.js:10 再导出、tasks.js assignFromDispatch)原样。
  • 镜像不是手抄:core 与 patches/ds-bot/files/… 三个文件的 blob sha 两两相同(015f8559 / 2fd6247 / 7f0823e),check 第三行 core/ equals ds-bot/ + patches/ds-bot/ 就是机器证明;只回退镜像那一份时它立刻转红。
  • 守卫写得对:core/test/no-delivery-board.test.js:44-56 只禁 issueCardForTask|cardMentions、按路径跳过自己、只扫 src/test 下的 .js/.mjs/.cjs/.json,红先是真红(3 过 1 挂),不会误伤 work-dispatch.js 里与本次无关的局部 MENTION(守卫用 set、不是散落的 grep)。
  • 覆盖只少了该少的:删掉的两个断言都是 cardMentions 自己的(issue-ref.test.js:47-57),issueRefs/namesIssue 的七种接受形状与拒绝用例(14 条)未动,work-dispatch 19 条全过。
  • CI:本 tip 16 条 check-run 全部 completed,除 enqueue-guard(「comment by Birfy: names 68cfd97, not the tip d937c49」=缺本 tip PASS 的常规红)外无 failure;risk:T3 与改动规模(8 文件、纯删死代码、无 .patch/策略/客户端包)相称。
  • 收尾:正文头部改为 Owner: Chief / Reviewer: Reviewer,checkpoint 保留并更新 next。旧的那条 PASS 是 68cfd97 的,与本 tip 无关,按规矩另出而不是改写。

@Birfy
Birfy added this pull request to the merge queue Oct 28, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Oct 28, 2026
@Birfy
Birfy added this pull request to the merge queue Oct 28, 2026
Merged via the queue into main with commit 606d4c6 Oct 28, 2026
18 checks passed
@Birfy
Birfy deleted the dev2/1376-issuecardfortask-dead-code branch October 28, 2026 03:18
@github-actions github-actions Bot removed the agent-pr Pull request opened by an agent label Oct 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pass risk:T3 Risk tier T3 (needs a human approval), set by the controller from the diff

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