dsh-trajectory-traceview-plus 0.11.1 → 0.11.2

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,32 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.11.2 — 2026-11-24
4
+
5
+ `release-status` 增加第 4 个外部环节的检查:**tarball 是否真的可下载**。
6
+
7
+ ### Why
8
+
9
+ 0.11.1 发布后,packument 的 `versions`、`dist-tags.latest`、`time`、`dist.shasum` 全部正确,
10
+ 但 `…-0.11.1.tgz` 返回 **HTTP 404** 约两分钟——`dsh plugin add pkg@0.11.1` 直接失败。
11
+
12
+ `npm view` 只读元数据、从不下载 tarball,所以对这个窗口完全失明;而这个窗口正是
13
+ 真实安装器会命中的那个。带个 cache-buster 立刻 200,说明是 CDN 把 404 缓存住了。
14
+
15
+ ### Added
16
+
17
+ - `release-status.mjs` 的 npm 行拆成两个事实:元数据存在 + tarball 可下载。失败时区分
18
+ 「没发布」与「发布了但字节还没到位」——后者是安全失败(装不上,而不是装错版本)。
19
+ - 故意**不加 cache-buster**:加了会绕开正是过期的那个缓存,从而隐藏真实安装器会踩的坑。
20
+
21
+ ### Changed
22
+
23
+ - 发布清单第 12 步从「三处对齐」改为「四处对齐(tag / Release / npm 元数据 / tarball)」。
24
+
25
+ ### Notes
26
+
27
+ 0.11.0 / 0.11.1 / 0.11.2 三者**运行时代码完全相同**(`lib/` 逐字节一致)。这三次发版
28
+ 修的都只是「用户能不能正确装上」这件事。
29
+
3
30
  ## 0.11.1 — 2026-11-24
4
31
 
5
32
  修正 **0.11.0 已发布包内文档的错误**:那份 README 会让读者装错东西。
package/README.en.md CHANGED
@@ -131,7 +131,7 @@ dsh-trajectory-traceview-plus/ # repo root (directory name == npm package name
131
131
  Install from npm (recommended — **pin the exact version**):
132
132
 
133
133
  ```powershell
134
- dsh plugin --profile web add dsh-trajectory-traceview-plus@0.11.1
134
+ dsh plugin --profile web add dsh-trajectory-traceview-plus@0.11.2
135
135
  ```
136
136
 
137
137
  > **Why not `@latest`**: `dsh plugin` forwards to pnpm, and **pnpm 12 ships a supply-chain delay** (`minimumReleaseAge`): a version that is too new 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).
@@ -141,10 +141,10 @@ dsh plugin --profile web add dsh-trajectory-traceview-plus@0.11.1
141
141
  Install from GitHub (**always pin the tag**):
142
142
 
143
143
  ```powershell
144
- dsh plugin --profile web add "github:MisonL/dsh-trajectory-traceview-plus#v0.11.1"
144
+ dsh plugin --profile web add "github:MisonL/dsh-trajectory-traceview-plus#v0.11.2"
145
145
  ```
146
146
 
147
- > **Why the `#v0.11.1` 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.
147
+ > **Why the `#v0.11.2` 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.
148
148
 
149
149
  Then **restart `dsh web`** to take effect.
150
150
 
@@ -307,12 +307,12 @@ node scripts/provenance.mjs # 4. refresh the provenance list (rerun
307
307
  npm run check # 5. the 7 local gates; all green before going further
308
308
  git add -A; git commit -m "..." # 6.
309
309
  git push origin main # 7.
310
- git tag -a v0.11.1 -m "..." # 8.
311
- git push origin v0.11.1 # 9.
310
+ git tag -a v0.11.2 -m "..." # 8.
311
+ git push origin v0.11.2 # 9.
312
312
  npm publish # 10. runs prepublishOnly -> the whole check again
313
- gh release create v0.11.1 --notes-file … # 11. the badge reads the Release, not the tag
313
+ gh release create v0.11.2 --notes-file … # 11. the badge reads the Release, not the tag
314
314
 
315
- node scripts/release-status.mjs # 12. do all three agree? (tag / Release / npm)
315
+ node scripts/release-status.mjs # 12. do all four agree? (tag / Release / npm metadata / tarball)
316
316
  ```
317
317
 
318
318
  **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).
package/README.md CHANGED
@@ -134,7 +134,7 @@ dsh-trajectory-traceview-plus/ # 仓库根(目录名 = npm 包名)
134
134
  从 npm 安装(推荐,**写死版本号**):
135
135
 
136
136
  ```powershell
137
- dsh plugin --profile web add dsh-trajectory-traceview-plus@0.11.1
137
+ dsh plugin --profile web add dsh-trajectory-traceview-plus@0.11.2
138
138
  ```
139
139
 
140
140
  > **为什么不用 `@latest`**:`dsh plugin` 底层是 pnpm,而 **pnpm 12 有供应链延迟保护**
@@ -149,10 +149,10 @@ dsh plugin --profile web add dsh-trajectory-traceview-plus@0.11.1
149
149
  从 GitHub 安装(**必须带 tag**):
150
150
 
151
151
  ```powershell
152
- dsh plugin --profile web add "github:MisonL/dsh-trajectory-traceview-plus#v0.11.1"
152
+ dsh plugin --profile web add "github:MisonL/dsh-trajectory-traceview-plus#v0.11.2"
153
153
  ```
154
154
 
155
- > **为什么必须带 `#v0.11.1`**:`github:` 规格不带 ref 时装的是**默认分支的 HEAD**,
155
+ > **为什么必须带 `#v0.11.2`**:`github:` 规格不带 ref 时装的是**默认分支的 HEAD**,
156
156
  > 不是任何发布版本。而这个仓库在发版后还会继续提交(本轮 v0.11.0 之后就有 5 个
157
157
  > 文档/脚本提交),所以"不带 ref"装到的东西**明天可能是另一个样子**,而版本号
158
158
  > 仍写着 0.11.0。带 tag 才能让"装到的"和"发布过的"是同一份代码。
@@ -323,12 +323,12 @@ node scripts/provenance.mjs # 4. 刷新来源清单(新增/改名
323
323
  npm run check # 5. 7 步门禁,全绿再往下
324
324
  git add -A; git commit -m "..." # 6.
325
325
  git push origin main # 7.
326
- git tag -a v0.11.1 -m "..." # 8.
327
- git push origin v0.11.1 # 9.
326
+ git tag -a v0.11.2 -m "..." # 8.
327
+ git push origin v0.11.2 # 9.
328
328
  npm publish # 10. 触发 prepublishOnly → 再跑一遍 check
329
- gh release create v0.11.1 --notes-file … # 11. 徽章读的是 Release,不是 tag
329
+ gh release create v0.11.2 --notes-file … # 11. 徽章读的是 Release,不是 tag
330
330
 
331
- node scripts/release-status.mjs # 12. 三处对齐了吗?(tag / Release / npm)
331
+ node scripts/release-status.mjs # 12. 四处对齐了吗?(tag / Release / npm 元数据 / tarball)
332
332
  ```
333
333
 
334
334
  **第 10 步最容易漏,而且不会有任何报错**:`git push` + `git tag` 之后仓库看起来"发布完了",但 registry 上还是旧版本。任何人 `npm i <包名>@latest` 拿到的都是旧包。这个仓就发生过一次——tag 和 Release 都在,npm 还停在上一版(§13.47)。
package/docs/DESIGN.md CHANGED
@@ -8054,3 +8054,89 @@ const isClaimed = (idx) => claimedSpans.some(([s, e]) => idx >= s && idx < e);
8054
8054
  3. 门禁报错时优先怀疑门禁。这已经是第三次(§13.37、§13.44、本节),而且三次都是
8055
8055
  同一个形状:**具体写法被通用规则误伤**。这次终于把「规则优先级」变成了显式机制,
8056
8056
  而不是每次都去改正则躲。
8057
+
8058
+
8059
+ ### 13.51 元数据已发布,tarball 却 404(2026-11-24)
8060
+
8061
+ #### 现象
8062
+
8063
+ `npm publish` 0.11.1 成功,`time` 字段写入,`versions` 里有 0.11.1,
8064
+ `dist-tags.latest` 指向 0.11.1。然后按自己 README 里那条命令装:
8065
+
8066
+ ```
8067
+ dsh plugin --profile web add dsh-trajectory-traceview-plus@0.11.1
8068
+ × adding a new package
8069
+ ╰─▶ Tarball server returned HTTP 404 for
8070
+ https://registry.npmjs.org/dsh-trajectory-traceview-plus/-/dsh-trajectory-traceview-plus-0.11.1.tgz
8071
+ ```
8072
+
8073
+ **所有元数据检查都通过,实际安装失败。**
8074
+
8075
+ #### 这是「发布」的第 4 个外部环节
8076
+
8077
+ §13.47 记了 `npm publish` 是叶子步骤(漏了没报错);
8078
+ §13.48 记了 registry 写入后 CDN 有延迟(`versions` 会滞后);
8079
+ §13.49 记了包管理器可能出于安全策略不选新版本(`@latest` 静默退回)。
8080
+
8081
+ 这次是**第 4 个**:metadata 与 tarball 是两条独立的分发路径。
8082
+
8083
+ | 检查方式 | 0.11.1 发布后 2 分钟内 |
8084
+ |---|---|
8085
+ | `npm view <pkg>@0.11.1 version` | ✓ `0.11.1` |
8086
+ | packument `versions` / `dist-tags` | ✓ 都对 |
8087
+ | packument `time["0.11.1"]` | ✓ 已写入 |
8088
+ | `dist.shasum` / `integrity` / `fileCount` | ✓ 都在 |
8089
+ | **`HEAD <dist.tarball>`** | **✗ HTTP 404** |
8090
+ | **`dsh plugin add <pkg>@0.11.1`** | **✗ 失败** |
8091
+
8092
+ 而且 404 不是权限问题——加个 cache-buster 立刻 200:
8093
+
8094
+ ```
8095
+ HEAD ...-0.11.1.tgz → 404
8096
+ HEAD ...-0.11.1.tgz?x=12345 → 200
8097
+ ```
8098
+
8099
+ **是 CDN 把一个 404 缓存住了。** 也就是说:真实安装器命中的那个 URL 上有负缓存,
8100
+ 而换一个 URL(带参数)就能拿到正确的字节(shasum 与 registry 声明一致)。
8101
+
8102
+ #### 为什么这个特别难想到
8103
+
8104
+ `npm view` 是这个生态里"检查是否发布成功"的标准姿势,我刚在 §13.48 里还教了
8105
+ 用 `time` 字段确认。但 `npm view` **只读元数据,从不下载 tarball**——它对这个
8106
+ 窗口完全失明。
8107
+
8108
+ **正确的判据是 HEAD 一次 `dist.tarball`**,而这一点只有真的去装一次才会暴露。
8109
+ 这已经是这一轮第三次「只有真的装一次才知道」了(§13.47 npm 没发、§13.49
8110
+ `@latest` 静默降级、本节 tarball 404)。
8111
+
8112
+ #### 修法
8113
+
8114
+ `release-status.mjs` 的 npm 行拆成两个事实:
8115
+
8116
+ ```js
8117
+ const published = npmView.ok && npmView.out.includes(version);
8118
+ // HEAD the tarball URL, NO cache-buster: a cache-buster would defeat the very cache
8119
+ // that is stale, hiding exactly the window a real installer falls into.
8120
+ const code = run('curl', ['-s', '-o', '/dev/null', '-w', '%{http_code}', '-I', url]).out;
8121
+ ```
8122
+
8123
+ 输出变成 `published (dist-tags.latest = 0.11.1), tarball downloads`。失败时
8124
+ **区分两种原因**,因为用户看到的都是"装不上":
8125
+
8126
+ - 元数据不在 → 「tagged but NOT on npm」
8127
+ - 元数据在、tarball 404 → 「in the packument but its tarball is not downloadable yet
8128
+ — `dsh plugin add` will fail with HTTP rather than install something wrong. Wait
8129
+ for the CDN」
8130
+
8131
+ 第二条里那句「rather than install something wrong」是有意的:**这个失败模式是安全
8132
+ 的**——装不上,而不是装错。负缓存比"装到错误版本"好得多。
8133
+
8134
+ #### 教训
8135
+
8136
+ 1. **"已发布"至少是四件事**:git tag、GitHub Release、registry 元数据、
8137
+ **tarball 可下载**。前三个各有一个读者(git / 徽章 / `npm view`),第四个
8138
+ 只有一个读者:真正要装包的人。
8139
+ 2. 标准姿势失明。`npm view` 被当作发布成功的判据用了很多年,但它不下载字节。
8140
+ **凡是"检查"和"使用"走不同路径的,检查就可能看不见使用时的失败。**
8141
+ 3. 负缓存 ≠ 数据缺失,但表现一样。区分它们需要绕过缓存(换 URL 参数),而不是
8142
+ 重试。**重试同一个被缓存的 URL 永远不会好。**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-trajectory-traceview-plus",
3
- "version": "0.11.1",
3
+ "version": "0.11.2",
4
4
  "description": "轨迹视图增强版(Plus):在「轨迹」标签旁新增可回放的横向时间轴——minimap、窗口内检索(显式标注覆盖边界)、回放、轮次跳转、跟随模式、历史分页、步骤/子调用耗时与吞吐、时钟轴切换、稳定锚点复制与深链、孤立工具结果站点、提示词变更对比、原始请求分析与 Markdown 导出。基于 AFAP/dsh-trajectory-traceview (MIT) 改造。",
5
5
  "type": "module",
6
6
  "main": "lib/index.js",
@@ -102,15 +102,34 @@ rows.push({
102
102
  });
103
103
 
104
104
  // 4. npm registry — what `npm i <name>@latest` installs.
105
+ //
106
+ // Two separate facts, because they failed separately: the VERSION being present in
107
+ // the packument (metadata) and the TARBALL being downloadable (bytes). Right after
108
+ // 0.11.1's publish, `versions` and `dist-tags.latest` both said 0.11.1 while
109
+ // `…/dsh-trajectory-traceview-plus-0.11.1.tgz` returned HTTP 404 for ~2 minutes —
110
+ // so `dsh plugin add pkg@0.11.1` failed with "Tarball server returned HTTP 404"
111
+ // while every metadata check looked perfect. `npm view <pkg>@<v> version` cannot
112
+ // see that; only fetching the URL can.
105
113
  const npmView = run('npm', ['view', name + '@' + version, 'version']);
106
114
  const latest = run('npm', ['view', name, 'dist-tags.latest']);
115
+ const published = npmView.ok && npmView.out.includes(version);
116
+ let tarballState = 'not checked';
117
+ if (published) {
118
+ const url = run('npm', ['view', name + '@' + version, 'dist.tarball']).out;
119
+ // HEAD, no cache-buster: a cache-buster would defeat the very cache that is stale,
120
+ // hiding exactly the window a real installer would fall into.
121
+ const code = run('curl', ['-s', '-o', '/dev/null', '-w', '%{http_code}', '-I', url]).out;
122
+ tarballState = code === '200' ? 'tarball downloads' : 'tarball URL returns HTTP ' + code + ' (metadata is live, bytes are not)';
123
+ }
107
124
  rows.push({
108
125
  place: 'npm registry',
109
- present: npmView.ok && npmView.out.includes(version),
110
- detail: npmView.ok && npmView.out.includes(version)
111
- ? 'published' + (latest.ok ? ' (dist-tags.latest = ' + latest.out + ')' : '')
112
- : 'MISSING — `npm i ' + name + '@latest` still installs ' + (latest.ok ? latest.out : '(unknown)'),
113
- missing: 'npm publish',
126
+ present: published && tarballState === 'tarball downloads',
127
+ detail: !published
128
+ ? 'MISSING — `npm i ' + name + '@latest` still installs ' + (latest.ok ? latest.out : '(unknown)')
129
+ : 'published' + (latest.ok ? ' (dist-tags.latest = ' + latest.out + ')' : '') + ', ' + tarballState,
130
+ missing: published && tarballState !== 'tarball downloads'
131
+ ? 'wait for the CDN (a few minutes) then re-check; `npm view` is not enough'
132
+ : 'npm publish',
114
133
  });
115
134
 
116
135
  const pad = (s, n) => s + ' '.repeat(Math.max(0, n - [...s].length));
@@ -122,7 +141,12 @@ if (absent.length > 0) {
122
141
  for (const r of absent) if (r.missing) console.log(' ' + r.place + ': ' + r.missing);
123
142
  }
124
143
  if (absent.some((r) => r.place === 'npm registry')) {
125
- const msg = 'release-status: ' + version + ' is tagged but NOT on npm — anyone installing by package name gets the old version';
144
+ // Two very different causes read the same to a user ("install fails"), so the
145
+ // message has to name which one it is.
146
+ const msg = !published
147
+ ? 'release-status: ' + version + ' is tagged but NOT on npm — anyone installing by package name gets the old version'
148
+ : 'release-status: ' + version + ' is in the npm packument but its tarball is not downloadable yet — `dsh plugin add` will fail with HTTP ' +
149
+ 'rather than install something wrong. Wait for the CDN, then re-run.';
126
150
  if (WARN_ONLY) console.log('\n' + msg + ' (warn only)');
127
151
  else {
128
152
  console.error('\n' + msg);