Skip to content

Commit 3c22ddd

Browse files
committed
docs(#14646): record at both sites what the runtime pin stopped proving
Measured, one mutation and two pins: giving the shipped InMemoryRealtimeAdapter a getChannelRoute() reddens service-realtime's no-channel-route pin (2 of 3 cases) and leaves the runtime producer pin green on all 4. So the shipped- occupant claim is covered next door, not lost — and the runtime pin's stand-in is equivalent to the real adapter only on the two reads a producer performs, which was measured rather than assumed. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ARYe3yQTQCUFm5qPYNgKaJ
1 parent 8506516 commit 3c22ddd

2 files changed

Lines changed: 24 additions & 7 deletions

File tree

.changeset/discovery-subscribable-channel-definition.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,6 @@ What to read instead, per case:
1717
- deciding whether to open a subscription → `handlerReady === true && typeof route === 'string'`, i.e. `isSubscribableChannel(discovery.services.realtime)`, or the equivalent `capabilities.websockets.enabled`; poll or degrade otherwise;
1818
- asking whether the slot is occupied at all → `status` (`'unavailable'` = nothing registered; `'degraded'` = registered, reduced) — this is what `enabled` answered for `realtime` before.
1919

20+
Testing note, recorded because it is a real limit rather than an implementation detail: the two producer pins drive a declared in-process-bus stand-in, not the shipped `InMemoryRealtimeAdapter``@objectstack/runtime` taking a source-level dependency on `@objectstack/service-realtime` for a test is refused by this repo's type-resolution ratchets. The claim about the shipped occupant is pinned against the real class in `@objectstack/service-realtime`'s own suite instead; a mutation giving that adapter a channel route reddens that pin and leaves the producer pins green, which is the division of labour stated at both sites.
21+
2022
New in `@objectstack/spec`: `isSubscribableChannel()`, `readChannelRoute()`, `CHANNEL_SURFACE_SLOTS` (`@objectstack/spec/api`) and the optional `IRealtimeService.getChannelRoute()` — the producer half, by which an occupant that really serves a transport names the path a host mounted it at. Additive; no existing member changed shape. `@objectstack/service-realtime` deliberately does not implement it.

packages/runtime/src/discovery-realtime-channel.pin.test.ts

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -47,13 +47,28 @@ const PREFIX = '/api/v1';
4747
* `tsconfig.test.json` states it will not widen — 13 `TS6059` billed to a
4848
* ledger `service-realtime` cannot see, the same shape PR #12570 measured.
4949
*
50-
* Nothing is lost by declaring it here, because the claim about the SHIPPED
51-
* occupant is not this file's to make: it is pinned against the real class, in
52-
* the package that owns it, by
53-
* `packages/services/service-realtime/src/no-channel-route.pin.test.ts`. That
54-
* pin plus these compose to the stock-boot reading — this file pins that the
55-
* PRODUCER derives its answer from whatever the occupant names, and that one
56-
* pins what the shipped occupant names.
50+
* ⚠️ What this file therefore STOPPED proving, stated because a pin that still
51+
* passes while proving less is a real cost: the first case below no longer
52+
* evaluates the SHIPPED adapter. Measured, one mutation, two pins —
53+
* `InMemoryRealtimeAdapter` given a `getChannelRoute()` returning
54+
* `/api/v1/realtime`: `no-channel-route.pin.test.ts` goes RED (2 of its 3
55+
* cases), and THIS file stays GREEN on all 4. So if the shipped occupant ever
56+
* starts naming a channel, the red arrives next door and never here.
57+
*
58+
* That is the whole of the loss, and it is covered rather than merely moved:
59+
* the claim about the SHIPPED occupant is not this file's to make. It is pinned
60+
* against the real class, in the package that owns it, by
61+
* `packages/services/service-realtime/src/no-channel-route.pin.test.ts` — the
62+
* pin the mutation above proves has teeth. That one pins WHAT THE SHIPPED
63+
* OCCUPANT NAMES; this one pins that the PRODUCER derives its answer from
64+
* whatever an occupant names. Together they compose to the stock-boot reading,
65+
* and neither can go green by accident of the other.
66+
*
67+
* The stand-in is equivalent to the real adapter only on the two reads either
68+
* producer performs on an occupant — `readChannelRoute` and
69+
* `readServiceSelfInfo` — and that equivalence was measured (both `undefined`
70+
* on both objects) rather than assumed. It is a statement about today, which is
71+
* exactly why the shipped-occupant claim lives next door instead of here.
5772
*/
5873
const inProcessBus: IRealtimeService = {
5974
publish: async () => {},

0 commit comments

Comments
 (0)