Repository navigation
[PR] feat(web): compression structure tab — tier tree, lazy originals, mNNNNN locate, JSON export - #3942
[PR] feat(web): compression structure tab — tier tree, lazy originals, mNNNNN locate, JSON export#3942ranxianglei wants to merge 2 commits into
Conversation
… and ref lookup (#3917)
📦 Built Package ArtifactBranch: Option A — Install this exact build (recommended)npm install -g billion-context@0.0.4753-pr.3942.68397c8This exact version is immutable and reproducible. The rolling Option B — Download artifact
tar xzf billion-context-pr3942.tgz
npm install -g packageInstall instructions are refreshed on each push. |
…ate (#3942) resolveSessionForWeb / BlockContentMode / WebRefMatch are referenced only inside sessions-data.ts; the gate's INTERNAL_ONLY verdict prescribes dropping the leading export. No behavior change.
(ai: vllm-qwen/qwen3.8-27b) CI 修复:unused-exports 门禁已修,已推回 PR 分支(auto-fix 第 1/2 次)。 失败检查: 八问:
本地验证: |
|
(ai: vllm-qwen/qwen3.8-27b) 关闭原因:与 #3924 重复(先来后到,保留外部贡献)。 本 PR 与 #3924 是同一个功能请求(#3917:会话详情页「压缩结构」tab)的两份实现:同一页面、同一数据源( 按项目规则(先来后到保留先到者;agent PR 不得以新 PR 替换外部贡献),保留先到的 #3924(vegetable86 提交,上一轮已审:质量达标、无回归、CI 全绿),关闭本后到 PR。 本 PR 的独有部分不丢弃,已记录在 #3917 作为后续项:
如后续需要这些能力,移植进 #3924 分支(additive commit)即可,不再重开本 PR。 CI 备注:本 PR 主 CI lane 为红—— |
What
Adds a compression structure card to the web UI session detail page (
/__bili/<id>):directBlockIds(the kernel has noparentBlockId; children are the edge source). Each node shows block id, tier badge, topic, compressed tokens, age, ref span and active/external badges; open a node for its summary markdown.one(direct messages + nested child summaries) andfull(every original message). A 2 MiB response guard truncates oversized views with a marker; aoneview persisted as byte-identical to full (sessions 存储三重膨胀:叶块 blockContents 逐字节重复 50%、零 GC、每次启动两遍全量同步解析(实测 387MB/+60MB 每天/2s 起步) #401 single copy) is served with anidenticalToFullflag.mNNNNNref or raw message id; lookup is EXACT membership over each block'seffectiveMessageIds(no span guessing), so every containing block (leaf + all ancestors) is reported with the deepest one marked as owner. Matched nodes highlight and auto-expand along the root→owner chain..json.API surface (additive only, read-only)
GET /__bili/sessions/:id/block-content?block=bN&mode=one|full→{ blockId, mode, count?, text?, truncated?, identicalToFull? }or{ missing: true }; 404 unknown session/block, 400 bad mode/params. Sits behind the existing loopback/trusted-origin/tunnel gates like every other/__bili/*route.GET /__bili/sessions/:id/block-ref?q=m00042|raw-id→{ query, kind, owner?, matches[] }; 404 unknown session, 400 empty q.WebSessionDetail.blockDetails[]gainschildren: string[](child block ids). Sparse legacy block records missingdirectBlockIdsrender as leaves instead of throwing the detail page.No proxying/wire/config/persistence changes; no kernel changes.
Tests
Targeted additions in
tests/web-sessions.test.ts: tier-tree wiring in the detail payload,buildBlockContent(both modes, identical-to-full, missing content, unknown session/block, bad-mode precedence, 2 MiB truncation),buildRefLookup(ref + raw kinds, leaf+ancestor chains, owner = smallest id set, honest empty sets, bad-query) and HTTP-level status coverage for both endpoints (200/400/404). The i18n parity suite covers the 12 new keys.Closes #3917