cross-tab-worker-databus 0.21.26 → 0.21.28

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,3 +1,52 @@
1
+ ## [0.21.28] - 2026-09-25
2
+
3
+ Four shipped sentences re-read against the code, and three measurements taken again rather than carried forward. Two of the four were wrong; one was right but unreadable, and one was right in its conclusion and wrong in the count it quoted to support it.
4
+
5
+ ### Fixed
6
+
7
+ - **`reopenTransport()`'s early-return arm does not hold "the only handler this opening ever gets".** The note also claimed it "is not dominated by anything: it is the handler". Five sites call this method, and three of them (`startDemandRecovery()`, `updateStatus()`'s recovery-timer arm, `runTransport()`) chain their own `opening.then(f, g)` onto the promise this returns — the *same* object, so their `g` is already a handler of `opening` by Promise semantics and this `.catch` decides nothing on those paths. `start()` returns it to its own caller. Only `resumeTransport()`'s `void` call is the case the absorb exists for, and the note now says exactly that. It also records the symmetric mutation: deleting **this** line leaves all 37 test files green with zero unhandled-rejection reports, and so does deleting the `.catch` at the top of the method, because no test constructs a rejection on the `void` path. What separates the two absorbs is the caller list, not a test — an enumeration, not a pin.
8
+ - **`ClusterEnvironment.now` was documented as having a monotonic alternative it does not have.** The field said "the injected clock is the only monotonic one in the picture". There is no monotonic clock in the picture: `createBrowserEnvironment` binds the field straight to `Date.now`, and `performance.now()`/`hrtime` are read nowhere in `src/`. Nor is the injected clock monotonic by contract — it is a bare `() => number`, and a whole-suite census of every clock the tests inject found one that steps **backwards** on purpose (`tests/trace.test.ts`'s "keeps counting a measurable dispatch whose clock ran backwards"). What the sentence was reaching for is a property of the consumers, so it is now stated as one: `cluster.ts` is the field's only reader in `src/`, seven of its ten reads only stamp a record, and the three that subtract each fail their comparison on a backwards jump, so a record stamped before one reads as not-yet-expired until the clock climbs back past its stamp.
9
+ - **The `runTransport()` guard's census rows were never decodable.** The note quoted `1000`, `0000`, `0100`, `1001` and `1010` without saying what the four bits are, so no reader could check any of them. The encoding is now stated (the four premises in source order), the row set was re-derived with a first-sight `console.log` over one whole-suite run — **same five rows** — and the `1001` row's stack is now named rather than paraphrased: `handoffAssignedTopics()` → `onControl` → `unsubscribeTransport()`.
10
+ - **`ReapTarget`'s ordering note said a port is a chance.** "A port that is about to be closed is the only chance its owner gets to learn why" restated `reap()`'s measured reasoning and lost the grammar on the way. It now names the three steps, the order, why `notify` must go first, and what the shared `try`/`catch` costs — a target that throws in `notify` also skips `close` and `stop` for itself.
11
+
12
+ ### Tests
13
+
14
+ - **None added or changed.** `pnpm check` 0 (936 tests, 37 files, 5/5 perf gates), `pnpm lint` 0, `pnpm test:coverage` 0 with **46** zero-count branch arms of **1963** and aggregate 99.02 / 97.65 / 99.27 / 99.69 — the same distribution as `0.21.27`, which is the control that says this diff contains no code. `git diff -U0 src/` with comment lines filtered returns nothing.
15
+ - **Two operand mutants re-run, and one count had rotted.** Deleting `droppedAfterConnect` fails exactly the two named tests, as the note claimed. Deleting `transportReady` fails **nine** (6 in `data-bus.test.ts`, 3 in `centrifuge.test.ts`), where the note said eight — and because the eight were never named, the newcomer cannot be identified. The comment now gives both numbers as "run the mutant" rather than as limits.
16
+
17
+ ### Documentation
18
+
19
+ - **`AGENTS.md` grew from these two findings**: a row/flag vector is worth nothing until the comment says what its positions mean, and a kill count quoted without the list behind it cannot be re-attributed when it drifts.
20
+ - **Nothing consumer-facing moved**, so no `docs/` page was rewritten. All four corrections sit in maintainer-facing comments about internal methods. Two of them are class-member/interface JSDoc (`ClusterEnvironment.now`, `ReapTarget`), so they do reach the published `.d.ts`; the other two are statement-slot comments inside method bodies, which reach the package only through the published `.js.map` embedded sources — the split this repository measured in `0.21.27`.
21
+
22
+ ### Compatibility
23
+
24
+ Comment-only. No export, frame, option, default or storage key moved; `verify:compat`, `verify:types` and `verify:pack` pass against `v0.21.27`.
25
+
26
+ ## [0.21.27] - 2026-09-25
27
+
28
+ Three shipped sentences about lifecycle windows were re-checked against the code and the runner: one held and is now backed by a measurement, one was false about *why* the code is safe, and one quoted a number that had already rotted.
29
+
30
+ ### Fixed
31
+
32
+ - **`reconcile()`'s REGISTRY leg was unreachable for a different reason than its comment gave.** The note said the span between `pause()` clearing `started` and `pause()` removing the message listener holds "a boolean assignment and two `heartbeatHandle` writes, with no call that can hand the stack to consumer code". The middle of those three statements is `this.environment.clearInterval(this.heartbeatHandle)` — a call into adapter code, which this same file's `activate()` comment treats as consumer-supplied and untrusted. So the absence of calls was never what closed the window; the `if (!this.started) return` guard at the top of `reconcile()` is. The comment now says that, which also strengthens the case for keeping a guard that the old phrasing made look redundant.
33
+ - **The activation window's provenance is measured rather than argued.** `pause()`'s null-`heartbeatHandle` branch is a covered arm whose *origin* was a claim: that only the two "abandons activation…" tests reach it. Instrumenting the branch and running the whole suite printed exactly two lines and no third — one from the adapter's `createChannel`, one from the storage-less self-SUBSCRIBE's `handlers.onControl` — and the two test names are now quoted at the site, so a third origin is something a future reader can notice rather than something they have to re-derive.
34
+ - **A quoted call count became a lookup.** `reopenTransport()`'s note had carried "0 of 5041 calls" since `b0354e4`; the same function count on this tree reads 5046. The number was only ever there to say *hot method, cold arms*, and that reading survives any drift — which is precisely why a stale figure is dangerous: it looks like evidence. The sentence now names where to take the count from instead of preserving one.
35
+
36
+ ### Tests
37
+
38
+ - **None added or changed, and the ledger is quoted rather than assumed.** `pnpm check` 0 with **936** tests and 5/5 perf gates, `pnpm lint` 0, `pnpm test:coverage` 0 with **46** zero-count branch arms of **1963** and aggregate 99.02 / 97.65 / 99.27 / 99.69 — unchanged, as it must be for a diff that contains no code. `git diff -U0 src/` with every comment line filtered out returns nothing.
39
+
40
+ ### Documentation
41
+
42
+ - **`AGENTS.md` gained the decay rule for quoted numbers.** A count in a comment contradicts nothing when it drifts, so either name the lookup that re-derives it or drop the figure; the pair that carries the argument (this leg runs thousands of times, these arms read zero) is the part worth keeping. This is the same failure mode as quoting a sweep total as a per-seed cost — the reader cannot tell a stale measurement from a current one, and a stale one calibrates them.
43
+ - **And the shipped-surface rule got its position half, measured rather than inherited.** The existing note says a src comment ships through the declarations *and* the JS, which is true in aggregate and misleading per sentence: this release's three corrections all sit in **statement slots inside method bodies**, and grepping one built tree shows they reach the published package only through the `.js.map` files' embedded sources (`files: ["dist"]` does publish those). A **class-member JSDoc** — `0.21.26`'s `stop()` note is the control — does appear in `dist/core/replay-manager.d.ts`, in the shared ESM chunk and in both CJS bundles. The control that keeps this from reading as a regression is a comment that predates both releases: `cluster.ts`'s "Order matters: release local subscriptions…" is equally absent from the bundles. So "does this comment ship?" is asked per artifact — what a consumer's editor shows, what a sourcemap step recovers, what a bundle read surfaces — not once for the tree.
44
+ - **Nothing consumer-facing moved**, so no `docs/` page was rewritten: these are maintainer-facing comments about internal methods, corrected in place.
45
+
46
+ ### Compatibility
47
+
48
+ Comment-only. No export, frame, option, default or storage key moved; `verify:compat`, `verify:types` and `verify:pack` pass against `v0.21.26`.
49
+
1
50
  ## [0.21.26] - 2026-09-25
2
51
 
3
52
  One false sentence about who cancels a persistence retry, corrected everywhere it had been written — found by an audit pass whose own scheduling step was wrong, which is the part worth reading.
@@ -7,7 +7,7 @@ import {
7
7
  publicationMetadata,
8
8
  selectWorkerBackend,
9
9
  serializeError
10
- } from "./chunk-LN5O3IR6.js";
10
+ } from "./chunk-GHZ7JTYD.js";
11
11
  import {
12
12
  CENTRIFUGE_INPUT_TYPE,
13
13
  CENTRIFUGE_OUTPUT_TYPE,