Repository navigation
Description
来源: #4555 (#4555) 分析 epoch-confirm/escalation 测试红、验证其修复 PR #4569 的 CI 时发现。
查重: 按失败签名(测试名+关键错误行,不只标题措辞)检索 open+closed issues 与 PRs——域 A("1111 bytes"/error-dump/#4297)、域 B(GENERATION_BOUNDARY_NOTE/generation-boundary/#4305):无任何跟踪条目(#4305/#4308 为已关功能票);域 C("older than kernel/src"/pretest cache/mtime):#4541(已关)、#4548(已关无评论)、PR #4549(已关未合)存在,但经实测当前 master 的 scripts/ci-pretest-cache.mjs 中 utimes/touch/mtime 逻辑为空(grep 确认),tip d95799d 仍红 → 既有条目实际未解决,故合并立项并在此重列证据。
现象
自 2026-10-24 ~10:31Z(#4525 train 合并窗口)起,master 所有测试道持续红,每个 PR 的测试道同样携带这些红。本 issue 立项时 tip d95799d 的 CI:7 failed / 1 success / 3 in-progress(test shards)。除 #4555 的 epoch-confirm 家族(PR #4569 已修,不在此列)外,还剩多个互不相关的失败域,各自都足以让全部 ubuntu/windows leg 红、淹没合并判定(#4555 的验证就不得不逐 shard 人工核对目标测试)。立项时列了 A/B/C 三域;随后逐 shard 核对 PR #4569 rebase head(ea9c2d5)的全部失败日志时又发现 D/E 两域,一并补入——合计 5 个独立机制。
子缺陷清单(同症状「master 测试道红」,机制各异)
A. error-dump 最终字节上限不再执行(#4297 家族回归测试红;eb483c6b3 出生即红)
- 签名:
not ok ... #4297 main dump enforces final UTF-8 bytes including markers and pretty printing— ERR_ASSERTIONerror: '0: 1111 bytes'(tests/error-dump.test.ts:200;cap=BILI_DUMP_4XX_MAX_BYTES=1024,实际 1111) - 本地复现(node --import tsx --test tests/error-dump.test.ts @ d95799d):14 tests / 10 pass / 4 fail(四个 [diagnostics] 4xx dump files exceed dump4xxMaxBytes after UTF-8 and JSON serialization #4297 字节上限子测试);CI ubuntu 22,2 & 24,2 & win 22,5 确定性红(node 22/24 全中)
- 归因(worktree 实测):pre-train 8ae56a0 绿(10/10);eb483c6b3(Opt-in raw dumps (ACP_DUMP_BODY) write conversation bodies to disk unmasked with no warning — real credentials landed on disk #4482 凭据警告 banner)出生即红(8 个子测试);bd38d15a9(No per-prompt image count cap: upstream "Too many images in request: 165 > 30" is forwarded as-is | 缺少按 prompt 的图片张数上限:上游 "Too many images in request: 165 > 30" 被原样转发 #4124)顺带修好其中 4 个基础用例,留下这 4 个上限用例
- 机制(已验证):src/error-dump.ts:69
fs.writeFileSync(out,${DUMP_PLAINTEXT_BANNER}\n${text}${marker})—— banner(实测含换行 89 字节)在 cap 截断之外前置拼接,最终落盘 = 截断后文本 + banner > cap;dumpSummaryRejection(src/error-dump.ts:113)同形 - 修法方向:把 banner 字节计入预算(truncate 到 maxBytes − bannerLen − markerLen)或对最终字符串强制 cap;两个 writer 都要覆盖
B. generation-boundary 激活态 note 缺失(#4305 家族回归测试红;abf7d0012 出生即红)
- 签名:
not ok ... #4305: injectSystem appends the note only when the boundary is active— ERR_ASSERTIONerror: 'active: note rides the ACP standing block'(tests/generation-boundary.test.ts:130) - 本地复现(@ d95799d):10 tests / 9 pass / 1 fail;CI win 22,3 not ok 397 + ubuntu 22,3/24,3 not ok 657
- 归因(worktree 实测):该测试文件由 abf7d00(fix(Switching model mid-conversation restarts the ref ledger, but the rendered transcript still shows the old refs — the model keeps aiming compress at dead ranges until the circuit breaker fires | 切模型后消息编号整体换账本,但渲染历史仍显示旧编号,模型对着死区间反复压缩直至熔断 #4305))引入,在该提交上立即红(同签名 9/1)——从未绿过,被 train 取消的 CI legs 掩盖
- 机制(已验证,位置参数错位):injectSystem 真实签名是 9 个位置参数(src/server/inject.ts:12-22,generationBoundaryActive 是第 9 参),测试只传了 8 个位置实参(tests/generation-boundary.test.ts:127-130),末尾的 true 落进第 8 参 mcpDialectNote,generationBoundaryActive 保持默认 false → note 永不注入。其余 prepare* 路径(prepare-openai.ts:336、prepare-responses.ts:408/424)走命名检测不受影响——运行时行为大概率正常,坏的是这个测试自己的调用点
- 修法方向:测试调用补成 9 参(或改对象形式);动手前先确认实现意图确为「note rides the ACP standing block」(src/server/inject.ts:35-37 注释与测试期望一致)
C. stale kernel dist mtime 守卫仍在触发(#4541/#4548 家族;修复早已写好但从未落地)
- 签名:
golden drive: node_modules/acp-kernel/dist is older than kernel/src (.../kernel/tsup.config.ts) — a stale kernel dist produces digests no fresh build can reproduce (#3325). Rebuild first: npm run build(tests/golden-storage-drive.ts:73 __goldenGuard()) - 受害:tests/golden-storage-render.test.ts(chat + anthropic + responses + google golden)+ storage-engine-proofs full-mode restart golden;实测命中 ubuntu 22,3/24,3(not ok 659-662、2224)、win 22,4(1573)、win 22,5(479-482)
- 机制链(CI test shards all red since today 10:31Z: kernel-dist freshness guard rejects cache-restored dist as stale — every merge blocked #4541 原诊断,至今成立):CI Windows test lane takes 20+ minutes: every leg does a full rebuild of kernel/pi-subagents dist — the sharding is way | CI windows 测试车道 20+ 分钟:每条腿都全量重建 kernel/pi-subagents dist,分片也太粗 #4360/[PR] CI: build once, reuse everywhere — cache kernel/pi-subagents dist by content hash so legs stop rebuilding 6 minutes of artifacts every run #4377 pretest 内容哈希缓存 HIT 跳过重建 × actions/cache 恢复的 dist 带归档旧时间戳 × [PR] test: golden drive refuses to run on a stale kernel dist (#3325 lesson) #3330 的 test: rebaseline storage-render goldens after remove-absorb (#3309) #3325 mtime 守卫判 stale → 每次缓存命中必炸
- 流程洞:修复在两处分支都已写好、均未合入——分支 2026-10-24_pretest-cache-mtime(2b8d0be,即 PR [PR] fix(ci): a verified pretest-cache HIT must also touch dist mtimes to now (#4548) #4549 head,utimes×3 + 回归钉)与分支 2026-10-24_4541_pretest-cache-mtime-refresh(c775203,同形);PR [PR] fix(ci): a verified pretest-cache HIT must also touch dist mtimes to now (#4548) #4549 被以「陈旧票清理」关闭且未合,CI test shards all red since today 10:31Z: kernel-dist freshness guard rejects cache-restored dist as stale — every merge blocked #4541/Master CI is fully red: the dist restored from pretest cache carries old archive timestamps, which are misidentified as | master CI 全红:pretest 缓存恢复的 dist 带归档旧时间戳,被 #3330 的新鲜度守卫误判为 stale,所有测试道失败 #4548 均已关,而当前 master 上没有该修复(grep 实证)
- 修法方向:cherry-pick 2b8d0be 或 c775203 之一到当前 master 开新的小 PR(两者均自包含:scripts/ci-pretest-cache.mjs + tests/ci-pretest-cache.test.ts;本地 8/8 绿证据见 CI test shards all red since today 10:31Z: kernel-dist freshness guard rejects cache-restored dist as stale — every merge blocked #4541 floor 4 与 [PR] fix(ci): a verified pretest-cache HIT must also touch dist mtimes to now (#4548) #4549 正文)
D. judge render-baseline 出口缺陷检测不再触发(#4241 家族回归测试红;train 窗口内回归)
- 签名:
not ok ... #4241: render turn with a host-side history edit — judge reconciles against the rendered baseline, stays clean, teeth intact— ERR_ASSERTIONerror: 'exit defect on a render turn still fires (teeth intact)'(tests/issue4241-judge-render-baseline.test.ts:262) - 本地复现(@ d95799d):1 test / 0 pass / 1 fail,确定性;CI ubuntu 22,3 & 24,3 not ok 1150 + win 22,1 not ok 885
- 归因:测试文件由 234943f(fix(judge) Egress Judge false positive on Snapshot Render Lane I2: prefix comparison baseline needs to be aware of the render view | 出站判官对快照渲染车道误报 I2:前缀比对基准需要感知渲染视图 #4241)引入,pre-train 8ae56a0 已存在且当时 CI 全绿(CI test shards all red since today 10:31Z: kernel-dist freshness guard rejects cache-restored dist as stale — every merge blocked #4541 记录 10:37Z 前 master 绿)→ train 窗口(8ae56a0..d95799d)内某提交把牙齿弄掉了,具体提交待处理会话二分定位
- 影响面:judge 对 host-side history edit(render turn)的出口缺陷检测失灵 = Egress Judge false positive on Snapshot Render Lane I2: prefix comparison baseline needs to be aware of the render view | 出站判官对快照渲染车道误报 I2:前缀比对基准需要感知渲染视图 #4241 修的误报/漏报契约部分失效,不只是测试噪音
E. publish redaction 的 $HOME→~ 掩码在 Windows 失效(#4427 家族,win-only 红)
- 签名:
not ok ... #4427 maskPathsForPublish rewrites this machine's $HOME to ~, anchored on both flanks— actual/home/alice/.local/share/billion-context/x.db,expected~/.local/share/billion-context/x.db(tests/web-storage-diagnostics-redaction.test.ts;win 22,5 not ok 1515/1516/1517/1519,同文件 4 个用例) - 本地复现:linux @ d95799d 同文件 5/5 绿——仅 Windows 红,linux 无法复现
- 机制(推断,待处理会话确认):maskPathsForPublish 解析 home 的方式在 Windows 上没吃到测试注入的 env($HOME vs USERPROFILE/os.homedir() 平台差异)→ 掩码不触发;若属实,生产影响 = Windows 机器上 publish 的诊断 blob 可能泄漏 home 路径([security][web] Storage diagnostics publish raw log lines and absolute paths | 存储诊断公开报告泄露本地路径和未脱敏日志 #4427 要防的事)
- 修法方向:home 解析统一走 process.env.HOME || os.homedir(),或在测试里同时注入 USERPROFILE 以钉住跨平台契约(先确认实现意图再选)
影响
零用户侧运行时影响(A/B/C/D 均为测试道;E 若推断属实则有 Windows 生产影响面,优先级应上调),但阻塞一切合并判定:每个 PR 的 CI 测试道携带这些红,合入前必须人工逐 shard 甄别目标测试;master push CI 全红。默认打 p2;若 owner 认定「阻塞全部合并 = 可用性停摆」可升 p1(#4548 当时自评 p1)。
建议处置
- C 优先(cherry-pick 级,解锁面最大):候选提交 2b8d0be / c775203 如上;
- B 疑似一行测试修复,可最先顺手做;A 需改上限计算(对最终字节强制 cap,两个 writer 都钉住);
- D 需要二分定位 train 窗口内的肇事提交(范围小:judge/render-baseline 触碰者),E 需要 windows 定向复现;两者互相独立,可与 A/B/C 并行;
- 五项与 epoch-confirm latch semantics: train a5d1994d test born-red (all-missing) + regression of 2915 escalation-latch-recovery — owner decision needed #4555 共享同一根因类「train 的 CI legs 被取消 → 出生即红/窗口内回归漏网」——建议 owner 评估是否在 train 合并流程加阻断(例如合并前强制跑一次完整 test legs,或禁止 cancel)。
Activity