Skip to content

[PR] gate: dsh protocol-matrix lanes into master (fixes #3500's wrong base) | gate: dsh 协议矩阵车道进 master(补 #3500 的 base 错位) - #3564

Merged
ranxianglei merged 3 commits into
masterfrom
feat/gate-plugin-lanes
Oct 18, 2026
Merged

ranxianglei merged 3 commits into
masterfrom
feat/gate-plugin-lanes

Conversation

@ranxianglei

Copy link
Copy Markdown
Owner

ai: zhipuai-lb/glm-5.3

这是什么

把 #3500(dsh 协议矩阵车道)送进 master。#3500 之前合进了 feat/gate-plugin-lanes 分支(base 选错了分支,不是 master),导致这批 gate 扩展一直没进主线——v0.1.198 发布时也不含它。本 PR 不带新改动,就是同一批内容进 master,下次发版带上即可。

内容(即 #3500)

  • gate 的 dsh 车道覆盖 pi-ai 全部四门协议:dsh(chat,原有)/dsh-responses/dsh-anthropic/dsh-google,外加 dsh-proxy 前缀模式车道(同宿主双激活路径对照)。
  • 每门 wire 硬断言(WIRE_EXPECT):recorder 收到的 POST 必须匹配该门路径 + body 顶层形状;首请求落盘 egress-sample.json 作往返证据。静默换协议(google 走成 chat、responses 走成 chat)当场红,不靠「回合完成」这种软信号。
  • 降级车道语义:ENV-BLOCKED(上游门不健康——全部被拒或中途劣化)/CLIENT-BLOCKED(客户端当前版本驱动不了该协议,如 dsh ≤0.2.1-rc.1 无 google-generative-ai)——各自从记分中剔除,客户端支持后自动升级,无需改脚本。

影响面

只动 scripts/gate/(plugin-lanes.mjs / README / zh-CN)+ ci-gate-plugins.yml 输入描述 + .gitignore。产品代码零改动,不影响运行时。

Closes #3475

awork and others added 3 commits October 17, 2026 15:39
…tions (#3475)

Extend the dsh gate lanes from one protocol to all four pi-ai protocols
(openai-completions / openai-responses / anthropic-messages /
google-generative-ai) plus a dsh proxy-mode lane for same-host
two-activation-path contrast. Same headless driver and corpus flow; only
the cordis provider api + baseURL suffix differ per lane.

- per-door WIRE_EXPECT hard assertion: every recorder POST must match the
  door path regex AND body top-level shape; first request dumped to
  egress-sample.json as round-trip evidence
- blocked semantics: ENV-BLOCKED (door unhealthy: all-rejected or degraded
  mid-flow, opencode2/#3461 rule) and CLIENT-BLOCKED (client config surface
  cannot express the api yet — dsh's cordis schema lists no
  google-generative-ai in 0.2.0-rc.2 / 0.2.1-rc.1); excluded from tally,
  printed at exit
- calibration fixes from real-model runs: GATE_OUTPUT_TOKENS (thinking
  models degenerate when output budget < thinking budget), p1 = max over
  full post-t1 log, post-fold small-window widening for adaptive recipes,
  mid-seed guard, lane-local dsh install (GATE_DSH_VERSION) + lane TMPDIR
- t1 dual marker (S40+S07): verify the read precondition so downstream
  S07 recalls can't fail for fixture reasons

Existing lanes' generated configs are byte-identical to pre-#3475
(parity harness); new lanes are GATE_AGENTS opt-in. Local real-model run:
56/56 passed (dsh-responses:env, dsh-google:client).
…l-matrix

gate: dsh 协议矩阵车道(四门)+ dsh proxy 车道 — wire 硬断言 (#3475)
@github-actions

Copy link
Copy Markdown
Contributor

📦 Built Package Artifact

Branch: feat/gate-plugin-lanes (233690b)

Option A — Install this exact build (recommended)

npm install -g billion-context@0.0.4215-pr.3564.bf318cf

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

Option B — Download artifact

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

Install instructions are refreshed on each push.

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

查重: 不重复——本 PR 是已关闭的 #3500(同一批 gate dsh 矩阵车道内容,当时 base 选错了 feat/gate-plugin-lanes 而非 master)的 master 重投;#3475 是其要关闭的原 issue(仍 open);open PR 列表里没有第二个覆盖 scripts/gate/ 此内容的在途 PR。

收到,开始按 [PR] 流程审核:拉分支核对代码、审 CI、出八问结论。审核中,稍后回帖。

@ranxianglei ranxianglei changed the title gate: dsh 协议矩阵车道进 master(补 #3500 的 base 错位) [PR] gate: dsh protocol-matrix lanes into master (fixes #3500's wrong base) | [PR] gate: dsh 协议矩阵车道进 master(补 #3500 的 base 错位) Oct 17, 2026
@ranxianglei ranxianglei changed the title [PR] gate: dsh protocol-matrix lanes into master (fixes #3500's wrong base) | [PR] gate: dsh 协议矩阵车道进 master(补 #3500 的 base 错位) gate: dsh protocol-matrix lanes into master (fixes #3500's wrong base) | gate: dsh 协议矩阵车道进 master(补 #3500 的 base 错位) Oct 17, 2026
@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

审核完成。本 PR 是把 #3500(dsh 协议矩阵车道)补进 master——之前合错了分支(feat/gate-plugin-lanes 而非 master),v0.1.198 因此没带上。我拉了分支逐文件核对了代码、查了 CI。结论:可合入,未做任何改动(CI 绿、你明确「不带新改动」)。查重结论见上一条回复(不重复)。

1. 是什么问题:gate(CI 插件门禁)此前只走 dsh 的 chat 门,pi-ai 另外三门(responses/anthropic/google)没有 wire 层硬校验——如果 bili 静默换协议(比如 google 请求实际走了 chat),gate 不会红,#3475 要求补上每门硬断言 + 跑不了车道的降级机制。

2. 什么原因导致的:一是原 gate 脚本只有「回合完成」这种软信号,没有对出站 wire 做路径+形状断言;二是这批内容当初(#3500)base 选错分支,一直没进主线。

3. 影响范围与严重程度:只动 CI/gate 面——scripts/gate/plugin-lanes.mjs、两版 README、ci-gate-plugins.yml 的一行输入描述、.gitignore(+plugin-lanes/)。产品代码零改动,运行时不受影响。修前是 gate 盲区(静默换协议不可见),修后当场红。

4. 怎么修复的:每门一张 WIRE_EXPECT(路径正则 + body 顶层形状),对 bili→upstream 首跳的每个 POST 硬断言;首请求落盘 egress-sample.json 作往返证据(auth 头被既有 recorder 的 SENSITIVE_HEADERS 掩码,无泄密)。跑不动的车道打 ENV-BLOCKED(上游门不健康)/CLIENT-BLOCKED(客户端版本驱动不了该协议)从记分剔除,支持后自动升级。另给 dsh 家族做了车道内 hermetic 安装(GATE_DSH_VERSION 默认 latest),不再依赖系统里的 dsh。

5. 是否有回归问题:逐项审过,无意回归没有;有意变更如下(全部已写入两版 README):

  • 既有 dsh 车道:默认配置下 profile/cordis 产物与改前字节一致;
  • pi/codex/opencode/opencode2/claude 车道:wireApi 只设在 dsh 家族上,BLOCKED 记分逻辑在 dsh 家族外不触发,行为不变;
  • 有意的 gate 行为收紧/增强:① t1 prompt 改为同时答 S40+S07 双标记(所有车道)— 这是 t4 召回的前置校验,防假红;② p1 seed 从「最后一次」改「取最大值」— 抗 [可观测性] 计量/窗口/对账决策的可审计性缺口:窗口翻转时间序列、逐请求 usage-vs-est 成对记录、回滚 token 体量(#2274) #2283 source-flip 中途截日志;③ claude 车道(master 上既有的自适应 smallWindow)也会吃到新增的 phase-3b「fold 后地板抬高时扩窗」逻辑——有界(w2≤mid<BIG_WINDOW),减少假红而非引入新行为;④ dsh 家族改用车道内安装的 dsh(原来用系统 dsh)。
  • 缓存/持久化/wire 协议:不涉及。

6. 是否破坏缓存:不涉及(没碰产品代码)。

7. 是否改了设计方向:不涉及——只是 gate 基础设施扩展,产品架构/数据流不变。

8. 是否引入了新的配置:无产品配置新增。gate 脚本新增 3 个 GATE_* env(GATE_DSH_VERSION / GATE_OUTPUT_TOKENS / GATE_DSH_SMALL_WINDOW,后者为小窗口强制钉死逃生口),沿用既有 GATE_* 约定,已在 scripts/gate README 中英双版文档化。

CI 状态(head 233690b96):主 CI 全绿——kernel-guard/version-guard/pi-subagents-guard/lane-guard/docs-sync/config-surface-guard 等元守卫全过;test/static-gates 矩阵是按设计跳过(plan job 判定本 PR 只碰 gate 脚本,scope=skip,无需全量套件);8 条真实客户端 e2e 车道全部通过,含 e2e-native-dsh(真实 dsh headless profile 对确定性 fake 上游)。那条名为 ci-gate-plugins.yml 的零 job push 失败是仓库级历史现象(近期每次 master push 都有同样模式,该 workflow 纯手动触发),与本 PR 无关。

协调提醒:在途 PR #3497(opencode warmup 车道,开得更早)也改同一个 plugin-lanes.mjs,插桩点正好在本 PR 重写的 t1 行上方——后合的那个需要 rebase 一次,建议 #3497 先合。本分支落后 master 31 个提交,但 5 个文件与那些提交零重叠,直接 merge 或同步后再 merge 都安全。

一个小建议(未推):mid-clamp 那行注释写 (dsh adaptive, #3475),但实际条件 recipe.smallWindow 也覆盖 claude 的既有自适应配方,建议改成 (dsh adaptive #3475, and the pre-existing claude adaptive recipe)。既然你声明本 PR 不带新改动,我没擅自动;要补这个一行 commit 说一声即可。

判定:可合入。按惯例由人工合并:#3564

@ranxianglei ranxianglei changed the title gate: dsh protocol-matrix lanes into master (fixes #3500's wrong base) | gate: dsh 协议矩阵车道进 master(补 #3500 的 base 错位) [PR] gate: dsh protocol-matrix lanes into master (fixes #3500's wrong base) | gate: dsh 协议矩阵车道进 master(补 #3500 的 base 错位) Oct 17, 2026
@ranxianglei
ranxianglei merged commit 38d0149 into master Oct 18, 2026
66 of 73 checks passed
@github-actions

Copy link
Copy Markdown
Contributor

📦 Merged Build Published

This merge to master was published as 0.0.558-master.38d0149 (rolling master tag).

npm install -g billion-context@0.0.558-master.38d0149  # 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

Projects

None yet

1 participant