Skip to content

[PR] Gate: add two toggles — laneScript + snapshotRender (#6785 real verification on the body plane) | gate 补两个开关:laneScript + snapshotRender(#6785 正文平面真验证) - #6913

Merged
ranxianglei merged 11 commits into
masterfrom
2026-11-16_gate-render-knobs
Nov 16, 2026
Merged

ranxianglei merged 11 commits into
masterfrom
2026-11-16_gate-render-knobs

Conversation

@ranxianglei

@ranxianglei ranxianglei commented Nov 16, 2026 •

Copy link
Copy Markdown
Owner

gate 补两个开关:正文平面真验证

背景

跑 #6785(msgid × 快照平面)候选 gate 时发现两处"开关没真正生效",正文(出站字节)平面实际没被验证:

  1. P 车道的 snapBase 没开成:entrypoint 的 P 车道优先用候选仓自己的 scripts/gate/plugin-lanes.mjs,而候选分支早于 [PR] Gate switch: let P/R lanes run with candidate snapBase planes enabled (verify #6785) | gate 开关:让 P/R 车道开着候选 snapBase 平面跑(验证 #6785) #6889 的 GATE_SNAPBASE 旋钮 → P 车道的 bili.json 里没有 storage.snapBase(实跑验证:候选分支 run 里 P 车道 0 个文件含 snapBase,R 车道因为固定用镜像脚本才是开态)。
  2. 正文渲染 rollout 是 0%:候选里 snapshotRender 默认 0%(src/rollout.ts),storage.snapBase 只开了存储底库;出站正文要走 snapshotRender 平面。不翻它,"看正文"看的是 client 原始字节。

改动(2 文件,+14)

scripts/gate/bili-gate.sh 新增两个可选配置键(都向后兼容,缺省 = 现状):

  • laneScript:透传 GATE_LANE_SCRIPT —— entrypoint 本来就支持这个逃生门(注释里明说用途:"fixes not yet merged into master"),现在配置能喂进去了。设 /gate-tools/plugin-lanes.mjs 即强制用带旋钮的 harness 脚本。
  • snapshotRender:往 P/R 车道 bili.json 写 rollout.features.snapshotRender: true(config 层,优先于 0% bucket)。注意:第一版走 env 层(BILI_ROLLOUT_SNAPSHOT_RENDER)是错的 —— cleanEnv() 按设计剥掉车道 spawn env 里的 BILI_*,真跑验证时 rollout 行仍是 off(bucket);第二个 commit 改成 config 层。插件模式车道(dsh 包 / pi 原生)按设计 client-authoritative(正文本就不走平面),正文渲染真正跑在 codex / opencode / claude 前缀车道上。

scripts/gate/config.example.json:两键 + _doc 说明。

验证

ework-agent and others added 9 commits November 14, 2026 16:52
# Conflicts:
#	tests/e2e/e2e-native-dsh-persona.test.ts
#	tests/e2e/e2e-native-dsh.test.ts
#	tests/e2e/e2e-native-opencode.test.ts
#	tests/e2e/e2e-native-pi.test.ts
#	tests/e2e/e2e-pi-codex-ws.test.ts
#	tests/e2e/e2e-subagent-sessions.test.ts
#	tests/notice-registry.test.ts
#	tests/plugin-fork.test.ts
On Windows, new URL(import.meta.url).pathname yields /D:/a/... (leading
slash before the drive), so path.resolve prepends the current drive and
the module-level readFileSync opens D:\D:\a\...\package.json and
crashes the whole test file at import time. import.meta.dirname is the
cross-platform form already used by every sibling e2e test.
# Conflicts:
#	tests/e2e/e2e-selfupdate-cli.test.ts
- storage-durability: drop the #4609 verdict cache (index.db.chk) after
  corrupting the db — the flip keeps size + mtime (4 ms granularity), so a
  cached 'ok' skipped quick_check and the corrupt open succeeded, failing
  the assert.throws / shadow-alarm expectations.
- wire-exit-matrix: abortAfterFirstByte now waits for a ready predicate
  (up.requests() >= 1) before destroying the client socket — the 400 ms
  fallback used to fire before the proxy forwarded on slow runners, leaving
  requests=0 / closed=0. Applied to all four abort cells.
- issue4612-gc-online-guard: wrap the 21,000 fixture inserts in one
  BEGIN/COMMIT — autocommit paid one fsync per row (WAL + synchronous=FULL),
  ~17 min on slow-fsync disks, past the runner timeout.
The snapBase storage substrate reaches the R lanes via the bundled
restart-lanes.mjs, but the P lanes prefer the candidate checkout OWN
plugin-lanes.mjs — which predates the GATE_SNAPBASE knob, so P ran
off-state in candidate-branch verification. laneScript forces the
bundled copy (the entrypoint already supports GATE_LANE_SCRIPT for
exactly this). snapshotRender flips BILI_ROLLOUT_SNAPSHOT_RENDER
(env tier > 0% rollout) so the egress BODY plane renders live —
without it storage.snapBase only exercises the v2 substrate, not the
body path the verification is actually after. Both keys documented in
config.example.json.
…es lane proxies

cleanEnv() strips BILI_* from the lane spawn env by design, so
BILI_ROLLOUT_SNAPSHOT_RENDER set container-wide still resolved to
off(bucket) in every lane (verified in the #6785 gate run: rollout line
showed snapshotRender=off(bucket, 7206/10000 vs 0bp) with the env set).
The knob now writes rollout.features.snapshotRender=true into the P/R
lane bili.json — the config tier the rollout resolver honors above
bucketing. GATE_SNAPSHOT_RENDER stays harness-internal; the proxy never
sees it.
@github-actions

github-actions Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

📦 Built Package Artifact

Branch: 2026-11-16_gate-render-knobs (aa92494)

Latest build — install this exact version

npm install -g billion-context@0.0.10380-pr.6913.f11c2de

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
aa92494 billion-context@0.0.10380-pr.6913.f11c2de build
850f0ad billion-context@0.0.10353-pr.6913.910949a build
772af00 billion-context@0.0.10351-pr.6913.e54f9c9 build

Download artifact

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

Install instructions are refreshed on each push.

@ranxianglei ranxianglei changed the title [PR] gate 补两个开关:laneScript + snapshotRender(#6785 正文平面真验证) [PR] Gate: add two toggles — laneScript + snapshotRender (#6785 real verification on the body plane) | gate 补两个开关:laneScript + snapshotRender(#6785 正文平面真验证) Nov 16, 2026
buildCorpus() produces a 441-line file, but the t1 recipe said "~1300
lines". Most models ignored the mismatch; opencode/codex occasionally
flagged it ("the file is only 441 lines, but the task says ~1300") and
wasted the turn, red-ing S40/S07 t1 (2026-11-16 gate run 4). Quote the
actual count instead.
@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

[bot] 🏷
(ai: vllm-qwen/qwen3.8-27b)

查重: 不重复 —— 镜像内检索 gate/laneScript/snapshotRender/正文平面 无同题条目;相关的 #6785(候选 gate 来源)与 #6889(snapBase 前作)范围不同,本 PR 是它们共同暴露的 gate 开关缺口。

PR #6913 审核完成,结论 APPROVE,无阻断项。全部技术声明已逐条对源码验证过,不是照抄 PR 描述。

审核要点(独立重读 diff + 源码)

结构化八问

  1. 是什么问题:gate 有两个开关"没真正生效"——P 车道 snapBase 开不成、出站正文 snapshotRender rollout 是 0%,导致 [PR] msgid delivery × snapshot plane: unified merge (absorbing #6564 + #5901 + #6680, including gate fully-open lane local ve | msgid 递送 × 快照平面:统一合并(收编 #6564 + #5901 + #6680,含 gate 全开 lane 本地验证) #6785 候选 gate 声称的"正文平面验证"实际验证的是 client 原始字节。
  2. 什么原因导致的:① entrypoint 的 P 车道优先用候选仓自己的 plugin-lanes.mjs,候选分支早于 [PR] Gate switch: let P/R lanes run with candidate snapBase planes enabled (verify #6785) | gate 开关:让 P/R 车道开着候选 snapBase 平面跑(验证 #6785) #6889 的 GATE_SNAPBASE 旋钮 → P 车道 bili.json 无 storage.snapBase(R 车道固定用镜像脚本才是开态);② snapshotRender 默认 0%(src/rollout.ts:93),storage.snapBase 只开存储底库,出站正文要走 snapshotRender 平面,不翻它看到的不是平面字节。
  3. 影响范围与严重程度:只影响 gate harness 自身(scripts/gate/*),对代理运行时行为零影响;两键缺省 = 现状(byte-identical)。严重度:测试基建缺陷(gate 验证有效性)而非产品缺陷——修复前 [PR] msgid delivery × snapshot plane: unified merge (absorbing #6564 + #5901 + #6680, including gate fully-open lane local ve | msgid 递送 × 快照平面:统一合并(收编 #6564 + #5901 + #6680,含 gate 全开 lane 本地验证) #6785 候选的正文平面验证是假阳性。
  4. 怎么修复的:两个向后兼容的可选配置键——laneScript → GATE_LANE_SCRIPT(entrypoint 既有逃生门,强制用带旋钮的 harness 脚本);snapshotRender → 写进 P/R 车道 bili.json 的 rollout.features.snapshotRender: true(config 层,压过 0% bucket)。第一版走 env 层是错的(cleanEnv 按设计剥 BILI_*),第二版 commit 改 config 层。
  5. 是否有回归问题:无。审过的既有行为:① 两键缺省时 docker 命令与车道配置逐字节同前(dry-run 双向验证);② gateRolloutCfg 对 ""/0/off 返回 {}(单测验证);③ config 层 true 仅在显式开启时生效,默认路径不变;④ 插件车道 client-authoritative 早退(snapshot-render.ts:505)按设计不受影响;⑤ 无测试 import scripts/gate,测试套件零影响。
  6. 是否破坏缓存:不涉及——gate harness 不触碰生产缓存/重试/游标/去重逻辑。
  7. 是否改了设计方向:不涉及——无架构/边界/数据流变更,只是把 gate 配置接到两个既有机制(GATE_LANE_SCRIPT 逃生门 + rollout config 层)。
  8. 是否引入了新的配置:gate 配置(scripts/gate/config.example.json)新增两个可选键:laneScript(string,默认空)、snapshotRender(string,默认空;"1"/"true" 开,"0"/"off"/空 关)。属 gate harness 配置,非产品配置面(不进 ~/.config/billion-context,不加 BILI_* env)。

判定:APPROVE,无阻断项。等 aa92494 的 CI 重跑转绿后,由人合并(agent 不 merge)。

@ranxianglei
ranxianglei merged commit 642000e into master Nov 16, 2026
13 of 22 checks passed
@github-actions

Copy link
Copy Markdown
Contributor

📦 Merged Build Published

This merge to master was published as 0.0.1217-master.642000e (rolling master tag).

npm install -g billion-context@0.0.1217-master.642000e  # this exact build
npm install -g billion-context@master  # always the newest merged build

npm view billion-context@master prints the current version at any time.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant