Skip to content

[PR] #5825 Identity Channel Wiring: Unified Consumption Seam + Six Lanes (opencode V2/goose/qwen/claude/codebuddy/mcode) | #5825 身份信道接线:统一消费缝 + 六条车道(opencode V2/goose/qwen/claude/codebuddy/mcode) - #5842

Merged
ranxianglei merged 6 commits into
masterfrom
2026-11-07_identity-channel-wiring
Nov 7, 2026

Conversation

@ranxianglei

@ranxianglei ranxianglei commented Nov 7, 2026 •

Copy link
Copy Markdown
Owner

#5825 身份信道接线:统一消费缝 + 六条车道(opencode V2 / goose / qwen / claude-code / codebuddy / mcode)

一句话:各客户端的「稳定会话号 + 消息 id」现在都接进同一条消费缝,任何使用点都不再单独读客户端存储。owner 裁定(2026-11-07):能接的都接、一个 PR、不过度耦合。issue #5825 的全部逐客户端结论在本 PR 里落成代码或闭合备忘。

服务端核心缝(wire 车道)

  • src/msgid-pin.ts 新增 incomingMsgIdsHeader():x-bili-msg-ids 请求头载体(逗号列表;>64 KiB 原值 / >4096 条 / 坏字符 → 整份作废;宽松级校验与 body 字段完全同构)。
  • src/server/handle.ts 统一入口:body biliMsgIds 字段 > x-bili-msg-ids 头 > 采集注册表。判定后两条 wire(openai+anthropic)走同一条路:无条件剥除(绝不上游)+ 灰度内 applyMsgIdPin 钉进行 + biliLedgerSeqs/#5719 归属档。
  • openai wire 的 pin 补齐(src/server/prepare-openai.ts):与 anthropic twin 同款结构(剥除在前、计数对拍、失败 warn 整轮退化);命中水位快路径的轮次窗口变短、按构造不参与(安全方向)。集成测试 tests/openai-msgid-pin.test.ts 钉死「字段绝不上游 + 行带客户端 id」。
  • src/server/headers.ts:x-bili-msg-ids 入出站剥除名单(host↔bili 簿记头,任何上游都不应见到)。

opencode V2 宿主侧(本批强调项)

扩展自己的 http-request hook 读当轮自己的结构化消息铸 x-bili-msg-ids——同一事件取值零竞态,不用独立 context hook/LRU 缓存;任一变体缺 id → 该轮戳整体作废(宁可整轮退化不做部分映射)。src/agent/opencode-v2-msgids.ts(纯函数可单测)+ 4096 条/16 KiB 双上限防胖头。V1 链路不动。

采集缝(loopback harvest 车道 ×3)

src/identity-harvest.ts 注册表 + 门控:env BILI_IDENTITY_HARVEST(缺省关,可按车道点名)与灰度键 rollout.features.identityChannelHarvest(默认 0%)二者任其一即可使能——与 dsh 历史车道的 pluginLaneServerHistory 解耦;仅回环来源;任一不满足整轮退化。自包含适配器(不 import 客户端任何东西、各自可删):

车道 连接键 存储 备注
claude-code x-claude-code-session-id 转录 JSONL 尾部快照 sidechain/summary 行排除
codebuddy x-conversation-id(本次并入会话识别低信任层,#5825 决定 A) conversation-id==文件名布局 system/无 parent 草稿排除;turn 级 request-id 按 owner 决定不消费
mcode/mavis x-mavis-session-id(已识别) runtime-state.sqlite 每轮只读 bulk-replace 路径靠每轮重拍防脏
goose agent-session-id(本次并入会话识别低信任层) sessions.db message_id 行 BYOK/OSS 路径无条件盖章(openai_def.rs:122);用户改名覆盖 → 静默退化
qwen-code x-opencode-session(官方 BYOK 文档示例 ${session_id} 自定义头名;已识别) chats/<sid>.jsonl git-log 转录 sidechain/chat_compression checkpoint 排除

其余 roster(审计后记闭合备忘,见 docs/identity-channels.md §2 表)

crush(join 键是 xxh3 摘要 + 库在工程目录内)、gemini-cli(仅装机级身份非会话级)、hermes-agent(线上零身份信号)、iflow(产品已下线)、zed/kiro/qoder/copilot(需登录实测或 blob 解析成本高)、aider/jcode/kimi(无线上 id,内容指纹兜底即最优)、codex(自铸 id 两度生产否决,等 #5643)。

测试与验证

tests/identity-harvest.test.ts(注册表门控 + 五适配器夹具含 SQLite/JSONL 布局 + 角色抽验)、tests/opencode-v2-msgids.test.ts、tests/msgid-header-channel.test.ts(头载体契约 + 与 body 字段同判 + 胖头防爆)、tests/openai-msgid-pin.test.ts(全链路集成)+ 既有回归全绿;tsc --noEmit 干净。

灰度与回退

出厂惰性(env 缺省关 + cohort 键 0% + 仅回环),合入 = 零行为变化;开启顺序:单装 env=all 小流量观察 warnOnce 退化率 → 抬 identityChannelHarvest percent;row pin 继续走既有 pluginLaneServerHistory 灰度。kill = env unset(即时)或两键归 0。

文档:AGENTS.md KDD #18、docs/identity-channels.md/.zh-CN.md、LIFECYCLE §1 登记、website/config-reference(env-only + rollout 两份种子已生成)。

@github-actions

github-actions Bot commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

📦 Built Package Artifact

Branch: 2026-11-07_identity-channel-wiring (4a5a4a7)

Latest build — install this exact version

npm install -g billion-context@0.0.8467-pr.5842.faf4a07

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
4a5a4a7 billion-context@0.0.8467-pr.5842.faf4a07 build
47e3ac8 billion-context@0.0.8457-pr.5842.7aa1469 build
da75afd billion-context@0.0.8441-pr.5842.b4d6b28 build
01bde87 billion-context@0.0.8439-pr.5842.c7ce6eb build
006cc1e billion-context@0.0.8436-pr.5842.3a9fd59 build
235a5bc billion-context@0.0.8430-pr.5842.449d053 build

Download artifact

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

Install instructions are refreshed on each push.

@ranxianglei ranxianglei changed the title #5825 身份信道接线:统一采集缝 + claude-code/codebuddy/mcode 三车道 [PR] #5825 Identity Channel Wiring: Unified Collection Seam + claude-code/codebuddy/mcode Three Lanes | #5825 身份信道接线:统一采集缝 + claude-code/codebuddy/mcode 三车道 Nov 7, 2026
@ranxianglei
ranxianglei force-pushed the 2026-11-07_identity-channel-wiring branch from a008273 to 006cc1e Compare November 7, 2026 04:38
@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

审核了 PR #5842(身份信道接线:统一采集缝 + claude-code/codebuddy/mcode 三车道)。结论先行:让 CI 变红的两道守卫失败,根因已定位、且分支上已由并行会话修好(commit d02df83fe、a0082732a);我独立复现了根因,并在当前头 a0082732 上重跑这两道守卫确认转绿。我的本地等价改动被 push 以 non-fast-forward 拒绝后已丢弃——没有重复推送。以下为结构化审核。

① 是什么问题
功能 PR(非缺陷):给没有显式 msgid 信道的回环客户端,从各自本地存储(JSONL 转录 / SQLite)采集稳定的“会话+消息 ID”,接进既有归属/pin 管道;外加 codebuddy 会话键识别合并。CI 红是交付不完整——新代码漏过两道仓库级守卫。

② 什么原因导致(CI 红)

  • unused-exports 守卫:src/identity-harvest.ts 里 3 个符号(MAX_ROLE_SPOT_CHECK、IdentitySource、HarvestResult)被 export 但全仓零外部引用 → 判 INTERNAL_ONLY。
  • lifecycle-ledger-guard 守卫:新增 env BILI_IDENTITY_HARVEST(src/identity-harvest.ts 读取)没登记进 LIFECYCLE.md;PR 只登记了 CONFIGURATION.md / env-only.yaml,漏了生命周期账本。

③ 影响范围与严重程度
功能默认完全关闭(env 缺省 + rollout pluginLaneServerHistory 0% + 仅回环来源),对现有用户零行为变化。唯一未门控的变化:x-conversation-id 进入会话键识别名单的低信任层(src/session-id.ts)——任何发该头的客户端都会被识别为会话键;PR 已披露并有测试钉住层级。当前严重度:无(灰度 0%)。

④ 怎么修复的
把 3 个内部符号去掉 export(守卫证明零外部引用 ⇒ 纯声明改动、不可能引入类型错误);给 BILI_IDENTITY_HARVEST 在 LIFECYCLE.md §1 加过渡行(默认关、双重门控、含退役条件)。两者已在分支上(d02df83fe/a0082732a),我在 a0082732 上重跑两守卫均绿。

⑤ 是否有回归问题
逐项审了触碰路径的既有行为:默认路径不变(env 关 ⇒ 注册表惰性);dsh body-msgid 车道不受影响(缝在已有盖章 id 时跳过,不与增量/水位车道双处理);body 字段只在 anthropic wire 打戳(与既有消费面一致,其余 wire 仅本地喂归属档);适配器自包含、sqlite 每轮开→查→关无跨轮缓存、symlink 逃逸有 realpath 前缀防护、jsonl 尾行截断丢弃。未发现无意回归。唯一有意变更即上面的 x-conversation-id 识别层(已披露 + 测试钉)。

⑥ 是否破坏缓存
未引入缓存失效。默认关闭时不改任何出站字节;开启时采集 id 只是替换内容哈希这一档身份证据、喂进同一归属机制,不是改写缓存键。真实流量下的命中率/有效性是留观察项(0% 灰度下不影响任何人)。

⑦ 是否改了设计方向
新增一个采集缝(注册表 + 适配器),但刻意不改任何消费者——消费者仍读统一缝,符合 owner 2026-11-07「每条车道接进同一处」裁定;KDD#18 已记录。方向一致,不是转向。

⑧ 是否引入了新的配置
是:BILI_IDENTITY_HARVEST(env-only,默认 off)+ rollout feature pluginLaneServerHistory(0%)。已登记 CONFIGURATION.md(中/英)+ env-only.yaml + LIFECYCLE.md §1。不新增配置文件字段,迁移无需(默认关)。小瑕疵(非阻塞):PR 正文缺显式「config surface」小节标题(AGENTS.md 配置面纪律要求)。


🔶 需要决策(两项均不阻塞合并)

  • 背景:PR 本身可合,但留下两处需你拍板的事。
  • 待决 1 — 灰度节奏数字:建议先 BILI_IDENTITY_HARVEST=all 小流量观察 warn-once 退化率,再抬 rollout %。
    • 选项 A 出厂即 0%、由你后续给数字(代价:合入后暂不生效,等你调参);选项 B 本次直接定一个起步 %(代价:需现定数字)。
    • 推荐:A(合并不依赖它,出厂 0% 最稳)。不决定的默认行为:rollout 保持 0%,功能休眠。
  • 待决 2 — openai wire 的行钉住要不要扩:store-row 写 msg_id 目前仅 anthropic wire 打通;采集 id 在 openai wire 上已进归属档/水位证据,但没落到存储行。影响面更大,本 PR 不动。
    • 选项 A 维持现状(anthropic-only),以后有需要再排期(代价:openai-wire 会话拿不到行级 pin);选项 B 现在排一个后续工作项(按 2026-11-01 政策留在本线程备忘,不单开 issue)。
    • 推荐:A(先让三车道在灰度站稳,row-pinning 扩展另议)。不决定的默认行为:保持 anthropic-only。

收工判定:两个 CI 阻塞项已在分支上修复并被我独立验证转绿;设计稳健、门控充分、默认零变化。待 CI 全量 lane 在头 a0082732 上确认绿即可合并;合并后由你定灰度节奏与 openai-wire 去向。

ranxianglei added a commit that referenced this pull request Nov 7, 2026
…de V2 stamped header + goose/qwen adapters + openai row-pin parity + decoupled cohort gate
@ranxianglei

Copy link
Copy Markdown
Owner Author

范围二已推(commit 01bde872a,已 rebase 到 ci-check 的修正链之上):

本轮补进去的(对应你的三条指令:能接的都接、opencode 优先、①②给交代):

  1. opencode V2 已接——而且用的是最强的缝:扩展在自己的 http-request hook 里直接读当轮自己的结构化消息铸 x-bili-msg-ids 请求头(同一事件取值,零竞态;任一变体缺 id → 整份作废,绝不半戳)。服务端新增盖戳头信道,消费优先级 body 字段 > 该头 > 采集注册表;egress 剥除清单同步加了这个头名。V1 既有车道不动。
  2. goose + qwen-code 两条采集器(按 lane-facts 审计的完整事实落码):goose agent-session-id==sessions.id → sessions.db message_id 行(该头名同时进了会话识别低信任层);qwen chats/<sid>.jsonl git-log uuid,join 用官方 BYOK 文档示例头名 x-opencode-session——用户选别的头名就只是不接,无任何副作用。
  3. ①灰度节奏的交代:门控解耦了。你自己机器上开这个功能现在只动一个变量(env BILI_IDENTITY_HARVEST),不再借用 dsh server-history 旗标;放量是维护者侧的另一把钥匙(rollout.features.identityChannelHarvest,缺省 0%,env 也可强制)。两把独立、随时可分别关。
  4. ②的交代:openai wire 的行钉住对等件就在这个 PR 里(prepare-openai 与 anthropic 同款无条件剥除+灰度内钉住),不需要另立 issue。集成测试钉住「字段绝不上游 + 行带客户端 id」。
  5. 审计闭合备忘固化进文档:crush(XXH3 join + 工程目录内库)、gemini-cli(仅装机级身份)、hermes(线上零信号)、iflow(产品下线)四条不做代码,理由写死在 docs/identity-channels.md §2。

证据:tsc 干净;新测试 22 例全绿(identity-harvest 11 含新夹具 / opencode-v2-msgids 5 / msgid-header-channel 5 / openai-msgid-pin 集成 1);关联套件 fastpath×35、proxy-session-id、issue5719 全绿。未开启时零行为变化。

ranxianglei added a commit that referenced this pull request Nov 7, 2026
…le, lane status (owner request, #5825/#5842)

New docs/session-identity-resolution.md (+zh-CN): session-id vs message-id
roles, the full resolveSessionOrder ladder (claim → byte continuation →
persona escape rungs w/ verbatim-evidence demands → deterministic |sub: fork
→ #5719 msgid last-resort rung), why the msgid rung is last not first
(owner discussion 2026-11-07 ruling recorded), switching-layer table
(recognition ungated / harvest double-gate off / row pinning unchanged),
trust boundaries incl. whole-turn degrade contract.
AGENTS.md KDD #18 now points at it; channel docs cross-link both directions.
@ranxianglei
ranxianglei force-pushed the 2026-11-07_identity-channel-wiring branch from 8a80f45 to 47e3ac8 Compare November 7, 2026 07:02
ranxianglei added a commit that referenced this pull request Nov 7, 2026
…de V2 stamped header + goose/qwen adapters + openai row-pin parity + decoupled cohort gate
ranxianglei added a commit that referenced this pull request Nov 7, 2026
…le, lane status (owner request, #5825/#5842)

New docs/session-identity-resolution.md (+zh-CN): session-id vs message-id
roles, the full resolveSessionOrder ladder (claim → byte continuation →
persona escape rungs w/ verbatim-evidence demands → deterministic |sub: fork
→ #5719 msgid last-resort rung), why the msgid rung is last not first
(owner discussion 2026-11-07 ruling recorded), switching-layer table
(recognition ungated / harvest double-gate off / row pinning unchanged),
trust boundaries incl. whole-turn degrade contract.
AGENTS.md KDD #18 now points at it; channel docs cross-link both directions.
@ranxianglei

Copy link
Copy Markdown
Owner Author

Rebased onto post-#5826 master(owner merged #5826 at fb18e7e4c; branch tip now 47e3ac835).

  • Single conflict (CHANGELOG [Unreleased] ordering) resolved by keeping both sides: the [PR] release review #5826 msgid-parity-lock bullet, this PR's identity-lane bullet, and the kiro lane entry appear once each.
  • KDD numbering settled without collision: [PR] release review #5826's declaration is list item 17 in AGENTS.md; this PR's seam declaration stays release v0.1.6 #18.
  • Local verification on the rebased tip: tsc --noEmit clean; tests/{identity-harvest,opencode-v2-msgids,msgid-header-channel,openai-msgid-pin,issue5719-msgid-lane-identity,proxy-session-id,native-intercept}.test.ts → 130 pass / 0 fail.

One heads-up for CI readers: two reds in tests/msgid-rule-parity.test.ts are inherited from master, not introduced here. Pure master (fb18e7e4c) fails the same two v6-F1/F2 parity rows because #5826's re-pin commit (33b2f82dc, «re-pin … to v6 F1/F2 rulings after master merge») pinned behaviors whose implementing code (#5652 fastpath-v6) was subsequently removed by revert #5854 (bebc239f2). Needs a tiny follow-up on master: drop or re-pin those two rows to the pre-v6 verdicts. Nothing in this branch touches that file (byte-identical to master).

@ranxianglei ranxianglei changed the title [PR] #5825 Identity Channel Wiring: Unified Collection Seam + claude-code/codebuddy/mcode Three Lanes | #5825 身份信道接线:统一采集缝 + claude-code/codebuddy/mcode 三车道 #5825 身份信道接线:统一消费缝 + 六条车道(opencode V2/goose/qwen/claude/codebuddy/mcode) Nov 7, 2026
@ranxianglei

Copy link
Copy Markdown
Owner Author

Scope 2 landed on this branch (tip 8e1c510da) — per owner ruling 2026-11-07 「能接的都接吧 尤其是opencode很重要 一个pr即可」:

  1. opencode V2 wired — the extension stamps x-bili-msg-ids from the same http-request event's structured e.messages (zero race; no LRU/context hook). Missing/malformed id → whole-turn stamp voided. New pure module src/agent/opencode-v2-msgids.ts + tests.
  2. Goose & qwen-code adapters added to the harvest registry (researcher-audited facts: agent-session-id header = sqlite session id, unconditional for BYOK; qwen join = official BYOK doc-example ${session_id} custom header onto its git-log JSONL transcript). Both join keys are already recognized conversation keys (x-opencode-session), one new tier entry added for goose (agent-session-id, low-trust tier).
  3. OpenAI-wire row-pin parity closed the round-1 gap: prepare-openai now strips biliMsgIds unconditionally and pins inside rollout, mirroring the proven anthropic twin; integration test proves "field never upstream + rows carry client ids" end-to-end.
  4. Decoupled kill gate: BILI_IDENTITY_HARVEST env and new cohort key rollout.features.identityChannelHarvest (default 0%, env-forced) are independent enablers — turning on harvesting no longer requires enabling the unrelated dsh server-history rollout. Owner-facing switch is now exactly one env var.
  5. New stamped-header channel test suite (tests/msgid-header-channel.test.ts) pins the body-field ≡ header identical verdict + fat-header guards.

Local: tsc --noEmit clean; suites {identity-harvest, opencode-v2-msgids, msgid-header-channel, openai-msgid-pin, issue5719-msgid-lane-identity, proxy-session-id} = 61 pass / 0 fail. Docs updated (KDD #18 wording, lane tables now show all five adapters + V2 stamping + memo reasons per lane).

Roster status in docs: crush/gemini-cli/hermes/iflow = closure memos with audit citations; zed/kiro/qoder/copilot = live-run blocked; codex = deferred (#5643); aider/jcode/kimi = content-hash optimum (closed). Remaining open item from round 1 (openai row-pinning follow-up) is now done in this PR, so nothing external is outstanding except ramp-up numbers after observation.

@ranxianglei ranxianglei changed the title #5825 身份信道接线:统一消费缝 + 六条车道(opencode V2/goose/qwen/claude/codebuddy/mcode) [PR] #5825 Identity Channel Wiring: Unified Consumption Seam + Six Lanes (opencode V2/goose/qwen/claude/codebuddy/mcode) | #5825 身份信道接线:统一消费缝 + 六条车道(opencode V2/goose/qwen/claude/codebuddy/mcode) Nov 7, 2026
ranxianglei and others added 6 commits November 7, 2026 15:47
…fied

consume seam; no use site ever reads client storage itself.

- src/identity-harvest.ts: registry core — per-request snapshot at the single
  handle entry, same downstream path as host-stamped ids (#5719 attribution
  rung; anthropic wire additionally enters the pin/row pipeline via the
  existing body field). Gates: pluginLaneServerHistory rollout x
  BILI_IDENTITY_HARVEST env (off by default) x loopback-only x canonical
  msgid validation. Whole-turn degrade on any doubt — never partial mapping.
  Shared alignment: exact count parity vs expectedLen + boundary role
  spot-check (<=4 positions where both sides expose roles); bounded tail
  readers for jsonl/sqlite layouts.
- Adapters (self-contained, node builtins only): identity-claude.ts
  (transcript .jsonl: uuid rows, sidechain/summary excluded),
  identity-codebuddy.ts (<config>/projects/<dir>/<conversation-id>.jsonl,
  id+parentId rows only), identity-mcode.ts (runtime-state.sqlite
  local_runtime_message_rows per-turn read probe, open->query->close).
  Barrel registration in src/identity-sources.ts.
- Recognition merge (#5825 decision A): x-conversation-id joins the
  conversation-header names list in its low-trust tier (measured stable
  across restarts on 2.181.0; above bare generics, below affinity tier).
- Zero behavior change by default: env unset = fully inert, rollout at 0%,
  loopback boundary, all-or-nothing per turn.
- Docs: AGENTS.md KDD (all lanes into the one seam), docs/identity-channels
  (.md/.zh-CN) lane status table incl. deferred roster from the #5825
  investigation, env-only.yaml seed + regenerated config docs.
- Tests: tests/identity-harvest.test.ts (fixture-level sqlite/jsonl layouts,
  gate matrix, degraded paths, recognition precedence).
…s gate, #5825)

MAX_ROLE_SPOT_CHECK, IdentitySource and HarvestResult have zero references
outside src/identity-harvest.ts (verified textually across src/, tests/,
scripts/, docs/); the gate flags them as INTERNAL_ONLY. Drop the leading
export keywords instead of adding waivers - no cross-boundary consumer
exists. No behavior change.
…r-guard, #5825)

The new harvest kill/scope switch is read from src/identity-harvest.ts
but was missing from the ledger. Added as a transitional row in section 1
(default off, double-gated behind rollout pluginLaneServerHistory x
loopback-only; plan: retire per the #2028 pattern once the lanes settle).
…de V2 stamped header + goose/qwen adapters + openai row-pin parity + decoupled cohort gate
…s gate, #5825)

OpencodeV2MessageLike (src/agent/opencode-v2-msgids.ts) and
qwenVisibleRows (src/identity-qwen.ts) have zero references outside their
own files (verified textually across src/, tests/, scripts/); the gate
flags them as INTERNAL_ONLY. Drop the leading export keywords - no
cross-boundary consumer exists. No behavior change.
…le, lane status (owner request, #5825/#5842)

New docs/session-identity-resolution.md (+zh-CN): session-id vs message-id
roles, the full resolveSessionOrder ladder (claim → byte continuation →
persona escape rungs w/ verbatim-evidence demands → deterministic |sub: fork
→ #5719 msgid last-resort rung), why the msgid rung is last not first
(owner discussion 2026-11-07 ruling recorded), switching-layer table
(recognition ungated / harvest double-gate off / row pinning unchanged),
trust boundaries incl. whole-turn degrade contract.
AGENTS.md KDD #18 now points at it; channel docs cross-link both directions.
@ranxianglei
ranxianglei force-pushed the 2026-11-07_identity-channel-wiring branch from 47e3ac8 to 4a5a4a7 Compare November 7, 2026 07:48
@ranxianglei

Copy link
Copy Markdown
Owner Author

Rebased onto post-#5862 master (713a97562) — clean, zero conflicts; the hygiene fix lands in this branch too. Local re-verification on the new tip: tsc --noEmit clean; the eight related suites (incl. the now-restored msgid-rule-parity) → 135 pass / 0 fail. The two inherited v6-pin reds are gone from this branch.

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

查重:无——检索过并行身份信道接线工作项/PR,本 PR 是 #5825 的唯一落地载体。
标签:claude-code / codebuddy / mcode / goose / qwen-code / opencodev2(本 PR 接线的六条车道)、scope/wiring(协议接线·统一采集缝)、p3(默认全关的功能,零行为变化);功能类不打 bug。

本轮工作 = 对你三条留言的独立验证(继承红预警、scope-2 落地、post-#5862 rebase)+ 上一轮三个红 shard 的归因。结论先行:三个红 shard 全部是继承红,零自伤红;继承红已在 master 侧修复(#5862),分支 rebase 后已纳入,本地独立复核全绿。

① 是什么问题
不是缺陷修复,是功能 PR(身份信道接线)的验证轮。唯一要处理的问题:上一轮 CI 三个红测试 shard(ubuntu-22-s1 / ubuntu-24-s1 / windows-22-s4)是不是这个分支造成的。

② 什么原因导致
三个红全部继承自 master,与本分支无关。因果链:#5826 的重钉提交 33b2f82dc 把 msgid-rule-parity 两行钉到 fastpath-v6 F1/F2 裁定 → 同日 revert bebc239f2(#5854)删掉了 v6 实现代码 → master 自身在这两行上变红。证据链:该文件在分支↔master 间逐字节一致;分支头单文件跑精确复现同样两行失败(per-slot screening … (v6 F2) / pf-channel end-to-end handshake … (v6 F1…F2));拉取两个红 job(ubuntu-24-s1、windows-22-s4)日志,各自恰好只有这两条 not ok、无任何其他失败(第三个 ubuntu-22-s1 未单独拉日志,另两个签名完全一致且其余 shard 全绿)。

③ 影响范围与严重程度
master 级 born-red:凡包含这两个提交的树,持有该文件的 shard 必红,阻塞所有 PR 的 merge-gating;纯测试文件漂移,零运行时/用户影响。已修复:#5862(613d290ef9,两行恢复 pre-v6 裁定,+12/-21 恰好抵消重钉)已合入 master(713a97562)——正是你在预警里点名的修法。

④ 怎么修复的
按 CI 协调规则不在本分支重复修——修复收敛到 master(#5862),本分支经 rebase 到 713a97562 纳入。透明说明:我本轮中途曾起一个 rebase 到 pre-#5862 master 的本地版本,看到你的干净 rebase 落地后直接丢弃了那个本地产物(未 push),不存在双份工作。

⑤ 是否有回归问题
本轮零推送、零引入。新头 4a5a4a7469 上独立复核:tsc --noEmit 干净;八个关联套件(identity-harvest / opencode-v2-msgids / msgid-header-channel / openai-msgid-pin / issue5719-msgid-lane-identity / proxy-session-id / native-intercept / msgid-rule-parity)135 pass / 0 fail,与你的数字一致;scope-2 关键文件(opencode-v2-msgids.ts、identity-goose.ts、identity-qwen.ts、msgid-header-channel.test.ts、openai-msgid-pin.test.ts)在 HEAD 全部在位。分支 merge-base 为 713a97562,其后 master 仅多 #5860(kernel nudge 幻影压力守卫 + lockfile 同步),与本分支零文件重叠,behind 不阻塞合并。

⑥ 是否破坏缓存
不涉及。本轮未改任何代码;功能保持默认关闭(env BILI_IDENTITY_HARVEST 缺省 × rollout identityChannelHarvest 0%),出站字节不变。

⑦ 是否改了设计方向
没有。统一采集缝 + KDD #18 的方向已按你的裁定定死,本轮纯验证。

⑧ 是否引入了新的配置
本轮没有。PR 的配置面维持:BILI_IDENTITY_HARVEST(env-only,默认关)+ rollout.features.identityChannelHarvest(默认 0%,env 可强制),两把钥匙独立,均已登记 CONFIGURATION.md(中/英)、env-only.yaml、LIFECYCLE.md。

现状与遗留项

  • CI 正在新头 4a5a4a7469 上跑(截至 07:56Z:5 绿、12 shard 运行中、0 红);全量转绿后即具备合并条件。
  • 遗留 owner 决策一项(第一轮延续):放量数字——门控已解耦(你机器上开功能只动一个 env 变量),rollout 百分比缺省 0%,等你观察 warn-once 退化率后给数。其余外部开放项为零(openai wire 行钉住对等件已在 PR 内闭环)。

收工判定:三个红归因完毕且已在 master 侧修复,本分支干净、本地独立验证全绿;等 CI 在新头上确认即可由你合并,放量数字待你拍板。

@ranxianglei
ranxianglei merged commit df0a402 into master Nov 7, 2026
129 of 168 checks passed
@github-actions

github-actions Bot commented Nov 7, 2026

Copy link
Copy Markdown
Contributor

📦 Merged Build Published

This merge to master was published as 0.0.1070-master.df0a402 (rolling master tag).

npm install -g billion-context@0.0.1070-master.df0a402  # 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.

Louie0806 added a commit to Louie0806/billion-context that referenced this pull request Nov 7, 2026
…nel wiring + ranxianglei#5862 parity hygiene + ranxianglei#5860 phantom-pressure guard

Master moved twice since the last sync (295ba58 -> 591e940 -> df0a402).

- 591e940 (folded in here): ranxianglei#5862 "master hygiene" restored the
  msgid-rule-parity pins to their pre-v6 verdicts (undoing 33b2f82,
  which had pinned behaviour that the ranxianglei#5854 revert deleted), plus the
  ranxianglei#5860 phantom-pressure guard (a7cbfd1) and the kernel 0.0.184 bump.
- df0a402 (this merge): ranxianglei#5842 identity-channel wiring - one unified
  consume seam for every client lane (opencode V2 stamped header, goose/
  qwen adapters, openai row-pin parity, decoupled cohort gate), the
  identity DETERMINATION docs, and the unused-exports gate fixes.

The merge itself was conflict-free: the only shared files are the two
generated CONFIGURATION docs plus the website config-reference/web
artifacts, all of which are regenerated from the committed seeds rather
than hand-merged.

One inherited red needed a golden refresh: tests/golden/storage-render/
*.json digest drift, pre-existing on pristine master (verified on a
detached df0a402 worktree before the merge). The metadata section digest
and its derived stateDigest/stateDigestAligned moved with a7cbfd1, which
added compress.requireUsageSampleForPressure (default true) to the config
echo written into session.metadata - but that commit did not regenerate
tests/golden/storage-render/. Regenerated all four under the documented
pinned environment (node --import tsx scripts/update-storage-render-goldens.ts);
the diff is exactly 3 lines per wire (stateDigest, stateDigestAligned,
sectionDigests.metadata) and every other section digest is byte-identical.
ranxianglei added a commit that referenced this pull request Nov 7, 2026
…ted-state shape

Master moved past this branch's base (295ba58 → df0a402: #5860 phantom-pressure
guard + kernel 0.0.184, #5862 pin hygiene, #5842 identity-channel-wiring). The new
kernel config surface changes what the golden drive persists per session, so every
merge-ref CI run reds on all four wires even though no rendering behavior moved.

Re-generated via scripts/update-storage-render-goldens.ts (its own Parity #3 pin).
Per wire only stateDigest / stateDigestAligned / sectionDigests.metadata changed —
all turns[].sha (wire bodies) byte-identical, foldAt/editedAt unchanged,
state-key set unchanged ("state-key divergence: none").

A/B proof, same machine, same env (real node_modules each, kernel dist rebuilt):
- base 295ba58 + this branch's BILI_MESSAGE_TIMESTAMPS pin   -> exit 0, all green
- master df0a402 + identical pin                              -> exactly these four
  failures; digests byte-match our PR's CI errors verbatim
  (chat f53ae7a7..., anthropic 769f3766..., responses 01c80a61..., google 2c935a3a...).
Master's last scheduled CI predates #5860, so nothing upstream has surfaced this
yet; regenerating here so the branch is green against live master. No render or
storage-contract intent behind the delta beyond what the merged upstream commits
introduced.
ranxianglei pushed a commit that referenced this pull request Nov 7, 2026
…render-lane overlap

prepare-openai.ts: keep the v6 bounded kernel pass (scratch-clone window
pass + legacy fallback) and thread master's new tokenCountSource param
(kernel 0.0.184 phantom-pressure guard, #5860) through BOTH processTurn
calls inside it. LIFECYCLE.md: union — keep the v6 render-window env rows
and add master's BILI_IDENTITY_HARVEST row (#5842).
Louie0806 added a commit to Louie0806/billion-context that referenced this pull request Nov 7, 2026
…nel wiring + ranxianglei#5862 parity hygiene + ranxianglei#5860 phantom-pressure guard

Master moved twice since the last sync (295ba58 -> 591e940 -> df0a402).

- 591e940 (folded in here): ranxianglei#5862 "master hygiene" restored the
  msgid-rule-parity pins to their pre-v6 verdicts (undoing 33b2f82,
  which had pinned behaviour that the ranxianglei#5854 revert deleted), the ranxianglei#5860
  phantom-pressure guard (a7cbfd1), and the kernel 0.0.184 bump.
- df0a402 (this merge): ranxianglei#5842 identity-channel wiring - one unified
  consume seam for every client lane (opencode V2 stamped header, goose/
  qwen adapters, openai row-pin parity, decoupled cohort gate), the
  identity DETERMINATION docs, and the unused-exports gate fixes.

The merge itself was conflict-free: the only shared files are the two
generated CONFIGURATION docs plus the website config-reference/web
artifacts, all of which are regenerated from the committed seeds rather
than hand-merged.

Two golden refreshes ride along, both caused by a7cbfd1 and both already
red on pristine master before this merge (verified on detached worktrees at
591e940 and df0a402):

- tests/golden/storage-render/*.json - the new
  compress.requireUsageSampleForPressure (default true) lands in the config
  echo written into session.metadata, so only the metadata section digest
  and its derived stateDigest/stateDigestAligned moved. Three lines per
  wire; every other section digest is byte-identical.
- tests/golden/wire-contract/kernel.json - the same knob appears in the
  pinned acp-kernel NudgeConfig export snapshot: exactly one added line,
  "requireUsageSampleForPressure": true.

Both regenerated with the documented scripts (update-storage-render-goldens,
update-wire-contract-goldens) under the pinned suite environment.

Not fixed here (upstream behaviour, needs an owner ruling): a7cbfd1
defaults the pressure band to usage-grade readings only, but
tests/fork-nudge-trigger.test.ts and tests/silent-backend-nudge.test.ts
still assert that a local-estimate reading fires the pressure nudge. Both
are byte-identical to master and fail there too, so this merge does not
touch them.
@github-actions github-actions Bot mentioned this pull request Nov 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant