diff --git a/.changeset/websocket-retirement-note-carried-shape.md b/.changeset/websocket-retirement-note-carried-shape.md new file mode 100644 index 0000000000..a4a0d54e13 --- /dev/null +++ b/.changeset/websocket-retirement-note-carried-shape.md @@ -0,0 +1,15 @@ +--- +"@objectstack/spec": patch +--- + +`websocket.zod.ts`'s retirement note now names the subscription shape the transports actually carry. + +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. + +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. + +- **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. +- **`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. +- **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. + +**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. diff --git a/packages/spec/src/api/websocket.zod.ts b/packages/spec/src/api/websocket.zod.ts index ef6005d206..3348dd7674 100644 --- a/packages/spec/src/api/websocket.zod.ts +++ b/packages/spec/src/api/websocket.zod.ts @@ -61,9 +61,12 @@ export type WebSocketMessageType = z.input; // Nothing imported any of it — not this repo, not objectui, not cloud — and no // runtime ever evaluated an event filter: `matchesSubscription` matches on // object name and event type only (see `contracts/realtime-service.ts`), and the -// subscription shape the transports actually carry is the separate, deliberately -// unvalidated `filters: z.unknown()` on `SubscriptionEventSchema` -// (`api/realtime.zod.ts`). +// subscription shape the transports actually carry is a plain TS interface one +// directory over — `contracts/realtime-service.ts#RealtimeSubscriptionOptions`, +// whose `object` and `eventTypes` are the only two fields that predicate reads. +// The separate, deliberately unvalidated `filters: z.unknown()` on +// `SubscriptionEventSchema` (`api/realtime.zod.ts`) is a sibling declaration of +// the same unenforced kind, not a shape any transport carries. // // So this was a *second* spelling of event filtering, disagreeing with both the // live one and with `VALID_AST_OPERATORS`, and it described a capability no code