Skip to content

Commit 8fd246d

Browse files
claude[bot]claude
andauthored
docs(spec): name the shape the transports carry in the websocket retirement note (#16978)
* docs(spec): name the shape the transports carry in the websocket retirement note The retirement note for the deleted `FilterOperator` / `EventFilterCondition` / `EventFilterSchema` vocabulary said the subscription shape the transports actually carry is the `filters: z.unknown()` on `SubscriptionEventSchema` (`api/realtime.zod.ts`). Measured, no transport parses that schema at all: the shipped subscription path carries a plain TS interface one directory over, `contracts/realtime-service.ts#RealtimeSubscriptionOptions`, whose `object` and `eventTypes` are the only two fields `matchesSubscription` reads. Only the sentence's second half moves. Its first half — `matchesSubscription` matches on object name and event type only — was already exact. `SubscriptionEventSchema.filters` keeps its place in the note as the sibling declaration of the same unenforced kind, which is what it is; it is simply no longer described as a shape anything transports. The correction uses a symbol anchor rather than a bare name, because the whole point of the sentence is which of four same-ish spellings is meant, and rather than a line number, because prose citations by line rot. No key, type, export or tombstone is touched, and no behaviour changes. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016N6xmWt5hYm94ffVEwGH8x * chore(changeset): patch @objectstack/spec for the websocket retirement-note correction Both halves of the publish test say yes, so this is not a `skip-changeset`: the changed path matches `src/**/*.zod.ts` in the package's `files[]`, and the changed text is byte-present in the packed tarball. Measured on the real `npm pack` output with controls — a `.describe()` from the same file reaches `src` + `dist` + `json-schema` (7 files), a string unique to a sibling `*.test.ts` reaches none, and this `//` comment reaches exactly the shipped source file. `src/**/*.zod.ts` is the tree that decides it. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016N6xmWt5hYm94ffVEwGH8x --------- Co-authored-by: Claude <noreply@anthropic.com>
1 parent eda26ce commit 8fd246d

2 files changed

Lines changed: 21 additions & 3 deletions

File tree

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
---
2+
"@objectstack/spec": patch
3+
---
4+
5+
`websocket.zod.ts`'s retirement note now names the subscription shape the transports actually carry.
6+
7+
The note recording the deletion of the `FilterOperator` / `EventFilterCondition` / `EventFilterSchema` vocabulary stated, as a positive fact, that "the subscription shape the transports actually carry" is the deliberately unvalidated `filters: z.unknown()` on `SubscriptionEventSchema` (`api/realtime.zod.ts`). Measured, no transport parses that schema at all — nothing outside `packages/spec` imports it — so the sentence read as evidence that the schema *has* a consumer, and it was the only prose in the repo connecting the two.
8+
9+
The shipped subscription path carries a plain TypeScript interface one directory over: `contracts/realtime-service.ts#RealtimeSubscriptionOptions`, whose `object` and `eventTypes` are the only two fields `matchesSubscription` (`service-realtime/src/in-memory-realtime-adapter.ts`) reads.
10+
11+
- **Only the sentence's second half moved.** Its first half — `matchesSubscription` matches on object name and event type only — was already exact, and is untouched.
12+
- **`SubscriptionEventSchema.filters` keeps its place in the note**, as the sibling declaration of the same unenforced kind. That is what it is; it is simply no longer described as a shape anything transports.
13+
- **The correction anchors on a symbol** — not a bare name, and not a line number. Four same-ish spellings of a realtime subscription exist and only one is executed, so a bare name would re-plant the ambiguity the sentence exists to remove, and a line-number citation would rot out of date.
14+
15+
**What moves for consumers.** Comment text only, and it is genuinely shipped: `@objectstack/spec` publishes `src/**/*.zod.ts`, so `src/api/websocket.zod.ts` reaches the npm tarball verbatim, comments included. Nothing else moves — no key, type, export, tombstone or accept set, no `.describe()` string, and no generated artifact.

‎packages/spec/src/api/websocket.zod.ts‎

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,12 @@ export type WebSocketMessageType = z.input<typeof WebSocketMessageType>;
6161
// Nothing imported any of it — not this repo, not objectui, not cloud — and no
6262
// runtime ever evaluated an event filter: `matchesSubscription` matches on
6363
// object name and event type only (see `contracts/realtime-service.ts`), and the
64-
// subscription shape the transports actually carry is the separate, deliberately
65-
// unvalidated `filters: z.unknown()` on `SubscriptionEventSchema`
66-
// (`api/realtime.zod.ts`).
64+
// subscription shape the transports actually carry is a plain TS interface one
65+
// directory over — `contracts/realtime-service.ts#RealtimeSubscriptionOptions`,
66+
// whose `object` and `eventTypes` are the only two fields that predicate reads.
67+
// The separate, deliberately unvalidated `filters: z.unknown()` on
68+
// `SubscriptionEventSchema` (`api/realtime.zod.ts`) is a sibling declaration of
69+
// the same unenforced kind, not a shape any transport carries.
6770
//
6871
// So this was a *second* spelling of event filtering, disagreeing with both the
6972
// live one and with `VALID_AST_OPERATORS`, and it described a capability no code

0 commit comments

Comments
 (0)