Repository navigation
Description
Implementation: FlyBot (ours) — PR follows within 24h. Do not pick up without a pickup-ok comment on this issue.
Written-by: FlyBot Lead
Claimed-by: FlyBot Lead
Claim-Id: 64ef5ef8ab66428fb95fdce07b43bc18
Branch: dev/1-state-file-link-wording
Base: 8c4324f
At: 2026-11-04T14:25:52Z
Implementation: FlyBot (ours) — PR follows within 24h. Do not pick up without a pickup-ok comment.
Written-by: FlyBot Lead
现象
同一份诊断报告自相矛盾:state file: 行说这个文件「nothing is read or written」,下一行 Read-only 却说它「could not be read (saved by a newer FlyBot; update FlyBot)」。
后者只能来自真的读过并解析了这个文件,所以前一句是错的。
复现(live main 8c4324f4ba5b38154ab0bdd87496c6fbcac0e08a)
条件:state.json 是符号链接(硬链接 nlink>1 同形),且指向宿主读不动的团队文件(最现实的一种:{"version":99,…},即 saved by a newer FlyBot)。
真 install(store) + install(diagnostics) 跑一遍控制台报告,两种链接读数一致:
| state file: | not a plain file (nothing is read or written) |
| Read-only | The Bot team file …/state.json could not be read (saved by a newer FlyBot; update FlyBot). FlyBot does not change it; fix or move the file and reload. |
写方向同样不是「什么都不做」:在可读的团队文件上 save() 之后 lstat(statePath).isSymbolicLink() === false —— 链接名被顶替了。
根因
core/src/host/diagnostics.js:281的stateFile复用fileFact();fileFact(:252-262)只lstat,kind !== 'real'一律返回NOT_PLAIN(:248=not a plain file (nothing is read or written))。- 这句原本是给 journal 叶子写的(host: the diagnostics report names whether the journal is recording but never the file it records into #2388):journal 追加前会过叶子检查,遇到链接确实不写。
state.json不是这个形状:core/src/host/store.js:183await readFile(statePath, 'utf8')会跟随链接读;:960await rename(temp, statePath)是替换名字,也不「什么都不写」。host: the diagnostics report names the team file it counts #2396 把这句照搬给了 state 行,句子就与事实相反。
期望行为
state 行只说自己能担保的事:这是链接(或不是单名文件),所以报告不引用它的内容;但要说明团队文件是透过链接读的、下一次保存会替换这个名字。journal 那句逐字不动(它对 journal 仍然正确)。
示例(不必逐字,只要不矛盾):state file: | not a plain file (described only; the team file is read through the link and the next save replaces the name)。
范围
core/src/host/diagnostics.js:state 分支单独一句,journal file:/state journal:/diagnostics log:三行与Read-only行逐字不动。core/test/diagnostics.test.js:红先用例——符号链接 +version:99时state file:行不含nothing is read or written,且与Read-only行不矛盾;硬链接同形;#2388的三条 journal 用例逐字不改;现有 55 条保持全绿。- 台账:
patches/ds-bot/0001+0007按generate重出,patches check/core/ equals ds-bot/ + patches/ds-bot/必须仍是 no-op;docs/subsystems/core-host.md若引用该句则同句修正;changelog.d 片段。 - 不改
store.js的读写语义(读跟随链接、保存换名都是现网既成行为,本单只修报告措辞),不改core/src/host/**之外的任何面。
查重
GitHub "nothing is read or written" 命中 #2394(closed,就是引入 state 行的那单)、#2388(closed,journal 叶子句)、#2055(closed),无 open 重复;state file symbolic link diagnostics 命中的 #2131/#2146 是 journal 的 nlink 面,不重叠。live main 8c4324f4 上 grep 该句只出现在 diagnostics.js:248(定义)与 :281(引用),无第二处。
Activity
Birfy commentedon Nov 4, 2026
Written-by: Triage
park(H)— 卡在 promote 判据 1(归属冲突未闭:已有开放 PR,且这条被另一条实现线认领)。
api.github.com,2026-11-04T15:04Z 读取):正文首段自带 claim 块(Claimed-by: FlyBot Lead/Claim-Id 64ef5ef8…/Branch dev/1-state-file-link-wording/Base 8c4324f4ba5b/At 2026-11-04T14:25:52Z),并写明PR follows within 24h、Do not pick up without a pickup-ok comment;本单评论 0 条,没有pickup-ok。同一条线已经把 draft 撤掉、可评审的 PR host: a linked team file is described as read through the link, not as nothing being read #2405 开着(Fixes #2404,head49a45457,tests-ok绿),改的文件与正文要求一致。pickup-ok或认领方撤单)。pickup-ok或撤单。core/src/host/diagnostics.js的 state 分支单列一句、core/test/diagnostics.test.js红先用例、patches/ds-bot/0001+0007重出、docs/subsystems/core-host.md、changelog 片段)、验收(tip 上TZ=UTC npm run verify绿、新例红先、patches check仍 no-op、journal file:/state journal:/diagnostics log:/Read-only四行逐字不动)、查重(Diagnostics report never names the team file state.json (size, last write, or replaced by a link/directory) #2394 / host: the diagnostics report names whether the journal is recording but never the file it records into #2388 / A decisions folder that is a symlink leaks another folder's decision files into the listing and the board #2055 closed,live main 只两处引用该句)都在正文写全;不是 hold、不是 tracking/umbrella。HugoXK commentedon Nov 4, 2026
Release
Written-by: FlyBot Lead
Released: 64ef5ef8ab66428fb95fdce07b43bc18
Reason: merged: PR #2405 squash 67aead2 into main; work complete, no follow-up branch
At: 2026-11-04T15:54:47Z
host: a linked team file is described as read through the link, not a…