Repository navigation
[PR] Fully retire legacy |sub: fork ladder (post trust-stamped-id GA cleanup, #7525) | 彻底退役 legacy |sub: fork 阶梯(trust-stamped-id GA 后的清场,#7525) - #7564
Conversation
…7525) With the client-stamped session id trusted on every lane (percent:100 since #7525 GA), the content-forecasting fork machinery is write-only: every reachable session key is either the stamped id verbatim or the #5095 declared lane-token key. Owner ruling 2026-11-23: remove it completely instead of leaving a debug escape hatch. Removed: - src/session-resolve.ts rewritten to the GA shape: resolveSessionOrder( rawId, personaTag?, laneToken?) returns the verbatim id (action "raw") or the #5095 lane-token fork (action "derived-persona"). Gone: the skeleton map + record(), the |sub:aux / |sub:<fp> / |sub:task:<skel8> fork rungs, #5719 msgid rescue (tryMsgIdRescue / readStoredMsgIds / laneDiscriminator), model-drift absorption, persona re-anchor. - src/order-persist.ts (the 630KB kv_store namespace "session-order" writer) and src/persona-anchor.ts (header-marked retired, kept only as a test pin) deleted; boot hydrate + shutdown/exit flush wiring removed from src/cli.ts, src/server.ts, src/restart.ts. - src/rollout.ts: trustStampedId flag entry deleted; the BILI_ROLLOUT_TRUST_STAMPED_ID=0 env escape hatch no longer exists. - src/session-id.ts: anthropicFirstUserFrag (only consumer was the D1-B discriminator rung) deleted. - src/server/handle.ts: the six persona call sites drop their dead arguments (history / model / msgIds / storedMsgIdsOf); the observer now logs derived- (lane-token) resolutions only — the reanchor/claim noise of the retired rungs is gone. Config-surface removals (declared per repo doctrine): - rollout.features.trustStampedId (config key) — GA default moved into the code; setting it now has no effect. - env BILI_ROLLOUT_TRUST_STAMPED_ID — read by nothing anymore. - kv_store row namespace "session-order" key "v1" becomes dead data (nothing writes or reads it; left in place — delete manually if desired); stateDir()/session-order.json is a stale fallback file that nothing produces any more. - telemetry: the [session-resolve][msgid-rescue] warn line (#5719 / #5865-P2) dies with its rung. Kept (still load-bearing): - #5095 declared lane-token fork (client-declared, survives GA) — tests/trust-stamped-id.test.ts reworked as the GA characterization, tests/issue5095-subagent-lane-token.test.ts un-pinned. - #970 claude agent-header split, aux sidecar lanes, side-lane invariants — tests/side-lane-invariants.test.ts un-pinned, its (D)/(E)/(E2)/(L) fork assertions flipped to the GA verbatim contract. - #2601 livePersonaDescendant birth-order follow in src/plugin.ts stays (it also serves token-minted lanes); its construction scenario was a legacy content-fork, so the two pin suites (persona-fork-active-parent-guard, issue2948-aux-lane-lineage-guard) are deleted and that path is now covered only indirectly. - tests/session-continuity-proof.test.ts: scenario A control flipped (uncorroborated system drift now rides the raw key, no fork); scenario B (host-driven fork API + copy-on-fork) untouched. 16 legacy-pinning test suites deleted, 9 test files de-pinned, scripts/ci-shard-weights.json re-trimmed (9 removed entries), reference/architecture.md updated.
(ai: vllm-qwen/qwen3.8-27b) 收到,这是 #7564 的 [PR] 镜像 issue。按「自己的 PR 不重做」纪律处理:核对代码 + 确认 CI + 报告结论,不重做。 当前状态(实时核对,非记忆):
我先把分支拉下来做代码审查(重点: |
… ladder it rescued master's #5844 (sessions reattach) exists to repair legacy persona forks (the warning log that names the command is gone with the ladder, and tagHash recording is gone, so the command could never have worked under GA): drop the CLI subcommand, runReattach, and its test. order-persist.ts stays deleted.
…amped-id-ga-2026-11-23
📦 Built Package ArtifactBranch: Latest build — install this exact versionnpm install -g billion-context@0.0.11580-pr.7564.a68e3f7This exact version is immutable and reproducible. The rolling Recent builds (commit → version)
Download artifact
tar xzf billion-context-pr7564.tgz
npm install -g packageInstall instructions are refreshed on each push. |
|
review结论 |
[bot] 🏷 收到。review 结论如下。 总体判定:PR 自身 diff 干净正确(GA 行为字节不变、测试重写到位、配置面声明合规、无悬空引用),但有一个 stale-base 阻断问题——#5844 在 PR 切出后落到 master,其 一、PR 自身 diff(干净,已逐项核验)
二、阻断性发现:#5844 stale-base 冲突#5844(
PR 删 rebase 到当前 master 的后果:
语义层面:reattach 恢复的是 GA 退役的 persona fork( 三、需 owner 决策(rebase 合并的前置)
在决策前,这个 PR 不能 rebase 合并——无论选哪个,都需要在 rebase 时一并处理 #5844 的 4 个文件,不是简单 rebase 能过的。 四、其他发现(非阻断)
八问
收工判定:PR 自身 diff 可合(干净、正确、测试到位),但当前不能 rebase 合并——需 owner 先拍板 #5844 reattach 的去留(推荐 A,若存量 orphan lane 可丢弃),再在 rebase 时一并处理 #5844 的 4 个文件。 |
🔶 需要决策 背景:PR #7564 要彻底退役 GA 后已无决定权的 legacy 待决问题:#5844 的 选项(各带代价):
推荐:A——reattach 恢复的 persona fork 在 GA 下已不再产生,若 PRE-GA 存量 orphan lane 已清理/可丢弃,选 A 清场才彻底。 不决定的默认行为:PR 保持 open、不 rebase 合并(当前 rebase 必红);#5844 的 reattach 功能维持现状(仍可用,直到本 PR 落地)。 详见上一条 review 结论(八问 + #5844 交互细节)。 |
…kes the all-four-wires version
📦 Merged Build PublishedThis merge to master was published as npm install -g billion-context@0.0.1293-master.328fdeb # this exact build
npm install -g billion-context@master # always the newest merged build
|
…ranxianglei#6785 egress-plane era (slim ccr envelope) + ranxianglei#7564 trust-stamped-id GA retirement + ranxianglei#7566 revert + ranxianglei#7565 dsh re-pin + ranxianglei#7553 self-contained blocks
这是啥
#7525 把「信任客户端盖的 session id」提到 100% 之后,代码里那套「看内容猜会话、猜错就 fork 一个 |sub: 影子会话」的老机器已经没有任何决定权了——每个会话 key 要么就是客户端盖的原值,要么是 #5095 客户端声明的 lane-token。owner 2026-11-23 拍板:不留调试后门,整条链路彻底删干净。本 PR 就是那次清场。
删了什么
src/session-resolve.ts重写为 GA 形状:只剩两条路——stamped id 原样骑(action "raw")/ Claude Code sub-agents of the same type share a single compaction lane: unrelated sessions bleed content into each other | Claude Code 同类型子代理共用一条压缩车道:无关会话互相串内容、折叠暂停;旧版共享父 id 的折叠块升级后仍残留在父会话 #5095 lane-token fork(action "derived-persona")。skeleton 图、|sub:aux/|sub:<fp>/|sub:task:各 rung、[resolveSessionOrder] Full compaction and persona tag drift occurring in the same turn → inevitably forks to |sub: side | [resolveSessionOrder] Full compaction and persona tag drift occurring in the same turn → inevitably forks to |sub: side | [resolve… #5719 msgid rescue、模型漂移吸收、persona re-anchor 全部移除。src/order-persist.ts删除——它就是 kv_store 里那个 630KB 大 JSON(namespace "session-order" key "v1")的唯一写入器;src/persona-anchor.ts(头部早已标注 retired、只作为测试 pin 保留)一并删除。cli/server/restart 里的 hydrate/flush 接线同步拆掉。rollout.features.trustStampedId配置键 +BILI_ROLLOUT_TRUST_STAMPED_ID环境变量——设置它们从此无任何效果。src/session-id.ts的anthropicFirstUserFrag(唯一消费者是已退役的 rung)删除。src/server/handle.ts六个 persona 调用点去掉死参数(history / model / msgIds / storedMsgIdsOf);resolve 事件观察者现在只记 derived-(lane-token)事件,reanchor/claim 的日志噪音随 rung 一起没了。明确留住的
tests/trust-stamped-id.test.ts重写为 GA 特征化,tests/issue5095-...解除 env pin。tests/side-lane-invariants.test.ts解除 pin,(D)/(E)/(E2)/(L) 的 fork 断言翻成 GA 原值契约。tests/session-continuity-proof.test.ts:scenario A control 翻转(无佐证 drift 现在原样骑 raw key、不 fork);scenario B(host 驱动的 fork API + copy-on-fork)不受影响。CLI 面移除(合并 master 时补删,merge commit 5202c49)
bili sessions reattach子命令随本 PR 删除(master 在 [PR] fix: bili sessions reattach — reclaim a persona fork's parent blocks after a host prompt upgrade (#5844) #7512 新合的 Resuming a long session fails with preflight 413 when persona fingerprint and replay shape change together (0.1.212) #5844;master 侧随后也自行 revert 了 [PR] fix: bili sessions reattach — reclaim a persona fork's parent blocks after a host prompt upgrade (#5844) #7512,见 PR [PR] revert: bili sessions reattach (#7512) — this incident pattern no longer occurs after trust-stamped-id GA | revert: 撤回 bili sessions reattach(#7512)——trust-stamped-id GA 后该事故形态不再产生 #7566——两边处置一致):它唯一的存在理由是把 legacy persona fork 的父块接回去,触发入口是 fork 警告日志(已随 rung 删除),且 tagHash 记录机制已删、GA 下它读不到任何数据——死命令。src/cli.ts/src/storage-maintenance.ts的对应代码与tests/issue5844-sessions-reattach.test.ts一并移除。测试与数据
scripts/ci-shard-weights.json同步减 9 条,reference/architecture.md更新;architecture-docs / unused-exports / test-import-graph 三道门全绿,全部受影响套件本地全过。src/plugin.ts的 livePersonaDescendant)代码保留(token-minted lane 还在用),但它原有的构造场景就是 legacy 内容 fork,两个专属 pin 套件(persona-fork-active-parent-guard、issue2948-aux-lane-lineage-guard)随之删除——这条路目前没有专门测试。namespace="session-order" key="v1"那行、以及 stateDir 下session-order.json落盘文件,从此无任何代码读写。生产库那行建议合并后手动DELETE FROM kv_store WHERE namespace='session-order' AND key='v1';(约 630KB)。回归
GA 行为字节不变:#5095 lane-token 的 key 公式逐字节保留(
<id>|sub:[<fp>:]t:<token>);#970 拆分、side-lane、prefix-affinity、plugin-conversations 未触碰。被删路径在 GA 默认下本来就不可达(flag percent:100 自 #7525 起)。