cross-tab-worker-databus 0.21.36 → 0.21.37

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.
@@ -2570,7 +2570,7 @@ var SDK_VERSION = (
2570
2570
  // declaration's type is `string | undefined` and the export's is `string`
2571
2571
  // (dropping the conditional is TS2322, measured). Recorded here so the leg reads
2572
2572
  // as a shape the harness cannot reach rather than as a case nobody exercised.
2573
- true ? "0.21.36" : ""
2573
+ true ? "0.21.37" : ""
2574
2574
  );
2575
2575
 
2576
2576
  // src/core/data-bus.ts
package/dist/index.js CHANGED
@@ -20,7 +20,7 @@ import {
20
20
  selectRebalanceTarget,
21
21
  selectWorkerBackend,
22
22
  topicMatchesPattern
23
- } from "./chunk-AWCFYLIT.js";
23
+ } from "./chunk-COFXTIRW.js";
24
24
  import {
25
25
  DEFAULT_STORAGE_PREFIX,
26
26
  PRUNE_STRATEGY,
@@ -42,6 +42,6 @@ For a manual release (no `NPM_TOKEN` in the workflow), run `npm publish --access
42
42
  2. Install the published tarball or version in a clean consumer and import the root plus every public subpath.
43
43
  3. Record the result in the release notes. Do not advance to `1.0.0` until the public API and protocol deprecation policy are explicitly frozen.
44
44
 
45
- The tagged-release workflow already ran the consumer verification above. Run `PUBLISHED_VERSION=<version> pnpm verify:published` by hand only when you need an offline repeat. The workflow's 12-minute ceiling is not padding, and the number is a sum of two measured lags. First: the registry records the publish minutes after `npm publish` returns — the ack→`time[<version>]` gap measured on 0.21.27 through 0.21.35 was 74.8–310.0 s, and 248.7 / 96.8 / 74.8 / 310.0 / 127.2 / 76.1 / 75.5 / 75.8 / 127.3 s in version order — nine values, counted from that enumeration (read `time[<version>]` from the packument and compare it with the `Publish to npm` step's completion time). Three consecutive releases (0.21.32–0.21.34) recorded at 76.1, 75.5 and 75.8 s, a spread of 0.6 s, and this note read that as the lag being stable; **0.21.35 then came back at 127.3 s**, so the tightness was three samples and not a property. What the nine values do support is weaker and is the only thing the ceiling needs: the record lag sits between 74.8 and 310.0 s, none has beaten the 310 s that sizes the budget, and while it ranges over a minute the *step* has consumed 304–308 s every single time across ten green runs — so the varying quantity is how long the reader stays blind to a record that already exists, which is the second lag, not this one. Second: the packument that `npm pack` resolves against is served with `cache-control: public, max-age=300`, so a copy of it anywhere in the path is allowed to be up to five minutes stale, and resolution cannot be trusted to beat one cache lifetime after a write that lands inside that window. Which copy — npm's local cache or an intermediate — served the stale views below is *not* established, and the counter-observation this note used to offer against a purely local account does not survive being read carefully, because it joins two machines: the 21:44:34Z "fresh fetch" was a `npm pack` run on a laptop, while the 1 s green at 21:47:10Z was a *new runner job*, and a new job's npm cache starts empty — which is what the local account predicts rather than what contradicts it. What a purely-local account still cannot explain is one specific reading: the runner's own `ETARGET` at 21:45:07Z — 364 s after the step that opened its first poll (21:39:03Z), so ~60 s *after* the point where a copy taken then must have gone stale (21:44:03Z, give or take the second the request actually left). The ceiling is therefore arithmetic rather than a model: worst-case ack→`time[]` gap plus one cache lifetime. That sum is not theoretical: the previous 6-minute ceiling was exhausted by a *successful* publish, the 0.21.30 tag run spending its whole 360 s budget (48 × 7.5 s) on `ETARGET` while that version's tarball HEAD and a local `npm pack` had both already succeeded, and the same step 123 s later taking 1 s. The 0.20.89 run had shown the same shape against that release's 2-minute budget. So a long retrying verify is normal propagation, not an unusually slow mirror — raise `PUBLISHED_VERIFY_ATTEMPTS` / `PUBLISHED_VERIFY_DELAY_MS` further only if the ack→`time[]` gap has itself grown. Note the asymmetry when repeating by hand: `verify-published-consumer.mjs` defaults to `6` attempts × `5_000` ms — 30 seconds, not 12 minutes — because the tag run passes the larger pair as env rather than the script owning it. So a manual repeat can report `ETARGET` on a version whose CI run was green, which reads like a failed publish and is not one; reproduce the CI budget explicitly with `PUBLISHED_VERSION=<version> PUBLISHED_VERIFY_ATTEMPTS=96 PUBLISHED_VERIFY_DELAY_MS=7500 pnpm verify:published`, or judge a manual failure against the 30 s budget you actually ran. Read the step's duration as a diagnostic rather than a mood: the five green tag runs from 0.21.25 to 0.21.29 took 307, 304, 305, 304 and 304 s, 0.21.31's took 308 s and 0.21.32's, 0.21.33's and 0.21.34's took 304 s each — nine samples in a 5-second band, which is what one 300 s cache lifetime plus a few seconds of command time predicts (take the numbers from each release run's `Verify published npm consumers` step, `steps[].started_at`/`completed_at` from the same `gh api` call). 0.21.31 through 0.21.34 are the first four releases to run under the raised 720 s ceiling, and their lags split differently, which is the useful contrast: 127.2 s of record plus ~181 s of cache for the first, 76.1 s of record plus ~228 s before the runner saw it for the next, 75.5 s plus ~229 s for the third, and 75.8 s plus ~228 s for the fourth — on 0.21.32 a `no-cache` packument read from a laptop reported the new `latest` 151 s in, while the runner's own poll kept failing until 304 s, i.e. one lifetime after *its* first fetch. So the sample that set the previous ceiling has not been beaten: if the *ack→`time[]`* figure grows past 310 s, raise `PUBLISHED_VERIFY_ATTEMPTS` again; a verify that finishes in seconds means whatever copy it read already carried the new version.
45
+ The tagged-release workflow already ran the consumer verification above. Run `PUBLISHED_VERSION=<version> pnpm verify:published` by hand only when you need an offline repeat. The workflow's 12-minute ceiling is not padding, and the number is a sum of two measured lags. First: the registry records the publish minutes after `npm publish` returns — and **read that series off the runs rather than off a list in this file**. `node scripts/publication-lag.mjs` walks every release tag, subtracts the `Publish to npm` step's `completed_at` from `time[<version>]` on the packument, prints which attempt each non-first reading came from, and names every tag its denominator drops. Re-run there at `0.21.36`: **43** releases from `0.20.92` on, record lag **74.8–310.0 s**, none over 310 s. This note used to carry the per-version values, and two consecutive releases then refuted the regularity those values had been read as: three records at 76.1 / 75.5 / 75.8 s looked like a stable lag, then `0.21.35` came back at 127.3 s and `0.21.36` at 126.4 s. So the tight run was three samples in a wide distribution, and the enumeration was both a maintenance liability — it needs an edit every release, and it was stale the moment it shipped twice — and the vehicle of an inference the data never supported. The list is gone; the range above is what the ceiling is sized from, and it is re-derivable in one command. What the series does support is weaker and is all the ceiling needs: while the *record* lag spans four minutes, every green release whose consumer step actually waited took **301–309 s** (42 measurements inside 300–310 s, `0.21.30`'s 364 s exhausted budget the only outlier above it, and the two rows below it — `0.20.86` and `0.20.87` at 1.0 s — are the only pre-`0.20.92` releases the sweep measures at all, the other four of that window printing as `NEGATIVE` and so sitting outside the 45) — so the varying quantity is how long the reader stays blind to a record that already exists, which is the second lag, not this one. Second: the packument that `npm pack` resolves against is served with `cache-control: public, max-age=300`, so a copy of it anywhere in the path is allowed to be up to five minutes stale, and resolution cannot be trusted to beat one cache lifetime after a write that lands inside that window. Which copy — npm's local cache or an intermediate — served the stale views below is *not* established, and the counter-observation this note used to offer against a purely local account does not survive being read carefully, because it joins two machines: the 21:44:34Z "fresh fetch" was a `npm pack` run on a laptop, while the 1 s green at 21:47:10Z was a *new runner job*, and a new job's npm cache starts empty — which is what the local account predicts rather than what contradicts it. What a purely-local account still cannot explain is one specific reading: the runner's own `ETARGET` at 21:45:07Z — 364 s after the step that opened its first poll (21:39:03Z), so ~60 s *after* the point where a copy taken then must have gone stale (21:44:03Z, give or take the second the request actually left). The ceiling is therefore arithmetic rather than a model: worst-case ack→`time[]` gap plus one cache lifetime. That sum is not theoretical: the previous 6-minute ceiling was exhausted by a *successful* publish, the 0.21.30 tag run spending its whole 360 s budget (48 × 7.5 s) on `ETARGET` while that version's tarball HEAD and a local `npm pack` had both already succeeded, and the same step 123 s later taking 1 s. The 0.20.89 run had shown the same shape against that release's 2-minute budget. So a long retrying verify is normal propagation, not an unusually slow mirror — raise `PUBLISHED_VERIFY_ATTEMPTS` / `PUBLISHED_VERIFY_DELAY_MS` further only if the ack→`time[]` gap has itself grown. Note the asymmetry when repeating by hand: `verify-published-consumer.mjs` defaults to `6` attempts × `5_000` ms — 30 seconds, not 12 minutes — because the tag run passes the larger pair as env rather than the script owning it. So a manual repeat can report `ETARGET` on a version whose CI run was green, which reads like a failed publish and is not one; reproduce the CI budget explicitly with `PUBLISHED_VERSION=<version> PUBLISHED_VERIFY_ATTEMPTS=96 PUBLISHED_VERIFY_DELAY_MS=7500 pnpm verify:published`, or judge a manual failure against the 30 s budget you actually ran. Read the step's duration as a diagnostic rather than a mood: one 300 s cache lifetime plus a few seconds of command time predicts a tight cluster just above 300 s, and that is what the sweep prints — 42 of its 45 measurements land inside 300–310 s, `0.21.30`'s 364 s budget exhaustion is the only outlier above it, and every sub-2 s row belongs to a release before `0.20.92` where nothing had to propagate. Take the per-release numbers from that run's `Verify published npm consumers` step (`steps[].started_at` / `completed_at`, from the same `gh api` call the attempt selection above uses); this file no longer lists them, because its last enumeration named a 304–308 s band that the whole series widens to 301–309 s, and a number copied out of a subset is how a claim like that survives being false. 0.21.31 through 0.21.34 are the first four releases to run under the raised 720 s ceiling, and their lags split differently, which is the useful contrast: 127.2 s of record plus ~181 s of cache for the first, 76.1 s of record plus ~228 s before the runner saw it for the next, 75.5 s plus ~229 s for the third, and 75.8 s plus ~228 s for the fourth — on 0.21.32 a `no-cache` packument read from a laptop reported the new `latest` 151 s in, while the runner's own poll kept failing until 304 s, i.e. one lifetime after *its* first fetch. So the sample that set the previous ceiling has not been beaten: if the *ack→`time[]`* figure grows past 310 s, raise `PUBLISHED_VERIFY_ATTEMPTS` again; a verify that finishes in seconds means whatever copy it read already carried the new version.
46
46
 
47
- **Do not adjudicate a publish from `dist-tags.latest`.** The package document endpoint and the tarball URL are two different read paths, and their timestamps are worth more than the impression they first give. Read during the 0.21.30 release, in order: `npm publish` returned success at `21:39:03Z`; a `curl -s -H "Cache-Control: no-cache" https://registry.npmjs.org/<pkg>` at `21:43:15Z` reported `latest` still on the previous version, no `0.21.30` in `versions`, and no `time['0.21.30']`; npm's own stamp for that version is `21:44:12.987Z` and the document's `last-modified` is `21:44:14 GMT`. So the 21:43:15 read was **not** a replica refusing an artifact that already existed — the registry had not finished recording the publish, and `no-cache` could not have made it see a version that did not exist yet. Absence from `versions` and from `latest`, minutes after a green publish step, is the expected state of a successful release from `0.20.92` on — all 42 of them measured on 2026-09-25 took at least 74.8 s to be recorded — while the five just before the window (`0.20.86`, `0.20.87`, `0.20.88`, `0.20.90`, `0.20.91`) recorded within ±0.6 s of their acks and resolved in 1 s. So the sentence describes this window and not npm; what to do when it holds is unchanged. The genuine read-path disagreement came 60 s later: between `21:44:14Z` and `21:44:35Z`, `curl -I …/-/<pkg>-0.21.30.tgz` returned `HTTP 200` and a local `npm pack <pkg>@0.21.30 --registry https://registry.npmjs.org` completed and wrote the tarball, while the workflow runner's own `npm pack` kept returning `ETARGET` until it exhausted its budget at `21:45:07Z`. Same version, two machines, opposite answers a minute apart. To answer "did the publish happen", HEAD the tarball URL and try the pack — those reach the artifact — and try it **from the place that is failing**, because "fetchable" is a per-machine answer; read `latest` only for the question "which version do consumers get by default", which is a different one and settles later. `npm view <pkg> version` adds a third path on top: it can be served from npm's *local* packument cache, so on a machine that queried the registry before the publish it can return the superseded version even after the global `latest` has moved (that is why this gate resolves its target from `PUBLISHED_VERSION` and refuses an inferred version that disagrees with `package.json`). Never re-push, move, or replace a tag because a metadata read looked stale; the tag is immutable once published.
47
+ **Do not adjudicate a publish from `dist-tags.latest`.** The package document endpoint and the tarball URL are two different read paths, and their timestamps are worth more than the impression they first give. Read during the 0.21.30 release, in order: `npm publish` returned success at `21:39:03Z`; a `curl -s -H "Cache-Control: no-cache" https://registry.npmjs.org/<pkg>` at `21:43:15Z` reported `latest` still on the previous version, no `0.21.30` in `versions`, and no `time['0.21.30']`; npm's own stamp for that version is `21:44:12.987Z` and the document's `last-modified` is `21:44:14 GMT`. So the 21:43:15 read was **not** a replica refusing an artifact that already existed — the registry had not finished recording the publish, and `no-cache` could not have made it see a version that did not exist yet. Absence from `versions` and from `latest`, minutes after a green publish step, is the expected state of a successful release from `0.20.92` on — **43** of them as of `0.21.36`, every one recorded at least 74.8 s after its ack. Take the count from `CHANGELOG.md`'s version headings intersected with the packument's `time` map and the floor from the same sweep that yields the lag range above: that set gains a member at every release, which is the whole reason a value in this sentence is the wrong thing to memorize — while the five just before the window (`0.20.86`, `0.20.87`, `0.20.88`, `0.20.90`, `0.20.91`) recorded within ±0.6 s of their acks and resolved in 1 s. So the sentence describes this window and not npm; what to do when it holds is unchanged. The genuine read-path disagreement came 60 s later: between `21:44:14Z` and `21:44:35Z`, `curl -I …/-/<pkg>-0.21.30.tgz` returned `HTTP 200` and a local `npm pack <pkg>@0.21.30 --registry https://registry.npmjs.org` completed and wrote the tarball, while the workflow runner's own `npm pack` kept returning `ETARGET` until it exhausted its budget at `21:45:07Z`. Same version, two machines, opposite answers a minute apart. To answer "did the publish happen", HEAD the tarball URL and try the pack — those reach the artifact — and try it **from the place that is failing**, because "fetchable" is a per-machine answer; read `latest` only for the question "which version do consumers get by default", which is a different one and settles later. `npm view <pkg> version` adds a third path on top: it can be served from npm's *local* packument cache, so on a machine that queried the registry before the publish it can return the superseded version even after the global `latest` has moved (that is why this gate resolves its target from `PUBLISHED_VERSION` and refuses an inferred version that disagrees with `package.json`). Never re-push, move, or replace a tag because a metadata read looked stale; the tag is immutable once published.
package/docs/roadmap.md CHANGED
@@ -1,6 +1,13 @@
1
1
  # Roadmap
2
2
 
3
- 0.21.36 was released on September 25, 2026. The project is intentionally continuing through reliability-focused releases before a 1.0.0 stability freeze.
3
+ 0.21.37 was released on September 25, 2026. The project is intentionally continuing through reliability-focused releases before a 1.0.0 stability freeze.
4
+
5
+ ## 0.21.37 delivered scope
6
+
7
+ - **A shipped instruction pointed at a directory git never had.** Both release checklists told the reader to re-derive the publication-lag series from `.gate-logs/publication-pair.mjs`, and that path is gitignored — live on the one machine that wrote it, dead in every clone and in the published tarball's own docs. Nothing can gate it: the citation sweep resolves test *titles*, and a shell command is neither a title nor a symbol. The tool is now `scripts/publication-lag.mjs`, tracked, resolving the repository and the Release workflow id through `gh` instead of hardcoding either, with a per-call timeout after the previous sweep hung 18 minutes on one `gh api`, a `reading <version>` line so a stopped run names where it stopped, and a printed line for every member its denominator drops.
8
+ - **Running it corrected three numbers in the prose that quotes it.** The sub-second consumer steps inside the measured set are two (`0.20.86`, `0.20.87`), not the six both languages carried — the other four pre-`0.20.92` releases print as `NEGATIVE` and sit outside the 45, the exact distinction the tool draws and the copied sentence lost. The `0.20.92`-onward window holds 43 releases, not the 42 `AGENTS.md` still counted, and since that number moves every release the count became the lookup. "Prints the attempt each reading came from" over-stated a flag that fires only for a non-first attempt.
9
+ - **What the series confirmed, and what the instrument itself taught.** Every per-release sample the prose quotes re-read identical — 127.2 / 76.1 / 75.5 / 75.8 / 127.3 / 126.4 s of record lag across `0.21.31`–`0.21.36`, their steps at 304–308 s, `0.21.30` alone at 310.0 s and 364.0 s, 42 of 45 steps inside 300–310 s, no gap over 310 s — so the 720 s budget and its floor test are unchanged. And the promoted script first ran *broken*: a `const` formatter scoped inside the sweep loop killed it with a `ReferenceError` after all 45 tags had been read, printing four lines and exit 1 — the formatter moved to module scope, and what made the failure diagnosable at all was the non-zero exit, since four rows from a 49-tag sweep reads like a short series rather than a broken one.
10
+ - **A copied-forward count in the progress log had never been measured.** The `bench:browser` debt read "four releases", then "five", in successive `Next` lines; the newest `bench-results/browser-*.json` is `2026-09-24T13:40:52Z`, eight minutes before `0.21.22`'s release commit regenerated `docs/benchmarks.md`, so it is fourteen (`0.21.23` on). Neither number is in a shipped file, so the correction stays in the log, where both older lines now point at the two artifacts.
4
11
 
5
12
  ## 0.21.36 delivered scope
6
13
 
@@ -43,6 +43,6 @@
43
43
  2. 在干净消费者中安装已发布版本或 tarball,并导入主入口及所有公开子路径。
44
44
  3. 将结果记录到发布说明。在公开 API 和协议弃用策略明确冻结前,不进入 `1.0.0`。
45
45
 
46
- 打 tag 的发布工作流已自动执行上述消费者验证;仅在需要离线复验时才手动运行 `PUBLISHED_VERSION=<version> pnpm verify:published`。工作流的 12 分钟上限不是凑数,而是两段实测延迟之和。第一段:`npm publish` 返回成功后,registry 还要几分钟才把这条版本记进去——0.21.27 到 0.21.35 的"发布确认 → `time[<version>]`"间隔实测为 74.8–310.0 秒,按版本顺序分别是 248.7 / 96.8 / 74.8 / 310.0 / 127.2 / 76.1 / 75.5 / 75.8 / 127.3 秒——九个值,数一遍上面那份枚举就是(自己去 packument 读 `time[<version>]`,再和工作流 `Publish to npm` 步骤的完成时刻相减)。其中连续三次(0.21.32–0.21.34)落在 76.1、75.5、75.8 秒,跨度只有 0.6 秒,本段据此写过"落库很稳";**接着 0.21.35 回到了 127.3 秒**,所以那半秒只是三个样本,不是这个量的性质。九个值真正支持的结论更弱、也更够用:落库延迟落在 74.8–310.0 秒之间,没有任何一次超过决定预算的 310 秒;而在它自己跨越一分钟的同时,那一步在十次绿色运行里每次都吃掉 304–308 秒——会变的其实是"记录已经存在之后,读者还要瞎多久",那是第二段,不是这一段。第二段:`npm pack` 用来解析版本的 packument 是以 `cache-control: public, max-age=300` 提供的,也就是说路径上任何一份副本按设计都可以旧五分钟,落在这一窗口内写入的版本,解析不太可能快过一整个缓存生命周期。究竟是哪个副本(npm 本地缓存,还是中间的 CDN)在下面提供了过期视图**并未确立**,而这段文字此前用作"反对纯本地解释"的那个观测,仔细读过之后站不住,因为它把两台机器拼成了一句话:21:44:34Z 那次"新鲜读取"是在笔记本上跑 `npm pack`,而 21:47:10Z 一秒就绿的是一次*全新的 runner 任务*,新任务的 npm 缓存本来是空的——这恰好是纯本地模型预测的结果,不是反驳它的结果。纯本地模型仍然解释不了的,只有一个读数:runner 自己在 21:45:07Z 仍然报 `ETARGET`——距离开始轮询的那一步(21:39:03Z)已经 364 秒,也就是比"那一刻抓到的副本必然已过期"的时间点(21:44:03Z,误差在请求真正发出的那一秒之内)还要晚约 60 秒。因此上限靠的是算术而不是模型:最坏情况的"确认 → `time[]`"间隔,加上一个缓存生命周期。这个和并非理论值——上一个 6 分钟上限被一次*成功*的发布排空过:0.21.30 的 tag 运行把整整 360 秒预算(48 × 7.5 秒)花在 `ETARGET` 上,而那时该版本的 tarball HEAD 和本地 `npm pack` 都已经成功;123 秒后同一步骤只用了 1 秒。0.20.89 针对它当时的 2 分钟预算也是同一形状。所以长时间的反复重试是正常的传播延迟,不是镜像异常慢——只有"确认 → `time[]`"间隔本身变长了,才需要继续调大 `PUBLISHED_VERIFY_ATTEMPTS` 和 `PUBLISHED_VERIFY_DELAY_MS`。手动复验时要注意这个不对称:`verify-published-consumer.mjs` 的默认值是 `6` 次 × `5_000` ms——30 秒而不是 12 分钟——因为更大的那一对是由 tag 工作流以 env 传入、而非脚本自带。于是手动复跑可能在一个 CI 全绿的版本上报出 `ETARGET`,这看起来像发布失败而实际不是;要对齐 CI 预算就显式执行 `PUBLISHED_VERSION=<version> PUBLISHED_VERIFY_ATTEMPTS=96 PUBLISHED_VERIFY_DELAY_MS=7500 pnpm verify:published`,否则请按你实际跑到的 30 秒预算来判断手动失败。把这个步骤的耗时当诊断读数而不是情绪指标:0.21.25 到 0.21.29 那五次*绿色* tag 运行分别用了 307、304、305、304、304 秒,0.21.31 用了 308 秒,0.21.32、0.21.33 与 0.21.34 各用了 304 秒——九个样本落在 5 秒的区间里,而这正是"一个 300 秒缓存生命周期 + 几秒命令时间"会预测出的形状(数字自己取:对每次发布运行 `gh api` 出来的 jobs 里,`Verify published npm consumers` 这一步的 `steps[].started_at`/`completed_at`)。0.21.31 到 0.21.34 是头四个跑在提高后的 720 秒上限下的发布,而它们几段延迟的切分方式不同,这个对照正是有用的地方:第一次是 127.2 秒落库 + 约 181 秒缓存;第二次是 76.1 秒落库 + 之后约 228 秒 runner 仍看不见它;第三次是 75.5 秒落库 + 约 229 秒;第四次是 75.8 秒落库 + 约 228 秒——在 0.21.32 上,笔记本在 151 秒时用 `no-cache` 读 packument 已经能看到新的 `latest`,而 runner 自己的轮询一直到 304 秒才成功,也就是从*它自己*首次抓取算起整整一个生命周期。所以当初定这个上限的那个样本至今没有被超过:如果*确认 → `time[]`*这一段自己长过了 310 秒,就再调大 `PUBLISHED_VERIFY_ATTEMPTS`;而几秒就结束的 verify 只说明它读到的那份副本已经带上了新版本。
46
+ 打 tag 的发布工作流已自动执行上述消费者验证;仅在需要离线复验时才手动运行 `PUBLISHED_VERSION=<version> pnpm verify:published`。工作流的 12 分钟上限不是凑数,而是两段实测延迟之和。第一段:`npm publish` 返回成功后,registry 还要几分钟才把这条版本记进去——而**这份序列要从运行记录里读,不要从本文件抄来的清单里读**。`node scripts/publication-lag.mjs` 会走一遍所有 release tag,用 packument 上的 `time[<version>]` 减去 `Publish to npm` 步骤的 `completed_at`,打印每条非首次读出的数取自第几次 attempt,并把它从分母里丢掉的 tag 逐个点名。在 `0.21.36` 处重跑的答案:从 `0.20.92` 起共 **43** 个发布,落库延迟 **74.8–310.0 秒**,没有一次越过决定预算的 310 秒。本段以前逐个抄录过这些数值,而紧接着的两次发布接连推翻由那串数值读出的规律:连续三次落在 76.1 / 75.5 / 75.8 秒,看着像"落库很稳",随后 `0.21.35` 回到 127.3 秒、`0.21.36` 是 126.4 秒。所以那段紧凑只是宽分布里的三个样本;而那份枚举既是维护负担(每次发布都要改,两次刚写下就已过期),也承载了一个数据从来不支持的推论。清单已删,上面这个区间才是预算的来源,而且一条命令就能重取。这套数据真正支持的结论更弱、也更够用:落库延迟横跨四分钟,可绿色发布里真正等待过的消费者步骤一律是 **301–309 秒**(45 个读数里 42 个落在 300–310 秒内,唯一的上方异常是 `0.21.30` 耗尽预算的 364 秒;下方两条各 1.0 秒,是 `0.20.86` 和 `0.20.87`,也正是 `0.20.92` 之前唯二被这条序列量到的发布——那个窗口里另外四条以 `NEGATIVE` 打印,不在这 45 条之内——那时根本没有东西需要传播)——会变的其实是"记录已经存在之后,读者还要瞎多久",那是第二段,不是这一段。第二段:`npm pack` 用来解析版本的 packument 是以 `cache-control: public, max-age=300` 提供的,也就是说路径上任何一份副本按设计都可以旧五分钟,落在这一窗口内写入的版本,解析不太可能快过一整个缓存生命周期。究竟是哪个副本(npm 本地缓存,还是中间的 CDN)在下面提供了过期视图**并未确立**,而这段文字此前用作"反对纯本地解释"的那个观测,仔细读过之后站不住,因为它把两台机器拼成了一句话:21:44:34Z 那次"新鲜读取"是在笔记本上跑 `npm pack`,而 21:47:10Z 一秒就绿的是一次*全新的 runner 任务*,新任务的 npm 缓存本来是空的——这恰好是纯本地模型预测的结果,不是反驳它的结果。纯本地模型仍然解释不了的,只有一个读数:runner 自己在 21:45:07Z 仍然报 `ETARGET`——距离开始轮询的那一步(21:39:03Z)已经 364 秒,也就是比"那一刻抓到的副本必然已过期"的时间点(21:44:03Z,误差在请求真正发出的那一秒之内)还要晚约 60 秒。因此上限靠的是算术而不是模型:最坏情况的"确认 → `time[]`"间隔,加上一个缓存生命周期。这个和并非理论值——上一个 6 分钟上限被一次*成功*的发布排空过:0.21.30 的 tag 运行把整整 360 秒预算(48 × 7.5 秒)花在 `ETARGET` 上,而那时该版本的 tarball HEAD 和本地 `npm pack` 都已经成功;123 秒后同一步骤只用了 1 秒。0.20.89 针对它当时的 2 分钟预算也是同一形状。所以长时间的反复重试是正常的传播延迟,不是镜像异常慢——只有"确认 → `time[]`"间隔本身变长了,才需要继续调大 `PUBLISHED_VERIFY_ATTEMPTS` 和 `PUBLISHED_VERIFY_DELAY_MS`。手动复验时要注意这个不对称:`verify-published-consumer.mjs` 的默认值是 `6` 次 × `5_000` ms——30 秒而不是 12 分钟——因为更大的那一对是由 tag 工作流以 env 传入、而非脚本自带。于是手动复跑可能在一个 CI 全绿的版本上报出 `ETARGET`,这看起来像发布失败而实际不是;要对齐 CI 预算就显式执行 `PUBLISHED_VERSION=<version> PUBLISHED_VERIFY_ATTEMPTS=96 PUBLISHED_VERIFY_DELAY_MS=7500 pnpm verify:published`,否则请按你实际跑到的 30 秒预算来判断手动失败。把这个步骤的耗时当诊断读数而不是情绪指标:整条序列自己取——`node scripts/publication-lag.mjs` 会打印每个发布运行里这一步的墙钟时间(`steps[].started_at`/`completed_at`,和上面选 attempt 用的是同一个 `gh api` 调用)。45 个读数里 42 个落在 300–310 秒内,`0.21.30` 耗尽预算的 364 秒是唯一的上方异常,1 秒以内的两条都属于 `0.20.92` 之前的发布——那时没有东西需要传播。这正是"一个 300 秒缓存生命周期 + 几秒命令时间"会预测出的形状,所以本文件不再抄录逐个数:上一份枚举写下的是 304–308 秒的区间,而整条序列把它放宽成 301–309 秒——从子集里抄一个数,就是这么让一个错说法活得比它的样本更久。0.21.31 到 0.21.34 是头四个跑在提高后的 720 秒上限下的发布,而它们几段延迟的切分方式不同,这个对照正是有用的地方:第一次是 127.2 秒落库 + 约 181 秒缓存;第二次是 76.1 秒落库 + 之后约 228 秒 runner 仍看不见它;第三次是 75.5 秒落库 + 约 229 秒;第四次是 75.8 秒落库 + 约 228 秒——在 0.21.32 上,笔记本在 151 秒时用 `no-cache` 读 packument 已经能看到新的 `latest`,而 runner 自己的轮询一直到 304 秒才成功,也就是从*它自己*首次抓取算起整整一个生命周期。所以当初定这个上限的那个样本至今没有被超过:如果*确认 → `time[]`*这一段自己长过了 310 秒,就再调大 `PUBLISHED_VERIFY_ATTEMPTS`;而几秒就结束的 verify 只说明它读到的那份副本已经带上了新版本。
47
47
 
48
- **不要用 `dist-tags.latest` 来判断发布是否发生。** 包文档端点与 tarball URL 是两条不同的读取路径,而它们的时间戳比这两条路径给的第一手印象更值得读。0.21.30 发布期间按顺序读到:`npm publish` 在 `21:39:03Z` 返回成功;`21:43:15Z` 的一次 `curl -s -H "Cache-Control: no-cache" https://registry.npmjs.org/<pkg>` 仍报 `latest` 是上一个版本、`versions` 里没有 `0.21.30`、`time['0.21.30']` 也不存在;而 npm 自己给这个版本盖的时间戳是 `21:44:12.987Z`,文档的 `last-modified` 是 `21:44:14 GMT`。所以 21:43:15 那次读取**不是**一份副本在拒绝已经存在的产物——registry 当时确实还没把这次发布记完,`no-cache` 也不可能让它看见尚不存在的版本;在发布步骤全绿之后的几分钟里,`versions` 与 `latest` 里没有这个版本,对 `0.20.92` 起的每一次成功发布都是正常状态——那 42 个版本在 2026-09-25 全部量过,被记下最少也要 74.8 秒——而窗口之前的那五次(`0.20.86`、`0.20.87`、`0.20.88`、`0.20.90`、`0.20.91`)在 ack 前后 ±0.6 秒内就记录好了,1 秒即可解析。所以这句话描述的是这个窗口,而不是 npm 本身;当它成立时,该怎么判断并没有变。真正的读取路径分歧出现在 60 秒之后:`21:44:14Z` 到 `21:44:35Z` 之间,`curl -I …/-/<pkg>-0.21.30.tgz` 返回 `HTTP 200`,本地一次 `npm pack <pkg>@0.21.30 --registry https://registry.npmjs.org` 也成功写出了 tarball,而工作流 runner 自己的 `npm pack` 一直 `ETARGET` 到 `21:45:07Z` 把预算排空。同一个版本、两台机器、相隔一分钟给出相反答案。要回答"发布到底成没成",去 HEAD 那个 tarball URL 并试一次 pack——它们摸到的是产物本身——而且要从**正在失败的那台机器**上去试,因为"能取到"是一台机器才有的答案;`latest` 只回答"消费者默认拿到哪个版本",那是另一个问题,而且会更晚才稳定。`npm view <pkg> version` 在这之上还有第三条路径:它可能来自 npm 的**本地** packument 缓存,于是在发布前查过一次的机器上,即使全局 `latest` 已经前进,它仍会返回被取代的旧版本——这正是本门禁把目标版本固定取自 `PUBLISHED_VERSION`、并拒绝与 `package.json` 不一致的推断值的原因。不要因为一次元数据读取看起来过期就重推、移动或替换 tag;发布出去的 tag 是不可变的。
48
+ **不要用 `dist-tags.latest` 来判断发布是否发生。** 包文档端点与 tarball URL 是两条不同的读取路径,而它们的时间戳比这两条路径给的第一手印象更值得读。0.21.30 发布期间按顺序读到:`npm publish` 在 `21:39:03Z` 返回成功;`21:43:15Z` 的一次 `curl -s -H "Cache-Control: no-cache" https://registry.npmjs.org/<pkg>` 仍报 `latest` 是上一个版本、`versions` 里没有 `0.21.30`、`time['0.21.30']` 也不存在;而 npm 自己给这个版本盖的时间戳是 `21:44:12.987Z`,文档的 `last-modified` 是 `21:44:14 GMT`。所以 21:43:15 那次读取**不是**一份副本在拒绝已经存在的产物——registry 当时确实还没把这次发布记完,`no-cache` 也不可能让它看见尚不存在的版本;在发布步骤全绿之后的几分钟里,`versions` 与 `latest` 里没有这个版本,对 `0.20.92` 起的每一次成功发布都是正常状态——截至 `0.21.36` 共 **43** 个,其中每一次被记下的延迟都不小于 74.8 秒(计数取 `CHANGELOG.md` 的版本标题与 packument `time` 映射的交集,下限由上面那条同一命令给出;这个集合每次发布都会 +1,所以值得记住的是取法而不是那个数)——而窗口之前的那五次(`0.20.86`、`0.20.87`、`0.20.88`、`0.20.90`、`0.20.91`)在 ack 前后 ±0.6 秒内就记录好了,1 秒即可解析。所以这句话描述的是这个窗口,而不是 npm 本身;当它成立时,该怎么判断并没有变。真正的读取路径分歧出现在 60 秒之后:`21:44:14Z` 到 `21:44:35Z` 之间,`curl -I …/-/<pkg>-0.21.30.tgz` 返回 `HTTP 200`,本地一次 `npm pack <pkg>@0.21.30 --registry https://registry.npmjs.org` 也成功写出了 tarball,而工作流 runner 自己的 `npm pack` 一直 `ETARGET` 到 `21:45:07Z` 把预算排空。同一个版本、两台机器、相隔一分钟给出相反答案。要回答"发布到底成没成",去 HEAD 那个 tarball URL 并试一次 pack——它们摸到的是产物本身——而且要从**正在失败的那台机器**上去试,因为"能取到"是一台机器才有的答案;`latest` 只回答"消费者默认拿到哪个版本",那是另一个问题,而且会更晚才稳定。`npm view <pkg> version` 在这之上还有第三条路径:它可能来自 npm 的**本地** packument 缓存,于是在发布前查过一次的机器上,即使全局 `latest` 已经前进,它仍会返回被取代的旧版本——这正是本门禁把目标版本固定取自 `PUBLISHED_VERSION`、并拒绝与 `package.json` 不一致的推断值的原因。不要因为一次元数据读取看起来过期就重推、移动或替换 tag;发布出去的 tag 是不可变的。
@@ -1,6 +1,13 @@
1
1
  # 路线图
2
2
 
3
- 0.21.36 已于 2026 年 9 月 25 日发布。项目会先持续完成可靠性发布,再进入 1.0.0 稳定性冻结。
3
+ 0.21.37 已于 2026 年 9 月 25 日发布。项目会先持续完成可靠性发布,再进入 1.0.0 稳定性冻结。
4
+
5
+ ## 0.21.37 已完成范围
6
+
7
+ - **一份已发布的操作说明指向了一个 git 里从来没有的目录。** 两份发版检查清单都告诉读者用 `.gate-logs/publication-pair.mjs` 重新推导发布延迟序列,而这个路径在 `.gitignore` 里——它只在写下这句话的那台机器上有效,在任何一份克隆里、在已发布压缩包自带的文档里都是死链。这一类问题无法被门禁看见:引用扫描解析的是测试*标题*,而一条 shell 命令既不是标题也不是符号。这个工具现在是 `scripts/publication-lag.mjs`,已被跟踪,仓库名与 Release workflow id 都通过 `gh` 解析而不再硬编码;上一版扫描曾卡在一次没有上限的 `gh api` 上 18 分钟且不打印任何东西,因此每次调用现在都有 30 秒超时、一行 `reading <version>` 进度,以及为分母丢掉的每个成员单独打印的一行。
8
+ - **跑一遍它,就改掉了引用它的正文里的三个数字。** 被测量的序列里耗时不足一秒的消费者步骤是两条(`0.20.86`、`0.20.87`),而不是两种语言都写的六条——`0.20.92` 之前另外四个发布以 `NEGATIVE` 打印,因而不在这 45 条之内,这正是工具自己的输出会做、而被抄下来的那句话丢掉的区分。`0.20.92` 起的窗口有 43 个发布,而不是 `AGENTS.md` 仍在计的 42;既然这个数每次发布都会动,它就被换成了查找方法(`measured=N of M tags`)。而"打印每条读数取自第几次 attempt"高估了这个标记——它只在非首次的 attempt 上出现。
9
+ - **序列确认了什么,工具本身又教了什么。** 正文引用的每个逐版本样本重读之后完全一致——`0.21.31`–`0.21.36` 的落库延迟 127.2 / 76.1 / 75.5 / 75.8 / 127.3 / 126.4 秒,对应的步骤耗时 304–308 秒,`0.21.30` 独自是 310.0 秒与 364.0 秒,45 条里 42 条落在 300–310 秒内,没有一次间隔越过 310 秒——因此 720 秒预算与钉住它的测试都原样不动。而被提升为正式工具的脚本第一次跑起来是*坏的*:一个作用域在扫描循环内的 `const` 格式化函数,让它在读完全部 45 个 tag 之后死于 `ReferenceError`,只打印了四行并以 1 退出——让这次失败可诊断的只是那个非零退出码,因为 49 个 tag 的扫描只返回四行,读起来像"序列短"而不是"工具坏了"。
10
+ - **进度日志里一个被抄来抄去的数,从来没有人量过。** `bench:browser` 的欠账在相邻两条 `Next` 里分别写成"四个发布"和"五个";而最新的 `bench-results/browser-*.json` 是 `2026-09-24T13:40:52Z`,比重新生成 `docs/benchmarks.md` 的 `0.21.22` 发版提交早八分钟,所以这个数是十四个(自 `0.21.23` 起)。两个错数都不在已发布文件里,因此修正留在日志中,而两条旧 `Next` 现在指向那两份产物本身。
4
11
 
5
12
  ## 0.21.36 已完成范围
6
13
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cross-tab-worker-databus",
3
- "version": "0.21.36",
3
+ "version": "0.21.37",
4
4
  "description": "Framework-agnostic cross-tab data bus with Dedicated/Shared Worker clustering and Centrifuge support.",
5
5
  "type": "module",
6
6
  "license": "MIT",