背景:#2157 修复 #2156 时引入 fork 子会话污染回归(#2164 修复,幸好未发版即被拦下)。根因:泳道判定是复合布尔条件,dsh 流量形状 = 会话种类 × 请求种类 × 到达顺序 的组合空间,fork-child + 全量重放侧请求这个格子无测试覆盖。 **5 项措施**(按性价比排序,全部要做): 1. **泳道判定抽纯函数 + 穷举真值表**:`resolveSideLane(signals) → {lane, reason}`,单测穷举全部输入组合;改条件必翻红。 2. **测结果不变量 + ordering-fuzz**:侧请求对 kernel 会话观察透明(不追加 turn / 不动 usage 基线 / stats.requests 不涨);侧请求交错位置不影响主会话终态。#2156 与 #2157 回归都违反后者,一个 fuzz 能同时抓住两者。 3. **dsh golden fixture + e2e lane**:把 fork-side-request-lane.test.ts 的 wire harness(anthropic wire + x-bili-plugin + /fork + title 重放)固化为 CI 常驻;现状 pi/codex 有专门 lane,dsh 作为最大宿主反而没有。 4. **运行时金丝雀**:side 形状请求引起会话突变 → warn + /__bili/status 暴露 `sideEffectLeak`;acp_status 检测同 id 裸会话与 `|sub:` 会话同时有近期流量时告警(让 #2165 式分裂不再静默)。 5. **lane-guard CI job**:仿 kernel-guard,改动 sideRequestLike/泳道区域的 PR 必须跑 fork-side 测试文件。 实施约束:全部落在 src/ + tests/ + workflows,不碰 kernel/(避免 kernel-change 流程)。由 @ework 认领协调,实施按 1→2→4→5→3 顺序(3 需要 fixture 录制基建,最后做)。
Activity
ranxianglei commentedon Oct 5, 2026
[bot] 🏷 查重结论先说:本 issue 已有 #2175(open、mergeable、CI 全绿)实现了同样的 5 项措施。我在发现它之前已独立完成了一份等价实现;按 loop guard(一个 issue 至多一个 PR)我没有再开第二个 PR。下面是我对 #2175 的结构化评审 + 与 issue 原文的偏差 + 整合建议。
对 #2175 的结构化七问(review 结论)
demoteGate+resolveSideLane)作单一事实源 + 穷举真值表钉死。splitSessionWarnings分裂检测;⑤lane-guard(改泳道逻辑必须同改泳道测试文件)。dsh plugin lane、lane-guard、kernel-guard、全部真实客户端 lane 均 success);措施 1 抽函数经真值表逐格对照原表达式验证行为保持。/__bili/status的splitSessions字段与内部常量SPLIT_CANARY_FRESH_MS=10min。与 issue 原文的两处偏差(实测自 diff,供你确认是否有意)
/__bili/status暴露sideEffectLeak"。feat: side-lane regression hardening — pure lane gates, truth tables, canaries, CI lane guard (#2170) #2175 只在src/server.ts把计数存到session.metadata.sideEffectLeaks+ 打 warn 日志,但sendStatus(≈L7636)返回的 JSON 里只有splitSessions,没有sideEffectLeak字段 → 该要求未落地(仅日志可见,状态端点不可见)。|sub:会话同时有近期流量时告警"。feat: side-lane regression hardening — pure lane gates, truth tables, canaries, CI lane guard (#2170) #2175 未改src/acp-status.ts,splitSessionWarnings只接进sendStatus(HTTP/__bili/status)+ 一次性日志,没进 acp_status 工具输出 → 表面不符(issue 点名的是 acp_status,让 agent 侧能看到)。另其判定为「同 base ≥2 个 live 会话」,比 issue 字面形状「裸会话 AND|sub:会话」更宽——两个合法 persona fork 且无裸孪生时可能误报。设计差异(非缺陷,记录备查)
tests/fork-side-request-lane.test.ts兜底。我的独立实现额外把 fork-child 也塞进了同一个 fuzz(一个 fuzz 同时抓 [bug] dsh:side request 先到会抢走 persona 锚点,主会话被 fork 到 |sub:<fp>,原生 compress 永久失败 #2156 与 fix: side requests under public-fork children ride the #388 passthrough (#2157 follow-up) #2164)。结论与建议
以 #2175 为准合并(它绿、可合、方向对)。上面两处措施 4 的小缺口我已在独立实现里写好并验证过(63 tests 绿 + typecheck clean),可作为 additive commit 补到 #2175 分支;golden fixture 可另开一个小的 follow-up PR 引用 #2170/#2175。
请你拍板整合路径:①合 #2175 后我来补这两处 + 开 golden-fixture follow-up;还是 ②你指定以哪份为准。我的独立实现在本地分支
2026-10-05_dsh-regression-guard(commit f5f3589f,未推送)作参考,需要我再推也行。fix(#2170): review findings A+B — split canary excludes design person…
Merge pull request #2175 from ranxianglei/2026-10-05_dsh-regression-h…
feat: side-lane regression hardening — pure lane gates, truth tables,…
test: pin responses-wire side-request persona boundary (#2203, lane-g…
test: pin responses-wire side-request persona boundary (#2203, lane-g…
test: pin responses-wire side-request persona boundary (#2203, lane-g…
test: pin responses-wire side-request persona boundary (#2203, lane-g…
fix(ci): watch the extracted handle.ts lane region in lane-guard
test(#2730): move the google side-request pin into the dedicated side…
test(side-lane): empty-persona dsh traffic rides the raw key on every…
test(#2731): pin the google-lane empty-system non-anchoring guard in …
test: pin read_original_image in the bili-owned set alongside its sid…
test: pin read_original_image in the bili-owned set alongside its sid…
13 remaining items
test: pin the output-budget re-export identity in the side-lane suite (…
fix(ci): restore side-request.ts comment line to clear lane-guard (#2170
fix(v1internal): hyphenate side-request in the 413 message (lane-guar…
fix(v1internal): reword bypass comment to not trip the #2170 lane-gua…
test: move the ranxianglei#6828 dual-shape guard regression to the si…
test: pin the output-budget re-export identity in the side-lane suite (…
side-lane truth table: pin the declared-purpose input (#6880, lane-gu…
plugin: v2 wire — declare EVERY dispatch's purpose, main traffic keys…
plugin: v2 wire — declare EVERY dispatch's purpose, main traffic keys…
test(side-lane): pin the ranxianglei#7009 probe block as structurally…
test: pin the output-budget re-export identity in the side-lane suite (…
test(side-lane): pin the pi declared-main-turn rung in the truth table (
test(side-lane): pin the ranxianglei#7009 probe block as structurally…
test(side-lane): pin the kind-aware demotion gate in the truth table …
test: move the #6828 dual-shape guard regression to the side-lane sui…