dsh-trajectory-traceview-plus 0.11.3 → 0.11.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,22 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.11.4 — 2026-11-26
4
+
5
+ ### Fixed
6
+
7
+ - **中文界面里的 Token 用量 chip 是硬编码英文。** 「原始请求」标签下那一排显示 `in 880 fresh 500 cache-read 320 cache-write 60 out 52 think 12`,而 README §2 的中文原话是「入站(含缓存读 / 写)与出站(含思考)明细」。已补 6 个 locale 键(入站 / 未缓存 / 缓存读 / 缓存写 / 出站 / 思考),英文侧保持原词。这是 §13.68 记的那类缺陷:I18N3 守卫只查「代码里有中文」,查不到「英文字面量进了中文界面」。
8
+
9
+ ### Added
10
+
11
+ - **英文界面首次被渲染验证。** harness 新增 `__setLocale` / `__remount` 路径,`test/browser/probe-en.js` 做一遍英文渲染,断言 chrome 里不含 CJK 且确实翻译了。此前 28 组观测、189 条断言里没有一条碰过 `en`。
12
+ - 浏览器探针补齐 README §2 剩余的全部入口:KPI 与模型名、⏱ 等距/按时钟切换、详情面板 ⤢ 展开、minimap 跳转与高亮、🔗 锚点输入框(含地址栏同步与往返验证)、📋 复制本步复盘、📋 Markdown 整段导出、⚡ 提示词变更、「原始请求」四段(系统提示 / 工具目录 / 消息列表 / Token 用量)、子调用卡片、证据等级、空态与不兼容态。
13
+
14
+ ### Changed
15
+
16
+ - `test/browser/probe-en.js` 拆成独立文件:`agent-browser eval` 有 30 秒硬上限,英文组放进主探针后整条跑到 30.03 秒,失败形态是「结果无法解析」而不是红断言。现在主探针 28 秒、英文 pass 5 秒。
17
+ - `readme-numbers.mjs` 现在遍历两个 probe 文件累加数字,并且只把 `failures.push("…")` 字面量算作断言(转发 `push(...arr)` 不算)。
18
+ - 探针总量:14 组 / 57 条 → 28 组 / 189 条(`--shots` 另加 1 组 / 3 条)。
19
+
3
20
  ## 0.11.3 — 2026-11-24
4
21
 
5
22
  ### Fixed
package/README.en.md CHANGED
@@ -122,7 +122,9 @@ dsh-trajectory-traceview-plus/ # repo root (directory name == npm package name
122
122
  │ └── browser-harness.mjs / bench-fold.mjs
123
123
  ├── docs/ # DESIGN.md (why each change) / PROVENANCE.md (generated)
124
124
  ├── test/
125
- │ └── smoke.test.cjs # helper unit tests (plain node)
125
+ │ ├── smoke.test.cjs # helper unit tests (plain node)
126
+ │ └── browser/ # fixture.js (host stub) / probe.js (main assertions) / probe-en.js (English UI)
127
+ │ # harness.html is generated by browser-harness.mjs and not committed
126
128
  └── lib/
127
129
  ├── index.js # host half: no-op stub (browser-only plugin)
128
130
  └── client.js # browser bundle: the trace view (generated)
@@ -133,7 +135,7 @@ dsh-trajectory-traceview-plus/ # repo root (directory name == npm package name
133
135
  Install from npm (recommended — **pin the exact version**):
134
136
 
135
137
  ```powershell
136
- dsh plugin --profile web add dsh-trajectory-traceview-plus@0.11.3
138
+ dsh plugin --profile web add dsh-trajectory-traceview-plus@0.11.4
137
139
  ```
138
140
 
139
141
  > **Why not `@latest`**: `dsh plugin` forwards to pnpm, and **pnpm 12 ships a supply-chain delay** (`minimumReleaseAge`, default **1440 minutes = 24 hours**): a version published less than a day ago is not selected by `@latest`, and pnpm **silently falls back to the previous release** — no warning at all. Right after 0.11.0 was published, `pnpm add pkg@latest` installed 0.10.0, which the newer DSH hosts skip entirely. An exact version has no such ambiguity (verified with both cold and warm caches).
@@ -145,10 +147,10 @@ dsh plugin --profile web add dsh-trajectory-traceview-plus@0.11.3
145
147
  Install from GitHub (**always pin the tag**):
146
148
 
147
149
  ```powershell
148
- dsh plugin --profile web add "github:MisonL/dsh-trajectory-traceview-plus#v0.11.3"
150
+ dsh plugin --profile web add "github:MisonL/dsh-trajectory-traceview-plus#v0.11.4"
149
151
  ```
150
152
 
151
- > **Why the `#v0.11.3` matters**: a `github:` spec without a ref installs the **default branch HEAD**, not any released version. This repository keeps committing after a release (v0.11.0 was followed by five docs/scripts commits), so an unpinned install can hand you different code tomorrow while still reporting version 0.11.0. Pinning the tag is what makes "installed" and "released" the same code.
153
+ > **Why the `#v0.11.4` matters**: a `github:` spec without a ref installs the **default branch HEAD**, not any released version. This repository keeps committing after a release (v0.11.0 was followed by five docs/scripts commits), so an unpinned install can hand you different code tomorrow while still reporting version 0.11.0. Pinning the tag is what makes "installed" and "released" the same code.
152
154
 
153
155
  Then **restart `dsh web`** to take effect.
154
156
 
@@ -254,8 +256,8 @@ The tests run the helper region against mock snapshots covering: tree building /
254
256
  **What needs a real browser** (`react-dom/server` cannot see scroll, focus, clipboard, intervals or layout):
255
257
 
256
258
  ```powershell
257
- node scripts/browser-check.mjs # builds the harness; 69 assertions over 15 recorded groups
258
- node scripts/browser-check.mjs --shots # saves screenshots and adds 1 more group / 2 assertions: 375px overflow (14 total)
259
+ node scripts/browser-check.mjs # builds the harness; 189 assertions over 28 recorded groups
260
+ node scripts/browser-check.mjs --shots # saves screenshots and adds 1 more group / 3 assertions: 375px overflow (29 total)
259
261
  ```
260
262
 
261
263
  It needs `agent-browser` (Chrome via CDP). **Deliberately not in CI**: adding a browser to the runner is more moving parts than the check is worth, and a flaky browser job trains people to ignore red builds. Run it locally before releasing.
@@ -316,10 +318,10 @@ node scripts/provenance.mjs # 4. refresh the provenance list (rerun
316
318
  npm run check # 5. the 7 local gates; all green before going further
317
319
  git add -A; git commit -m "..." # 6.
318
320
  git push origin main # 7.
319
- git tag -a v0.11.3 -m "..." # 8.
320
- git push origin v0.11.3 # 9.
321
+ git tag -a v0.11.4 -m "..." # 8.
322
+ git push origin v0.11.4 # 9.
321
323
  npm publish # 10. runs prepublishOnly -> the whole check again
322
- gh release create v0.11.3 --notes-file … # 11. the badge reads the Release, not the tag
324
+ gh release create v0.11.4 --notes-file … # 11. the badge reads the Release, not the tag
323
325
 
324
326
  node scripts/release-status.mjs # 12. do all four agree? (tag / Release / npm metadata / tarball)
325
327
  ```
package/README.md CHANGED
@@ -125,7 +125,9 @@ dsh-trajectory-traceview-plus/ # 仓库根(目录名 = npm 包名)
125
125
  │ └── browser-harness.mjs / bench-fold.mjs
126
126
  ├── docs/ # DESIGN.md(每处改动的原因)/ PROVENANCE.md(自动生成)
127
127
  ├── test/
128
- │ └── smoke.test.cjs # 纯 helpers 单测(node 直接跑)
128
+ │ ├── smoke.test.cjs # 纯 helpers 单测(node 直接跑)
129
+ │ └── browser/ # fixture.js(宿主桩)/ probe.js(主断言)/ probe-en.js(英文界面)
130
+ │ # harness.html 由 browser-harness.mjs 生成,不入库
129
131
  └── lib/
130
132
  ├── index.js # 宿主半部:无操作桩(纯浏览器端插件)
131
133
  └── client.js # 浏览器 bundle:轨迹视图(生成物)
@@ -136,7 +138,7 @@ dsh-trajectory-traceview-plus/ # 仓库根(目录名 = npm 包名)
136
138
  从 npm 安装(推荐,**写死版本号**):
137
139
 
138
140
  ```powershell
139
- dsh plugin --profile web add dsh-trajectory-traceview-plus@0.11.3
141
+ dsh plugin --profile web add dsh-trajectory-traceview-plus@0.11.4
140
142
  ```
141
143
 
142
144
  > **为什么不用 `@latest`**:`dsh plugin` 底层是 pnpm,而 **pnpm 12 有供应链延迟保护**
@@ -157,10 +159,10 @@ dsh plugin --profile web add dsh-trajectory-traceview-plus@0.11.3
157
159
  从 GitHub 安装(**必须带 tag**):
158
160
 
159
161
  ```powershell
160
- dsh plugin --profile web add "github:MisonL/dsh-trajectory-traceview-plus#v0.11.3"
162
+ dsh plugin --profile web add "github:MisonL/dsh-trajectory-traceview-plus#v0.11.4"
161
163
  ```
162
164
 
163
- > **为什么必须带 `#v0.11.3`**:`github:` 规格不带 ref 时装的是**默认分支的 HEAD**,
165
+ > **为什么必须带 `#v0.11.4`**:`github:` 规格不带 ref 时装的是**默认分支的 HEAD**,
164
166
  > 不是任何发布版本。而这个仓库在发版后还会继续提交(本轮 v0.11.0 之后就有 5 个
165
167
  > 文档/脚本提交),所以"不带 ref"装到的东西**明天可能是另一个样子**,而版本号
166
168
  > 仍写着 0.11.0。带 tag 才能让"装到的"和"发布过的"是同一份代码。
@@ -270,8 +272,8 @@ npm test # 只跑 smoke
270
272
  **需要真实浏览器的部分**(`react-dom/server` 测不到滚动、焦点、剪贴板、定时器、响应式):
271
273
 
272
274
  ```powershell
273
- node scripts/browser-check.mjs # 起 harness,跑 69 条断言 / 记录 15 组观测
274
- node scripts/browser-check.mjs --shots # 另存截图,并另加 1 组 / 2 条断言(375px 溢出,共 14 组)
275
+ node scripts/browser-check.mjs # 起 harness,跑 189 条断言 / 记录 28 组观测
276
+ node scripts/browser-check.mjs --shots # 另存截图,并另加 1 组 / 3 条断言(375px 溢出,共 14 组)
275
277
  ```
276
278
 
277
279
  它需要 `agent-browser`(Chrome via CDP)。**故意不进 CI**:把浏览器塞进 runner 的
@@ -337,10 +339,10 @@ node scripts/provenance.mjs # 4. 刷新来源清单(新增/改名
337
339
  npm run check # 5. 8 步门禁,全绿再往下
338
340
  git add -A; git commit -m "..." # 6.
339
341
  git push origin main # 7.
340
- git tag -a v0.11.3 -m "..." # 8.
341
- git push origin v0.11.3 # 9.
342
+ git tag -a v0.11.4 -m "..." # 8.
343
+ git push origin v0.11.4 # 9.
342
344
  npm publish # 10. 触发 prepublishOnly → 再跑一遍 check
343
- gh release create v0.11.3 --notes-file … # 11. 徽章读的是 Release,不是 tag
345
+ gh release create v0.11.4 --notes-file … # 11. 徽章读的是 Release,不是 tag
344
346
 
345
347
  node scripts/release-status.mjs # 12. 四处对齐了吗?(tag / Release / npm 元数据 / tarball)
346
348
  ```
package/docs/DESIGN.md CHANGED
@@ -8854,3 +8854,848 @@ localStorage(那个在 `file://` 下是真的可用,变异 A 验证过会红
8854
8854
  /cookie"是真的,它让上面那句假的"不写入任何存储"显得也可信。
8855
8855
  3. **变异测试也可能被环境骗过。** `file://` 下 cookie 赋值无效,于是"没有 cookie"
8856
8856
  永真。写断言前先确认**这个环境下失败是可能的**——否则测的不是代码,是环境。
8857
+
8858
+
8859
+ ### 13.60 README §12 的三条承诺,浏览器里一条都没验过(2026-11-25)
8860
+
8861
+ #### 现象
8862
+
8863
+ README §12「兼容性与数据契约」有三条很硬的承诺:
8864
+
8865
+ 1. 畸形数据不会让页面崩,有显式 `⚠ N 条记录结构异常` 提示
8866
+ 2. 版本不兼容会**大声说**,不会伪装成「暂无数据」
8867
+ 3. `kind: "unknown"` 是契约里有名字的类型,**不计入**版本不兼容
8868
+
8869
+ smoke 里有一整套 `DRIFT` / `R4` 断言,覆盖得挺细。但那些测的是**分类器**
8870
+ (`snapshotContract` / `unknownNodeStats` / `isEverythingUnknown`),
8871
+ **没有一条测画出来的东西**。
8872
+
8873
+ 浏览器探针此前只喂过一份健康 fixture:第 1 组就断言「有 15 个站点」,之后全程
8874
+ 正常路径。`dstv_empty` / `dstv_incompat` / `dstv_warn` / `dstv_chip.warn`
8875
+ 在探针里出现次数是 **0**。
8876
+
8877
+ 也就是说:分类器算对了,UI 用错了,没有任何东西会知道。
8878
+
8879
+ #### 新第 16 组 `degraded`
8880
+
8881
+ 直接改 `window.__store`,把面板推进四种降级状态,断言**渲染结果**:
8882
+
8883
+ | 场景 | 断言 |
8884
+ |---|---|
8885
+ | 空会话 | 有 `.dstv_empty`、文案含「暂无轨迹数据」、**不是** incompat、图例仍在 |
8886
+ | 全部 kind 不认识 | 有 `.dstv_incompat`、文案含「无法识别」、`.dstv_incompatCodes` 含 `unrecognized-kinds` |
8887
+ | 一个 `kind:"unknown"` + 一个正常站点 | **无** incompat、**无** drift chip、站点仍渲染 |
8888
+ | 部分记录损坏 | 有对应的 ⚠ chip,健康记录仍渲染 |
8889
+ | 恢复到健康数据 | 站点回来、无残留横幅 |
8890
+
8891
+ 最后一条(恢复正常)是容易漏的:**永不恢复的降级状态,对读者来说和崩溃没有区别**。
8892
+
8893
+ #### 写这组时踩的三个坑,全是探针自己的
8894
+
8895
+ **坑 1:引号嵌在双引号字符串里。**
8896
+ `"… that is the "fake empty" README forbids"` —— 语法错误。改用单引号。
8897
+
8898
+ **坑 2:拿错了一个状态。**
8899
+ 我最初用 `{ eventNodes: "nope" }` 测「有 ⚠ 结构异常提示」,报:
8900
+
8901
+ ```
8902
+ ✗ a contract-damaged snapshot produced no .dstv_warn notice
8903
+ ```
8904
+
8905
+ 原因是这份快照**一条可用记录都没有**,于是正确地走进了 incompatibility 分支,
8906
+ 而 incompatibility 分支里**没有** header chip。**是我把两种状态混成一种了**:
8907
+ 「零条可用」和「部分损坏」是不同分支。
8908
+
8909
+ **坑 3(最重要):两条 chip 的可见文本一模一样。**
8910
+ 改成"部分损坏"后仍然失败一次,然后成功——但变异测试打脸了:把 contract chip
8911
+ 整个删掉,探针依然绿。
8912
+
8913
+ 因为 header 里有**两条** chip,文案相同、来源不同:
8914
+
8915
+ | chip | 触发条件 | locale key |
8916
+ |---|---|---|
8917
+ | `hMalformed` | `snapshotContract().ok === false` | `view.malformed` = `{n} 条记录结构异常` |
8918
+ | `hInvalid` | `nodeStats.invalid > 0` | `view.invalid` = `{n} 条记录结构异常` |
8919
+
8920
+ **两条都渲染成「N 条记录结构异常」。** 我按文本匹配,匹配到的是另一条,
8921
+ 于是两条断言互相掩护——删掉任何一条都不会红。
8922
+
8923
+ 这和 §13.59 的 cookie 假绿是同一个形状:**断言命中的是你以为的东西吗?**
8924
+
8925
+ 修法:用各自独立的条件触发,并读 `title`(不同 locale key 的 title 不同):
8926
+
8927
+ ```js
8928
+ // hMalformed ← 合法 kind+seq,但 content 不是数组
8929
+ { kind: "assistant", seq: 2, …, content: "not-an-array" }
8930
+ → 断言 title 含 "字段形状不符合预期"
8931
+
8932
+ // hInvalid ← kind 为空 / seq 缺失
8933
+ { kind: "", seq: 2 }, { seq: 3 }
8934
+ → 断言 title 含 "缺少 kind 或 seq"
8935
+ ```
8936
+
8937
+ #### 变异验证
8938
+
8939
+ | 变异 | 第一版 | 修好后 |
8940
+ |---|---|---|
8941
+ | `incompatible = false`(伪造空态) | 红 | 红 |
8942
+ | 把 `unknown` 移出 `KNOWN_NODE_KINDS` | **绿(漏报)** | 红(header 说「1 条记录无法识别」) |
8943
+ | 删掉 contract chip | **绿(被另一条掩护)** | 红 |
8944
+ | 删掉 invalid chip | — | 红 |
8945
+
8946
+ 第二行值得单独说:`kind:"unknown"` 的回归在 R4 里被记过一次(一个陌生事件让整个
8947
+ 面板变成「版本不兼容」)。我最初只断言「没有 incompat 横幅」,而 R4 的真实症状是
8948
+ **header 上的 drift chip**。加上 chip 断言后立刻抓到。
8949
+
8950
+ #### 教训
8951
+
8952
+ 1. **单元测试测分类器,浏览器测试测渲染结果。** 两者都绿才算真的。这次分类器
8953
+ 全对,UI 完全没验。
8954
+ 2. 文案相同、来源不同的元素是最难查的假绿。**要么让文案不同,要么按结构断言**
8955
+ (title / data 属性 / 独立触发条件),不要按文本。
8956
+ 3. 变异测试的"没红"有两种解释:代码没问题,或者**断言没命中**。必须逐次确认
8957
+ 断言真的踩到了目标元素——上面三个坑里有两次都属于后者。
8958
+
8959
+
8960
+ ### 13.61 「仅已加载范围」徽标:实现有三个分支,探针一个都没碰(2026-11-25)
8961
+
8962
+ #### 现象
8963
+
8964
+ README §2 有一条很明确的 Plus 承诺:
8965
+
8966
+ > **检索范围显式标注**:搜索只覆盖**当前已加载**的轨迹,所以命中计数旁会显示
8967
+ > `⬆ 仅已加载范围` 徽标——点它即可加载更早一页……**没加载的历史永远不会被误报成
8968
+ > "无命中"**。
8969
+
8970
+ 而 `.dstv_scope` 在浏览器探针里出现次数是 **0**。
8971
+
8972
+ smoke 里有 `D2` 一组断言测 `searchScopeNote(hasMore, loading, t)` 的返回值,
8973
+ 覆盖得不错。但那仍然是**分类器**——和 §13.60 完全同一个盲区,隔了两节又出现一次。
8974
+
8975
+ #### 这颗徽标其实有三个分支
8976
+
8977
+ ```js
8978
+ searching && scopeNote !== null
8979
+ ? (canPage
8980
+ ? <button …> // (1) 有 loader 且不忙 → 可点,真的能翻页
8981
+ : <span data-static>) // (2) 没有 loader → 保留提示,去掉"看起来能点"
8982
+ : null // (3) 全量已加载 / 未在搜索 → 不显示
8983
+ ```
8984
+
8985
+ 分支 (1)/(2) 的差别在源码注释里写得很重:
8986
+
8987
+ > `data-static` drops the pointer cursor and the hover highlight: `.dstv_scope` is
8988
+ > styled as a button, so a bare span would still LOOK clickable — the same lie one
8989
+ > layer down.
8990
+
8991
+ **"看起来能点但其实不能"** 是这一整个项目反复在防的东西。而它零覆盖。
8992
+
8993
+ #### 补的断言
8994
+
8995
+ | 场景 | 断言 |
8996
+ |---|---|
8997
+ | 搜索中 + `hasMore: true` | 徽标存在、文案含「仅已加载」、有 `title`、**是 `<button>`**、**无 `data-static`** |
8998
+ | 切到 `hasMore: false` | 徽标**消失**(全量会话上常驻警告会训练人忽略它) |
8999
+ | 切回 `hasMore: true` | 徽标回来 |
9000
+ | 按 `Esc` | 徽标随之消失(搜索结束后留着是同一类谎言) |
9001
+
9002
+ #### 写的时候又踩了状态顺序
9003
+
9004
+ 第一版把徽标断言放在 `Esc` **之后**,报:
9005
+
9006
+ ```
9007
+ ✗ a search with hasMore=true rendered no ⬆ loaded-range badge
9008
+ ```
9009
+
9010
+ 因为 `Esc` 已经把搜索清空了,`searching` 变 false,徽标按设计就不该在。
9011
+ **是我把断言放在了错误的状态里**,不是徽标没渲染。
9012
+
9013
+ 修法:把整块移到 `Esc` 之前,并**额外**加一条 `Esc` 之后徽标必须消失的断言——
9014
+ 错位让我发现了一个本来没想到要测的行为。
9015
+
9016
+ 这已经是这一轮第二次被"断言所处状态"咬到(§13.60 坑 2 是拿错快照类型,
9017
+ §13.56 第 2 条是改坏后一组的前提)。**顺序耦合是探针的常态,不是意外。**
9018
+
9019
+ #### 变异验证
9020
+
9021
+ | 变异 | 结果 |
9022
+ |---|---|
9023
+ | `searchScopeNote` 忽略 `hasMore`(永远返回提示) | `the loaded-range badge is still shown on a fully loaded session` |
9024
+ | 删掉徽标渲染 | `rendered no ⬆ loaded-range badge` + 恢复那条也红 |
9025
+ | 恒用静态 `span` | `should be a button, got <span>` + `marked data-static while a loader exists` |
9026
+
9027
+ 三条分支各自都有独立的变异能打到。
9028
+
9029
+ #### 教训
9030
+
9031
+ 1. **第 13.60 节的盲区立刻又出现一次。** 上一节刚写"单元测试测分类器,浏览器测试
9032
+ 测渲染结果",这一节就在同一个形状上又找到一个。说明这类盲区不是靠"记住教训"
9033
+ 能清掉的,得靠**逐个 README 承诺去核对**。
9034
+ 2. 分支数量 > 1 的 UI 元素,每个分支都该有能打到它的变异。`(1)/(2)/(3)` 里
9035
+ 我最开始只想着"存在 / 不存在",差点把"是 button 还是 span"这一整类漏掉。
9036
+ 3. 断言的位置就是它的一部分。同一条 `document.querySelector(".dstv_scope")`
9037
+ 在两处放,测的是两个不同的行为。
9038
+
9039
+
9040
+ ### 13.62 逐条走 README 功能清单,又挖出两处零覆盖 + 一个 fixture 用错了契约(2026-11-25)
9041
+
9042
+ #### 做法
9043
+
9044
+ §13.60 和 §13.61 连着两次在同一个形状上找到盲区(分类器测了,渲染没测)。教训写进
9045
+ 去也不管用,因为下次还是靠"想起来"。于是换个办法:**把 README §2 的功能条目逐行
9046
+ 拉出来,每条去 smoke 和 probe 里 grep**。
9047
+
9048
+ 表格里 `probe=0` 就是这条功能在浏览器里从没被看过一眼。
9049
+
9050
+ #### 发现 1:KPI 与模型名零覆盖
9051
+
9052
+ `.dstv_kpi` 在 probe 里出现 0 次。而 README §2 写得很明确:
9053
+
9054
+ > KPI 条:轮次 / 步骤 / 工具次数 / 错误数 / 工具总耗时 / 请求与生成 tokens,
9055
+ > 实时「当前步骤」指示灯 + **当前模型名**
9056
+
9057
+ 补的断言(第 15b 组):
9058
+
9059
+ - 五个固定 KPI **按标签**逐个核对(轮次/步骤/工具/错误/工具总耗时)
9060
+ - token KPI 在这个 fixture 下必须出现
9061
+ - `.dstv_modelChip` 必须写着 `deepseek-chat`
9062
+
9063
+ #### 发现 2:⏱ 等距 / 按时钟切换零覆盖
9064
+
9065
+ 这颗按钮的三个可观测点全都没验过:
9066
+
9067
+ 1. 默认 OFF(`data-on` 不存在)
9068
+ 2. 点一下变 ON,**标签文案也变**(`⏱ 等距` ↔ `⏱ 按时钟`)
9069
+ 3. 时钟模式下空闲色带必须拿到 `.scaled` 类——**否则切换只是换了个字**
9070
+
9071
+ 第 3 点最容易漏:只断言"按了之后 data-on 变了"和断言"模式真的生效"是两件事。
9072
+
9073
+ #### 发现 3(最重要):harness fixture 用的是**错的契约字段名**
9074
+
9075
+ KPI 断言第一次跑就红:
9076
+
9077
+ ```
9078
+ ✗ the KPI strip rendered 5 cells
9079
+ ```
9080
+
9081
+ 一个都没有 token。查下去发现 fixture 写的是:
9082
+
9083
+ ```js
9084
+ usage: { input: 120, output: 40 } // ← 探针自己编的
9085
+ ```
9086
+
9087
+ 而 `normalizeUsage()` 读的是:
9088
+
9089
+ ```js
9090
+ num(u.inputTokens) + num(u.cacheReadTokens) + num(u.cacheWriteTokens)
9091
+ ```
9092
+
9093
+ **真实契约是 `inputTokens` / `outputTokens`。** smoke 里所有 fixture 用的都是正确
9094
+ 名字,只有浏览器 harness 用了错的——因为它从没被 token 相关的断言看过。
9095
+
9096
+ 也就是说:**这个 harness 三年来一直喂着一份"插件读不懂的 usage",而 KPI 就这样
9097
+ 一直显示 5 格,没人发现。**
9098
+
9099
+ 修 `test/browser/fixture.js`(`harness.html` 是生成物,且在 `.gitignore` 里),
9100
+ 改完 token KPI 立刻出现。
9101
+
9102
+ 顺带一个坑:第一次我改了 `harness.html` 然后重新生成,**改动被覆盖了**。生成物
9103
+ 必须改源文件——这点很简单,但我确实先改错了地方。
9104
+
9105
+ #### 又踩一次"按数量断言"
9106
+
9107
+ KPI 第一版写的是 `if (kpis.length < 6) fail(...)`。变异测试删掉错误数那一格:
9108
+
9109
+ ```
9110
+ TV PLUGIN SMOKE TEST … PASS
9111
+ ```
9112
+
9113
+ 因为这份 fixture 渲染的是 **7 格**(五个固定 + 请求 tokens + 生成 tokens),
9114
+ 删一格还剩 6,**越过地板线**。
9115
+
9116
+ **数量断言在"实际数量 > 承诺数量"时永远失效。** 改成按标签逐个核对,立刻抓到:
9117
+
9118
+ ```
9119
+ ✗ the KPI strip is missing ["错误"] (rendered: ["7轮次","6步骤","3工具","3.5 min工具总耗时","560请求 tokens","140生成 tokens"])
9120
+ ```
9121
+
9122
+ 这是这一轮第 3 次栽在同一件事上(§13.56 的 `keyboard = "ok"`、§13.60 的两条同名
9123
+ chip、本节的数量地板)。**"至少 N 个"不是覆盖率的断言。**
9124
+
9125
+ #### 变异验证
9126
+
9127
+ | 变异 | 结果 |
9128
+ |---|---|
9129
+ | 删掉错误数 KPI | `missing ["错误"]`(第一版数量断言漏报) |
9130
+ | 时钟按钮 `onClick: () => {}` | 三条同时红(data-on / 标签 / scaled) |
9131
+ | gap band 忽略 `clockAxis` | `clock mode is on but the gap band is not marked scaled` |
9132
+
9133
+ #### 教训
9134
+
9135
+ 1. **逐条 grep 比"记住教训"可靠。** 前两节都写了"分类器≠渲染",第三节还是在同一
9136
+ 形状上找到两处。方法对了才不会漏。
9137
+ 2. **fixture 也是被测代码的一部分。** 它写错了字段名,整组功能就变成测不到——而且
9138
+ 看起来一切正常(KPI 有 5 格,只是缺两个)。
9139
+ 3. 数量断言只在"实际数量恰好等于承诺数量"时有效。**要么按名字核对,要么别用数量。**
9140
+
9141
+
9142
+ ### 13.63 详情面板 ⤢ 展开:按钮存在但没人点过;顺手抓到我自己写错的存储断言(2026-11-25)
9143
+
9144
+ #### 补的覆盖
9145
+
9146
+ README §2 有一行:「详情面板可 ⤢ 展开全高 / ⤡ 收起」。`.dstv_panelToggle` 在探针里
9147
+ 从未被点击。
9148
+
9149
+ 补的断言(15a 组):
9150
+
9151
+ 1. 点开一个步骤站,`.dstv_detail` 出现,里面有 `.dstv_panelToggle`
9152
+ 2. 第一次点击 → 拿到 `.full` 类、**高度真的变大**、字形变 `⤡`
9153
+ 3. 展开后 `.dstv_dBody` 仍然 `overflow-y: auto|scroll`
9154
+ 4. 再点一次 → 收起、字形回 `⤢`
9155
+
9156
+ 第 3 条是这组的重点。展开面板的目的是"看得更多",而如果展开后正文不再内部滚动,
9157
+ 它会把整个页面顶长——**看起来展开了,实际是更糟的体验**。这是本项目反复记的
9158
+ 那条(面板必须内部滚动、不许溢到宿主里)。
9159
+
9160
+ #### 顺带抓到我自己写错的一条断言
9161
+
9162
+ 加完这组,**另一个毫不相关的组红了**:
9163
+
9164
+ ```
9165
+ ✗ more than one view-state key was written: ["dstv:view:1:session-1","dstv:view:1:session-2"]
9166
+ ```
9167
+
9168
+ §13.59 加 `storage` 组时我写的是「至多一条 `dstv:view:1:` 键」。而 README §10 的原话是
9169
+ **每个会话一条**。第 8b 组早就故意用 `session-2` 重挂载来验证状态不泄漏,所以
9170
+ 两条键是**正确结果**,我的断言才是错的。
9171
+
9172
+ 这条一直没红,因为它挂在**组之后**——任何新组只要让面板处于正常状态,两条键就
9173
+ 都在,"最多一条"立刻炸。
9174
+
9175
+ 修法:改判「至多两条 / 键不重复 / 每个都符合 `dstv:view:1:<会话>` 形状」。
9176
+
9177
+ **这是同一类错误的第 4 次**:把"我记住的数量"当成"契约的数量"(§13.56
9178
+ `keyboard = "ok"`、§13.60 两条同名 chip、§13.62 的 `length < 6`)。
9179
+
9180
+ #### 变异验证
9181
+
9182
+ | 变异 | 结果 |
9183
+ |---|---|
9184
+ | `onClick: () => {}`(按钮失效) | 三条同时红(`.full` 没加 / 高度没变 / 字形没变) |
9185
+ | CSS 注入 `.dstv_detail.full .dstv_dBody{overflow-y:hidden}` | `the expanded panel's body no longer scrolls internally (overflow-y=hidden)` |
9186
+
9187
+ #### 教训
9188
+
9189
+ 1. **新组会让旧组的断言现形。** 这次是"存储断言"被"展开组"顶出来的:旧断言写错
9190
+ 了但要等到某个新状态才暴露。**加测试之后要重跑全部**,别只看自己那一组。
9191
+ 2. 展开类交互必须断言"展开之后还能正常用"(内部滚动),而不只是"展开了"。
9192
+ 状态变化和能力保持是两件事。
9193
+
9194
+
9195
+ ### 13.64 功能清单上最后两处零覆盖:子调用卡片与证据等级(2026-11-25)
9196
+
9197
+ #### 收尾
9198
+
9199
+ §13.62 的逐条 grep 表里还剩两条 `probe=0`:
9200
+
9201
+ - `.dstv_subCard` —— README §2「子调用链完整卡片(子调用自己的参数 / 结果 / 耗时 / 错误)」
9202
+ - `.dstv_evRow` —— README §2「证据等级:逐项标注这份数据是原始记录、近似重建、还是可能不全」
9203
+
9204
+ 两条都补上了(15c 组)。
9205
+
9206
+ #### 坑 1:没有"工具站点"这种东西
9207
+
9208
+ 我按 `aria-label` 找含「工具」的站点:
9209
+
9210
+ ```js
9211
+ .find((o) => (o.getAttribute("aria-label") || "").indexOf("工具") >= 0)
9212
+ ```
9213
+
9214
+ 匹配到了——但那是**步骤站**,因为它的 meta 里写着「1次工具」。**工具调用是步骤站
9215
+ 内部的 cell,不是独立站点。** 于是断言在一棵没有子调用的树里找子卡,报
9216
+ `shows no sub-call section`。
9217
+
9218
+ 诊断办法:直接把 15 个站点的 label 全打出来看。真正的目标是「轮次 2 的步骤」——
9219
+ fixture 里只有那一站带嵌套的 `jest` 子调用。
9220
+
9221
+ **又一次"断言没命中目标"**(§13.60 坑 3、§13.63 存储断言同型)。
9222
+
9223
+ #### 坑 2:`fail()` 不中断执行
9224
+
9225
+ 第一版写成:
9226
+
9227
+ ```js
9228
+ if (summary === undefined) fail("…");
9229
+ else if (…) fail("…");
9230
+ const det = summary.parentElement; // ← summary 是 undefined 就炸
9231
+ ```
9232
+
9233
+ 探针的 `fail` 只是 `failures.push(m)`,**不抛**。所以判失败之后代码继续跑,
9234
+ 在 `undefined.parentElement` 上抛 TypeError,整个探针变成
9235
+ `Evaluation error` —— 一条断言都没收集到,比"红"更糟(红至少告诉你哪条错了)。
9236
+
9237
+ 修法:判失败之后用 `else { … }` 把后续包起来,别指望 `fail` 短路。
9238
+
9239
+ **这是个通用陷阱:所有 `if (x === undefined) fail(…)` 后面都必须假设 x 仍然
9240
+ 是 undefined。**
9241
+
9242
+ #### 断言写了什么
9243
+
9244
+ 子调用:
9245
+
9246
+ 1. 步骤站的详情里必须有「子调用」小节(即使折叠着——读者不展开也该看到数量)
9247
+ 2. 小节标题要写出**数量**
9248
+ 3. 展开后出现 `.dstv_subCard`,且卡片里写的是**子工具名**(`jest`),不是父工具(`bash`)
9249
+
9250
+ 第 3 点是关键:卡片挂错工具是最容易犯又最难看的错。
9251
+
9252
+ 证据等级(在「原始请求」标签下):
9253
+
9254
+ 1. `.dstv_evRow` 必须存在
9255
+ 2. 每个 chip 都必须有 `title` 解释——"近似重建"四个字没有解释就是黑话
9256
+ 3. chip 文案里必须出现「重建」,因为消息列表确实是重建的
9257
+
9258
+ #### 变异验证
9259
+
9260
+ | 变异 | 结果 |
9261
+ |---|---|
9262
+ | 子调用小节 `&& false` | `shows no sub-call section although the fixture has one` |
9263
+ | 证据行 `&& false` | `the request tab shows no evidence-level chips` |
9264
+ | 去掉 chip 的 `title` | 三条同时红(原始记录 / 近似重建 / 可能不全) |
9265
+
9266
+ #### 至此 README §2 的功能条目全部在浏览器里至少有一条断言
9267
+
9268
+ 探针:**20 组 / 128 条断言**(本轮开始时 14 组 / 57 条)。
9269
+
9270
+ #### 教训
9271
+
9272
+ 1. **"找到元素"不等于"找对元素"。** `indexOf("工具")` 匹配到的是步骤站,
9273
+ 因为站点标签里混着 meta 文本。选元素要靠结构,不要靠可见文案。
9274
+ 2. 测试辅助函数如果不抛,就必须显式 `else` 保护后续代码。`fail()` 之后的一切
9275
+ 都在 undefined 上运行。
9276
+
9277
+
9278
+ ### 13.65 三个复制按钮只验过一个,minimap 只验过"存在"(2026-11-25)
9279
+
9280
+ #### 复制按钮
9281
+
9282
+ README §2 承诺了三个入口:
9283
+
9284
+ | 入口 | 产出 |
9285
+ |---|---|
9286
+ | 🔗 复制锚点 | `tvp1:e3019` |
9287
+ | 📋 复制本步复盘 | 该步的 Markdown 包 |
9288
+ | 📋 Markdown(头部) | 整段轨迹 + 附录 |
9289
+
9290
+ 探针只验过第一个。后两个函数的**单元测试很足**(`buildStepMarkdown` /
9291
+ `buildTraceMarkdown`),但按钮本身从没被点过——**调用点接错 builder 是可以直接
9292
+ 上线的**。
9293
+
9294
+ 补的断言:
9295
+
9296
+ `📋 复制本步复盘`
9297
+ - 剪贴板真的收到东西(≥80 字符)
9298
+ - 有 markdown 标题
9299
+ - 提到本步调用的工具
9300
+ - **不含另一站的工具结果**(`128 passing` 属于轮次 2,本步是轮次 1)
9301
+
9302
+ 最后一条是关键:本步包和整段包最容易混淆,而"内容正确"只能靠"不该有的东西不
9303
+ 在里面"来证。
9304
+
9305
+ `📋 Markdown`
9306
+ - 剪贴板收到东西
9307
+ - **严格大于**单步包
9308
+ - 含后面轮次的文本(`第 7 轮问题`)
9309
+ - 有附录标题
9310
+
9311
+ #### 变异验证(一个都没白写)
9312
+
9313
+ | 变异 | 结果 |
9314
+ |---|---|
9315
+ | 本步包改用 `buildTraceMarkdown` | `leaked another step's tool result` + `is not larger than one step's pack` |
9316
+ | 整段导出只取前 5 站 | `does not include the later turns` |
9317
+ | 附录标题换成 `-` | `has no system-prompt appendix` |
9318
+
9319
+ #### minimap:只验了"色块存在"
9320
+
9321
+ `.dstv_miniTick` 在探针里出现 0 次。README §2 说的是「**点击色块即跳转**,
9322
+ 回放时高亮当前站点」——**跳转和高亮两件事都没验**。
9323
+
9324
+ 补(15d 组):
9325
+
9326
+ 1. 色块数必须**等于站点数**(1:1,不是"差不多")
9327
+ 2. 每个色块必须有 `data-k`(颜色编码是 minimap 的全部价值)
9328
+ 3. 点第 7 个色块 → 站点列表必须选中第 7 个(**两个入口必须一致**)
9329
+ 4. 高亮色块必须**就是**被选中的那个
9330
+
9331
+ 第 3 条是这组的核心:minimap 和站点列表是**同一份数据的两个入口**,它们不一致
9332
+ 比没有 minimap 更糟。
9333
+
9334
+ #### 顺带又一个状态陷阱
9335
+
9336
+ 写完这组,`await press("End")` 报 `could not return to the overview`。
9337
+
9338
+ 因为刚点过色块,`document.activeElement` 是**那个色块按钮**,而它有自己的 roving
9339
+ focus 键盘处理,把 `End` 吃掉了,事件从没冒泡到面板处理器。
9340
+
9341
+ 修法:`root.focus()` 之后再按。
9342
+
9343
+ 这是**第四次**被"当前焦点/状态"咬到(§13.56 / §13.60 / §13.63 / 本节)。规律很
9344
+ 清楚:**任何跨组的键盘操作,都必须显式把焦点放回面板。**
9345
+
9346
+ #### 变异验证
9347
+
9348
+ | 变异 | 结果 |
9349
+ |---|---|
9350
+ | 色块 `onClick` 去掉 `seek` | `clicking minimap tick 7 selected [1] — the two affordances disagree` |
9351
+ | 去掉 `data-k` | `15 minimap tick(s) carry no data-k colour key` |
9352
+
9353
+ #### 教训
9354
+
9355
+ 1. **"函数有单测"和"按钮接对了"是两件事。** 三个复制入口里两个从没被点过,
9356
+ 接错 builder 完全能上线。
9357
+ 2. 同一份数据的多个入口,必须断言它们**互相一致**,而不是各自"有反应"。
9358
+ 3. 跨组键盘操作前先 `root.focus()`——焦点在子控件上时,事件被子控件的处理器吃掉。
9359
+
9360
+
9361
+ ### 13.66 锚点输入框:README 的头号 Plus 功能,浏览器里一次都没用过(2026-11-25)
9362
+
9363
+ #### 现象
9364
+
9365
+ README §2 把这条放在「站点可定位、可复制(Plus 新增)」的第一位:
9366
+
9367
+ > 🔗 **稳定锚点**:每个站点都有可复制的引用…粘进工具栏的 🔗 输入框回车即可精确定位;
9368
+ > **地址栏会同步成 `#tvp1:e3019`**,把这个链接发给别人、或刷新页面,都会回到同一条记录。
9369
+
9370
+ 探针里 `.dstv_anchorInput` 出现 0 次(只有那次给搜索框加 `:not(.dstv_anchorInput)`
9371
+ 时提过它)。smoke 里 `parseAnchor` / `resolveAnchorInStations` / `anchorLoadTarget`
9372
+ 的单测非常细,但**输入框本身从没被输入过**。
9373
+
9374
+ 一句话:**解析器测透了,入口没接。**
9375
+
9376
+ #### 补的四段(15e 组)
9377
+
9378
+ | 场景 | 断言 |
9379
+ |---|---|
9380
+ | 垃圾锚点 `not-an-anchor` | 视图**不动**、必须给出「无法识别」 |
9381
+ | 往返:复制某站锚点 → 取消选中 → 粘回去 | 落回**同一站**、地址栏变成 `#<锚点>` |
9382
+ | 不在窗口的锚点 `tvp1:e999999`(`hasMore` 关掉) | 不选中任何东西、必须给出「不在当前窗口」 |
9383
+ | `Esc` | 清空输入框**和**提示 |
9384
+
9385
+ #### 三处我自己写错的地方
9386
+
9387
+ **错 1:又是焦点。**
9388
+ 第一行 `await press("End")` 想回到总览,但上一组刚点过色块,焦点在色块按钮上,
9389
+ `End` 被它的 roving focus 吃掉。measuring 一下:
9390
+
9391
+ ```
9392
+ ✗ DBG before-malformed sel=[1] hash="" warns=[]
9393
+ ```
9394
+
9395
+ 还没开始测锚点,状态就已经不是总览了。修法:`root.focus()` 再按。
9396
+
9397
+ 这是**第 5 次**被"当前焦点"咬到(§13.56 / §13.60 / §13.63 / §13.65 / 本节)。
9398
+ 已经不能算意外了——**探针里任何键盘操作前都必须显式聚焦 `root`**。
9399
+
9400
+ **错 2:硬编码锚点。**
9401
+ 我最初写 `setA("tvp1:e2")` 然后断言"应该选中第 1 站"。但 `e2` 落在哪里取决于
9402
+ fixture 的 seq 分配,断言失败时给的信息是:
9403
+
9404
+ ```
9405
+ ✗ tvp1:e2 resolved to the wrong station: "2 / 15,步骤 1,轮次 1,…"
9406
+ ```
9407
+
9408
+ **是我对 fixture 的假设错了,不是代码错了。** 改成**往返验证**:先在某个站点上点
9409
+ 「复制锚点」,把它复制到的串原样粘回去,断言落回**同一站**。这样测的是
9410
+ "给你的锚点能把你带回来"——这才是这个功能的性质,而且不依赖 fixture 的数字。
9411
+
9412
+ **错 3:合成锚点测错了对象。**
9413
+ 我用 `tvp1:p3s7` 想测"合成记录会如实标注",结果报:
9414
+
9415
+ ```
9416
+ ✗ a synthetic anchor produced no honest explanation (note "正在向前加载更早历史以定位…(第 1/40 页,已载入 15 站)")
9417
+ ```
9418
+
9419
+ 因为 `p3s7`(第 3 轮第 7 步)在这份 fixture 里**存在**服务端记录的可能性,
9420
+ 所以走的是"向前翻页"分支而不是"合成"分支。合成锚点只在**未落盘**的记录上出现,
9421
+ 那需要构造一个 `partial` 快照——不是输入一个字符串就能造出来的。
9422
+
9423
+ 我把这条改成了它真正该测的东西:**不在窗口的锚点必须诚实报告**(关掉 `hasMore`,
9424
+ 用 `tvp1:e999999`)。合成锚点的渲染在 smoke 里已有覆盖。
9425
+
9426
+ #### 变异验证
9427
+
9428
+ | 变异 | 结果 |
9429
+ |---|---|
9430
+ | 去掉 `history.replaceState` 的哈希同步 | `address bar was not synced to tvp1:e4: ""` |
9431
+ | `resolveAnchorInStations` 恒返回第 0 站 | 三条连锁红(复制按钮不在选中的站上 / 往返找不到 / 无诚实提示) |
9432
+ | "不在窗口"的提示改成 `null` | `an anchor outside the loaded window produced no honest note` |
9433
+
9434
+ #### 教训
9435
+
9436
+ 1. **解析器的单测覆盖率会掩盖"入口没接"。** 这是本轮第 4 个同类盲区
9437
+ (§13.60 契约、§13.62 KPI、§13.65 复制按钮),而锚点是其中最重要的一个。
9438
+ 2. **断言要落在功能性质上,不是 fixture 的数字上。** 往返验证比"e2 应该在位置 1"
9439
+ 更强也更稳。
9440
+ 3. 输入一个字符串**造不出**"未持久化"状态。测某个状态前先确认这个状态下
9441
+ 前置条件真的成立,否则测的是另一个分支。
9442
+
9443
+
9444
+ ### 13.67 ⚡ 提示词变更:fixture 里连 promptChange 字段都没有,整块 UI 不可达(2026-11-26)
9445
+
9446
+ #### 现象
9447
+
9448
+ README §2「原始请求」标签下有一条:
9449
+
9450
+ > ⚡ **提示词变更**:当次请求相对上次的差异摘要——系统提示字符数变化、
9451
+ > `+ 新增` / `- 移除` 的工具名(`initial` 为首份系统提示)。
9452
+
9453
+ `.dstv_diffBox` 在探针里出现 **0 次**。
9454
+
9455
+ 一开始以为只是"没写断言"。查下去发现更彻底:**fixture 的请求里没有
9456
+ `promptChange` 字段**。
9457
+
9458
+ ```js
9459
+ { … prompt: { system: "你是助手。", tools: [] } } // 没有 promptChange
9460
+ ```
9461
+
9462
+ 而渲染条件是 `diff !== null`,`diff = promptDiffOf(r.promptChange, …)`,`change == null`
9463
+ 直接返回 `null`。**所以这块 UI 在浏览器里从来没有存在过,不是"没测到",是"不存在"。**
9464
+
9465
+ `promptDiffOf` / `promptTextDiff` 的单测非常详细(40 行上限、首尾裁剪、`narrows`
9466
+ 标记都覆盖了)。**又一次同型盲区**(§13.60 契约 / §13.62 KPI / §13.65 复制按钮 /
9467
+ §13.66 锚点),而且这次是最彻底的一次:不是入口没接对,是入口根本不存在。
9468
+
9469
+ #### 修 fixture
9470
+
9471
+ 给第 2、3 条请求加 `promptChange`,并且**故意让两次变更方向相反**:
9472
+
9473
+ | 请求 | 相对上一次 |
9474
+ |---|---|
9475
+ | turn1 step2 | 加一行提示(`新增一条。`)、加一个工具(`read`) |
9476
+ | turn2 step1 | 减两行提示、减两个工具(`pwsh` `read`) |
9477
+
9478
+ 只测"新增"是最容易漏的一半——**只显示 addition 的 diff 是完全可能的实现缺陷**,
9479
+ 而且看起来一切正常。
9480
+
9481
+ #### 断言
9482
+
9483
+ - 有 `.dstv_diffBox`
9484
+ - 新增侧:有 `+ read` 且带 `.dstv_diffChip.add`
9485
+ - 字符增量必须写成 `18 → 5`(**两个数**),不是只给一个
9486
+ - 展开后有 `.dstv_diffSide.add`,内容含 `新增一条`
9487
+ - 删除侧:有 `-` chip、`.dstv_diffSide.del`,内容含 `请遵守规则`
9488
+
9489
+ 第 3 条来自一个很小的判断:`系统提示字符 18` 这种写法**读者无法知道是变多还是变少**。
9490
+ 项目里凡是要表达"变化"的地方都必须给出两端(这也是 §13.62 里时钟轴"标签必须变"的
9491
+ 同一条原则)。
9492
+
9493
+ #### 变异验证
9494
+
9495
+ | 变异 | 结果 |
9496
+ |---|---|
9497
+ | `diff box && false` | 两条红(新增侧 + 删除侧) |
9498
+ | `toolsRemoved = []`(只显示新增) | `removed tools are not marked (- chip)` |
9499
+ | 字符增量只给一个数 | `the delta does not show before AND after: "系统提示字符 18"` |
9500
+
9501
+ 第二个变异尤其值得记:它验证的正是"我特意让两次变更方向相反"这个设计——
9502
+ 如果只有新增那一条请求,`toolsRemoved = []` 这个变异**会绿**。
9503
+
9504
+ #### 教训
9505
+
9506
+ 1. **"零覆盖"有两种,第二种更隐蔽**:入口没接(锚点那种),和**数据根本没有**
9507
+ (这次)。前者探针里至少能看到元素,后者元素从未存在,grep 也是 0,看到的
9508
+ 现象完全一样。要区分它们,得问"这个元素的渲染前提,fixture 满足吗"。
9509
+ 2. **fixture 也是被测代码**(§13.62 已经记过一次,那时是字段名写错)。这次是
9510
+ 字段根本没写。每次补断言前先确认:**这个 UI 块要渲染,前提条件在当前 fixture
9511
+ 下成立吗?**
9512
+ 3. 测一个"变更"类 UI,**必须两个方向都测**。单向测试对"只实现了一半"这种最常见
9513
+ 的缺陷完全无能为力。
9514
+
9515
+
9516
+ ### 13.68 「原始请求」四个段一个都没验过,而 Token 用量里是硬编码英文(2026-11-26)
9517
+
9518
+ #### 现象
9519
+
9520
+ README §2 把「原始请求」拆成四段:**系统提示全文 / 工具目录 / 消息列表 / Token 用量**。
9521
+ `.dstv_dSection` 在探针里出现 **0 次**——整个请求标签从没被结构性地看过一眼。
9522
+
9523
+ #### 真 bug:中文面板里的英文 chip
9524
+
9525
+ 补断言时先写了个宽泛版:
9526
+
9527
+ ```js
9528
+ if (!/请求 tokens|入站/i.test(tabText())) fail(…)
9529
+ ```
9530
+
9531
+ 它红了。查下去发现 Token 用量那一排 chip 是**硬编码英文**:
9532
+
9533
+ ```js
9534
+ jsx("span", { children: ["in ", jsx("b", { children: fmtInt(usage.input) }, "v")] })
9535
+ jsx("span", { children: ["cache-read ", …] })
9536
+ jsx("span", { children: ["out ", …] })
9537
+ ```
9538
+
9539
+ 于是中文界面里显示的是 `in 880 cache-read 320 out 52`。
9540
+
9541
+ **而 README §2 的中文原话是「入站(含缓存读 / 写)与出站(含思考)明细」**——
9542
+ 文档用中文描述了功能,实现给的是英文。§13.13 的 I18N3 守卫只查 CJK 字面量(中文
9543
+ 硬编码进代码),**反向的不会查:英文字面量进中文界面。**
9544
+
9545
+ #### 修法
9546
+
9547
+ 加 6 个 locale 键(zh / en 各一份),把这排 chip 接上:
9548
+
9549
+ ```js
9550
+ "usage.in": "入站", "usage.fresh": "未缓存",
9551
+ "usage.cacheRead": "缓存读", "usage.cacheWrite": "缓存写",
9552
+ "usage.out": "出站", "usage.think": "思考",
9553
+ ```
9554
+
9555
+ 英文侧保持 `in` / `fresh` / `cache-read` / `cache-write` / `out` / `think`。
9556
+
9557
+ #### 三处"同一段文字有两个来源"的坑
9558
+
9559
+ **坑 1(第 6 次同型):消息列表的"近似"来自两处。**
9560
+
9561
+ 这条断言:
9562
+
9563
+ ```js
9564
+ if (!/近似|approx|reconstruct/i.test(msgs.textContent)) fail(…)
9565
+ ```
9566
+
9567
+ 变异(删掉 `detail.requestApprox` 整句警示)**没红**,因为同一段里还有证据等级
9568
+ chip 写着「近似重建」。删掉长警示句,短 chip 顶上。
9569
+
9570
+ 修法:断言**只有长句里才有的词**(`按会话日志`)。重做变异立刻红。
9571
+
9572
+ **坑 2:`usage.in` 在源码里出现两次**(普通请求 + 压缩请求各一处)。第一次只改了
9573
+ 一处,变异也没红——因为另一处还在。改成 `replace` 全部之后才验证成功。
9574
+
9575
+ **坑 3:fixture 没有 cache token。**
9576
+
9577
+ `缓存读` 断言红了一次,原因是 fixture 的 usage 只有 `inputTokens` / `outputTokens`,
9578
+ 没有 `cacheReadTokens`。补上 `cacheReadTokens: 320, cacheWriteTokens: 60,
9579
+ reasoningTokens: 12` 之后,chip 才真的出现。
9580
+
9581
+ **这是 §13.67 说的第二种"零覆盖"(数据根本没有)第二次出现。**
9582
+
9583
+ #### 断言写了什么
9584
+
9585
+ - 四段标签必须都在
9586
+ - 工具目录必须列出本请求携带的工具(`pwsh`)
9587
+ - 消息列表必须带**完整警示句**(`按会话日志`)
9588
+ - Token 用量必须有 `入站` / `出站` / `缓存读`
9589
+ - 系统提示必须写出字符数
9590
+
9591
+ #### 变异验证
9592
+
9593
+ | 变异 | 结果 |
9594
+ |---|---|
9595
+ | `usage.in` 改回硬编码 `"in "`(两处) | `no 入站 (inbound) chip` |
9596
+ | 不渲染缓存读 chip(两处) | `does not split out cache reads` |
9597
+ | 系统提示字符数换成 `—` | `states no character count` |
9598
+ | 删掉长警示句 | `does not carry the full … warning`(修前绿) |
9599
+ | 工具目录不写工具名 | `does not list the request's own tool` |
9600
+
9601
+ #### 教训
9602
+
9603
+ 1. **I18N 守卫是单向的。** I18N3 查"代码里有中文",不查"代码里有英文进了中文界面"。
9604
+ 后者更难自动检测,但**按可见文案断言**能顺带抓到它——这次就是这么发现的。
9605
+ 2. 同一段里两个来源表达同一个意思,是这类假绿的根源(§13.60 / §13.63 / 本节)。
9606
+ 修法永远是:**找只有目标来源才有的那个词。**
9607
+ 3. 变异"没红"时,先数目标在源码里出现几次。`replace(o, n, 1)` 只改一处是这类
9608
+ 漏报的常见原因。
9609
+
9610
+
9611
+ ### 13.69 英文界面从没被渲染过;加进去之后先撞了 30 秒上限(2026-11-26)
9612
+
9613
+ #### 起点
9614
+
9615
+ 插件同时提供 zh / en 两套词典。所有测试——smoke 和浏览器探针——**只跑过 zh**。
9616
+
9617
+ §13.68 抓到的是"英文字面量跑进中文界面"。反过来那一半更常见:**某条文案只在中文
9618
+ 词典里写了,英文用户看不到它;或者直接把中文硬编码进代码**。I18N3 在源码层扫中文
9619
+ 字面量,但扫不到"英文词典少了一个键,于是 `t()` 返回 key 本身"这种运行时状态。
9620
+
9621
+ #### harness 先得能切语言
9622
+
9623
+ fixture 的 `t` 是固定的 zh:
9624
+
9625
+ ```js
9626
+ var s = (d.zh && d.zh[key] !== void 0) ? d.zh[key] : key;
9627
+ ```
9628
+
9629
+ 加 `host.lang` + `window.__setLocale(lang)`。
9630
+
9631
+ **第一次实现用 `window.__render()`(重新渲染),结果 22 个站点标签还是中文。**
9632
+ 原因:`t` 是同一个闭包,`useMemo(…, [t])` 的依赖没变,缓存值全部保留。真实宿主切换
9633
+ 语言是换掉整个绑定,`t` 的身份会变——所以 `__setLocale` 改成 **`__remount()`**,
9634
+ 立刻 0 泄漏。
9635
+
9636
+ 这条值得单独记:**语言的"当前值"藏在 `t` 的闭包里时,只在依赖数组里写 `t` 是不够的。**
9637
+
9638
+ #### 撞上 30 秒上限
9639
+
9640
+ 把英文组放进 `probe.js` 之后:
9641
+
9642
+ ```
9643
+ ✗ Failed to read: Resource temporarily unavailable (os error 35)
9644
+ ```
9645
+
9646
+ 实测:整条探针 **30.03 秒**退出,正好卡在 `agent-browser eval` 的上限。而且失败形态
9647
+ 是"结果无法解析",不是一条红断言——**比红更糟**。
9648
+
9649
+ 两步处理:
9650
+
9651
+ 1. 两处 `await tick(700)` 改成**轮询等待条件**(通常 <100 ms 就满足);
9652
+ 2. 英文组**拆到 `test/browser/probe-en.js`**,由 `browser-check.mjs` 作为第二次
9653
+ eval 执行,共约 5 秒。
9654
+
9655
+ 拆完主探针 28 秒、英文 pass 5 秒,都留出余量。
9656
+
9657
+ #### 扫描范围踩了两次
9658
+
9659
+ 第一次把 `.dstv_root` 的 `textContent` 整个扫,报 1 处泄漏:
9660
+
9661
+ ```
9662
+ panel text: Trace ViewUserStepToolCompactionerror⏮⇤◀…
9663
+ ```
9664
+
9665
+ 那是**整个子树**,里面主要是**会话数据**(fixture 自己的中文消息)。
9666
+ **数据不是翻译问题。**
9667
+
9668
+ 第二次只扫 chrome,但**漏了详情面板**:大部分文案在详情里,而详情只有选中站点后才
9669
+ 渲染。变异(把一处 usage chip 硬编码成中文)因此**没红**。
9670
+
9671
+ 修法:`[role=option]` 排除在外(站点标签混着会话原文),面板根只查 `aria-label`,
9672
+ 然后**显式点开一个站点 + 切到原始请求标签**,再扫详情里的 `dLabel` / `dSecHead` /
9673
+ `cfgChip` / `chip` / 证据行 / diff 框。重做变异立刻红。
9674
+
9675
+ #### 变异验证
9676
+
9677
+ | 变异 | 结果 |
9678
+ |---|---|
9679
+ | 英文词典 `action.clockAxis` 改成「等距」 | `the English UI still shows Chinese in 1 place(s): ["control text: ⏱ 等距"]` |
9680
+ | 一处 usage chip 硬编码中文(只改 1/2 处) | **绿**(另一处仍是 `t()`,英文侧正常) |
9681
+ | 两处都改 | `detail text: 入站 880` |
9682
+
9683
+ 第二行是这一轮**第 3 次**被"同一个词在源码里有多处"骗到(§13.68 的 `usage.in` 也是)。
9684
+
9685
+ #### 连带修好的一个计数 bug
9686
+
9687
+ `readme-numbers.mjs` 只读 `probe.js`。拆出第二个文件后它继续报旧数字——**这正是它
9688
+ 自己文档里记过的"一个来源 vs 两个来源"盲区(§13.44)**,同一个文件里第二次出现。
9689
+
9690
+ 改成遍历两个 probe 文件累加。同时发现另一处:`extraAssertions` 用
9691
+ `/failures\.push\(/` 计数,把 **`parsed.failures.push(...parsedEn.failures)`
9692
+ (转发)也算成了一条断言**——转发不是断言,它搬的是别处产出的失败。改成只数
9693
+ `push("…")` 字面量参数。
9694
+
9695
+ #### 教训
9696
+
9697
+ 1. **"没测过英文"和"英文会崩"是两件事,但只有渲染才能分辨。** 28 组观测、189 条
9698
+ 断言,之前一条都没碰过 en。
9699
+ 2. 引擎有硬超时的时候,**拆文件**比压缩耗时更可靠;失败形态(不可解析 vs 红断言)
9700
+ 也要在意,前者会掩盖真正的原因。
9701
+ 3. 扫 UI 文案必须区分 **chrome 与 data**。站点标签里嵌着会话原文,那不是缺陷。
@@ -49,6 +49,7 @@
49
49
  - `src/40-view.js`
50
50
  - `src/50-entry.js`
51
51
  - `test/browser/fixture.js`
52
+ - `test/browser/probe-en.js`
52
53
  - `test/browser/probe.js`
53
54
 
54
55
  ## 二、`lib/client.js` 函数级
package/lib/client.js CHANGED
@@ -73,6 +73,17 @@ window.__ModuleLoader__.load({
73
73
  "kpi.tokensIn": "请求 tokens",
74
74
  "kpi.tokensOut": "生成 tokens",
75
75
  "kpi.errors": "错误",
76
+ // The Token-usage chips were hardcoded English ("in" / "out" / "cache-read" …)
77
+ // inside a Chinese panel, while README §2 describes this section as
78
+ // "入站(含缓存读 / 写)与出站(含思考)". Same words as the README, compact
79
+ // enough for a chip. `fresh` = input tokens that came from the prompt rather
80
+ // than from cache (the API's `inputTokens` minus cache read/write).
81
+ "usage.in": "入站",
82
+ "usage.fresh": "未缓存",
83
+ "usage.cacheRead": "缓存读",
84
+ "usage.cacheWrite": "缓存写",
85
+ "usage.out": "出站",
86
+ "usage.think": "思考",
76
87
  "status.done": "已完成",
77
88
  "status.retry": "重试",
78
89
  "detail.args": "调用参数",
@@ -248,6 +259,12 @@ window.__ModuleLoader__.load({
248
259
  "kpi.tokensIn": "Prompt tokens",
249
260
  "kpi.tokensOut": "Output tokens",
250
261
  "kpi.errors": "Errors",
262
+ "usage.in": "in",
263
+ "usage.fresh": "fresh",
264
+ "usage.cacheRead": "cache-read",
265
+ "usage.cacheWrite": "cache-write",
266
+ "usage.out": "out",
267
+ "usage.think": "think",
251
268
  "status.done": "Done",
252
269
  "status.retry": "Retry",
253
270
  "detail.args": "Call arguments",
@@ -5169,9 +5186,9 @@ window.__ModuleLoader__.load({
5169
5186
  usage !== null && usage.input + usage.output > 0 ? jsxs("div", { className: "dstv_dSection", children: [
5170
5187
  jsx("span", { className: "dstv_dLabel", children: `📊 ${t("detail.usage")}` }, "uLbl"),
5171
5188
  jsx("div", { className: "dstv_cfgChips", children: [
5172
- usage.input > 0 ? jsx("span", { className: "dstv_cfgChip", children: ["in ", jsx("b", { children: fmtInt(usage.input) }, "v")] }, "uIn") : null,
5173
- usage.cacheRead > 0 ? jsx("span", { className: "dstv_cfgChip", children: ["cache-read ", jsx("b", { children: fmtInt(usage.cacheRead) }, "v")] }, "uCR") : null,
5174
- usage.output > 0 ? jsx("span", { className: "dstv_cfgChip", children: ["out ", jsx("b", { children: fmtInt(usage.output) }, "v")] }, "uOut") : null
5189
+ usage.input > 0 ? jsx("span", { className: "dstv_cfgChip", children: [`${t("usage.in")} `, jsx("b", { children: fmtInt(usage.input) }, "v")] }, "uIn") : null,
5190
+ usage.cacheRead > 0 ? jsx("span", { className: "dstv_cfgChip", children: [`${t("usage.cacheRead")} `, jsx("b", { children: fmtInt(usage.cacheRead) }, "v")] }, "uCR") : null,
5191
+ usage.output > 0 ? jsx("span", { className: "dstv_cfgChip", children: [`${t("usage.out")} `, jsx("b", { children: fmtInt(usage.output) }, "v")] }, "uOut") : null
5175
5192
  ] }, "uChips")
5176
5193
  ] }, "crUsage") : null,
5177
5194
  cr.outputText !== "" ? jsxs("div", { className: "dstv_dSection", children: [
@@ -5305,12 +5322,12 @@ window.__ModuleLoader__.load({
5305
5322
  usage !== null && usage.input + usage.output > 0 ? jsxs("div", { className: "dstv_dSection", children: [
5306
5323
  jsx("span", { className: "dstv_dLabel", children: `📊 ${t("detail.usage")}` }, "uLbl"),
5307
5324
  jsx("div", { className: "dstv_cfgChips", children: [
5308
- usage.input > 0 ? jsx("span", { className: "dstv_cfgChip", children: ["in ", jsx("b", { children: fmtInt(usage.input) }, "v")] }, "uIn") : null,
5309
- usage.raw > 0 ? jsx("span", { className: "dstv_cfgChip", children: ["fresh ", jsx("b", { children: fmtInt(usage.raw) }, "v")] }, "uFresh") : null,
5310
- usage.cacheRead > 0 ? jsx("span", { className: "dstv_cfgChip", children: ["cache-read ", jsx("b", { children: fmtInt(usage.cacheRead) }, "v")] }, "uCR") : null,
5311
- usage.cacheWrite > 0 ? jsx("span", { className: "dstv_cfgChip", children: ["cache-write ", jsx("b", { children: fmtInt(usage.cacheWrite) }, "v")] }, "uCW") : null,
5312
- usage.output > 0 ? jsx("span", { className: "dstv_cfgChip", children: ["out ", jsx("b", { children: fmtInt(usage.output) }, "v")] }, "uOut") : null,
5313
- usage.think > 0 ? jsx("span", { className: "dstv_cfgChip", children: ["think ", jsx("b", { children: fmtInt(usage.think) }, "v")] }, "uThink") : null
5325
+ usage.input > 0 ? jsx("span", { className: "dstv_cfgChip", children: [`${t("usage.in")} `, jsx("b", { children: fmtInt(usage.input) }, "v")] }, "uIn") : null,
5326
+ usage.raw > 0 ? jsx("span", { className: "dstv_cfgChip", children: [`${t("usage.fresh")} `, jsx("b", { children: fmtInt(usage.raw) }, "v")] }, "uFresh") : null,
5327
+ usage.cacheRead > 0 ? jsx("span", { className: "dstv_cfgChip", children: [`${t("usage.cacheRead")} `, jsx("b", { children: fmtInt(usage.cacheRead) }, "v")] }, "uCR") : null,
5328
+ usage.cacheWrite > 0 ? jsx("span", { className: "dstv_cfgChip", children: [`${t("usage.cacheWrite")} `, jsx("b", { children: fmtInt(usage.cacheWrite) }, "v")] }, "uCW") : null,
5329
+ usage.output > 0 ? jsx("span", { className: "dstv_cfgChip", children: [`${t("usage.out")} `, jsx("b", { children: fmtInt(usage.output) }, "v")] }, "uOut") : null,
5330
+ usage.think > 0 ? jsx("span", { className: "dstv_cfgChip", children: [`${t("usage.think")} `, jsx("b", { children: fmtInt(usage.think) }, "v")] }, "uThink") : null
5314
5331
  ] }, "uChips")
5315
5332
  ] }, "uSec") : null,
5316
5333
  // messages
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-trajectory-traceview-plus",
3
- "version": "0.11.3",
3
+ "version": "0.11.4",
4
4
  "description": "轨迹视图增强版(Plus):在「轨迹」标签旁新增可回放的横向时间轴——minimap、窗口内检索(显式标注覆盖边界)、回放、轮次跳转、跟随模式、历史分页、步骤/子调用耗时与吞吐、时钟轴切换、稳定锚点复制与深链、孤立工具结果站点、提示词变更对比、原始请求分析与 Markdown 导出。基于 AFAP/dsh-trajectory-traceview (MIT) 改造。",
5
5
  "type": "module",
6
6
  "main": "lib/index.js",
@@ -40,6 +40,20 @@ try {
40
40
  process.exit(1);
41
41
  }
42
42
 
43
+ // The English pass runs as a second eval. `agent-browser eval` aborts with
44
+ // "Resource temporarily unavailable" at 30 s, and the main probe alone is close to that;
45
+ // merging the two failed as an unparsable result instead of a red assertion.
46
+ const probeEn = fs.readFileSync(path.join(root, "test/browser/probe-en.js"), "utf8");
47
+ const outEn = run("agent-browser", ["eval", "--stdin"], probeEn);
48
+ try {
49
+ const outerEn = JSON.parse((outEn.stdout || "").trim());
50
+ const parsedEn = JSON.parse(outerEn);
51
+ if (Array.isArray(parsedEn.failures)) parsed.failures.push(...parsedEn.failures);
52
+ parsed.info.englishLeaks = parsedEn.info.englishLeaks;
53
+ } catch {
54
+ parsed.failures.push("the English pass did not return a parsable result");
55
+ }
56
+
43
57
  if (shots) {
44
58
  fs.mkdirSync(path.join(root, "test/browser/shots"), { recursive: true });
45
59
  run("agent-browser", ["screenshot", "--screenshot-dir", "./test/browser/shots"]);
@@ -35,9 +35,18 @@ const pkg = JSON.parse(read('package.json'));
35
35
  const version = String(pkg.version);
36
36
  const localSteps = pkg.scripts.check.split('&&').map((s) => s.trim()).filter(Boolean).length;
37
37
 
38
- const probe = read('test/browser/probe.js');
39
- const observedGroups = new Set([...probe.matchAll(/info\.([a-zA-Z]\w*)\s*=/g)].map((m) => m[1]));
40
- const assertions = [...probe.matchAll(/\bfail\(/g)].length;
38
+ // Two probe files, one count. `probe-en.js` was split out because `agent-browser eval`
39
+ // aborts at 30 s and the language switch pushed the single file over it (§13.69) — and
40
+ // leaving it out of this count is exactly the one-source-vs-two-sources blindness this
41
+ // very block has already been fixed for once (§13.44).
42
+ const PROBE_FILES = ['test/browser/probe.js', 'test/browser/probe-en.js'];
43
+ const probes = PROBE_FILES.map((f) => read(f));
44
+ const observedGroups = new Set();
45
+ let assertions = 0;
46
+ for (const src of probes) {
47
+ for (const m of src.matchAll(/info\.([a-zA-Z]\w*)\s*=/g)) observedGroups.add(m[1]);
48
+ assertions += [...src.matchAll(/\bfail\(/g)].length;
49
+ }
41
50
 
42
51
  // ── checks added OUTSIDE probe.js ────────────────────────────────────────────
43
52
  //
@@ -55,7 +64,11 @@ const extraGroupNames = new Set(
55
64
  .map((m) => m[1])
56
65
  .filter((n) => !observedGroups.has(n)),
57
66
  );
58
- const extraAssertions = [...browserCheck.matchAll(/(?:parsed\.)?failures\.push\(/g)].length;
67
+ // Only `push("…")` is an assertion. `push(...other)` forwards failures produced
68
+ // ELSEWHERE (the English pass collects its own) — counting it as an assertion inflated the
69
+ // total by one for every forwarded bundle, and the gate would then demand README numbers
70
+ // that describe nothing a reader could point at.
71
+ const extraAssertions = [...browserCheck.matchAll(/(?:parsed\.)?failures\.push\(\s*["'`]/g)].length;
59
72
 
60
73
  const truth = {
61
74
  ciGates, localSteps, groups: observedGroups.size, assertions,
package/src/00-locale.js CHANGED
@@ -62,6 +62,17 @@
62
62
  "kpi.tokensIn": "请求 tokens",
63
63
  "kpi.tokensOut": "生成 tokens",
64
64
  "kpi.errors": "错误",
65
+ // The Token-usage chips were hardcoded English ("in" / "out" / "cache-read" …)
66
+ // inside a Chinese panel, while README §2 describes this section as
67
+ // "入站(含缓存读 / 写)与出站(含思考)". Same words as the README, compact
68
+ // enough for a chip. `fresh` = input tokens that came from the prompt rather
69
+ // than from cache (the API's `inputTokens` minus cache read/write).
70
+ "usage.in": "入站",
71
+ "usage.fresh": "未缓存",
72
+ "usage.cacheRead": "缓存读",
73
+ "usage.cacheWrite": "缓存写",
74
+ "usage.out": "出站",
75
+ "usage.think": "思考",
65
76
  "status.done": "已完成",
66
77
  "status.retry": "重试",
67
78
  "detail.args": "调用参数",
@@ -237,6 +248,12 @@
237
248
  "kpi.tokensIn": "Prompt tokens",
238
249
  "kpi.tokensOut": "Output tokens",
239
250
  "kpi.errors": "Errors",
251
+ "usage.in": "in",
252
+ "usage.fresh": "fresh",
253
+ "usage.cacheRead": "cache-read",
254
+ "usage.cacheWrite": "cache-write",
255
+ "usage.out": "out",
256
+ "usage.think": "think",
240
257
  "status.done": "Done",
241
258
  "status.retry": "Retry",
242
259
  "detail.args": "Call arguments",
package/src/40-view.js CHANGED
@@ -1831,9 +1831,9 @@
1831
1831
  usage !== null && usage.input + usage.output > 0 ? jsxs("div", { className: "dstv_dSection", children: [
1832
1832
  jsx("span", { className: "dstv_dLabel", children: `📊 ${t("detail.usage")}` }, "uLbl"),
1833
1833
  jsx("div", { className: "dstv_cfgChips", children: [
1834
- usage.input > 0 ? jsx("span", { className: "dstv_cfgChip", children: ["in ", jsx("b", { children: fmtInt(usage.input) }, "v")] }, "uIn") : null,
1835
- usage.cacheRead > 0 ? jsx("span", { className: "dstv_cfgChip", children: ["cache-read ", jsx("b", { children: fmtInt(usage.cacheRead) }, "v")] }, "uCR") : null,
1836
- usage.output > 0 ? jsx("span", { className: "dstv_cfgChip", children: ["out ", jsx("b", { children: fmtInt(usage.output) }, "v")] }, "uOut") : null
1834
+ usage.input > 0 ? jsx("span", { className: "dstv_cfgChip", children: [`${t("usage.in")} `, jsx("b", { children: fmtInt(usage.input) }, "v")] }, "uIn") : null,
1835
+ usage.cacheRead > 0 ? jsx("span", { className: "dstv_cfgChip", children: [`${t("usage.cacheRead")} `, jsx("b", { children: fmtInt(usage.cacheRead) }, "v")] }, "uCR") : null,
1836
+ usage.output > 0 ? jsx("span", { className: "dstv_cfgChip", children: [`${t("usage.out")} `, jsx("b", { children: fmtInt(usage.output) }, "v")] }, "uOut") : null
1837
1837
  ] }, "uChips")
1838
1838
  ] }, "crUsage") : null,
1839
1839
  cr.outputText !== "" ? jsxs("div", { className: "dstv_dSection", children: [
@@ -1967,12 +1967,12 @@
1967
1967
  usage !== null && usage.input + usage.output > 0 ? jsxs("div", { className: "dstv_dSection", children: [
1968
1968
  jsx("span", { className: "dstv_dLabel", children: `📊 ${t("detail.usage")}` }, "uLbl"),
1969
1969
  jsx("div", { className: "dstv_cfgChips", children: [
1970
- usage.input > 0 ? jsx("span", { className: "dstv_cfgChip", children: ["in ", jsx("b", { children: fmtInt(usage.input) }, "v")] }, "uIn") : null,
1971
- usage.raw > 0 ? jsx("span", { className: "dstv_cfgChip", children: ["fresh ", jsx("b", { children: fmtInt(usage.raw) }, "v")] }, "uFresh") : null,
1972
- usage.cacheRead > 0 ? jsx("span", { className: "dstv_cfgChip", children: ["cache-read ", jsx("b", { children: fmtInt(usage.cacheRead) }, "v")] }, "uCR") : null,
1973
- usage.cacheWrite > 0 ? jsx("span", { className: "dstv_cfgChip", children: ["cache-write ", jsx("b", { children: fmtInt(usage.cacheWrite) }, "v")] }, "uCW") : null,
1974
- usage.output > 0 ? jsx("span", { className: "dstv_cfgChip", children: ["out ", jsx("b", { children: fmtInt(usage.output) }, "v")] }, "uOut") : null,
1975
- usage.think > 0 ? jsx("span", { className: "dstv_cfgChip", children: ["think ", jsx("b", { children: fmtInt(usage.think) }, "v")] }, "uThink") : null
1970
+ usage.input > 0 ? jsx("span", { className: "dstv_cfgChip", children: [`${t("usage.in")} `, jsx("b", { children: fmtInt(usage.input) }, "v")] }, "uIn") : null,
1971
+ usage.raw > 0 ? jsx("span", { className: "dstv_cfgChip", children: [`${t("usage.fresh")} `, jsx("b", { children: fmtInt(usage.raw) }, "v")] }, "uFresh") : null,
1972
+ usage.cacheRead > 0 ? jsx("span", { className: "dstv_cfgChip", children: [`${t("usage.cacheRead")} `, jsx("b", { children: fmtInt(usage.cacheRead) }, "v")] }, "uCR") : null,
1973
+ usage.cacheWrite > 0 ? jsx("span", { className: "dstv_cfgChip", children: [`${t("usage.cacheWrite")} `, jsx("b", { children: fmtInt(usage.cacheWrite) }, "v")] }, "uCW") : null,
1974
+ usage.output > 0 ? jsx("span", { className: "dstv_cfgChip", children: [`${t("usage.out")} `, jsx("b", { children: fmtInt(usage.output) }, "v")] }, "uOut") : null,
1975
+ usage.think > 0 ? jsx("span", { className: "dstv_cfgChip", children: [`${t("usage.think")} `, jsx("b", { children: fmtInt(usage.think) }, "v")] }, "uThink") : null
1976
1976
  ] }, "uChips")
1977
1977
  ] }, "uSec") : null,
1978
1978
  // messages