Repository navigation
[PR] feat(web): per-request cache hit-rate line chart with drop-cause markers - #3523
Conversation
📦 Built Package ArtifactBranch: Option A — Install this exact build (recommended)npm install -g billion-context@0.0.4195-pr.3523.475b224This exact version is immutable and reproducible. The rolling Option B — Download artifact
tar xzf billion-context-pr3523.tgz
npm install -g packageInstall instructions are refreshed on each push. |
(ai: vllm-qwen/qwen3.8-27b) 查重:不重复。 open+closed 全检索(hit-rate chart / hit rate line / cache trend):唯一实现命中率折线的就是本 PR,需求源头是 #3484 item 1(单会话折线);相邻条目 #2489(轨迹图)、#1557/#1856/#2795(账本归因)都是被复用的既有机制,不是平行实现。本 PR = #3484 item 1 的落地,方向与 issue 一致。 开始独立审核:拉分支核对 diff、验证「数据零后端改动」「轨迹图 golden 字节稳定」「提取是逐字搬运」三项声明、本地定向跑测试、看 CI。结论稍后按八问给。 |
Session detail page gains a hit% line chart over the per-request ledger lines already returned by the detail API: fixed 0-100% axis, per-sample hover columns, and cause dots colored by ledger attribution (cold / comp / seam / PT / PS / rewind / client). - new hitRateSvg renderer; classifyLineCauses hoisted out of trajectorySvg so both charts share the exact same classification (hit-chart dots stay in lockstep with trajectory bands) - fold/seam mark and seq/time tick renderers extracted and shared - brush zoom-to-selection refactored into a makeChartZoom factory used by both charts; trajectory output stays byte-stable vs its golden - golden tests/golden/web-hitrate/small-full.svg + regen script - i18n en+zh: det.hitrate / det.hitrate_sub / det.hitrate_empty / det.legend_hitline
…dot (#3484) A 1-line cold session drew an accent placeholder dot ON TOP of its own cold cause dot (r=3 over r=2.5), so the dot read 'hit line' while the hover column named the sample 'cold start'. Draw the accent placeholder only when the sample carries no cause dot of its own.
d5fc9da to
b20877d
Compare
(ai: vllm-qwen/qwen3.8-27b) 查重:不重复(首条已述)——唯一实现命中率折线的就是本 PR,源头 #3484 item 1。 ① 原 issue 方向:#3484 item 1(单会话命中率折线,掉点归因着色)与本 PR 范围一致;item 2(全局折线)正确留待 A/B/C 拍板后落同分支。声明的「数据零后端改动」成立——diff 仅 6 个文件(client.ts / i18n.ts / harness / 新测试+golden+regen),数据确实全部来自 detail API 已有的 ② 回归审查(逐项既有行为):
③ 代码审查:共享化做得对—— ④ 测试有效性:3 个新测试有牙——golden 字节钉死渲染器漂移;parity 测试断言精确 cause 列表( 审核中发现的问题(均已处置):
rebase:分支原落后 master 18 提交;master 侧这 18 个提交与本 PR 六个文件零重叠,已 rebase 到 八问:
判定:代码可合——待 |
(ai: vllm-qwen/qwen3.8-27b) CI 确认:rebase 后 head 收工判定:可合并。合并动作留给人工:#3523 (item 2 全局折线待 #3484 拍板 A/B/C 后落同分支)。 |
📦 Merged Build PublishedThis merge to master was published as npm install -g billion-context@0.0.669-master.1cc1cb8 # this exact build
npm install -g billion-context@master # always the newest merged build
|
What
Session detail page gains a per-request cache hit-rate line chart (issue #3484, item 1): fixed 0–100% axis over the ledger lines the detail API already returns, per-sample hover columns (
seq · time · in · cached · missed · hit %), and drop-cause dots colored by ledger attribution — cold / comp / seam / PT (provider TTL) / PS (prompt-side) / rewind / client — with a legend that only shows causes actually present in the session.This is the decision-independent part of #3484: it is contained in every scope option proposed in the issue thread, so it ships ahead of the owner's A/B/C pick for the global chart (item 2), which will land on this same branch/PR to keep one closed loop.
How
session.metadata["cacheLedger"]and returned bybuildSessionDetail; only the render layer was missing. No backend, wire, config, or persistence change.hitRateSvgrenderer insrc/web/client.ts, hand-rolled SVG like the feat(web): add zoom-to-selection (brush) to the session context-trajectory chart #2489 trajectory chart (zero runtime deps).classifyLineCauseshoisted out oftrajectorySvgso both charts share the exact same classification — hit-chart cause dots stay in lockstep with trajectory bands (asserted by test).makeChartZoom({elId,statusId,resetId,render})factory used by both charts; the trajectory chart keeps its full zoom contract.tests/golden/web-hitrate/small-full.svg+ regen scriptscripts/update-web-hitrate-golden.ts(mirrors the trajectory golden discipline).det.hitrate,det.hitrate_sub,det.hitrate_empty,det.legend_hitline.Behavior surface
tests/golden/web-trajectory/small-full.svg) — the extraction was a verbatim move; verified by the existing feat(web): add zoom-to-selection (brush) to the session context-trajectory chart #2489 suite passing unchanged.Tests
Targeted local runs on the rebased head (full-suite verdict = remote CI):
Refs #3484