@pgxsinkit/client 0.1.46 → 0.1.48

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.
@@ -15,7 +15,7 @@ import type { SyncTableRegistry } from "@pgxsinkit/contracts";
15
15
  * objects that emit the SQL (`getTableConfig`/`getViewConfig`), so a token matches emission by
16
16
  * construction — schema and all. See "Known limitations" in ADR-0021 for the residual edges.
17
17
  */
18
- /** Static index of a registry's lazy relations and the exact quoted tokens their reads compile to. */
18
+ /** Static index of a registry's synced relations and the exact quoted tokens their reads compile to. */
19
19
  export interface LazyGuardIndex {
20
20
  /** Registry keys whose subscription timing is `lazy`. */
21
21
  readonly lazyKeys: ReadonlySet<string>;
@@ -27,6 +27,18 @@ export interface LazyGuardIndex {
27
27
  * token collision-proof against bare aliases/CTEs.
28
28
  */
29
29
  readonly lazyTokens: ReadonlyMap<string, readonly string[]>;
30
+ /**
31
+ * EVERY synced relation key (eager AND lazy). {@link lazyKeys} is a subset. Drives the hydration
32
+ * guarantee (ADR-0021/0032): a live subscription must gate `hydrating` on every consistency group it
33
+ * reads, not only the lazy ones — an eager group can still be catching up on a cold boot.
34
+ */
35
+ readonly allKeys: ReadonlySet<string>;
36
+ /**
37
+ * Per synced key (eager AND lazy), the exact quoted reference token(s) its reads compile to — the same
38
+ * token rules as {@link lazyTokens}, just spanning every subscription timing. {@link lazyTokens} is a
39
+ * subset restricted to the lazy keys (activation stays lazy-only; hydration spans all).
40
+ */
41
+ readonly allTokens: ReadonlyMap<string, readonly string[]>;
30
42
  }
31
43
  /** Build the {@link LazyGuardIndex} for a registry. Cheap and pure — cache it per client. */
32
44
  export declare function buildLazyGuardIndex(registry: SyncTableRegistry): LazyGuardIndex;
@@ -38,6 +50,13 @@ export declare function buildLazyGuardIndex(registry: SyncTableRegistry): LazyGu
38
50
  * aliased and so needs no such guard.
39
51
  */
40
52
  export declare function findReferencedLazyKeysInSql(sql: string, index: LazyGuardIndex): Set<string>;
53
+ /**
54
+ * The compiled-SQL scan across EVERY synced relation (eager AND lazy): the registry keys whose quoted
55
+ * reference token appears in `sql`. Same exact-token matching as {@link findReferencedLazyKeysInSql}, just
56
+ * over {@link LazyGuardIndex.allTokens}. Drives the hydration guarantee — the caller maps each key to its
57
+ * consistency group and gates a live subscription's `hydrating` on every group still catching up.
58
+ */
59
+ export declare function findReferencedSyncedKeysInSql(sql: string, index: LazyGuardIndex): Set<string>;
41
60
  /**
42
61
  * The activation backstop (ADR-0021): throw if a query references a lazy relation that is still not
43
62
  * active. Called *after* the referenced lazy relations have been activated, so in the normal path every
@@ -1 +1 @@
1
- {"version":3,"file":"lazy-guard.d.ts","sourceRoot":"","sources":["../src/lazy-guard.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAE9D;;;;;;;;;;;;;;;GAeG;AAEH,sGAAsG;AACtG,MAAM,WAAW,cAAc;IAC7B,yDAAyD;IACzD,QAAQ,CAAC,QAAQ,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IACvC;;;;;;OAMG;IACH,QAAQ,CAAC,UAAU,EAAE,WAAW,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC,CAAC;CAC7D;AAED,6FAA6F;AAC7F,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,iBAAiB,GAAG,cAAc,CAgC/E;AAOD;;;;;;GAMG;AACH,wBAAgB,2BAA2B,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,cAAc,GAAG,GAAG,CAAC,MAAM,CAAC,CAM3F;AAaD;;;;;;GAMG;AACH,wBAAgB,uBAAuB,CAAC,IAAI,EAAE;IAC5C,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,cAAc,CAAC;IACtB,QAAQ,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC;CACpC,GAAG,IAAI,CAIP;AAED,uHAAuH;AACvH,qBAAa,6BAA8B,SAAQ,K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AAI,CAIP;AAED,uHAAuH;AACvH,qBAAa,6BAA8B,SAAQ,KAAK;IACtD,8EAA8E;IAC9E,QAAQ,CAAC,SAAS,EAAE,SAAS,MAAM,EAAE,CAAC;IAEtC,YAAY,SAAS,EAAE,SAAS,MAAM,EAAE,EAUvC;CACF"}
@@ -104,6 +104,16 @@ export interface CreateMutationRuntimeOptions<TRegistry extends SyncTableRegistr
104
104
  * surfaces the typed reason (e.g. "full") rather than a resolve/diff UI. Never silent.
105
105
  */
106
106
  onReject?: (rejected: MutationDetail[]) => void | Promise<void>;
107
+ /**
108
+ * Invoked once per enqueue with the DISTINCT non-blind table keys of the planned batch (ADR-0039).
109
+ * An ordinary optimistic `create`/`update`/`delete` is a reference to its target, and a reference
110
+ * activates the target's lazy consistency group — the read path does this implicitly, the write path
111
+ * did not. The client wires this to a fire-and-forget `ensureSynced`, so the group is open by the time
112
+ * the echo returns. Purely-blind batches (only `updateBlind`) report nothing: a blind write is the
113
+ * deliberate no-echo, no-activation write-only exception. Fire-and-forget from the runtime's view —
114
+ * never awaited, and a throw here must never fail the enqueue (the runtime guards the call).
115
+ */
116
+ onOrdinaryEnqueue?: (tables: readonly string[]) => void;
107
117
  }
108
118
  export interface MutationRuntime<TRegistry extends SyncTableRegistry> {
109
119
  /** The registry fingerprint (ADR-0004) this runtime stamps onto enqueued mutations. */
@@ -1 +1 @@
1
- {"version":3,"file":"mutation.d.ts","sourceRoot":"","sources":["../src/mutation.ts"],"names":[],"mappings":"AA0EA,OAAO,KAAK,EAEV,WAAW,EACX,mBAAmB,EAEnB,oBAAoB,EAEpB,aAAa,EACb,eAAe,EACf,iBAAiB,EACjB,oBAAoB,EACpB,SAAS,EACV,MAAM,sBAAsB,CAAC;AAa9B,OAAO,EAIL,KAAK,cAAc,EACpB,MAAM,kBAAkB,CAAC;AAE1B,YAAY,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACvD,MAAM,MAAM,YAAY,GAAG,QAAQ,GAAG,QAAQ,GAAG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AM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACxC,+GAA+G;IAC/G,mBAAmB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC7C,wGAAwG;IACxG,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB;;;OAGG;IACH,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B;;;;;OAKG;IACH,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,4GAA4G;IAC5G,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,0EAA0E;IAC1E,KAAK,CAAC,EAAE,WAAW,CAAC;IACpB;;;;;OAKG;IACH,gBAAgB,CAAC,EAAE,uBAAuB,CAAC,SAAS,CAAC,CAAC,kBAAkB,CAAC,CAAC;IAC1E,oHAAoH;IACpH,cAAc,CAAC,EAAE,uBAAuB,CAAC,SAAS,CAAC,CAAC,gBAAgB,CAAC,CAAC;CACvE;AAED,qFAAqF;AACrF,MAAM,WAAW,cAAc,CAAC,SAAS,SAAS,iBAAiB;IACjE,8GAA8G;IAC9G,OAAO,EAAE,CAAC,IAAI,EAAE,UAAU,KAAK,IAAI,CAAC;IACpC,uGAAuG;IACvG,UAAU,EAAE,MAAM,OAAO,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC,CAAC;IACjD,kGAAkG;IAClG,KAAK,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CAC5B;AAOD;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,CAAC,SAAS,SAAS,iBAAiB,EACxE,OAAO,EAAE,uBAAuB,CAAC,SAAS,CAAC,GAC1C,cAAc,CAAC,SAAS,CAAC,CA6mB3B"}
@@ -240,18 +240,26 @@ export interface LiveInitialPayload {
240
240
  queryId: string;
241
241
  rows: Record<string, unknown>[];
242
242
  /**
243
- * The `lazy` relations the worker's guard activated for this query (ADR-0021). Streams are started but
244
- * the initial catch-up may still be in flight when this snapshot is taken — the tab awaits its
245
- * `groupReady` per key (fed by the worker's `groupReady` broadcasts) to know the rows are complete.
243
+ * The `lazy` relations the worker's guard activated for this query (ADR-0021) — the relations held out
244
+ * of the eager boot set. Observability only: {@link hydratingTables}, not this, drives the tab's
245
+ * `hydrated` promise.
246
246
  */
247
247
  lazyTables?: string[];
248
+ /**
249
+ * The referenced consistency groups' member tables (eager OR lazy) that were NOT YET caught up when this
250
+ * snapshot was taken (ADR-0021 / ADR-0032). Non-empty → the tab builds a `hydrated` promise the worker
251
+ * settles via `live-hydrated` (posted after the catch-up rows on this same port). Absent → every
252
+ * referenced group was already ready (steady state) or sync is disabled: nothing to hydrate.
253
+ */
254
+ hydratingTables?: string[];
248
255
  }
249
256
  /**
250
257
  * worker → tab: the subscription's lazy relations have completed their initial catch-up AND the live
251
258
  * query has been refreshed against the caught-up store (ADR-0021). Posted on the SAME port as the
252
259
  * live-diff stream, strictly after the refresh-triggered diff — so when the tab sees this, the rows
253
260
  * reflecting the catch-up have already been delivered. Resolves the tab subscription's `hydrated`
254
- * promise (the React hooks' `hydrating` gate); never sent for a query with no lazy relations.
261
+ * promise (the React hooks' `hydrating` gate); never sent for a query with no pending groups (steady
262
+ * state / sync disabled), i.e. an empty `live-initial` {@link LiveInitialPayload.hydratingTables}.
255
263
  */
256
264
  export interface LiveHydratedPayload {
257
265
  queryId: string;
@@ -1 +1 @@
1
- {"version":3,"file":"protocol.d.ts","sourceRoot":"","sources":["../../src/worker/protocol.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAE9D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAEpD,eAAO,MAAM,cAAc,EAAG,kBAA2B,CAAC;AAC1D,eAAO,MAAM,uBAAuB,EAAG,C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,UAAU,EAChB,KAAK,EAAE,WAAW,EAClB,IAAI,EAAE,iBAAiB,EACvB,OAAO,EAAE,OAAO,EAChB,EAAE,CAAC,EAAE,MAAM,EACX,QAAQ,CAAC,EAAE,kBAAkB,EAAE,GAC9B,IAAI,CAQN"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pgxsinkit/client",
3
- "version": "0.1.46",
3
+ "version": "0.1.48",
4
4
  "keywords": [
5
5
  "tanstack-intent"
6
6
  ],
@@ -36,7 +36,7 @@
36
36
  "@electric-sql/client": "^1.5.24",
37
37
  "@electric-sql/experimental": "^6.0.24",
38
38
  "@electric-sql/pglite-tools": "0.4.4",
39
- "@pgxsinkit/contracts": "0.1.46"
39
+ "@pgxsinkit/contracts": "0.1.48"
40
40
  },
41
41
  "peerDependencies": {
42
42
  "@electric-sql/pglite": "0.5.4",
@@ -6,13 +6,14 @@ description: >-
6
6
  API -> Postgres write path. Teaches the mental model the source does not make obvious: the two paths
7
7
  are separate and asymmetric, there is exactly one write path (an in-database apply function, not
8
8
  per-table CRUD), the Electric subquery flag is mandatory and fails closed, local PGlite schema is not
9
- full DDL parity, and writable tables must declare a conflict policy plus managed fields. Load this
10
- before wiring sync, defining a registry, or debugging "writes don't appear" / "no rows stream" / "a
11
- removed member still sees rows".
9
+ full DDL parity, writable tables must declare a conflict policy plus managed fields, ordinary writes
10
+ self-activate their lazy group, and authenticated groups must not activate before claims exist. Load
11
+ this before wiring sync, defining a registry, or debugging "writes don't appear" / "an acked write stays
12
+ pending" / "no rows stream" / "a removed member still sees rows".
12
13
  metadata:
13
14
  type: core
14
15
  library: "@pgxsinkit/client"
15
- library_version: "0.1.46"
16
+ library_version: "0.1.48"
16
17
  source: https://pgxsinkit.github.io/llms-full.txt
17
18
  ---
18
19
 
@@ -65,6 +66,23 @@ the callback, reach relations through a directly-imported synced table/view obje
65
66
  first-row-or-null variants. (Reactive equivalents: `useLiveDrizzleRows` for pure reads,
66
67
  `useLiveQueryRaw({ use, build })` for raw fragments.)
67
68
 
69
+ **Auth-gated lazy groups.** A query that references one lazy relation activates its **whole consistency
70
+ group** with the claims available to that shape request. If the row filter returns `DENY_ALL` without a
71
+ user claim, do not let an authenticated-only query run while auth is unresolved: gate it (`ready: false`
72
+ in the React hooks) until the session exists. Making the group eager is not an equivalent fix — it can
73
+ open the same anonymous subscription during boot. A later auth notification can rotate/refetch the shape,
74
+ but the intended path is to activate it once with the correct claims. Activating a claims-denied group
75
+ with no auth token now emits a `console.warn` naming the group, so an accidental anonymous activation is
76
+ visible rather than silent.
77
+
78
+ Writes self-activate. An ordinary optimistic create/update/delete on a lazy `readwrite` entry activates
79
+ its group automatically at enqueue (a write is a reference, and a reference activates), so the Postgres
80
+ commit can echo through Electric and retire the acknowledged journal row — no manual activator query is
81
+ needed. Because that activation uses the claims available when the write runs, an authenticated-only group
82
+ still should not be written before the session exists (gate the write on auth, same as a read).
83
+ `updateBlind` is the deliberate exception: it has no overlay, does not activate its group, and retires on
84
+ the authoritative ack without an echo.
85
+
68
86
  **Lint the split.** `@pgxsinkit/client` ships an oxlint rule via its `./oxlint` subpath export. Enable it
69
87
  in the consuming repo's `.oxlintrc.jsonc` — `"jsPlugins": ["@pgxsinkit/client/oxlint"]` +
70
88
  `"pgxsinkit/guarded-query-purity": "error"` — to catch a raw ``sql`…` `` fragment on the pure path and a
@@ -183,6 +201,9 @@ constraint that holds server-side also holds in PGlite.
183
201
  - Writing directly to Postgres tables / building per-table CRUD instead of using the one write path.
184
202
  - Reading a **readwrite** entry from its base `.table` instead of its `.view` overlay, so your own
185
203
  optimistic writes do not appear locally until they round-trip through Postgres.
204
+ - Activating an authenticated lazy group before auth resolves — reading OR writing while claims are
205
+ unresolved activates the group against anonymous claims (now flagged by a console warning), leaving the
206
+ shape empty until a later rotation/refetch.
186
207
  - Assuming PGlite enforces every Postgres constraint.
187
208
  - Assuming a revoked member keeps their synced rows offline — membership changes converge both ways,
188
209
  live and on resume.
@@ -13,7 +13,7 @@ description: >-
13
13
  metadata:
14
14
  type: task
15
15
  library: "@pgxsinkit/client"
16
- library_version: "0.1.46"
16
+ library_version: "0.1.48"
17
17
  source: https://pgxsinkit.github.io/start/operating-in-production/
18
18
  ---
19
19
 
package/src/index.ts CHANGED
@@ -19,7 +19,7 @@ import type {
19
19
  SyncTableUpdateInput,
20
20
  WriteMode,
21
21
  } from "@pgxsinkit/contracts";
22
- import { fingerprintRegistry, getSyncRegistrySchema } from "@pgxsinkit/contracts";
22
+ import { fingerprintRegistry, getSyncRegistrySchema, isClaimsDependentRowFilter } from "@pgxsinkit/contracts";
23
23
 
24
24
  import { type BootReport, type BootReportBuilder, createBootReportBuilder } from "./boot-report";
25
25
  import { type ConvergenceDriver, type ConvergenceTrigger, createConvergenceDriver } from "./convergence";
@@ -27,7 +27,12 @@ import { syncDebug, timeAsync } from "./debug";
27
27
  import { type DataExportOptions, type DataExportResult, performDataExport } from "./export-data";
28
28
  import { type DiagnosticExportOptions, type DiagnosticExportResult, performDiagnosticExport } from "./export-dump";
29
29
  import { performStoreExport, type StoreExportOptions, type StoreExportResult } from "./export-store";
30
- import { assertLazyRefsActivated, buildLazyGuardIndex, findReferencedLazyKeysInSql } from "./lazy-guard";
30
+ import {
31
+ assertLazyRefsActivated,
32
+ buildLazyGuardIndex,
33
+ findReferencedLazyKeysInSql,
34
+ findReferencedSyncedKeysInSql,
35
+ } from "./lazy-guard";
31
36
  import { createLifecycleSlot } from "./lifecycle-slot";
32
37
  import { wrapLiveQueryForMaterialization } from "./live-rows-sql";
33
38
  import {
@@ -169,6 +174,7 @@ export {
169
174
  assertLazyRefsActivated,
170
175
  buildLazyGuardIndex,
171
176
  findReferencedLazyKeysInSql,
177
+ findReferencedSyncedKeysInSql,
172
178
  type LazyGuardIndex,
173
179
  LazyRelationNotActivatedError,
174
180
  } from "./lazy-guard";
@@ -616,18 +622,20 @@ export interface LiveRowsSubscription<TRow> {
616
622
  initialRows: TRow[];
617
623
  unsubscribe: () => void;
618
624
  /**
619
- * The `lazy` relations the query reads (the guard's scan). Activation (stream start) completed before
620
- * the subscription registered, but the initial CATCH-UP may still be in flight — `initialRows` can be
621
- * legitimately empty until it lands. Await {@link hydrated} for completion.
625
+ * The `lazy` relations the query reads (the guard's scan) — the relations held out of the eager boot
626
+ * set. Activation (stream start) completed before the subscription registered. Informational only:
627
+ * {@link hydrated} — not this — reflects catch-up completion, and it now spans eager groups too.
622
628
  */
623
629
  lazyTables?: readonly string[];
624
630
  /**
625
- * Present only when the query reads `lazy` relations: resolves once their initial catch-up has
626
- * completed AND this subscription has already delivered rows reflecting it (the seam refreshes the
627
- * live query after catch-up, then resolves — rows-before-signal is guaranteed, so flipping a UI out
628
- * of its loading state on this promise can never flash a false "empty"). Absent for an eager-only
629
- * query (nothing to await). Offline note: stays pending until the catch-up truly completes — gate
630
- * empty-state COPY on it, not data access (rows flow regardless).
631
+ * Present when the query reads ANY consistency group (eager OR lazy) that was NOT YET caught up at
632
+ * subscribe time: resolves once every such group has completed its initial catch-up AND this
633
+ * subscription has already delivered rows reflecting it (the seam refreshes the live query after
634
+ * catch-up, then resolves — rows-before-signal is guaranteed, so flipping a UI out of its loading state
635
+ * on this promise can never flash a false "empty"). Absent when every referenced group is already ready
636
+ * at subscribe time (the steady-state fast path — no extra refresh) or sync is disabled. Offline note:
637
+ * stays pending until the catch-up truly completes — gate empty-state COPY on it, not data access (rows
638
+ * flow regardless).
631
639
  */
632
640
  hydrated?: Promise<void>;
633
641
  }
@@ -637,9 +645,14 @@ export interface LiveRowsSubscription<TRow> {
637
645
  * (∪ the explicit `use`) and activated. Activation means the group's STREAM IS STARTED — reads are
638
646
  * safe from the tripwire — not that its initial catch-up has completed; await
639
647
  * {@link SyncClient.groupReady} per key for that (see ADR-0021 / ADR-0032 decision 6).
648
+ *
649
+ * Parameterized by the TABLE-NAME UNION, not the registry: `keyof TRegistry` in an output position
650
+ * would make the registry parameter contravariant, and `SyncClient<ConcreteRegistry>` would stop
651
+ * being assignable to bare-`SyncTableRegistry` supertypes — the erasure pattern consumer seams rely
652
+ * on. A name union in output position keeps the whole client covariant in its registry.
640
653
  */
641
- export interface PreparedQueryResult<TRegistry extends SyncTableRegistry> {
642
- lazyTables: readonly SyncTableName<TRegistry>[];
654
+ export interface PreparedQueryResult<TTable extends string = string> {
655
+ lazyTables: readonly TTable[];
643
656
  }
644
657
 
645
658
  export interface SyncClient<TRegistry extends SyncTableRegistry> {
@@ -800,7 +813,7 @@ export interface SyncClient<TRegistry extends SyncTableRegistry> {
800
813
  * `query`/`queryRow` are the higher-level non-live wrappers. Raw, non-Drizzle SQL is out of scope —
801
814
  * pass `use`, or `ensureSynced` first.
802
815
  */
803
- prepareQuery: (input: PrepareQueryInput<TRegistry>) => Promise<PreparedQueryResult<TRegistry>>;
816
+ prepareQuery: (input: PrepareQueryInput<TRegistry>) => Promise<PreparedQueryResult<SyncTableName<TRegistry>>>;
804
817
  /**
805
818
  * Author an atomic write-**unit** (ADR-0022 §2). The callback receives collecting table handles; every
806
819
  * mutation it issues is tagged into one unit and enqueued atomically when the callback returns.
@@ -825,6 +838,16 @@ export interface SyncClient<TRegistry extends SyncTableRegistry> {
825
838
  * same readiness as a synchronous snapshot.
826
839
  */
827
840
  groupReady: (table: SyncTableName<TRegistry>) => Promise<void>;
841
+ /**
842
+ * The referenced consistency groups' member tables that are NOT YET caught up at call time (ADR-0021 /
843
+ * ADR-0032 decision 6): scan the compiled SQL for every synced relation the query reads (∪ `use`), map
844
+ * each to its consistency group, and return those whose group has not completed its initial catch-up.
845
+ * Empty when sync is disabled OR every referenced group is already ready — the steady-state fast path in
846
+ * which the live-rows seam builds no `hydrated` promise. The seam (and the worker bridge) use this to gate
847
+ * `hydrating` uniformly across eager AND lazy groups; ACTIVATION is separate and stays lazy-only. Returns
848
+ * plain table-name strings (not `keyof TRegistry`) to keep the client covariant in its registry.
849
+ */
850
+ hydratingTablesFor: (query: { sql: string; use?: readonly string[] }) => readonly string[];
828
851
  /**
829
852
  * The live-rows seam (ADR-0032 S2 §4): register a reactive query and receive its initial ordered
830
853
  * snapshot plus subsequent updates via `onRows`. The React live hooks consume THIS (not `pglite.live`
@@ -1254,10 +1277,16 @@ export async function createSyncClient<const TRegistry extends SyncTableRegistry
1254
1277
  ? { ...(options.requestHeaders ?? {}), ...(options.writeRequestHeaders ?? {}) }
1255
1278
  : undefined;
1256
1279
 
1280
+ // ADR-0039: an ordinary optimistic write activates its target's lazy consistency group (a write is a
1281
+ // reference, and a reference activates — the read path already does this). The runtime reports the
1282
+ // non-blind table keys per enqueue; this indirection is assigned once `ensureSynced`/`lazyGuardIndex`
1283
+ // exist below (a write never fires during boot, so it is a harmless no-op until then).
1284
+ let activateOrdinaryWriteTables: ((tables: readonly string[]) => void) | null = null;
1257
1285
  const mutationRuntime = createMutationRuntime({
1258
1286
  db: pglite,
1259
1287
  registry: options.registry,
1260
1288
  writeUrl: options.writeUrl,
1289
+ onOrdinaryEnqueue: (tables) => activateOrdinaryWriteTables?.(tables),
1261
1290
  ...(options.getAuthToken ? { getAuthToken: options.getAuthToken } : {}),
1262
1291
  ...(writePathHeaders ? { requestHeaders: writePathHeaders } : {}),
1263
1292
  ...(options.maxMutationAttempts != null ? { maxMutationAttempts: options.maxMutationAttempts } : {}),
@@ -1404,6 +1433,58 @@ export async function createSyncClient<const TRegistry extends SyncTableRegistry
1404
1433
  },
1405
1434
  };
1406
1435
 
1436
+ // ─── Anonymous-activation diagnostic (ADR-0039) ────────────────────────────────────────────────
1437
+ // Per group key, whether ANY member's row filter denies (or cannot serve) an unauthenticated caller,
1438
+ // plus its member registry keys (for the warning). The registry is static and the group→member map is
1439
+ // fixed once sync is running, so it is computed once and cached.
1440
+ type GroupClaimsInfo = { claimsDependent: boolean; memberKeys: string[] };
1441
+ let groupClaimsInfoCache: Map<string, GroupClaimsInfo> | null = null;
1442
+ const groupClaimsInfoFor = (activeSync: NonNullable<typeof sync>): Map<string, GroupClaimsInfo> => {
1443
+ if (groupClaimsInfoCache != null) return groupClaimsInfoCache;
1444
+ const map = new Map<string, GroupClaimsInfo>();
1445
+ for (const key of Object.keys(options.registry) as SyncTableName<TRegistry>[]) {
1446
+ const groupKey = activeSync.groupKeyForTable(key as string);
1447
+ if (groupKey == null) continue;
1448
+ const entry = options.registry[key] as SyncTableEntry;
1449
+ const info = map.get(groupKey) ?? { claimsDependent: false, memberKeys: [] };
1450
+ info.memberKeys.push(key as string);
1451
+ if (isClaimsDependentRowFilter(entry.shape?.rowFilter)) info.claimsDependent = true;
1452
+ map.set(groupKey, info);
1453
+ }
1454
+ groupClaimsInfoCache = map;
1455
+ return map;
1456
+ };
1457
+ // One warning per group key, ever (a claims-denied group activated with no token opens an empty
1458
+ // subscription by construction, so repeated activations must not spam).
1459
+ const anonymousActivationWarned = new Set<string>();
1460
+ const warnIfAnonymousClaimsDependentActivation = (activeSync: NonNullable<typeof sync>, groupKey: string) => {
1461
+ if (anonymousActivationWarned.has(groupKey)) return;
1462
+ const info = groupClaimsInfoFor(activeSync).get(groupKey);
1463
+ if (info == null || !info.claimsDependent) return;
1464
+ // Fire-and-forget: activation never blocks or fails on the token probe (a rejected `getAuthToken`
1465
+ // is swallowed into a syncDebug line). The dedupe Set is checked+set synchronously around the warn,
1466
+ // so concurrent activations still emit at most one console.warn.
1467
+ void (async () => {
1468
+ try {
1469
+ const token = options.getAuthToken ? await options.getAuthToken() : undefined;
1470
+ if (token != null && token !== "") return;
1471
+ if (anonymousActivationWarned.has(groupKey)) return;
1472
+ anonymousActivationWarned.add(groupKey);
1473
+ console.warn(
1474
+ `pgxsinkit: activating the lazy group [${info.memberKeys.join(", ")}] with no auth token — its ` +
1475
+ `row filter denies unauthenticated callers, so this opens an empty subscription. Gate the first ` +
1476
+ `query on auth (e.g. the React hooks' \`ready\` option) so the group activates with real claims.`,
1477
+ );
1478
+ syncDebug("anonymous activation of a claims-dependent lazy group", {
1479
+ groupKey,
1480
+ tables: info.memberKeys,
1481
+ });
1482
+ } catch (error) {
1483
+ syncDebug("anonymous-activation auth probe failed", { groupKey, error });
1484
+ }
1485
+ })();
1486
+ };
1487
+
1407
1488
  // ─── Lazy-relation activation + the declared-safe query facade (ADR-0021) ──────────────────────
1408
1489
  const ensureSynced: SyncClient<TRegistry>["ensureSynced"] = async (keys) => {
1409
1490
  const activeSync = sync;
@@ -1411,11 +1492,30 @@ export async function createSyncClient<const TRegistry extends SyncTableRegistry
1411
1492
  const groupKeys = new Set<string>();
1412
1493
  for (const key of keys) {
1413
1494
  const groupKey = activeSync.groupKeyForTable(key);
1414
- if (groupKey != null) groupKeys.add(groupKey);
1495
+ if (groupKey == null) continue;
1496
+ // Diagnostic at the activation choke point (ADR-0039): only for a group not yet started — an
1497
+ // already-active group has already paid (or dodged) this check. Write-triggered activation flows
1498
+ // through here too, so the warning fires for writes as well as reads.
1499
+ if (!activeSync.isTableStarted(key)) {
1500
+ warnIfAnonymousClaimsDependentActivation(activeSync, groupKey);
1501
+ }
1502
+ groupKeys.add(groupKey);
1415
1503
  }
1416
1504
  await Promise.all([...groupKeys].map((groupKey) => activeSync.ensureGroupStarted(groupKey)));
1417
1505
  };
1418
1506
 
1507
+ // ADR-0039: now `ensureSynced` + `lazyGuardIndex` exist, wire the ordinary-write activation. Filter the
1508
+ // reported tables to the lazy ones, then fire-and-forget `ensureSynced` — enqueue never blocks on the
1509
+ // network, and a failed start self-heals on the group's next activation (a `.catch` keeps the rejection
1510
+ // off the unhandled-rejection path).
1511
+ activateOrdinaryWriteTables = (tables) => {
1512
+ const lazyTables = tables.filter((table) => lazyGuardIndex.lazyKeys.has(table)) as SyncTableName<TRegistry>[];
1513
+ if (lazyTables.length === 0) return;
1514
+ void ensureSynced(lazyTables).catch((error) => {
1515
+ syncDebug("write-triggered lazy activation failed", { tables: lazyTables, error });
1516
+ });
1517
+ };
1518
+
1419
1519
  // Per-table catch-up completion (ADR-0032 decision 6) — the body of `client.groupReady`, hoisted so the
1420
1520
  // live-rows seam can also await it when building a subscription's `hydrated` promise.
1421
1521
  const groupReadyForTable = async (table: SyncTableName<TRegistry>): Promise<void> => {
@@ -1427,6 +1527,31 @@ export async function createSyncClient<const TRegistry extends SyncTableRegistry
1427
1527
  await activeSync.groupReady(groupKey);
1428
1528
  };
1429
1529
 
1530
+ // Synchronous peek at a table's consistency-group catch-up (ADR-0032 decision 6) — the counterpart of
1531
+ // `groupReadyForTable`, hoisted so the live-rows seam can compute the STEADY-STATE fast path: when every
1532
+ // referenced group is already ready at subscribe time, no `hydrated` promise is built (no extra refresh).
1533
+ const isGroupReadyForTable = (table: string): boolean => {
1534
+ const activeSync = sync;
1535
+ // Sync disabled → local-only: reads hit whatever is local, so a group is trivially "ready".
1536
+ if (activeSync == null) return true;
1537
+ const groupKey = activeSync.groupKeyForTable(table);
1538
+ // No consistency group (unknown/writeonly) → nothing to await; treat as ready.
1539
+ if (groupKey == null) return true;
1540
+ return activeSync.isGroupReady(groupKey);
1541
+ };
1542
+
1543
+ // The referenced synced tables whose consistency group is NOT YET caught up (ADR-0021/0032): scan the
1544
+ // compiled SQL for every synced relation the query reads (∪ the explicit `use`), then keep only those
1545
+ // whose group is still catching up. Empty when sync is disabled OR every referenced group is already
1546
+ // ready — the steady-state fast path, where the live-rows seam builds no `hydrated` promise. Eager and
1547
+ // lazy groups are treated identically here; only ACTIVATION (elsewhere) stays lazy-only.
1548
+ const hydratingTablesFor = (query: { sql: string; use?: readonly string[] }): string[] => {
1549
+ if (sync == null) return [];
1550
+ const referenced = new Set<string>(query.use ?? []);
1551
+ for (const key of findReferencedSyncedKeysInSql(query.sql, lazyGuardIndex)) referenced.add(key);
1552
+ return [...referenced].filter((table) => !isGroupReadyForTable(table));
1553
+ };
1554
+
1430
1555
  const isSynced: SyncClient<TRegistry>["isSynced"] = (key) => {
1431
1556
  const activeSync = sync;
1432
1557
  // Sync disabled → local-only: reads hit whatever is in the local store, so nothing is "dormant".
@@ -1730,6 +1855,7 @@ export async function createSyncClient<const TRegistry extends SyncTableRegistry
1730
1855
  prepareQuery,
1731
1856
  transaction,
1732
1857
  groupReady: groupReadyForTable,
1858
+ hydratingTablesFor,
1733
1859
  // The live-rows seam over PGlite's own `live` extension (ADR-0032 S2 §4) — the EXACT call the React
1734
1860
  // hooks made inline before the seam existed (`pglite.live.query` → `initialResults.rows` + `subscribe`),
1735
1861
  // so the in-process path is unchanged. `pkColumns` is unused here: PGlite's live query already diffs
@@ -1745,16 +1871,21 @@ export async function createSyncClient<const TRegistry extends SyncTableRegistry
1745
1871
  };
1746
1872
  registered.subscribe(listener);
1747
1873
  let unsubscribed = false;
1748
- // The query's lazy relations (guard scan ∪ `use`; the caller's `prepareQuery` already activated
1749
- // them). When present, build the `hydrated` promise with rows-before-signal ordering: await the
1750
- // groups' catch-up, refresh the live query against the caught-up store (its listener delivers the
1751
- // rows synchronously inside the refresh), THEN resolve — matching the worker bridge's contract.
1874
+ // The query's lazy relations (guard scan ∪ `use`; the caller's `prepareQuery` already activated them)
1875
+ // are surfaced as `lazyTables` for observability — the relations held out of the eager boot set.
1752
1876
  const lazySet = new Set<string>(use ?? []);
1753
1877
  for (const key of findReferencedLazyKeysInSql(sql, lazyGuardIndex)) lazySet.add(key);
1754
1878
  const lazyTables = [...lazySet];
1879
+ // Hydration spans EVERY referenced consistency group (eager AND lazy): the tables whose group is not
1880
+ // yet caught up at subscribe time. Empty (steady state / sync disabled) → NO `hydrated` promise, so a
1881
+ // post-boot subscription pays no extra refresh (exactly today's eager-only behaviour). Otherwise build
1882
+ // `hydrated` with rows-before-signal ordering: await the pending groups' catch-up, refresh the live
1883
+ // query against the caught-up store (its listener delivers the rows synchronously inside the refresh),
1884
+ // THEN resolve — so a UI flipping out of its loading state on this promise can never flash a false empty.
1885
+ const hydratingTables = hydratingTablesFor({ sql, ...(use ? { use } : {}) });
1755
1886
  const hydrated =
1756
- lazyTables.length > 0
1757
- ? Promise.all(lazyTables.map((table) => groupReadyForTable(table as SyncTableName<TRegistry>)))
1887
+ hydratingTables.length > 0
1888
+ ? Promise.all(hydratingTables.map((table) => groupReadyForTable(table as SyncTableName<TRegistry>)))
1758
1889
  .then(async () => {
1759
1890
  if (!unsubscribed) await registered.refresh();
1760
1891
  })