Skip to content

[PR] feat(web): Add Context Trace view to conversation detail page (#3201) | [PR] feat(web): 会话详情页新增「上下文轨迹」视图(#3201) - #3337

Open
ranxianglei wants to merge 11 commits into
masterfrom
2026-10-16_web-ui-trajectory-view
Open

ranxianglei wants to merge 11 commits into
masterfrom
2026-10-16_web-ui-trajectory-view

Conversation

@ranxianglei

@ranxianglei ranxianglei commented Oct 16, 2026 •

Copy link
Copy Markdown
Owner

Closes #3201

做什么

web UI 会话详情页(/__bili/)新增「上下文轨迹」视图:从已持久化的会话状态重建最近一次发给 LLM API 的出站上下文——不抓包就能看到完整请求内容,对应 dsh 每个会话的「轨迹」页(owner 在 #3201 拍板:详情页最下方默认换成轨迹)。

  • 记录台账(dsh 式):系统提示词与工具节(全文 + 工具名 + 原始定义),其后每条消息一行:#N、类型徽标(用户/助手/系统/工具调用/工具结果/思考/压缩摘要)、消息 ref(mNNNNN)、轮次、估算 tokens、单行预览;点开看全文。折叠块以「压缩摘要」行锚定在其 span 末尾(tier + 节省 tokens + summary);无法锚定的块诚实列出,不静默丢弃。
  • 替换交接文档作为页面最下方的默认展示([Feature] Provide a "trace" feature similar to dsh's on the session page of the Web UI | [Feature] 在 web ui 的会话页面里提供类似 dsh 的「轨迹」功能 #3201 owner 拍板);交接 md 的复制/下载按钮保留在视图工具栏。
  • 「复制 JSON」导出归一化轨迹结构。
  • 新增有界伴生文件 <stem>.system-surface.json(与 session JSON 同目录):记录最近一次请求的确切系统文本 + 工具定义(此前只持久化了 token 计数)。捕获点 = 四个 wire stamp 处,与既有 systemPromptTokens 测量同点同行;hash 门控(surface 真变化才重写);每字段 ≤400K chars(hash 仍覆盖未截断全量);原子 tmp+rename、mode 0600。derived artifact 语义:缺失/损坏降级为「未捕获」,永不阻塞会话加载;GC 按 twin-fallback 保留规则共删并纳入 orphan 清扫。

行为变更(旧 → 新)

  1. 会话详情页最下方默认展示:交接文档 → 上下文轨迹视图(交接 md 仍可通过工具栏复制/下载按钮获取)。原因:[Feature] Provide a "trace" feature similar to dsh's on the session page of the Web UI | [Feature] 在 web ui 的会话页面里提供类似 dsh 的「轨迹」功能 #3201 owner 拍板「直接默认换成轨迹」。
  2. token 曲线图标题:上下文轨迹 → 上下文曲线(en: Context trajectory → Context curve)。原因:与新视图命名冲突。
  3. GC 审计日志措辞:[gc] removed orphaned content store <f> → [gc] removed orphaned companion file <f>;汇总行 content store file(s) → companion file(s)。原因:orphan pass 现覆盖两类 sidecar(content store + system surface)。
  4. 新增有界伴生文件 <stem>.system-surface.json(每字段 ≤400K chars)。原因:系统提示词文本此前没有任何地方持久化,轨迹视图需要它。

Config surface

不涉及 — 无新 config 字段 / env / CLI flag。

测试

  • typecheck clean;build OK。
  • 定向套件全绿:tests/web-trajectory.test.ts(9 新)、tests/system-surface-persist.test.ts(7 新)、tests/session-gc.test.ts(27:原 23 含 twin-fallback 共删回归测试——本 PR 将该规则重构为两类 sidecar 共享的 helper;另补 4 个 system-surface sidecar 的 GC 生命周期测试——共删 / twin fallback / orphan 清扫,review 时补入)、tests/storage-ccr.test.ts、tests/wire-contract.test.ts、tests/proxy-persist.test.ts(23)。
  • 顺手小修(独立标注 commit):proxy-persist 两处目录布局断言假设顶层只有 legacy 条目,但未配置 storage tier 时 unified store 默认 shadow 模式(Storage layer: four concrete defects (filename coupling, multi-writer heuristic, non-atomic content-store write, immortal compressed sessions) #2671),会合法地在 namespace 目录旁打开 index.db/-wal/-shm——本地跑计数到 4 而非 1 而失败(master CI test lane 在同一 base commit c800ed1 上为绿,触发条件疑似环境相关,node:sqlite 可用性是首要嫌疑);断言现过滤这些已知 sidecar,「无杂散文件」的意图不变。

边界


[bot] 🏷 review 更新(2026-10-16):分支已 rebase 到当前 master(d8c0e50e7);唯一冲突 src/persist.ts flushAll 按 union-of-intent 解决(保留 #3133 drainWriterOffPending + 新 surface 保存循环)。定向套件本地全绿;补一个标注 commit 覆盖 surface sidecar 的 GC 路径。

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

查重:不重复。 全仓检索「trajectory / 轨迹」相关 issue 与 PR(open+closed)后确认:本 PR 是 #3201 的唯一在途实现;#2489/#2492(已关闭)是既有 token 曲线图的 zoom-brush 功能,与本 PR 的「上下文轨迹」视图无重叠。

审核进行中,初步观察:

  • PR 基于 c800ed1bb,当前 master 已前进(最新 merge b2868ca68),GitHub 报 mergeable_state: dirty——需要 rebase/merge 解冲突后才能合。
  • head commit 上尚未看到 CI check runs。

接下来按规范做完整 review(原 issue 方向、回归清点、代码审查、测试有效性、diff 整洁度),完成后按八问体例给结论。

@ranxianglei
ranxianglei force-pushed the 2026-10-16_web-ui-trajectory-view branch from eff0223 to 6efc7a3 Compare October 16, 2026 03:46
@github-actions

github-actions Bot commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

📦 Built Package Artifact

Branch: 2026-10-16_web-ui-trajectory-view (3ff16ed)

Option A — Install this exact build (recommended)

npm install -g billion-context@0.0.4791-pr.3337.8f52ce5

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-pr3337.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)

进度:分支已 rebase 到当前 master 并推送,CI 跑完后给八问结论。

  • Rebase:PR 原基于 c800ed1bb(master 已前进 399 个提交)。已 rebase 到 d8c0e50e7(当前 master HEAD),新 head 6efc7a372。唯一文本冲突在 src/persist.ts 的 flushAll——master 侧 影子存储(默认开启)每次落盘把整个会话重新序列化+哈希,大会话明显变卡;jsonWriter=off 时连防抖合并都没了 #3133 新增了 drainWriterOffPending()(关闭 sidecar 前排空 writerOff 挂起写),本 PR 把循环里加了 saveSystemSurface();按 union-of-intent 合并两者(先 drain、后双保存循环),语义不冲突。
  • 本地验证:rebased head 上 typecheck clean;定向套件全绿——web-trajectory(9)、system-surface-persist(7)、session-gc、proxy-persist、storage-ccr、wire-contract,合计 89 pass / 0 fail。
  • 顺手补的测试(独立标注 commit):审核发现本 PR 把 twin-fallback 共删规则重构成两类 sidecar 共享的 helper,但 tests/session-gc.test.ts 只覆盖了 content-store 一类——新增的 .system-surface.json GC 路径(共删 / twin fallback 保留 / orphan 清扫 + 年龄门)没有直接测试。补了 4 个镜像测试(session-gc 现 27 个),全部通过。commit:6efc7a372 test: cover system-surface sidecar lifecycle in session GC (#3201)。
  • PR 描述已同步(测试计数 + rebase 说明)。

等 CI check runs 出结果后按八问体例给最终结论。

@ranxianglei
ranxianglei force-pushed the 2026-10-16_web-ui-trajectory-view branch from 8e6a9be to c3e26c1 Compare October 16, 2026 04:32
@ranxianglei ranxianglei changed the title feat(web): 会话详情页新增「上下文轨迹」视图(#3201) [PR] feat(web): Add "Context Trace" view to Conversation Detail Page (#3201) | [PR] feat(web): 会话详情页新增「上下文轨迹」视图(#3201) Oct 16, 2026
@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

审核结论 — PR #3337「上下文轨迹」视图

1. 是什么问题
PR 本体(#3201 owner 拍板的功能):会话详情页 /__bili/ 最下方默认换成「上下文轨迹」视图,从已持久化会话状态重建最近一次出站 LLM 上下文 + 新增有界伴生文件 <stem>.system-surface.json 记录最近请求的确切系统文本与工具定义。我按 PR Review 规范做了全量审核(17 文件逐一读 diff + 既有行为清点 + 定向测试 + CI 全局把关),发现并直接修掉了 4 处真实缺陷(均已作为独立标注 commit 推到 PR 分支)。

2. 什么原因导致的

  • 严重:模板转义错误会让整个 /__bili/ 页面打不开。WEB_CLIENT 是 src/web/client.ts 里一个跨 ~2900 行的模板字符串,新轨迹代码里单转义的 \"/\n 会被外层模板先求值成裸引号/裸换行,浏览器加载时整段内联脚本 SyntaxError,页面白屏。共 4 处(trajPreview 的 indexOf("\n")、tool-chips/traj-json/traj-text 三处的 class 属性与截断后缀)。
  • t("kind." + r.kind) 动态拼 i18n key,Web UI 英文翻译开关(i18n)— 社区 PR #807 (@amirzamli) #1024 引用扫描器抓不到真实引用(误报 kind. 缺目录条目)→ 改为静态 KIND_LABEL 映射(8 个字面量 key,覆盖 kind union 全部取值)。
  • 本 PR 替换交接卡片后,det.handoff/det.handoff_hint 成为孤儿 key,dead-key 门禁必红 → 从 zh/en 两 locale 删除。
  • kind.tool-call/kind.tool-result 是全目录首批连字符 key,tests/web-i18n.test.ts 五处引用扫描正则 [\\w.]+ 不含 - → 参照的 key 反被报 dead。

3. 影响范围与严重程度
转义 bug = 合入即全站 /__bili/ 页面加载失败(所有 web 用户),属合入前必须拦下的级别——正是 vm 类测试(web-handoff-roles/web-i18n 用 vm.runInNewContext(WEB_CLIENT) 真编译脚本)在 CI 里把它钉住的。其余三处为界面显示瑕疵 + 仓库门禁失败,无数据风险。

4. 怎么修复的
全部在源头修,不做流上过滤:转义在发射点修对(对齐文件既有双转义约定);i18n 改静态引用让门禁可验证;死 key 删除;扫描器字符类扩展。需披露的门禁语义变更:tests/web-i18n.test.ts 五处并行正则 [\\w.]+ → [\\w.-]+(旧→新)。闭合引号锚定保证捕获精确、只会更严不会漏放;这是让首批连字符 key 可被门禁追踪的必要配套。另有两处早前已推的审查修复:session-gc 补 4 个 system-surface 生命周期测试(co-delete/twin 保留/orphan 年龄门,23→27)、去掉 WebTrajectoryRecord/WebTrajectory 两个未用导出(unused-exports 门禁)。分支已 rebase 到最新 master(d0ebe24fe,含 #3288),无冲突。

5. 是否有回归问题
触碰路径既有行为逐项清点,全部保住:flushAll 与 master #3133 的 drainWriterOffPending() 正确并集(冲突点按双方意图合并);GC twin-fallback 重构为两类 sidecar 共享 helper 后原 content-store 语义不变(原 23 个 session-gc 测试全绿 + 新增 4 个);handoff md 复制/下载按钮保留在工具栏;i18n 目录只删死 key 不动活 key;det.trajectory→det.curve 重命名的波及面核实为 client.ts 图表标题 + report.ts 文本报告同段标题两处,均就是 token-curve 段,与声明的行为变更 #2 一致。PR 声明的 4 项行为变更逐条在 diff 中验证属实。本地定向套件 109/109(全部 web-* 测试)+ typecheck 干净;head 0a60339 上 CI 全矩阵绿(ubuntu/windows × node22/24 × 3 shards + 全部 guard/static-gates + E2E codex/local-registry/dsh-plugin-lane 等 workflow)。

6. 是否破坏缓存
不涉及。新增伴生文件是 derived artifact:缺失/损坏降级为「未捕获」,永不阻塞会话加载;hash 门控只在 surface 真变化时重写;GC 按 twin-fallback 保留规则共删,探针失败一律保守保留(绝不猜删)。

7. 是否改了设计方向
不变。视图是协议中立的归一化重建(CoreMessage 台账),byte-exact wire dump 与逐轮时间线留待 #3201 Phase 2,边界声明准确。kernel/** 与 pi-subagents/** 零改动。

8. 是否引入了新的配置
不涉及 — 无新 config 字段 / env / CLI flag(与 PR 声明一致)。

非阻塞观察(留档,不在本 PR 处理)

  • 性能:buildTrajectory 每次详情页渲染对最多 5000 条消息做全文 defaultCountTokens 估算,无 memoization;马拉松长会话下首屏可能明显变慢。后续可加惰性/增量估算。
  • nit(接受现状):client.ts 硬编码 { n: 5000 } 与服务端 TRAJ_RECORDS_CAP 重复,改上限需同步两处。

判定:建议合并。 head 0a60339 CI 全绿、mergeable=True(blocked 仅为 review 条件)、4 处缺陷已在源头修复并有测试钉住、行为变更全部如实披露。合并动作请人工执行:#3337

@ranxianglei
ranxianglei force-pushed the 2026-10-16_web-ui-trajectory-view branch from 0a60339 to 25150f4 Compare October 16, 2026 05:26
@ranxianglei ranxianglei changed the title [PR] feat(web): Add "Context Trace" view to Conversation Detail Page (#3201) | [PR] feat(web): 会话详情页新增「上下文轨迹」视图(#3201) [PR] feat(web): Add Context Trace view to conversation detail page (#3201) | [PR] feat(web): 会话详情页新增「上下文轨迹」视图(#3201) Oct 16, 2026
@ranxianglei ranxianglei changed the title [PR] feat(web): Add Context Trace view to conversation detail page (#3201) | [PR] feat(web): 会话详情页新增「上下文轨迹」视图(#3201) [PR] feat(web): context-trajectory view on session detail page (#3201) | 会话详情页新增「上下文轨迹」视图(#3201) Oct 16, 2026
@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

查重: 不重复 —— 本条是系统转发的上游 PR 冲突唤醒,延续 #3201 的既有工作(前序会话已做过接单查重,floor 4),非新缺陷。

处理结果:冲突已解,CI 全绿,PR 可合并。

做了什么:

  1. Rebase:master 在 PR 分支落后期间推进了两个合并(fix(tests): pin AC12 restart shape with a synchronous persist barrier #3345 AC12 测试钉死、fix(antigravity): unwrap v1internal responses on compress-loop round 2+ and the non-streaming lane #3282 antigravity 修复),与 PR 文件集零重叠(dry-run 无文本冲突,"dirty" 标记是 base 过期)。已将分支从 0a6033927 rebase 到最新 master 745be9ff2,零冲突,新 head 25150f40b。
  2. 修掉 rebase 后 CI 暴露的两处测试回归(均为本 PR 引入、此前定向测试漏跑的文件):
    • tests/session-report.test.ts:PR 把 token 曲线段标题 i18n key det.trajectory 从「上下文轨迹/Context trajectory」改为「上下文曲线/Context curve」(PR 描述里已声明的行为变更 fix: address all code review findings (condense, routing, session-id, dead code) #2),但会话报告 markdown 的标题断言还写着旧名 → 所有分片报 missing section: 上下文轨迹。已把断言更新为新名。
    • tests/issue2129-restart-measurement-state.test.ts:该 e2e 的辅助函数 findRecordFile() 断言会话目录里「恰好一个 .json」,而本 PR 新增的派生伴生文件 <stem>.system-surface.json 也落在同目录 → expected exactly one session record, found 2。已让辅助函数排除伴生后缀(.content-store.json / .system-surface.json),与 persist-guard-ownership 等既有测试的过滤模式一致。
    • 第三个失败 AC12(lineage gate)不是本 PR 的问题:它是既有 flake,master 侧刚由 fix(tests): pin AC12 restart shape with a synchronous persist barrier #3345(fix(tests): pin AC12 restart shape with a synchronous persist barrier)修掉,rebase 后自动带上。本地复跑确认通过。
  3. 验证:typecheck 干净;三个受影响测试文件本地全绿(session-report 8/8、Restart loses measurement state: buildSession() omits stats fields buildRecord() persists (k̂, usage anchor, baseline origin, localInputEstimate) #2129 4/4、lineage 4/4);推送后远程 CI 在 25150f40b 上 30 success / 14 skipped(门控 e2e,照常)/ 0 fail,mergeable=True(base=745be9ff2)。合并动作按规矩留给人工。

结构化八问

  1. 是什么问题:系统报「上游 PR 冲突」——PR 分支落后于 master;rebase 后 CI 又红在 3 个测试上。
  2. 什么原因导致的:冲突本身只是 base 过期(无文本冲突);CI 红的根因是本 PR 自身两处测试面疏漏——① i18n 改名后旧断言没跟着改;② 新增 sidecar 文件被一个「数目录里 json 文件」的测试辅助函数当成了会话记录。AC12 失败是无关的既有 flake(master 已另行修复)。
  3. 影响范围与严重程度:仅测试面,无任何用户可见行为变化;后果是 PR 被 CI 卡住无法合并。
  4. 怎么修复的:rebase 到最新 master + 两处最小测试修正(断言跟上新命名;计数只认记录、不认伴生文件),独立标注 commit,不碰任何 src 代码。
  5. 是否有回归问题:无。两处改动都在 tests/ 内;报告渲染逻辑未动(改名本身是 PR 已声明变更);Restart loses measurement state: buildSession() omits stats fields buildRecord() persists (k̂, usage anchor, baseline origin, localInputEstimate) #2129 辅助函数只是收窄计数口径,与其他测试既有惯例一致,不影响被测行为。
  6. 是否破坏缓存:不涉及。
  7. 是否改了设计方向:不涉及。sidecar 与视图的设计维持 PR 原样。
  8. 是否引入了新的配置:不涉及。

另:按标题国际化规则,把 PR 与镜像 issue 标题都改成了「英文 | 中文原文」形式(正文未动)。

判定:收工 —— 分支干净、CI 全绿,等待人工合并。

@ranxianglei ranxianglei changed the title [PR] feat(web): context-trajectory view on session detail page (#3201) | 会话详情页新增「上下文轨迹」视图(#3201) [PR] feat(web): Add Context Trace view to conversation detail page (#3201) | [PR] feat(web): 会话详情页新增「上下文轨迹」视图(#3201) Oct 17, 2026
@ranxianglei

Copy link
Copy Markdown
Owner Author

冲突

awork added 10 commits October 20, 2026 23:00
…ed sidecar (#3201)

New <stem>.system-surface.json sibling (hash-gated, <=400K chars per field, atomic tmp+rename, 0600) records the exact system text + tool definitions sent to the upstream on the most recent request, captured at the four wire stamp sites alongside the existing systemPromptTokens measurement. Derived artifact: malformed/corrupt sidecars degrade to 'uncaptured' and never block session load; GC co-deletes with the twin-fallback keep rule and joins the orphan sweep.
Rebuilds the last outbound context as a dsh-style record ledger (system prompt & tools, per-message roles/kinds/refs/turns, folded blocks anchored at their span end) from already-persisted state; replaces the handoff document as the default bottom-of-page display (md copy/download buttons kept), renames the token chart title to avoid the name clash, and adds JSON copy of the normalized view.
…#2671)

Two proxy-persist assertions assumed legacy-only top-level entries, but with no storage tier configured the unified store defaults to shadow mode (#2671) and legitimately opens index.db/-wal/-shm beside the namespace dirs. Filter those known sidecars; the 'no stray files' intent is unchanged.
The #3201 PR refactored the twin-fallback companion rule into a shared
helper but only exercised the content-store class through tests/session-gc.test.ts;
the new .system-surface.json co-delete / twin-fallback / orphan-sweep paths had no
direct coverage. Add the four mirror tests (stale co-delete, twin still relies,
twin owns its own, orphan age gate).
CI unused-exports gate: WebTrajectoryRecord/WebTrajectory are only used inside
src/web/sessions-data.ts — make them module-internal per the checker's fix hint.
…ew (#3201)

Review fix for this PR. Two defects in the new trajectory code inside the WEB_CLIENT template literal:

1. Single-escaped \" / \n sequences are pre-evaluated by the OUTER template literal
   into raw quotes / raw newlines in the emitted browser script -> SyntaxError kills
   the entire /__bili/ page at load (every vm-based web test failed with
   'Invalid or unexpected token'). Doubled per the file's existing convention
   (e.g. join("\\n")). Sites: trajPreview, tool-chips/traj-json/traj-text class
   attrs, truncated markers. Verified: node --check on the extracted WEB_CLIENT
   passes end-to-end after the fix.
2. t("kind." + r.kind) defeated the #1024 reference scanner (false 'kind.' ref).
   Replaced with a KIND_LABEL map carrying explicit literal keys for all 8 kinds.
Review fix for this PR. det.handoff / det.handoff_hint labeled the handoff card
header that this PR replaces with the trajectory view; with the header gone the
keys are dead and the #1024 dead-key gate fails ('catalog key never referenced
anywhere: det.handoff'). Removed from both locales. The handoff md copy/download
buttons keep their still-referenced det.handoff_copy_md/_download/_truncated keys.
Review fix for this PR. The trajectory view introduces the first hyphenated
catalog keys (kind.tool-call, kind.tool-result); all five reference-scanner
regexes in collectRefs() use [\w.]+ which cannot match '-', so a referenced key
was reported as dead ('catalog key never referenced anywhere: kind.tool-call').
Extended the class to [\w.-]+ in all five parallel sites. The closing-quote
anchor keeps captures exact - strictly more precise, no over-capture possible.
…rtion (#3201)

The PR renamed the token-curve section label det.trajectory from
上下文轨迹/Context trajectory to 上下文曲线/Context curve (declared behavior
change #2, disambiguating it from the new trajectory view). The session
report renders that heading via t('det.trajectory') (src/web/report.ts:171),
so the zh heading assertion here went stale.
…lper (#3201)

findRecordFile() asserted exactly one .json file in the sessions dir, but
this PR's e2e flow now also writes the derived <stem>.system-surface.json
sidecar next to the record (#3201), so the helper saw two files and failed
with 'expected exactly one session record, found 2'. Exclude the companion
suffixes (.content-store.json / .system-surface.json), matching the pattern
already used by tests/persist-guard-ownership.test.ts and friends.
…oc block (#3201)

The unused-exports gate counts comment mentions as usage. This PR's rewrite
of the session-gc companion handling dropped the old walk/split block whose
comment named contentStoreRelPathFor (persist.ts), leaving the export with
no reference outside its own file → INTERNAL_ONLY failure on CI. Restored
the mention where the new doc block states the sibling scheme; it is also a
real invariant: the GC's suffix pairing must stay consistent with
contentStoreRelPathFor.
@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

查重: 不重复 —— 仍为 #3201 轨迹视图 PR 的冲突处理延续(前两轮已做过接单查重)。

本轮处置:master 又大幅前移(#3818 存储默认 full 模式、batch-B/mysql 整合等 ~50+ 合并),PR 与 10 个文件真实冲突。已 rebase 到最新 master 并解冲突,修掉一个本 PR 触发的门禁红,CI 除 master 侧既有红风暴测试外全绿。新 head 3ff16ed9f。

做了什么:

  1. Rebase + 冲突解决:master 在等待期间推进了两个大批次(860e617 → f57926c,含 batch-B 整合)。10 个 PR commit rebase 后仅首个 commit 有 4 处文本冲突,全部按「意图并集」解决:
  2. 修掉本 PR 触发的 unused-exports 门禁红:contentStoreRelPathFor(persist.ts 导出)原本靠 session-gc.ts 里一句注释被门禁计为「有引用」(该门禁把注释提及也算使用);本 PR 重写了 GC 伴生文件处理块,把那句注释弄丢了 → CI 报 INTERNAL_ONLY。已在 GC doc block 恢复对该 helper 的引用(独立标注 commit)— 这也是真实不变量:GC 的后缀配对必须与 contentStoreRelPathFor 保持一致。本地跑门禁确认 clean。
  3. CI 结果(head 3ff16ed9f):gates 全绿(含 unused-exports);6 个 test 分片中 3 绿;红的 3 片全部且仅有同一个测试:upgraded pre-fold-gate state keeps rotation-hidden orphans hidden end-to-end (#3769) —— 失败签名与 master 自己 CI 的红逐字节相同(同文件同断言 'record hydrates before the upgrade turn'),是 master 既有红风暴的一部分,非本 PR 引入。本 PR 自己的测试面(web-trajectory / system-surface-persist / session-report / session-gc / proxy-persist / Restart loses measurement state: buildSession() omits stats fields buildRecord() persists (k̂, usage anchor, baseline origin, localInputEstimate) #2129 e2e)在 CI 上全部通过。

顺带发现并已立项:#4004(带来源标记) —— 本地 Node 上 4 个持久化完整性测试(proxy-persist ×3 + #2129 corrupt-measurement)确定性失败,但同一代码在 GitHub CI 通过。机制已用 store 日志钉死:#3818 默认 full 模式下 writeNow 先写 sqlite 索引,测试只篡改 JSON envelope 后,loadSync 走 unified-first 从索引命中返回,永远到不了 envelope 的 id-mismatch 守卫——守卫是否被绕过取决于索引导入与磁盘时序(CI 恰好 miss、本地恰好 hit)。属 master 侧存储层语义问题(full 模式权威源判定),不在本 web-UI PR 范围内修,已在 #4004 给出复现/机制/两种修法选项待拍板。

结构化八问

  1. 是什么问题:系统报上游冲突——master 大幅前移后与 PR 产生真实文本冲突(10 文件重叠区)。
  2. 什么原因导致的:master 两个大批次(batch-B 存储整合、preflight/fold-budget 系列)改了本 PR 触碰的 persist/prepare 热区;另有一个次生问题:本 PR 重写 GC 时丢了对某个导出函数的注释引用,触发 unused-exports 门禁。
  3. 影响范围与严重程度:冲突本身阻塞合并;门禁红同样阻塞;均无用户可见行为影响。
  4. 怎么修复的:rebase + 四处冲突按意图并集手工解(两侧新逻辑都保留,已 grep 验证导入符号都有使用);门禁红以恢复注释引用的最小修复收敛(不改导出表面、不加 waiver)。
  5. 是否有回归问题:无。逐处核对过冲突区的既有行为(master 的 区间审查(#3331)残留 11 项中小问题集中修:守卫旋钮、存储竞态、静默丢参、CI 触发残角等 #3406 定时落盘、[Bug][responses] Mid-history system/developer items omitted from lastLocalTextEstimate inflate k-hat ~2.85x and trigger false-overflow 502 (0.1.200) #3713 token 公式、image-rescale/emergency-nudge 导入链均原样保留);CI 上本 PR 相关测试面全绿;剩余红 = master 既有 [Bug] MCP failed compression record rotation prematurely rewrites the history prefix, triggering expensive cache recompu | [Bug] MCP 失败压缩记录轮换提前改写历史前缀,触发大额缓存重算 #3769(签名与 master CI 完全一致)。
  6. 是否破坏缓存:不涉及。
  7. 是否改了设计方向:不涉及;[Feature] Provide a "trace" feature similar to dsh's on the session page of the Web UI | [Feature] 在 web ui 的会话页面里提供类似 dsh 的「轨迹」功能 #3201 的 sidecar + 视图设计维持原样。
  8. 是否引入了新的配置:不涉及。

行为变更披露:无新增(沿 PR 描述已声明的 4 项不变)。

判定:收工待合 —— 分支干净、可合并(mergeable=True, base 为当前 master);唯一红是 master 侧 #3769 红风暴测试,建议等其修复或人工判断后合并;发现的新问题已立 #4004 跟踪。

This branch has not been deployed

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

Labels

None yet

Projects

None yet

1 participant