clone

a deno framework for local-first web apps that open instantly, work offline and sync when users choose

fix(schema): move store provisioning to its own @nzip/lofi/schema/store entry

Dami committed 18ab305
The golden journey caught the failure this prevents: the Jazz schema
loader bundles the author's schema module graph — the schema facade
included — and executes it to derive the deployed schema, so
re-exporting the provisioning client from the facade perturbed the
deployed-schema identity and every client got CatalogueWriteDenied.
Provisioning is store lifecycle, not schema authoring; it now ships as
its own export with a matching vendored alias, and the facade carries
a note pinning the constraint.
commit
18ab3058001a45b3ffdfc12aeb67de18fe3c171e
parent
6ac48908535a61ae01fac9321341682a80d9fc65
author
Dami <dami.etoile@gmail.com>
6 files changed, +19 -21
Mdeno.json1+
Mdocs/store-provisioning.md10+++++++---
Mpackage/astro/mod.ts4++++
Mpackage/create_core_test.ts1+
Mpackage/schema/mod.ts14++++----------
Mpackage/schema/store_test.ts10++--------
M deno.json +1 -0
M docs/store-provisioning.md +7 -3
@@ -18,13 +18,17 @@ Two principles govern it:
1818 surface. A flat `s.defineApp` schema has no namespace and therefore may only provision a store it1919 wholly owns.2020 21+Provisioning lives at `@nzip/lofi/schema/store`, deliberately separate from `@nzip/lofi/schema`: the22+schema facade is bundled and executed by the Jazz schema loader when deriving the deployed schema,23+so the authoring surface stays free of the provisioning client.24+2125 ## Classify before you connect2226 2327 With store administration (admin secret, or a provision-scoped ticket URL as `serverUrl` with2428 `adminSecret` omitted):2529 2630 ```ts27-import { readStoreStatus } from "@nzip/lofi/schema";31+import { readStoreStatus } from "@nzip/lofi/schema/store";2832 2933 const status = await readStoreStatus(root, { serverUrl, appId, adminSecret });3034 ```
@@ -33,7 +37,7 @@ Without it — any valid sync ticket may call the node's metadata-only preflight
3337 sync-only client learns `no_schema` before ever attaching sync:3438 3539 ```ts36-import { readTicketStoreStatus } from "@nzip/lofi/schema";40+import { readTicketStoreStatus } from "@nzip/lofi/schema/store";3741 3842 const preflight = await readTicketStoreStatus(ticketUrl);3943 // → { state: "deployed", appId, headHash } | { state: "no_schema", appId }
@@ -54,7 +58,7 @@ attaching sync to a fresh store.
5458 ## Provision5559 5660 ```ts57-import { provisionStore } from "@nzip/lofi/schema";61+import { provisionStore } from "@nzip/lofi/schema/store";5862 import { permissions, root } from "./schema.ts";5963 6064 const result = await provisionStore({
M package/astro/mod.ts +4 -0
M package/create_core_test.ts +1 -0
M package/schema/mod.ts +4 -10
M package/schema/store_test.ts +2 -8