Skip to content

[PR] test: align host test pins and kernel.json snapshots after #5860 phantom pressure guard (fix deterministic red in master | test: 对齐 #5860 幻影压力守卫后的宿主测试钉与 kernel.json 快照(修 master 定时矩阵确定性红) - #5878

Closed
ranxianglei wants to merge 4 commits into
masterfrom
2026-11-07_post-5860-test-alignment

Conversation

@ranxianglei

@ranxianglei ranxianglei commented Nov 7, 2026 •

Copy link
Copy Markdown
Owner

一句话

#5860(幻影压力守卫,kernel 0.0.184)合入时漏了两样东西:host 侧 6 个断言旧语义的测试钉、wire-contract/storage-render 的 golden 快照。本 PR 补这两样——不改任何产品行为。Closes #5876。

分支构成(2026-11-07 review 后收敛)

commit 内容
5bcd6c35b7 tests/silent-backend-nudge.test.ts(#728A/#728C/#1119)+ tests/fork-nudge-trigger.test.ts(anon zero-baseline fork、#1137 image-term fork)+ tests/issue4241-judge-render-baseline.test.ts(teeth)各加一行文档化逃生阀 compress.requireUsageSampleForPressure:false,并注释为什么这样对齐
71a5338f92(merge ci-fixes) 按 #4599 CI 协调政策把 master 级 golden 修复从哨兵车道 ci-fixes 合入:e7b0cee859 storage-render 四线快照重对齐(+#5860 持久化形状)、6436b23b3c kernel.json defaultConfig 块纯增量一行 "requireUsageSampleForPressure": true——无行为常量变化、无账本缩减

review 说明:原自研 golden 提交与 ci-fixes 上的 6436b23b3c 逐字节重复(master 级修复必须收敛到 ci-fixes,#4599 政策),已移除;golden 内容经 merge 原样保留。推送后本分支同时覆盖 born-red 波的 F1(storage-render)+F2(kernel.json)+F3(六条测试钉)。

为什么是「加逃生阀」而不是「改写断言」

#5860 的设计(默认开):本轮 token 读数是本地估算且处于压力带 → 注压延后一轮等真实 usage。这 6 个钉全部跑在永不回 usage 的 silent mock upstream 上——新语义下它们等待的那份 usage 永远不来,延后每轮重复,把断言改写成后守卫语义等于把它们变成永不动作的空测。这些套件守的是守卫之前的机制(fork 基线制度 / 图片项计量 / judge 对渲染基线的核对);守卫自己有独立专属套件 tests/nudge-pressure-no-sample-armed.test.ts,本 PR 不碰它。用文档化逃生阀恢复各套件的原始覆盖,是既有配置面里最窄的对齐方式(不新增任何配置形状)。

#4241 的 teeth 单独说明:它假设引擎追加的尾部 nudge 占 exitCores.at(-1);延后让 nudge 缺席后索引整体前移,故障注入恰好砍进设计豁免区(prefix),teeth 哑火——不是 judge 坏了。

证据链

与相邻工作的关系

ework-agent added 2 commits November 7, 2026 18:58
…ted-state shape

#5860 added compress.requireUsageSampleForPressure; the resolved Config snapshot persisted in session.metadata["effectiveConfig"] (src/session.ts cloneSafe) grew by exactly that field, so the metadata section digest drifts deterministically on every lane (F1 of the #5860 born-red wave, signatures pinned in #4599). Regenerated all four snapshots at 5af5f9f with scripts/update-storage-render-goldens.ts; state/blockContents/stats sections unchanged, no behavior change - snapshot realignment only. Verified green under the CI preload env (BILI_MESSAGE_TIMESTAMMS=0 via tests/preload-test-env.mjs).
…ract kernel.json

buildKernelGolden() serializes behavior.defaultConfig100k = defaultConfig(100_000); #5860's additive NudgeConfig field broke the canonicalized snapshot (F2 of the #5860 born-red wave). Regenerated with scripts/update-wire-contract-goldens.ts: diff is the single additive field requireUsageSampleForPressure: true in the nudge section - the ledger grows, nothing shrinks (Kernel Boundary rule 4).
@github-actions

github-actions Bot commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

📦 Built Package Artifact

Branch: 2026-11-07_post-5860-test-alignment (71a5338)

Latest build — install this exact version

npm install -g billion-context@0.0.8514-pr.5878.8a34be4

This exact version is immutable and reproducible. The rolling pr tag tracks the newest test build across all PRs.

Recent builds (commit → version)

commit version build
71a5338 billion-context@0.0.8514-pr.5878.8a34be4 build
808efb1 billion-context@0.0.8492-pr.5878.7525aa1 build

Download artifact

  1. Download the artifact from the Actions run
  2. Extract the tarball and install:
tar xzf billion-context-pr5878.tgz
npm install -g package

Install instructions are refreshed on each push.

@ranxianglei ranxianglei changed the title test: 对齐 #5860 幻影压力守卫后的宿主测试钉与 kernel.json 快照(修 master 定时矩阵确定性红) [PR] test: align host test pins and kernel.json snapshots after #5860 phantom pressure guard (fix deterministic red in master | test: 对齐 #5860 幻影压力守卫后的宿主测试钉与 kernel.json 快照(修 master 定时矩阵确定性红) Nov 7, 2026
@ranxianglei ranxianglei added bug Something isn't working p2 scheduled-red 定时全量失败的自动跟踪 scope/ci labels Nov 7, 2026
ranxianglei and others added 2 commits November 7, 2026 20:22
…orphaned

#5860 defers pressure-band injection whenever the token reading is
estimate-grade and no billing sample landed this round (documented
design, default on; escape hatch compress.requireUsageSampleForPressure
= false). Eight host-side test pins assert ESTIMATE-driven injection and
now fail deterministically — their upstream mocks never send usage, so
every reading in them is estimate-grade:

  - silent-backend-nudge.test.ts   #728A, #728C (precondition), #1119
  - fork-nudge-trigger.test.ts     anon zero-baseline fork, #1137 image-term fork
  - issue4241-judge-render-baseline.test.ts
                                   teeth assume the engine-appended trailing
                                   nudge occupies exitCores.at(-1); the defer
                                   shifts the index so the faulted drop no
                                   longer hits the owned tail row

Each suite predates the guard and pins PRE-GUARD mechanisms (fork baseline
regime, image-term arithmetic, judge reconciliation against the rendered
baseline) — not sample gating. Rewriting their assertions to post-guard
semantics would make them vacuous on a permanently-silent backend (the
defer repeats every estimate round; the next usage-grade sample the design
waits for never arrives). They therefore opt out through the documented
escape hatch, keeping their original coverage byte-for-byte. The guard
itself keeps dedicated coverage in tests/nudge-pressure-no-sample-armed.test.ts
(run unmodified: green).

Local proof at 5af5f9f (fresh npm ci + build, CI-parity env pins):
before: 3+3+1 deterministic failures across the three files;
after: 11/11 pass incl. the guard suite.
@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

(ai: vllm-qwen/qwen3.8-27b)

查重: 不重复。 本 PR 是关闭 #5876 的唯一 PR。与哨兵收敛 PR #5879(ci-fixes→master)在 kernel.json 上有一处字节级相同的单行 hunk——已按 #4599 收敛政策处理(见下)。与 #5868(storage-render 重对齐,不同根因 #5772)、GitHub PR #5859/镜像 #5861(F3 决策线程)相关但机制不同,不并入。

标签: bug + scope/ci + p2(测试对齐修定时矩阵确定性红,无用户面行为变更;scheduled-red 原已有,保留)。

八问

  1. 是什么问题: [PR] fix(nudge): no billing sample this round → hold pressure-band injection one round (phantom-pressure guard) #5860(幻影压力守卫,kernel 0.0.184)合入后,master 定时矩阵确定性红——6 条断言守卫前语义的测试钉跑在永不回 usage 的 silent mock upstream 上被新延后语义饿死,加上两族 golden 快照未重生成(wire-contract kernel.json ×1、storage-render 四线 ×4)。本 PR 只做对齐,不改产品行为。
  2. 什么原因导致的: [PR] fix(nudge): no billing sample this round → hold pressure-band injection one round (phantom-pressure guard) #5860 新增 compress.requireUsageSampleForPressure(默认 true)+ estimate-grade 读数压力带注压延后一轮,但漏了 golden 重生成与这 6 条既有钉;master push 不触发 CI(owner 决定 2026-11-01),born-red 一直隐形,直到定时矩阵与 rebase 暴露。
  3. 影响范围与严重程度: CI 调度阻塞级——所有基于最新 master 的 PR 继承红 shard(实测 master run 42358603178 十六 shard 十三红)。本 PR 自身零用户面行为变化。底层功能问题(fully-silent backend 上压力带注压永久延后、只剩硬溢出兜底)是 [PR] fix(nudge): no billing sample this round → hold pressure-band injection one round (phantom-pressure guard) #5860 自身设计取舍,仅登记不处置,非本 PR 引入。
  4. 怎么修复的: 三层分离——① 6 条钉各加一行文档化逃生阀 requireUsageSampleForPressure: false(既有配置面,不新增形状),恢复各套件原始覆盖(fork 基线制度/图片项计量/judge 渲染基线核对);守卫专属套件 nudge-pressure-no-sample-armed 一字不动;② kernel.json 走官方 regen 脚本,纯增量一行、无账本缩减;③ 两族 golden 的重对齐内容整体取自 ci-fixes 哨兵车道(merge 带入,不再自研重复提交)。
  5. 是否有回归问题: 审过的既有行为逐项——无任何 src//kernel/ 产品代码改动,零行为漂移;逃生阀是套件级配置,不影响其他会话与其他套件;golden 账本只增不减(kernel.json 纯增量行,storage-render 仅 digest 重对齐、形状不变);gate 双向完整(守卫专属套件正负向仍钉住,本地绿)。高危模式逐项过:无阈值/时序/输出格式漂移、无 fail-fast 变吞错、无默认值变化(默认仍 true)。
  6. 是否破坏缓存: 不涉及(不触及缓存/重试/增量游标/去重键失效策略)。
  7. 是否改了设计方向: 未改。但必须点明:本 PR 的钉法是决策线程(GitHub PR [PR] ci(test): Minor CI/test signal fixes, Part 2 — dispatch guard blind-spot coverage + golden snapshot encapsulation + base | ci(test): CI/test 信号小修合集第二辑 —— dispatch 守卫补盲 + 黄金快照封闭化 + 基线注释更正 #5859 / 镜像 kernel authorization request: PR #3610 (transient-retry classifier) inherits a lockfile-only kernel delta from the #4599 ci-fixes sweep #5861 floor 4「🔶 需要决策」,2026-11-07 10:20Z)所列 A/B/C 之外的第四条路 D(测试侧逐套件 opt-out,产品语义不动)。它比选项 A 好(A 会把这 6 条测试变成永不动作的空测),但它不解决 B 要解决的功能回归本身。
  8. 是否引入新配置: 无——用的就是 [PR] fix(nudge): no billing sample this round → hold pressure-band injection one round (phantom-pressure guard) #5860 自带的既有逃生阀,默认值未动。

本地证据(双向验证,均为定向套件非全量)

我做的协调动作(均已实际执行并验证)

判定

内容已验证可合;合入等 owner 对 F3 语义裁决(镜像 #5861 floor 4 挂着 A/B/C + 默认行为,尚无拍板)。推荐把「接受 D(本 PR 测试侧逃生阀)+ 饥饿问题留在该决策线程继续评估 B」作为一个完整选项:这样 born-red 波(F1/F2/F3)一次清完、master 矩阵全绿,而唯一能真正修复功能性回归的 B(kernel 有界推迟,human-gated)不被抢跑也不被搁置。若拍 B,本 PR 的 6 行逃生阀按有界契约小改重对齐即可(follow-up)。spawn 型集成测试 ~15s 超时偶发为已知 flake,另行跟进,不阻塞。我不执行合并(human-only):PR #5878。

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

(ai: vllm-qwen/qwen3.8-27b)

补一条状态确认(完整审核八问已在上方 13:03Z 回复中发出):本轮审核与协调工作已全部完成——PR 分支已按 #4599 收敛政策重建并推送(移除与 ci-fixes 字节重复的自研 golden 提交,改 merge ci-fixes 带入两族 golden 重对齐),新 head 71a5338,构建管线已在该 head 上触发;本地双向验证通过(master@5af5f9fe 逐名复现 7 fail / 最终树六套件 21/21 pass),标签 bug+scope/ci+p2(+scheduled-red)已就位。当前状态:等 CI 在新 head 上复跑确认 + 等 owner 对 F3 语义的裁决(镜像 #5861 floor 4 🔶 需要决策;推荐选项见上条回复)。无其他待办。

@ranxianglei

ranxianglei commented Nov 7, 2026 •

Copy link
Copy Markdown
Owner Author

(ai: sglang-gpu0/qwen3.8-27b)

本 PR(#5860 守卫后的宿主钉/kernel.json 对齐)被 PR #5882 已取代——#5882 已合入 master,且处理得更好:

建议直接关闭本 PR 不再合并。issue #5876 已由 #5882 收口。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working p2 scheduled-red 定时全量失败的自动跟踪 scope/ci

Projects

None yet

1 participant