dsh-trajectory-traceview-plus 0.10.0 → 0.11.0
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 +30 -0
- package/README.en.md +83 -16
- package/README.md +96 -17
- package/docs/DESIGN.md +1129 -43
- package/docs/PROVENANCE.md +10 -15
- package/package.json +5 -4
- package/scripts/browser-check.mjs +6 -1
- package/scripts/browser-harness.mjs +22 -6
- package/scripts/doc-heading-check.mjs +66 -0
- package/scripts/doc-ref-check.mjs +94 -0
- package/scripts/provenance.mjs +42 -5
- package/scripts/readme-numbers.mjs +157 -0
- package/scripts/release-status.mjs +92 -0
- package/scripts/version-check.mjs +105 -0
- /package/screenshot/{overview.jpg → overview.png} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,35 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.11.0 — 2026-11-24
|
|
4
|
+
|
|
5
|
+
`engines.dsh` 从硬钉单一版本改为**已验证版本的区间**,插件不再因为宿主小版本升级就被整体跳过。
|
|
6
|
+
|
|
7
|
+
### Changed
|
|
8
|
+
|
|
9
|
+
- `engines.dsh`: `=0.2.2-rc.2` → `>=0.2.2-rc.2 <0.2.3-0`。覆盖 0.2.2 线上的 rc.2/rc.3/rc.4/rc.5 与正式版;**不跨 minor**,0.2.3 起仍需重新验证并跟版。
|
|
10
|
+
- 版本号段规则补一条:区间内放宽属 **minor**,因为它是兼容策略变更,不是纯修复。
|
|
11
|
+
|
|
12
|
+
### Why
|
|
13
|
+
|
|
14
|
+
0.10.0 在 dsh 0.2.2-rc.5 上**整个页签消失**——`=0.2.2-rc.2` 精确匹配拒绝 rc.5,宿主直接跳过该 bundle。这是硬钉的代价,而硬钉原本是为了诚实(只声明实测过的版本)。
|
|
15
|
+
|
|
16
|
+
现在两者兼顾:区间**只覆盖实测过的线**,并且实测证据是逐包比对的,不是"启动没报错"——
|
|
17
|
+
|
|
18
|
+
- 本插件绑定的四个宿主包在 rc.2 与 rc.5 之间**逐字节相同**:`dsh-client-locale`、`dsh-api-session-controller`、`dsh-client-ui-conversation`、`dsh-client-ui-trajectory`(以及 `dsh-client-modules/lib/client.js`、`dsh-client-store`)。
|
|
19
|
+
- 唯一有差异的 `dsh-client-ui-primitives` 是纯增量(新增三个 `IconUploadOutline*` 导出),本插件没有 `require` 它。
|
|
20
|
+
- rc.3 的升级项是错误码 `MALFORMED_RESPONSE` → `CONTENT_REFUSED`:本插件不硬编码任何错误码,读的是 `node.code` / `failure.code` 并原样展示(`src/30-helpers.js`)。
|
|
21
|
+
- rc.4 的升级项是 web search 默认提供方,与本插件无关。
|
|
22
|
+
- **真机实跑**(rc.5,web profile,真实会话 216 个站点):视图渲染、minimap、详情面板、站点跳转、复制锚点、KPI、时钟时间全部正常,无渲染错误;`browser-check` 47 条断言全过;`npm run check` 7 步全过。
|
|
23
|
+
|
|
24
|
+
### Verified on
|
|
25
|
+
|
|
26
|
+
dsh 0.2.2-rc.5(本机全局安装)、Node v24.22.1、macOS。
|
|
27
|
+
|
|
28
|
+
### Notes
|
|
29
|
+
|
|
30
|
+
- 0.2.3 及以后仍会被跳过。这是有意的:新 minor 意味着新局面,需要重新验证。被跳过时宿主日志会说明原因;临时放行用 `dsh plugin allow-version`(精确版本豁免)。
|
|
31
|
+
- 已发布到 npm 的 0.10.0 仍带旧钉版声明,需要本版本才能在新宿主上加载。
|
|
32
|
+
|
|
3
33
|
## 0.10.0 — 2026-11-22
|
|
4
34
|
|
|
5
35
|
First npm release of **dsh-trajectory-traceview-plus**, derived from AFAP/dsh-trajectory-traceview v0.3.0 (MIT).
|
package/README.en.md
CHANGED
|
@@ -93,21 +93,37 @@ Each item is tagged **〔upstream〕** (present in upstream v0.3.0) or **〔Plus
|
|
|
93
93
|
|
|
94
94
|
| Trace View overview (timeline + minimap + bottom detail / raw-request panels) |
|
|
95
95
|
|:---:|
|
|
96
|
-
|  |
|
|
97
97
|
|
|
98
98
|
## 4. Directory layout
|
|
99
99
|
|
|
100
100
|
```
|
|
101
|
-
dsh-trajectory-traceview/ # repo root (npm package name
|
|
102
|
-
├── package.json
|
|
103
|
-
├──
|
|
104
|
-
├──
|
|
105
|
-
├──
|
|
101
|
+
dsh-trajectory-traceview-plus/ # repo root (directory name == npm package name)
|
|
102
|
+
├── package.json # dsh.bundle.patch + dsh.client (browser declaration) + exports["./client"]
|
|
103
|
+
├── package-lock.json # for CI's npm ci only (not in the published files list)
|
|
104
|
+
├── cordis.patch.yml # composition row: a single plugin record (no route, no config)
|
|
105
|
+
├── LICENSE # MIT
|
|
106
|
+
├── CHANGELOG.md # release record (version-check verifies the entry)
|
|
107
|
+
├── screenshot/ # screenshots for the README "Preview" section
|
|
108
|
+
├── .github/workflows/
|
|
109
|
+
│ └── check.yml # CI: the eight gates, in the same order as the local commands
|
|
110
|
+
├── src/ # browser source (lib/client.js is generated from it; never hand-edit)
|
|
111
|
+
├── scripts/
|
|
112
|
+
│ ├── build-client.mjs # src/ -> lib/client.js
|
|
113
|
+
│ ├── provenance.mjs # generates docs/PROVENANCE.md
|
|
114
|
+
│ ├── version-check.mjs # version / tag / CHANGELOG agreement
|
|
115
|
+
│ ├── doc-ref-check.mjs # DESIGN.md §x.y references resolve
|
|
116
|
+
│ ├── doc-heading-check.mjs # headings must be valid Markdown (space after #)
|
|
117
|
+
│ ├── readme-numbers.mjs # README numbers match the code (computed, not typed)
|
|
118
|
+
│ ├── release-status.mjs # are tag / GitHub Release / npm all on this version? (network; not in CI)
|
|
119
|
+
│ ├── browser-check.mjs # real-browser assertions (needs agent-browser)
|
|
120
|
+
│ └── browser-harness.mjs / bench-fold.mjs
|
|
121
|
+
├── docs/ # DESIGN.md (why each change) / PROVENANCE.md (generated)
|
|
106
122
|
├── test/
|
|
107
|
-
│ └── smoke.test.cjs
|
|
123
|
+
│ └── smoke.test.cjs # helper unit tests (plain node)
|
|
108
124
|
└── lib/
|
|
109
|
-
├── index.js
|
|
110
|
-
└── client.js
|
|
125
|
+
├── index.js # host half: no-op stub (browser-only plugin)
|
|
126
|
+
└── client.js # browser bundle: the trace view (generated)
|
|
111
127
|
```
|
|
112
128
|
|
|
113
129
|
## 5. Quick start
|
|
@@ -137,7 +153,7 @@ dsh plugin --profile web remove dsh-trajectory-traceview-plus
|
|
|
137
153
|
### Manual install from a source directory (for equivalent verification)
|
|
138
154
|
|
|
139
155
|
```powershell
|
|
140
|
-
dsh plugin --profile web add "G:\path\to\dsh-trajectory-traceview"
|
|
156
|
+
dsh plugin --profile web add "G:\path\to\dsh-trajectory-traceview-plus"
|
|
141
157
|
```
|
|
142
158
|
|
|
143
159
|
### Verify it loaded
|
|
@@ -207,11 +223,24 @@ node scripts/provenance.mjs
|
|
|
207
223
|
Editing `src/` without rebuilding makes `--check` fail and the smoke suite report `BUILD1`. `lib/index.js` (host half) is a no-op stub; `lib/client.js` is a classic script (`window.__ModuleLoader__.load`) served directly by the client module system.
|
|
208
224
|
|
|
209
225
|
```powershell
|
|
210
|
-
|
|
226
|
+
npm run check # 7 steps: build --check / provenance --check / version-check
|
|
227
|
+
# doc-ref-check / doc-heading-check / smoke / readme-numbers
|
|
228
|
+
npm test # smoke only
|
|
211
229
|
```
|
|
212
230
|
|
|
213
231
|
The tests run the helper region against mock snapshots covering: tree building / request attachment / compaction-request pairing / sub-call detail / prompt diff / step timing / search matching / Markdown export / token stats.
|
|
214
232
|
|
|
233
|
+
**What needs a real browser** (`react-dom/server` cannot see scroll, focus, clipboard, intervals or layout):
|
|
234
|
+
|
|
235
|
+
```powershell
|
|
236
|
+
node scripts/browser-check.mjs # builds the harness; 47 assertions over 13 recorded groups
|
|
237
|
+
node scripts/browser-check.mjs --shots # also captures a 375px screenshot
|
|
238
|
+
```
|
|
239
|
+
|
|
240
|
+
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.
|
|
241
|
+
|
|
242
|
+
Other scripts: `scripts/bench-fold.mjs` times the pure fold that the streaming path repeats; `scripts/browser-harness.mjs` builds the standalone harness page (`test/browser/harness.html`) normally invoked by `browser-check`.
|
|
243
|
+
|
|
215
244
|
## 12. Compatibility and data contract
|
|
216
245
|
|
|
217
246
|
This plugin reads the official trajectory snapshot (`eventNodes` / `requests` / `callSchemas` / `partial` / `runningCalls`). Because that snapshot comes from another plugin and the contract is not ours, there are two explicit promises:
|
|
@@ -220,9 +249,19 @@ This plugin reads the official trajectory snapshot (`eventNodes` / `requests` /
|
|
|
220
249
|
- **Version drift is stated loudly**: if a DSH upgrade renames fields or node kinds, the header shows `⚠ N record(s) not recognized [kinds]`; if *nothing* is recognizable you get "Cannot recognize this session's trajectory data" with reason codes — **never a silent "no data yet" or a plausible-looking partial trace**.
|
|
221
250
|
- **The host is never accused wrongly**: `kind: "unknown"` is a *named* node kind in the contract (the host saying "I do not model this event"), so it renders as a first-class station carrying the event type and its raw payload, and it is **not** counted as drift. Only genuinely unseen kinds raise the alarm — one exotic event must not make the whole tree claim the format is unrecognized.
|
|
222
251
|
|
|
223
|
-
`engines.dsh` is
|
|
252
|
+
`engines.dsh` is `>=0.2.2-rc.2 <0.2.3-0` — it covers **only the 0.2.2 line that was actually tested**, and stops at the minor boundary. Earlier hard-pin conclusions (`=0.2.1-rc.5`, `=0.2.2-rc.2`) are kept in `docs/DESIGN.md` §12.25–§12.27 and §13.43.
|
|
253
|
+
|
|
254
|
+
**DSH *skips* an unmatched plugin** at boot (`skipping profile bundle … requirements {"engines.dsh":…}`) instead of degrading it, so getting the requirement wrong makes the whole tab vanish.
|
|
255
|
+
|
|
256
|
+
**Why a range instead of a hard pin**: the hard pin's cost came due on 0.2.2-rc.5 — the host moved one patch version and the tab vanished, though nothing in the plugin was broken. A range means patch releases inside the same minor no longer require a matching plugin release.
|
|
257
|
+
|
|
258
|
+
**Why the range stops at the minor boundary**: the ceiling is `<0.2.3-0`, not `<0.3.0`. Declaring compatibility is declaring *tested*; 0.2.3 has not been tested, so it is not claimed. On a new minor the plugin is skipped again, which is the signal to re-verify and cut a release — **being skipped is a clear signal, and far better than silently degrading**. To unblock temporarily, use the host's exact-version exemption:
|
|
259
|
+
|
|
260
|
+
```bash
|
|
261
|
+
dsh plugin allow-version # interactive; see dsh plugin --help
|
|
262
|
+
```
|
|
224
263
|
|
|
225
|
-
|
|
264
|
+
The host prints the exact command in the skip warning.
|
|
226
265
|
|
|
227
266
|
## 13. License
|
|
228
267
|
|
|
@@ -241,11 +280,39 @@ Substantive changes versus upstream: stable anchors and deep-link parsing, orpha
|
|
|
241
280
|
|
|
242
281
|
| Change | Position | Example |
|
|
243
282
|
| --- | --- | --- |
|
|
244
|
-
| `engines.dsh`
|
|
283
|
+
| `engines.dsh` moves (re-pin or widen to a range) | **minor** | `0.7.0 → 0.8.0` for DSH 0.2.2; `0.10.0 → 0.11.0` for the range |
|
|
245
284
|
| New capability, or changed behaviour | **minor** | `0.8.2 → 0.9.0` light theme + a11y |
|
|
246
285
|
| Fixes, performance, copy, docs | **patch** | `0.8.1 → 0.8.2` |
|
|
247
286
|
| Breaking (anchor format, view id, config) | **major** | none yet |
|
|
248
287
|
|
|
249
|
-
`engines.dsh`
|
|
288
|
+
`engines.dsh` covers only the current minor, so a host minor bump still requires a matching plugin release. That is one reason the number moves fastest — it is not feature bloat.
|
|
289
|
+
|
|
290
|
+
**Release steps** — every one of them, in order (skipping `npm publish` is what §13.47 records):
|
|
291
|
+
|
|
292
|
+
```bash
|
|
293
|
+
# 1-3 edit files: package.json version, CHANGELOG.md entry
|
|
294
|
+
node scripts/provenance.mjs # 4. refresh the provenance list (rerun after any add/rename)
|
|
295
|
+
npm run check # 5. the 7 local gates; all green before going further
|
|
296
|
+
git add -A; git commit -m "..." # 6.
|
|
297
|
+
git push origin main # 7.
|
|
298
|
+
git tag -a v0.11.0 -m "..." # 8.
|
|
299
|
+
git push origin v0.11.0 # 9.
|
|
300
|
+
npm publish # 10. runs prepublishOnly -> the whole check again
|
|
301
|
+
gh release create v0.11.0 --notes-file … # 11. the badge reads the Release, not the tag
|
|
302
|
+
|
|
303
|
+
node scripts/release-status.mjs # 12. do all three agree? (tag / Release / npm)
|
|
304
|
+
```
|
|
305
|
+
|
|
306
|
+
**Step 10 is the easiest to miss and it fails silently.** After `git push` and `git tag` the repo looks "released" — but the registry still serves the old version, so `npm i <name>@latest` hands people the old package. That happened here once: tag and Release both present, npm still on the previous release (§13.47).
|
|
307
|
+
|
|
308
|
+
**Step 11 is not ceremony**: the version badge at the top of the page reads the GitHub **Release**, not the tag. Tagging without creating a Release makes the badge show a red `no releases`, which reads as an abandoned repo (§13.45).
|
|
309
|
+
|
|
310
|
+
Three things guard the release, and all live in CI (`.github/workflows/check.yml`) so they run on every push to `main` and every pull request:
|
|
311
|
+
|
|
312
|
+
- stale `docs/PROVENANCE.md` — the smoke suite fails (`V1`)
|
|
313
|
+
- version / tag disagreement — `node scripts/version-check.mjs` fails (`F1`)
|
|
314
|
+
- a missing `CHANGELOG.md` entry for the version (`F2`), or a version that goes backwards relative to an existing tag (`F3`)
|
|
315
|
+
|
|
316
|
+
CI runs those 8 gates plus an install step (`npm ci --include=dev`): `build-client --check`, `node --check lib/client.js`, `provenance --check`, `version-check`, `doc-ref-check`, `doc-heading-check`, smoke, readme-numbers. `npm run check` runs 7 of them locally (build, provenance, version-check, doc-ref-check, doc-heading-check, smoke, readme-numbers) — everything but `node --check lib/client.js`; run `browser-check` too before releasing — see §11.
|
|
250
317
|
|
|
251
|
-
**
|
|
318
|
+
**Those numbers have a gate of their own**: `readme-numbers` derives the true values from `check.yml`, `package.json` and `test/browser/probe.js`, then checks both READMEs against them. A number written down twice will eventually disagree with itself (§13.37).
|
package/README.md
CHANGED
|
@@ -96,21 +96,37 @@
|
|
|
96
96
|
|
|
97
97
|
| 轨迹视图总览(时间轴 + minimap + 底部详情 / 原始请求面板) |
|
|
98
98
|
|:---:|
|
|
99
|
-
|  |
|
|
100
100
|
|
|
101
101
|
## 4. 目录结构
|
|
102
102
|
|
|
103
103
|
```
|
|
104
|
-
dsh-trajectory-traceview/ #
|
|
105
|
-
├── package.json
|
|
106
|
-
├──
|
|
107
|
-
├──
|
|
108
|
-
├──
|
|
104
|
+
dsh-trajectory-traceview-plus/ # 仓库根(目录名 = npm 包名)
|
|
105
|
+
├── package.json # dsh.bundle.patch + dsh.client(浏览器端声明)+ exports["./client"]
|
|
106
|
+
├── package-lock.json # 仅用于 CI 的 npm ci(发布包的 files 白名单不包含它)
|
|
107
|
+
├── cordis.patch.yml # 组合行:仅插入一行插件记录(无路由、无配置)
|
|
108
|
+
├── LICENSE # MIT
|
|
109
|
+
├── CHANGELOG.md # 发布记录(version-check 会核对版本条目)
|
|
110
|
+
├── screenshot/ # 效果截图(README「效果预览」用)
|
|
111
|
+
├── .github/workflows/
|
|
112
|
+
│ └── check.yml # CI:8 项门禁(本地命令的同序复现)
|
|
113
|
+
├── src/ # 浏览器端源码(lib/client.js 由它生成,不要手改产物)
|
|
114
|
+
├── scripts/
|
|
115
|
+
│ ├── build-client.mjs # src/ -> lib/client.js
|
|
116
|
+
│ ├── provenance.mjs # 生成 docs/PROVENANCE.md
|
|
117
|
+
│ ├── version-check.mjs # 版本 / tag / CHANGELOG 一致性
|
|
118
|
+
│ ├── doc-ref-check.mjs # docs/DESIGN.md 的 §x.y 引用不断链
|
|
119
|
+
│ ├── doc-heading-check.mjs # 标题必须是合法 Markdown(# 后要有空格)
|
|
120
|
+
│ ├── readme-numbers.mjs # README 里的数字与代码一致(数出来,不手写)
|
|
121
|
+
│ ├── release-status.mjs # 查 tag / GitHub Release / npm 三处是否都有这一版(需联网,不进 CI)
|
|
122
|
+
│ ├── browser-check.mjs # 真浏览器断言(需 agent-browser)
|
|
123
|
+
│ └── browser-harness.mjs / bench-fold.mjs
|
|
124
|
+
├── docs/ # DESIGN.md(每处改动的原因)/ PROVENANCE.md(自动生成)
|
|
109
125
|
├── test/
|
|
110
|
-
│ └── smoke.test.cjs
|
|
126
|
+
│ └── smoke.test.cjs # 纯 helpers 单测(node 直接跑)
|
|
111
127
|
└── lib/
|
|
112
|
-
├── index.js
|
|
113
|
-
└── client.js
|
|
128
|
+
├── index.js # 宿主半部:无操作桩(纯浏览器端插件)
|
|
129
|
+
└── client.js # 浏览器 bundle:轨迹视图(生成物)
|
|
114
130
|
```
|
|
115
131
|
|
|
116
132
|
## 5. 快速开始
|
|
@@ -140,7 +156,7 @@ dsh plugin --profile web remove dsh-trajectory-traceview-plus
|
|
|
140
156
|
### 从源码目录手动安装(等价验证用)
|
|
141
157
|
|
|
142
158
|
```powershell
|
|
143
|
-
dsh plugin --profile web add "G:\path\to\dsh-trajectory-traceview"
|
|
159
|
+
dsh plugin --profile web add "G:\path\to\dsh-trajectory-traceview-plus"
|
|
144
160
|
```
|
|
145
161
|
|
|
146
162
|
### 验证是否加载成功
|
|
@@ -210,11 +226,28 @@ node scripts/provenance.mjs
|
|
|
210
226
|
改了 `src/`却忘了重建时,`--check`会失败,`test/smoke.test.cjs`也会报 `BUILD1`。`lib/index.js`(宿主半部)是无操作桩;`lib/client.js`是经典脚本(`window.__ModuleLoader__.load`),由客户端模块系统直接服务。
|
|
211
227
|
|
|
212
228
|
```powershell
|
|
213
|
-
|
|
229
|
+
npm run check # 7 步:build --check / provenance --check / version-check
|
|
230
|
+
# doc-ref-check / doc-heading-check / smoke / readme-numbers
|
|
231
|
+
npm test # 只跑 smoke
|
|
214
232
|
```
|
|
215
233
|
|
|
216
234
|
自测用 mock 快照覆盖:树构建 / 请求附加 / 压缩请求配对 / 子调用详情 / prompt diff / 步骤计时 / 搜索匹配 / Markdown 导出 / token 统计。
|
|
217
235
|
|
|
236
|
+
**需要真实浏览器的部分**(`react-dom/server` 测不到滚动、焦点、剪贴板、定时器、响应式):
|
|
237
|
+
|
|
238
|
+
```powershell
|
|
239
|
+
node scripts/browser-check.mjs # 起 harness,跑 47 条断言 / 记录 13 组观测
|
|
240
|
+
node scripts/browser-check.mjs --shots # 另外存 375px 截图
|
|
241
|
+
```
|
|
242
|
+
|
|
243
|
+
它需要 `agent-browser`(Chrome via CDP)。**故意不进 CI**:把浏览器塞进 runner 的
|
|
244
|
+
活动部件比这项检查本身更值得担心,而一个 flaky 的浏览器任务会训练人忽略红灯。
|
|
245
|
+
发布前在本地跑。
|
|
246
|
+
|
|
247
|
+
其它脚本:`scripts/bench-fold.mjs` 量纯 fold 的耗时(流式路径的性能基线),
|
|
248
|
+
`scripts/browser-harness.mjs` 生成上面那个独立 harness 页面
|
|
249
|
+
(`test/browser/harness.html`),一般由 `browser-check` 自动调用。
|
|
250
|
+
|
|
218
251
|
## 12. 兼容性与数据契约
|
|
219
252
|
|
|
220
253
|
本插件读取 DSH 官方的轨迹快照(`eventNodes` / `requests` / `callSchemas` / `partial` / `runningCalls`)。因为快照来自另一个插件、契约不由本插件所有,所以有两条明确承诺:
|
|
@@ -223,9 +256,19 @@ node test/smoke.test.cjs
|
|
|
223
256
|
- **版本不兼容会大声说**:如果 DSH 升级后字段名或节点类型变了,头部显示 `⚠ N 条记录无法识别 [类型名]`;若**一条都认不出**,显示「无法识别当前会话的轨迹数据格式」并列出原因码——**不会伪装成"暂无数据"或一份看起来正常的残缺轨迹**。
|
|
224
257
|
- **不冤枉宿主**:`kind: "unknown"` 是契约里**有名字**的节点类型(宿主明确表示"这条事件我不建模"),所以它被当成一等站点画出来,标出事件类型与原始数据,**不计入"版本不兼容"**。只有真正没见过的节点类型才报警。这条区别很重要:一个陌生事件不该让整棵树改口说"格式不认识"。
|
|
225
258
|
|
|
226
|
-
`engines.dsh`
|
|
259
|
+
`engines.dsh` 是 `>=0.2.2-rc.2 <0.2.3-0`——**只覆盖 0.2.2 这一条实测过的线**,不跨 minor。旧钉版 `=0.2.1-rc.5`、`=0.2.2-rc.2` 的历史结论保留在 `docs/DESIGN.md` §12.25–§12.27、§13.43。
|
|
260
|
+
|
|
261
|
+
**DSH 会直接跳过不匹配的插件**(日志里是 `skipping profile bundle … requirements {"engines.dsh":…}`),不是降级运行。所以钉错版本的后果是「整个页签消失」——这比"看起来能用但内部错乱"更容易发现,也更容易解释。
|
|
227
262
|
|
|
228
|
-
|
|
263
|
+
**为什么是区间而不是硬钉**:硬钉 `=0.2.2-rc.2` 的代价在 0.2.2-rc.5 上兑现了——宿主打个小版本,页签就整体消失,而插件其实没坏。改成区间后,同一 minor 内的补丁版本不再需要跟随发版。
|
|
264
|
+
|
|
265
|
+
**为什么又不跨 minor**:区间上限是 `<0.2.3-0` 而不是 `<0.3.0`。声明兼容 = 声明测过;我没测过 0.2.3,就不替它担保。升到新 minor 时插件会再次被跳过,这时需要重新验证并跟一个版本——**被跳过本身就是一个明确的信号,比"静默降级运行"好得多**。临时放行可以用宿主提供的精确版本豁免:
|
|
266
|
+
|
|
267
|
+
```bash
|
|
268
|
+
dsh plugin allow-version # 交互式选择,或见 dsh plugin --help
|
|
269
|
+
```
|
|
270
|
+
|
|
271
|
+
被跳过时宿主日志会把确切命令打出来。
|
|
229
272
|
|
|
230
273
|
## 13. License
|
|
231
274
|
|
|
@@ -244,16 +287,52 @@ MIT。原版 © [AFAP](https://github.com/AFAP/dsh-trajectory-traceview);本
|
|
|
244
287
|
|
|
245
288
|
| 变化 | 版本位 | 例子 |
|
|
246
289
|
| --- | --- | --- |
|
|
247
|
-
| `engines.dsh`
|
|
290
|
+
| `engines.dsh` 变动(换钉 / 放宽区间) | **minor** | `0.7.0 → 0.8.0` 适配 DSH 0.2.2;`0.10.0 → 0.11.0` 改区间 |
|
|
248
291
|
| 新增能力、或改变已有行为 | **minor** | `0.8.2 → 0.9.0` 浅色主题与无障碍 |
|
|
249
292
|
| 修复、性能、文案、文档 | **patch** | `0.8.1 → 0.8.2` |
|
|
250
293
|
| 破坏性变更(锚点格式、视图 id、配置项) | **major** | 尚未发生 |
|
|
251
294
|
|
|
252
|
-
`0.x` 阶段:`engines.dsh`
|
|
295
|
+
`0.x` 阶段:`engines.dsh` 区间只覆盖当前 minor,跨 minor 仍需跟版——这仍是版本号跳得快的原因之一,不是功能膨胀。
|
|
296
|
+
|
|
297
|
+
**发布动作**是一套命令,一步都不能跳(§13.47 记了漏掉 `npm publish` 的后果):
|
|
298
|
+
|
|
299
|
+
```powershell
|
|
300
|
+
# 1-3 改内容
|
|
301
|
+
# 改 package.json 的 version、补 CHANGELOG.md 的版本条目
|
|
302
|
+
node scripts/provenance.mjs # 4. 刷新来源清单(新增/改名文件后必须重跑)
|
|
303
|
+
npm run check # 5. 7 步门禁,全绿再往下
|
|
304
|
+
git add -A; git commit -m "..." # 6.
|
|
305
|
+
git push origin main # 7.
|
|
306
|
+
git tag -a v0.11.0 -m "..." # 8.
|
|
307
|
+
git push origin v0.11.0 # 9.
|
|
308
|
+
npm publish # 10. 触发 prepublishOnly → 再跑一遍 check
|
|
309
|
+
gh release create v0.11.0 --notes-file … # 11. 徽章读的是 Release,不是 tag
|
|
310
|
+
|
|
311
|
+
node scripts/release-status.mjs # 12. 三处对齐了吗?(tag / Release / npm)
|
|
312
|
+
```
|
|
313
|
+
|
|
314
|
+
**第 10 步最容易漏,而且不会有任何报错**:`git push` + `git tag` 之后仓库看起来"发布完了",但 registry 上还是旧版本。任何人 `npm i <包名>@latest` 拿到的都是旧包。这个仓就发生过一次——tag 和 Release 都在,npm 还停在上一版(§13.47)。
|
|
315
|
+
|
|
316
|
+
**第 11 步不是仪式**:页面顶部的版本徽章读的是 GitHub **Release**,不是 tag。只打 tag 不建 Release 时徽章会显示红色的 `no releases`——看起来像这个仓已经废弃(§13.45)。
|
|
253
317
|
|
|
254
|
-
|
|
318
|
+
版本一致性有测试守着:
|
|
255
319
|
|
|
256
320
|
- `docs/PROVENANCE.md` 过期 → 冒烟测试直接失败(`V1`)
|
|
257
|
-
- 版本号与 tag 不一致 →
|
|
321
|
+
- 版本号与 tag 不一致 → `node scripts/version-check.mjs` 直接失败(`F1`)
|
|
322
|
+
- `CHANGELOG.md` 缺该版本条目 → 同上(`F2`)
|
|
323
|
+
- 版本号相对已有 tag 倒退 → 同上(`F3`)
|
|
324
|
+
|
|
325
|
+
这些检查都在 CI 里跑(`.github/workflows/check.yml`),push 到 main 和提 PR 时自动执行。
|
|
326
|
+
门禁本身是 8 项:`build-client --check`、`node --check lib/client.js`、`provenance --check`、
|
|
327
|
+
`version-check`、`doc-ref-check`、`doc-heading-check`、smoke、readme-numbers
|
|
328
|
+
(前面还有一步 `npm ci --include=dev` 装依赖)。
|
|
329
|
+
|
|
330
|
+
本地 `npm run check` 跑其中 7 步(`build-client --check`、`provenance --check`、`version-check`、
|
|
331
|
+
`doc-ref-check`、`doc-heading-check`、smoke、readme-numbers)——只差 CI 里的
|
|
332
|
+
`node --check lib/client.js`,够用于日常提交;发布前再按 §11 把 `browser-check` 也跑一遍。
|
|
333
|
+
|
|
334
|
+
**这些数字本身也有门禁**:`readme-numbers` 直接从 `check.yml`、`package.json` 和
|
|
335
|
+
`test/browser/probe.js` 数出真值,再回头核对两份 README——同一个数字在文档里写过
|
|
336
|
+
一遍就够,写两遍就一定会有一处过期(§13.37)。
|
|
258
337
|
|
|
259
338
|
**来源可查**:`git diff v0.3.0 -- lib/client.js` 看原始差异,`docs/PROVENANCE.md` 看改动落在哪些函数,`docs/DESIGN.md` 看每处改动的原因。
|