@aotter/mantle 0.2.0-alpha.5 → 0.2.0-alpha.7
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.
- package/README.md +152 -45
- package/dist/auth/adapter.d.ts +32 -0
- package/dist/auth/adapter.js +285 -0
- package/dist/auth/admin.d.ts +3 -0
- package/dist/auth/admin.js +21 -0
- package/dist/auth/caller.d.ts +86 -0
- package/dist/auth/caller.js +154 -0
- package/dist/auth/hardening.d.ts +24 -0
- package/dist/auth/hardening.js +40 -0
- package/dist/auth/identity.d.ts +121 -0
- package/dist/auth/identity.js +203 -0
- package/dist/auth/oauth.d.ts +31 -0
- package/dist/auth/oauth.js +124 -0
- package/dist/auth/resource-seeds.js +10 -0
- package/dist/auth/routes.d.ts +32 -0
- package/dist/auth/{createAuthRoutes.js → routes.js} +130 -35
- package/dist/build/compiler.d.ts +790 -0
- package/dist/build/compiler.js +6971 -0
- package/dist/{spec → build/spec}/domain/model/ManifestGrammar.d.ts +28 -42
- package/dist/{spec → build/spec}/domain/model/RuntimePlan.d.ts +77 -3
- package/dist/{spec → build/spec}/domain/model/SqlIr.d.ts +35 -6
- package/dist/build/spec/domain/model/UserFields.d.ts +20 -0
- package/dist/{spec → build/spec}/domain/service/PlanFingerprint.d.ts +2 -1
- package/dist/{spec → build/spec}/kernel/diagnostic.d.ts +1 -30
- package/dist/bun/assets.d.ts +2 -0
- package/dist/bun/assets.js +24 -0
- package/dist/domain/adminOrder.js +24 -0
- package/dist/domain/columns.js +55 -0
- package/dist/domain/describe/chunk-ZIQVLA7X.js +363 -0
- package/dist/domain/describe/index.d.ts +58 -0
- package/dist/domain/describe/index.js +115 -0
- package/dist/domain/describe/target-hash.d.ts +8 -0
- package/dist/domain/describe/target-hash.js +12 -0
- package/dist/domain/describe/targets.d.ts +40 -0
- package/dist/domain/entry.js +33 -0
- package/dist/domain/generated-tools.js +17 -0
- package/dist/domain/generation.d.ts +16 -0
- package/dist/domain/generation.js +1 -0
- package/dist/domain/input.js +17 -0
- package/dist/domain/model.js +1 -0
- package/dist/domain/paging.js +204 -0
- package/dist/domain/recipes.js +19 -0
- package/dist/domain/userReferences.js +5 -0
- package/dist/domain/wireScalars.js +47 -0
- package/dist/infrastructure/adminEntries.js +153 -0
- package/dist/infrastructure/adminPaging.js +72 -0
- package/dist/infrastructure/artifacts.js +71 -0
- package/dist/infrastructure/authSchema.js +83 -0
- package/dist/infrastructure/bundle.js +84 -0
- package/dist/infrastructure/cli.js +101 -0
- package/dist/infrastructure/generate.d.ts +14 -0
- package/dist/infrastructure/generate.js +174 -0
- package/dist/infrastructure/generateAuth.d.ts +8 -0
- package/dist/infrastructure/generateAuth.js +17 -0
- package/dist/infrastructure/inputs.js +36 -0
- package/dist/infrastructure/wrangler.js +71 -0
- package/dist/kernel/authorization.d.ts +4 -0
- package/dist/kernel/authorization.js +16 -0
- package/dist/kernel/binds.d.ts +51 -0
- package/dist/kernel/binds.js +45 -0
- package/dist/kernel/caller-identity.d.ts +24 -0
- package/dist/kernel/caller-identity.js +22 -0
- package/dist/kernel/contract-error.d.ts +12 -0
- package/dist/kernel/contract-error.js +14 -0
- package/dist/kernel/contracts.d.ts +139 -0
- package/dist/kernel/contracts.js +92 -0
- package/dist/{spec/domain/service/CloudflareCron.d.ts → kernel/cron.d.ts} +0 -1
- package/dist/{spec/domain/service/CloudflareCron.js → kernel/cron.js} +1 -6
- package/dist/kernel/dialect/common.d.ts +39 -0
- package/dist/kernel/dialect/common.js +6 -0
- package/dist/kernel/dialect/postgres.d.ts +16 -0
- package/dist/kernel/dialect/postgres.js +18 -0
- package/dist/kernel/dialect/sqlite.d.ts +20 -0
- package/dist/kernel/dialect/sqlite.js +34 -0
- package/dist/kernel/driver/bun-sqlite.d.ts +19 -0
- package/dist/kernel/driver/bun-sqlite.js +77 -0
- package/dist/kernel/driver/d1.d.ts +24 -0
- package/dist/kernel/driver/d1.js +22 -0
- package/dist/kernel/driver/postgres.d.ts +25 -0
- package/dist/kernel/driver/postgres.js +95 -0
- package/dist/kernel/driver/transaction-context.d.ts +10 -0
- package/dist/kernel/driver/transaction-context.js +29 -0
- package/dist/kernel/email.d.ts +28 -0
- package/dist/{auth/emailTemplates.js → kernel/email.js} +13 -2
- package/dist/kernel/host-access.d.ts +10 -0
- package/dist/kernel/host-access.js +65 -0
- package/dist/kernel/host-caller.d.ts +38 -0
- package/dist/kernel/host-caller.js +55 -0
- package/dist/kernel/json-body.d.ts +4 -0
- package/dist/kernel/json-body.js +44 -0
- package/dist/kernel/mcp-apps.d.ts +49 -0
- package/dist/kernel/mcp-apps.js +40 -0
- package/dist/kernel/mcp-call.d.ts +5 -0
- package/dist/kernel/mcp-call.js +25 -0
- package/dist/kernel/mcp-handler.js +288 -0
- package/dist/kernel/mcp.d.ts +101 -0
- package/dist/kernel/mcp.js +25 -0
- package/dist/kernel/media.d.ts +27 -0
- package/dist/kernel/media.js +216 -0
- package/dist/kernel/paging.d.ts +55 -0
- package/dist/kernel/paging.js +95 -0
- package/dist/kernel/publishing.d.ts +4 -0
- package/dist/kernel/publishing.js +16 -0
- package/dist/{cloudflare/r2Media.d.ts → kernel/r2-media.d.ts} +4 -5
- package/dist/kernel/r2-media.js +78 -0
- package/dist/kernel/rest-dispatch.js +38 -0
- package/dist/kernel/rest-router.js +63 -0
- package/dist/kernel/rest.d.ts +58 -0
- package/dist/kernel/rest.js +41 -0
- package/dist/kernel/scalars.d.ts +6 -0
- package/dist/kernel/scalars.js +43 -0
- package/dist/kernel/search.js +5 -0
- package/dist/{core/site.d.ts → kernel/site-types.d.ts} +38 -9
- package/dist/kernel/site-types.js +1 -0
- package/dist/kernel/site.d.ts +41 -0
- package/dist/kernel/site.js +32 -0
- package/dist/kernel/store.d.ts +165 -0
- package/dist/kernel/store.js +257 -0
- package/dist/kernel/surface.d.ts +10 -0
- package/dist/kernel/surface.js +19 -0
- package/dist/kernel/sweep.d.ts +17 -0
- package/dist/kernel/sweep.js +27 -0
- package/dist/kernel/translations.d.ts +1 -0
- package/dist/kernel/translations.js +13 -0
- package/dist/kernel/user-caller.d.ts +31 -0
- package/dist/kernel/user-caller.js +67 -0
- package/dist/kernel/user-field-name.js +3 -0
- package/dist/kernel/user-fields.d.ts +34 -0
- package/dist/kernel/user-fields.js +71 -0
- package/dist/kernel/validation.d.ts +15 -0
- package/dist/kernel/validation.js +54 -0
- package/dist/kernel/web-gateway.js +68 -0
- package/dist/kernel/web-head.js +15 -0
- package/dist/kernel/web-response.js +8 -0
- package/dist/kernel/web.d.ts +75 -0
- package/dist/kernel/web.js +155 -0
- package/dist/kernel/where.js +27 -0
- package/dist/testing/index.d.ts +1 -37
- package/dist/testing/index.js +1 -43
- package/dist/usecase/adminBindings.js +142 -0
- package/dist/usecase/adminDescriptors.js +153 -0
- package/dist/usecase/generate.js +164 -0
- package/dist/usecase/handlers.js +21 -0
- package/dist/usecase/mcp-media.js +17 -0
- package/dist/usecase/mcp.js +96 -0
- package/dist/usecase/paging.js +72 -0
- package/dist/usecase/publishing.js +63 -0
- package/dist/usecase/refusals.js +27 -0
- package/dist/usecase/rest.js +54 -0
- package/dist/usecase/search.js +7 -0
- package/dist/usecase/site.js +40 -0
- package/dist/usecase/stores.js +62 -0
- package/dist/usecase/translations.js +78 -0
- package/dist/usecase/ttl.js +20 -0
- package/dist/usecase/validation.js +132 -0
- package/dist/usecase/web.js +22 -0
- package/docs/examples/README.md +31 -16
- package/docs/examples/app-shell/README.md +48 -0
- package/docs/examples/app-shell/package.json +34 -0
- package/docs/examples/app-shell/pnpm-workspace.yaml +8 -0
- package/docs/examples/app-shell/smoke-kit.mjs +100 -0
- package/docs/examples/app-shell/src/admin.ts +10 -0
- package/docs/examples/app-shell/src/auth.ts +55 -0
- package/docs/examples/app-shell/src/handlers.ts +5 -0
- package/docs/examples/app-shell/src/index.ts +4 -0
- package/docs/examples/app-shell/src/routes.ts +13 -0
- package/docs/examples/app-shell/src/schedule.ts +8 -0
- package/docs/examples/app-shell/src/service.ts +70 -0
- package/docs/examples/app-shell/src/sign-in.ts +41 -0
- package/docs/examples/app-shell/src/signup.ts +8 -0
- package/docs/examples/{reference-service → app-shell}/tsconfig.json +2 -1
- package/docs/examples/app-shell/worker-configuration.d.ts +22 -0
- package/docs/examples/app-shell/wrangler.jsonc +61 -0
- package/docs/examples/club-events/README.md +60 -0
- package/docs/examples/club-events/manifests/club-events.yaml +225 -0
- package/docs/examples/club-events/smoke.mjs +121 -0
- package/docs/examples/club-events/src/handlers.ts +25 -0
- package/docs/examples/club-events/src/signup.ts +9 -0
- package/docs/examples/generated-web/README.md +74 -0
- package/docs/examples/generated-web/posts.yaml +38 -0
- package/docs/examples/generated-web/seed.sql +6 -0
- package/docs/examples/generated-web/src/worker.ts +43 -0
- package/docs/examples/generated-web/tsconfig.json +8 -0
- package/docs/examples/generated-web/wrangler.jsonc +7 -0
- package/docs/examples/purchasing/.dev.vars.example +6 -0
- package/docs/examples/purchasing/README.md +90 -0
- package/docs/examples/purchasing/manifests/purchasing.yaml +341 -0
- package/docs/examples/purchasing/seed.sql +4 -0
- package/docs/examples/purchasing/smoke.mjs +171 -0
- package/docs/examples/purchasing/src/admin.ts +12 -0
- package/docs/examples/purchasing/src/handlers.ts +33 -0
- package/docs/examples/purchasing/src/notify.ts +29 -0
- package/docs/examples/purchasing/src/requests-page.ts +57 -0
- package/docs/examples/purchasing/src/routes.ts +53 -0
- package/docs/examples/purchasing/src/schedule.ts +31 -0
- package/docs/examples/purchasing/src/signup.ts +5 -0
- package/docs/examples/purchasing/src/supplier.ts +32 -0
- package/docs/examples/purchasing/wrangler.jsonc +68 -0
- package/docs/examples/recipes/README.md +58 -0
- package/docs/examples/recipes/manifests/recipes.yaml +75 -0
- package/docs/examples/recipes/smoke.mjs +102 -0
- package/docs/examples/recipes/src/media.ts +13 -0
- package/docs/examples/recipes/src/pages.ts +99 -0
- package/docs/examples/recipes/src/routes.ts +71 -0
- package/docs/examples/recipes/src/site-config.ts +12 -0
- package/docs/examples/recipes/wrangler.jsonc +73 -0
- package/docs/handbook/cloudflare/authentication.md +142 -212
- package/docs/handbook/cloudflare/chatgpt-sites.md +4 -113
- package/docs/handbook/cloudflare/deploy-and-operate.md +20 -103
- package/docs/handbook/cloudflare/media-r2.md +62 -133
- package/docs/handbook/cloudflare/service-entry.md +180 -116
- package/docs/handbook/concepts/authorization.md +10 -123
- package/docs/handbook/concepts/four-atoms.md +9 -92
- package/docs/handbook/concepts/lifecycle-and-locales.md +9 -80
- package/docs/handbook/concepts/mcp-and-agents.md +10 -141
- package/docs/handbook/concepts/procedures-and-triggers.md +5 -162
- package/docs/handbook/concepts/runtime-and-adapters.md +15 -183
- package/docs/handbook/concepts/views.md +10 -109
- package/docs/handbook/examples/hub.md +2 -18
- package/docs/handbook/guides/adapter-guide.md +11 -0
- package/docs/handbook/guides/admin-extensions.md +20 -0
- package/docs/handbook/guides/admin-ui.md +5 -163
- package/docs/handbook/guides/agent-setup.md +5 -18
- package/docs/handbook/guides/email.md +86 -0
- package/docs/handbook/guides/mcp-apps.md +44 -0
- package/docs/handbook/guides/native-admin.md +298 -0
- package/docs/handbook/guides/native-execution.md +132 -0
- package/docs/handbook/guides/oauth.md +105 -0
- package/docs/handbook/guides/postgres-adapters.md +56 -0
- package/docs/handbook/guides/public-pages.md +53 -0
- package/docs/handbook/guides/size-and-startup.md +9 -0
- package/docs/handbook/guides/typed-queries.md +39 -102
- package/docs/handbook/navigation.json +164 -30
- package/docs/handbook/reference/admin-descriptors.md +88 -0
- package/docs/handbook/reference/authorization.md +44 -52
- package/docs/handbook/reference/describe.md +56 -0
- package/docs/handbook/reference/diagnostics.md +15 -78
- package/docs/handbook/reference/features.md +45 -53
- package/docs/handbook/reference/manifest.md +6 -69
- package/docs/handbook/reference/procedure.md +9 -117
- package/docs/handbook/reference/schema.md +65 -172
- package/docs/handbook/reference/site-config.md +5 -65
- package/docs/handbook/reference/surface.md +279 -93
- package/docs/handbook/reference/trigger.md +24 -93
- package/docs/handbook/reference/view.md +32 -158
- package/docs/handbook/releases/index.md +124 -15
- package/docs/handbook/start/overview.md +9 -56
- package/docs/handbook/start/project-and-cli.md +40 -141
- package/docs/handbook/start/quickstart-worker.md +38 -116
- package/docs/skills/develop/SKILL.md +34 -117
- package/docs/skills/develop/mcp-app.md +37 -77
- package/docs/skills/integrate/SKILL.md +42 -84
- package/docs/skills/media-gc/SKILL.md +14 -3
- package/docs/skills/provision/SKILL.md +25 -88
- package/docs/skills/update/SKILL.md +19 -40
- package/docs/source/scripts/postgres-adapter.ts +101 -0
- package/docs/upgrade-0.1-to-0.2.md +26 -10
- package/package.json +97 -112
- package/skills/.keep +0 -0
- package/skills/README.md +72 -0
- package/skills/mantle/SKILL.md +135 -0
- package/skills/mantle/references/local-testing.md +11 -0
- package/skills/mantle/references/web.md +41 -0
- package/skills/mantle/references/website.md +47 -0
- package/dist/admin/consent.d.ts +0 -17
- package/dist/admin/consent.d.ts.map +0 -1
- package/dist/admin/consent.js +0 -17
- package/dist/admin/consent.js.map +0 -1
- package/dist/admin/createAdminSurface.d.ts +0 -22
- package/dist/admin/createAdminSurface.d.ts.map +0 -1
- package/dist/admin/createAdminSurface.js +0 -592
- package/dist/admin/createAdminSurface.js.map +0 -1
- package/dist/admin/design.d.ts +0 -7
- package/dist/admin/design.d.ts.map +0 -1
- package/dist/admin/design.js +0 -18
- package/dist/admin/design.js.map +0 -1
- package/dist/admin/developerConsole.d.ts +0 -267
- package/dist/admin/developerConsole.d.ts.map +0 -1
- package/dist/admin/developerConsole.js +0 -136
- package/dist/admin/developerConsole.js.map +0 -1
- package/dist/admin/identity.d.ts +0 -62
- package/dist/admin/identity.d.ts.map +0 -1
- package/dist/admin/identity.js +0 -7
- package/dist/admin/identity.js.map +0 -1
- package/dist/admin/index.d.ts +0 -6
- package/dist/admin/index.d.ts.map +0 -1
- package/dist/admin/index.js +0 -6
- package/dist/admin/index.js.map +0 -1
- package/dist/admin/procedureFlow.d.ts +0 -38
- package/dist/admin/procedureFlow.d.ts.map +0 -1
- package/dist/admin/procedureFlow.js +0 -188
- package/dist/admin/procedureFlow.js.map +0 -1
- package/dist/auth/ConsoleEmailSender.d.ts +0 -15
- package/dist/auth/ConsoleEmailSender.d.ts.map +0 -1
- package/dist/auth/ConsoleEmailSender.js +0 -19
- package/dist/auth/ConsoleEmailSender.js.map +0 -1
- package/dist/auth/appleClientSecret.d.ts +0 -75
- package/dist/auth/appleClientSecret.d.ts.map +0 -1
- package/dist/auth/appleClientSecret.js +0 -116
- package/dist/auth/appleClientSecret.js.map +0 -1
- package/dist/auth/buildAuth.d.ts +0 -4566
- package/dist/auth/buildAuth.d.ts.map +0 -1
- package/dist/auth/buildAuth.js +0 -311
- package/dist/auth/buildAuth.js.map +0 -1
- package/dist/auth/callerResolver.d.ts +0 -48
- package/dist/auth/callerResolver.d.ts.map +0 -1
- package/dist/auth/callerResolver.js +0 -49
- package/dist/auth/callerResolver.js.map +0 -1
- package/dist/auth/createAuthRoutes.d.ts +0 -22
- package/dist/auth/createAuthRoutes.d.ts.map +0 -1
- package/dist/auth/createAuthRoutes.js.map +0 -1
- package/dist/auth/createMantleAuth.d.ts +0 -3
- package/dist/auth/createMantleAuth.d.ts.map +0 -1
- package/dist/auth/createMantleAuth.js +0 -503
- package/dist/auth/createMantleAuth.js.map +0 -1
- package/dist/auth/db.d.ts +0 -17
- package/dist/auth/db.d.ts.map +0 -1
- package/dist/auth/db.js +0 -24
- package/dist/auth/db.js.map +0 -1
- package/dist/auth/emailTemplates.d.ts +0 -7
- package/dist/auth/emailTemplates.d.ts.map +0 -1
- package/dist/auth/emailTemplates.js.map +0 -1
- package/dist/auth/index.d.ts +0 -9
- package/dist/auth/index.d.ts.map +0 -1
- package/dist/auth/index.js +0 -7
- package/dist/auth/index.js.map +0 -1
- package/dist/auth/methods.d.ts +0 -717
- package/dist/auth/methods.d.ts.map +0 -1
- package/dist/auth/methods.js +0 -321
- package/dist/auth/methods.js.map +0 -1
- package/dist/auth/oauthTokens.d.ts +0 -24
- package/dist/auth/oauthTokens.d.ts.map +0 -1
- package/dist/auth/oauthTokens.js +0 -146
- package/dist/auth/oauthTokens.js.map +0 -1
- package/dist/auth/setupIncomplete.d.ts +0 -16
- package/dist/auth/setupIncomplete.d.ts.map +0 -1
- package/dist/auth/setupIncomplete.js +0 -50
- package/dist/auth/setupIncomplete.js.map +0 -1
- package/dist/auth/types.d.ts +0 -440
- package/dist/auth/types.d.ts.map +0 -1
- package/dist/auth/types.js +0 -10
- package/dist/auth/types.js.map +0 -1
- package/dist/bun/index.d.ts +0 -65
- package/dist/bun/index.d.ts.map +0 -1
- package/dist/bun/index.js +0 -130
- package/dist/bun/index.js.map +0 -1
- package/dist/cli/emitModule.d.ts +0 -7
- package/dist/cli/emitModule.d.ts.map +0 -1
- package/dist/cli/emitModule.js +0 -127
- package/dist/cli/emitModule.js.map +0 -1
- package/dist/cli/generate.d.ts +0 -8
- package/dist/cli/generate.d.ts.map +0 -1
- package/dist/cli/generate.js +0 -391
- package/dist/cli/generate.js.map +0 -1
- package/dist/cli/main.d.ts +0 -3
- package/dist/cli/main.d.ts.map +0 -1
- package/dist/cli/main.js +0 -21
- package/dist/cli/main.js.map +0 -1
- package/dist/cli/preset.d.ts +0 -18
- package/dist/cli/preset.d.ts.map +0 -1
- package/dist/cli/preset.js +0 -353
- package/dist/cli/preset.js.map +0 -1
- package/dist/cloudflare/index.d.ts +0 -21
- package/dist/cloudflare/index.d.ts.map +0 -1
- package/dist/cloudflare/index.js +0 -14
- package/dist/cloudflare/index.js.map +0 -1
- package/dist/cloudflare/r2Media.d.ts.map +0 -1
- package/dist/cloudflare/r2Media.js +0 -69
- package/dist/cloudflare/r2Media.js.map +0 -1
- package/dist/core/caller.d.ts +0 -35
- package/dist/core/caller.d.ts.map +0 -1
- package/dist/core/caller.js +0 -3
- package/dist/core/caller.js.map +0 -1
- package/dist/core/createMantle.d.ts +0 -22
- package/dist/core/createMantle.d.ts.map +0 -1
- package/dist/core/createMantle.js +0 -117
- package/dist/core/createMantle.js.map +0 -1
- package/dist/core/dialect.d.ts +0 -41
- package/dist/core/dialect.d.ts.map +0 -1
- package/dist/core/dialect.js +0 -7
- package/dist/core/dialect.js.map +0 -1
- package/dist/core/driver.d.ts +0 -17
- package/dist/core/driver.d.ts.map +0 -1
- package/dist/core/driver.js +0 -2
- package/dist/core/driver.js.map +0 -1
- package/dist/core/email.d.ts +0 -17
- package/dist/core/email.d.ts.map +0 -1
- package/dist/core/email.js +0 -2
- package/dist/core/email.js.map +0 -1
- package/dist/core/index.d.ts +0 -16
- package/dist/core/index.d.ts.map +0 -1
- package/dist/core/index.js +0 -16
- package/dist/core/index.js.map +0 -1
- package/dist/core/invocation.d.ts +0 -66
- package/dist/core/invocation.d.ts.map +0 -1
- package/dist/core/invocation.js +0 -3
- package/dist/core/invocation.js.map +0 -1
- package/dist/core/observation.d.ts +0 -3
- package/dist/core/observation.d.ts.map +0 -1
- package/dist/core/observation.js +0 -10
- package/dist/core/observation.js.map +0 -1
- package/dist/core/runtime/auth.d.ts +0 -9
- package/dist/core/runtime/auth.d.ts.map +0 -1
- package/dist/core/runtime/auth.js +0 -39
- package/dist/core/runtime/auth.js.map +0 -1
- package/dist/core/runtime/createRuntime.d.ts +0 -23
- package/dist/core/runtime/createRuntime.d.ts.map +0 -1
- package/dist/core/runtime/createRuntime.js +0 -214
- package/dist/core/runtime/createRuntime.js.map +0 -1
- package/dist/core/runtime/verifyPlan.d.ts +0 -34
- package/dist/core/runtime/verifyPlan.d.ts.map +0 -1
- package/dist/core/runtime/verifyPlan.js +0 -301
- package/dist/core/runtime/verifyPlan.js.map +0 -1
- package/dist/core/service.d.ts +0 -45
- package/dist/core/service.d.ts.map +0 -1
- package/dist/core/service.js +0 -2
- package/dist/core/service.js.map +0 -1
- package/dist/core/site.d.ts.map +0 -1
- package/dist/core/site.js +0 -2
- package/dist/core/site.js.map +0 -1
- package/dist/core/siteConfig.d.ts +0 -5
- package/dist/core/siteConfig.d.ts.map +0 -1
- package/dist/core/siteConfig.js +0 -24
- package/dist/core/siteConfig.js.map +0 -1
- package/dist/core/sql/allowlist.d.ts +0 -65
- package/dist/core/sql/allowlist.d.ts.map +0 -1
- package/dist/core/sql/allowlist.js +0 -705
- package/dist/core/sql/allowlist.js.map +0 -1
- package/dist/core/sql/ast.d.ts +0 -24
- package/dist/core/sql/ast.d.ts.map +0 -1
- package/dist/core/sql/ast.js +0 -32
- package/dist/core/sql/ast.js.map +0 -1
- package/dist/core/sql/compile.d.ts +0 -50
- package/dist/core/sql/compile.d.ts.map +0 -1
- package/dist/core/sql/compile.js +0 -48
- package/dist/core/sql/compile.js.map +0 -1
- package/dist/core/sql/policy.d.ts +0 -121
- package/dist/core/sql/policy.d.ts.map +0 -1
- package/dist/core/sql/policy.js +0 -379
- package/dist/core/sql/policy.js.map +0 -1
- package/dist/core/sql/positions.d.ts +0 -30
- package/dist/core/sql/positions.d.ts.map +0 -1
- package/dist/core/sql/positions.js +0 -22
- package/dist/core/sql/positions.js.map +0 -1
- package/dist/core/sql/run.d.ts +0 -76
- package/dist/core/sql/run.d.ts.map +0 -1
- package/dist/core/sql/run.js +0 -267
- package/dist/core/sql/run.js.map +0 -1
- package/dist/core/store/createStore.d.ts +0 -49
- package/dist/core/store/createStore.d.ts.map +0 -1
- package/dist/core/store/createStore.js +0 -227
- package/dist/core/store/createStore.js.map +0 -1
- package/dist/core/store/cursor.d.ts +0 -4
- package/dist/core/store/cursor.d.ts.map +0 -1
- package/dist/core/store/cursor.js +0 -22
- package/dist/core/store/cursor.js.map +0 -1
- package/dist/core/store/json.d.ts +0 -80
- package/dist/core/store/json.d.ts.map +0 -1
- package/dist/core/store/json.js +0 -342
- package/dist/core/store/json.js.map +0 -1
- package/dist/core/store.d.ts +0 -160
- package/dist/core/store.d.ts.map +0 -1
- package/dist/core/store.js +0 -2
- package/dist/core/store.js.map +0 -1
- package/dist/core/wire.d.ts +0 -20
- package/dist/core/wire.d.ts.map +0 -1
- package/dist/core/wire.js +0 -84
- package/dist/core/wire.js.map +0 -1
- package/dist/core/withCaller.d.ts +0 -24
- package/dist/core/withCaller.d.ts.map +0 -1
- package/dist/core/withCaller.js +0 -35
- package/dist/core/withCaller.js.map +0 -1
- package/dist/d1/adapter.d.ts +0 -12
- package/dist/d1/adapter.d.ts.map +0 -1
- package/dist/d1/adapter.js +0 -23
- package/dist/d1/adapter.js.map +0 -1
- package/dist/d1/codec.d.ts +0 -14
- package/dist/d1/codec.d.ts.map +0 -1
- package/dist/d1/codec.js +0 -136
- package/dist/d1/codec.js.map +0 -1
- package/dist/d1/compile/index.d.ts +0 -9
- package/dist/d1/compile/index.d.ts.map +0 -1
- package/dist/d1/compile/index.js +0 -9
- package/dist/d1/compile/index.js.map +0 -1
- package/dist/d1/dialect.d.ts +0 -4
- package/dist/d1/dialect.d.ts.map +0 -1
- package/dist/d1/dialect.js +0 -13
- package/dist/d1/dialect.js.map +0 -1
- package/dist/d1/executor.d.ts +0 -13
- package/dist/d1/executor.d.ts.map +0 -1
- package/dist/d1/executor.js +0 -91
- package/dist/d1/executor.js.map +0 -1
- package/dist/d1/index.d.ts +0 -6
- package/dist/d1/index.d.ts.map +0 -1
- package/dist/d1/index.js +0 -6
- package/dist/d1/index.js.map +0 -1
- package/dist/d1/lower.d.ts +0 -8
- package/dist/d1/lower.d.ts.map +0 -1
- package/dist/d1/lower.js +0 -167
- package/dist/d1/lower.js.map +0 -1
- package/dist/d1/media.d.ts +0 -5
- package/dist/d1/media.d.ts.map +0 -1
- package/dist/d1/media.js +0 -157
- package/dist/d1/media.js.map +0 -1
- package/dist/d1/migrations.d.ts +0 -12
- package/dist/d1/migrations.d.ts.map +0 -1
- package/dist/d1/migrations.js +0 -111
- package/dist/d1/migrations.js.map +0 -1
- package/dist/d1/print.d.ts +0 -28
- package/dist/d1/print.d.ts.map +0 -1
- package/dist/d1/print.js +0 -54
- package/dist/d1/print.js.map +0 -1
- package/dist/d1/site.d.ts +0 -17
- package/dist/d1/site.d.ts.map +0 -1
- package/dist/d1/site.js +0 -63
- package/dist/d1/site.js.map +0 -1
- package/dist/d1/storage.d.ts +0 -34
- package/dist/d1/storage.d.ts.map +0 -1
- package/dist/d1/storage.js +0 -288
- package/dist/d1/storage.js.map +0 -1
- package/dist/d1/tz.d.ts +0 -21
- package/dist/d1/tz.d.ts.map +0 -1
- package/dist/d1/tz.js +0 -54
- package/dist/d1/tz.js.map +0 -1
- package/dist/d1/validator.d.ts +0 -10
- package/dist/d1/validator.d.ts.map +0 -1
- package/dist/d1/validator.js +0 -33
- package/dist/d1/validator.js.map +0 -1
- package/dist/mcp/apps.d.ts +0 -43
- package/dist/mcp/apps.d.ts.map +0 -1
- package/dist/mcp/apps.js +0 -57
- package/dist/mcp/apps.js.map +0 -1
- package/dist/mcp/catalog.d.ts +0 -55
- package/dist/mcp/catalog.d.ts.map +0 -1
- package/dist/mcp/catalog.js +0 -81
- package/dist/mcp/catalog.js.map +0 -1
- package/dist/mcp/createMcpSurface.d.ts +0 -60
- package/dist/mcp/createMcpSurface.d.ts.map +0 -1
- package/dist/mcp/createMcpSurface.js +0 -182
- package/dist/mcp/createMcpSurface.js.map +0 -1
- package/dist/mcp/index.d.ts +0 -4
- package/dist/mcp/index.d.ts.map +0 -1
- package/dist/mcp/index.js +0 -4
- package/dist/mcp/index.js.map +0 -1
- package/dist/mcp/media.d.ts +0 -9
- package/dist/mcp/media.d.ts.map +0 -1
- package/dist/mcp/media.js +0 -33
- package/dist/mcp/media.js.map +0 -1
- package/dist/postgres/adapter.d.ts +0 -20
- package/dist/postgres/adapter.d.ts.map +0 -1
- package/dist/postgres/adapter.js +0 -44
- package/dist/postgres/adapter.js.map +0 -1
- package/dist/postgres/codec.d.ts +0 -13
- package/dist/postgres/codec.d.ts.map +0 -1
- package/dist/postgres/codec.js +0 -110
- package/dist/postgres/codec.js.map +0 -1
- package/dist/postgres/compile/index.d.ts +0 -9
- package/dist/postgres/compile/index.d.ts.map +0 -1
- package/dist/postgres/compile/index.js +0 -9
- package/dist/postgres/compile/index.js.map +0 -1
- package/dist/postgres/driver.d.ts +0 -92
- package/dist/postgres/driver.d.ts.map +0 -1
- package/dist/postgres/driver.js +0 -110
- package/dist/postgres/driver.js.map +0 -1
- package/dist/postgres/executor.d.ts +0 -20
- package/dist/postgres/executor.d.ts.map +0 -1
- package/dist/postgres/executor.js +0 -69
- package/dist/postgres/executor.js.map +0 -1
- package/dist/postgres/index.d.ts +0 -7
- package/dist/postgres/index.d.ts.map +0 -1
- package/dist/postgres/index.js +0 -7
- package/dist/postgres/index.js.map +0 -1
- package/dist/postgres/lower.d.ts +0 -6
- package/dist/postgres/lower.d.ts.map +0 -1
- package/dist/postgres/lower.js +0 -157
- package/dist/postgres/lower.js.map +0 -1
- package/dist/postgres/print.d.ts +0 -11
- package/dist/postgres/print.d.ts.map +0 -1
- package/dist/postgres/print.js +0 -121
- package/dist/postgres/print.js.map +0 -1
- package/dist/postgres/storage.d.ts +0 -19
- package/dist/postgres/storage.d.ts.map +0 -1
- package/dist/postgres/storage.js +0 -201
- package/dist/postgres/storage.js.map +0 -1
- package/dist/postgres/textRows.d.ts +0 -10
- package/dist/postgres/textRows.d.ts.map +0 -1
- package/dist/postgres/textRows.js +0 -44
- package/dist/postgres/textRows.js.map +0 -1
- package/dist/postgres/validator.d.ts +0 -12
- package/dist/postgres/validator.d.ts.map +0 -1
- package/dist/postgres/validator.js +0 -46
- package/dist/postgres/validator.js.map +0 -1
- package/dist/spec/domain/index.d.ts +0 -3
- package/dist/spec/domain/index.d.ts.map +0 -1
- package/dist/spec/domain/index.js +0 -3
- package/dist/spec/domain/index.js.map +0 -1
- package/dist/spec/domain/model/ContentState.d.ts +0 -8
- package/dist/spec/domain/model/ContentState.d.ts.map +0 -1
- package/dist/spec/domain/model/ContentState.js +0 -7
- package/dist/spec/domain/model/ContentState.js.map +0 -1
- package/dist/spec/domain/model/Entry.d.ts +0 -29
- package/dist/spec/domain/model/Entry.d.ts.map +0 -1
- package/dist/spec/domain/model/Entry.js +0 -16
- package/dist/spec/domain/model/Entry.js.map +0 -1
- package/dist/spec/domain/model/Locale.d.ts +0 -30
- package/dist/spec/domain/model/Locale.d.ts.map +0 -1
- package/dist/spec/domain/model/Locale.js +0 -33
- package/dist/spec/domain/model/Locale.js.map +0 -1
- package/dist/spec/domain/model/ManifestGrammar.d.ts.map +0 -1
- package/dist/spec/domain/model/ManifestGrammar.js +0 -149
- package/dist/spec/domain/model/ManifestGrammar.js.map +0 -1
- package/dist/spec/domain/model/MediaMimeAccept.d.ts +0 -55
- package/dist/spec/domain/model/MediaMimeAccept.d.ts.map +0 -1
- package/dist/spec/domain/model/MediaMimeAccept.js +0 -90
- package/dist/spec/domain/model/MediaMimeAccept.js.map +0 -1
- package/dist/spec/domain/model/RuntimePlan.d.ts.map +0 -1
- package/dist/spec/domain/model/RuntimePlan.js +0 -4
- package/dist/spec/domain/model/RuntimePlan.js.map +0 -1
- package/dist/spec/domain/model/SiteConfig.d.ts +0 -173
- package/dist/spec/domain/model/SiteConfig.d.ts.map +0 -1
- package/dist/spec/domain/model/SiteConfig.js +0 -13
- package/dist/spec/domain/model/SiteConfig.js.map +0 -1
- package/dist/spec/domain/model/SqlIr.d.ts.map +0 -1
- package/dist/spec/domain/model/SqlIr.js +0 -95
- package/dist/spec/domain/model/SqlIr.js.map +0 -1
- package/dist/spec/domain/model/index.d.ts +0 -14
- package/dist/spec/domain/model/index.d.ts.map +0 -1
- package/dist/spec/domain/model/index.js +0 -14
- package/dist/spec/domain/model/index.js.map +0 -1
- package/dist/spec/domain/service/CloudflareCron.d.ts.map +0 -1
- package/dist/spec/domain/service/CloudflareCron.js.map +0 -1
- package/dist/spec/domain/service/CrossSchemaChecker.d.ts +0 -34
- package/dist/spec/domain/service/CrossSchemaChecker.d.ts.map +0 -1
- package/dist/spec/domain/service/CrossSchemaChecker.js +0 -114
- package/dist/spec/domain/service/CrossSchemaChecker.js.map +0 -1
- package/dist/spec/domain/service/EntryDataValidator.d.ts +0 -56
- package/dist/spec/domain/service/EntryDataValidator.d.ts.map +0 -1
- package/dist/spec/domain/service/EntryDataValidator.js +0 -88
- package/dist/spec/domain/service/EntryDataValidator.js.map +0 -1
- package/dist/spec/domain/service/JsonSchemaToZod.d.ts +0 -29
- package/dist/spec/domain/service/JsonSchemaToZod.d.ts.map +0 -1
- package/dist/spec/domain/service/JsonSchemaToZod.js +0 -156
- package/dist/spec/domain/service/JsonSchemaToZod.js.map +0 -1
- package/dist/spec/domain/service/LifecycleStateMachine.d.ts +0 -75
- package/dist/spec/domain/service/LifecycleStateMachine.d.ts.map +0 -1
- package/dist/spec/domain/service/LifecycleStateMachine.js +0 -76
- package/dist/spec/domain/service/LifecycleStateMachine.js.map +0 -1
- package/dist/spec/domain/service/LocaleCanonicalizer.d.ts +0 -29
- package/dist/spec/domain/service/LocaleCanonicalizer.d.ts.map +0 -1
- package/dist/spec/domain/service/LocaleCanonicalizer.js +0 -96
- package/dist/spec/domain/service/LocaleCanonicalizer.js.map +0 -1
- package/dist/spec/domain/service/ManifestFieldChecks.d.ts +0 -60
- package/dist/spec/domain/service/ManifestFieldChecks.d.ts.map +0 -1
- package/dist/spec/domain/service/ManifestFieldChecks.js +0 -116
- package/dist/spec/domain/service/ManifestFieldChecks.js.map +0 -1
- package/dist/spec/domain/service/ManifestGraphValidator.d.ts +0 -15
- package/dist/spec/domain/service/ManifestGraphValidator.d.ts.map +0 -1
- package/dist/spec/domain/service/ManifestGraphValidator.js +0 -225
- package/dist/spec/domain/service/ManifestGraphValidator.js.map +0 -1
- package/dist/spec/domain/service/ManifestLinker.d.ts +0 -45
- package/dist/spec/domain/service/ManifestLinker.d.ts.map +0 -1
- package/dist/spec/domain/service/ManifestLinker.js +0 -92
- package/dist/spec/domain/service/ManifestLinker.js.map +0 -1
- package/dist/spec/domain/service/ManifestLocaleTrimmer.d.ts +0 -16
- package/dist/spec/domain/service/ManifestLocaleTrimmer.d.ts.map +0 -1
- package/dist/spec/domain/service/ManifestLocaleTrimmer.js +0 -76
- package/dist/spec/domain/service/ManifestLocaleTrimmer.js.map +0 -1
- package/dist/spec/domain/service/ManifestParser.d.ts +0 -49
- package/dist/spec/domain/service/ManifestParser.d.ts.map +0 -1
- package/dist/spec/domain/service/ManifestParser.js +0 -203
- package/dist/spec/domain/service/ManifestParser.js.map +0 -1
- package/dist/spec/domain/service/ManifestPartition.d.ts +0 -9
- package/dist/spec/domain/service/ManifestPartition.d.ts.map +0 -1
- package/dist/spec/domain/service/ManifestPartition.js +0 -19
- package/dist/spec/domain/service/ManifestPartition.js.map +0 -1
- package/dist/spec/domain/service/ManifestPathDiagnoser.d.ts +0 -33
- package/dist/spec/domain/service/ManifestPathDiagnoser.d.ts.map +0 -1
- package/dist/spec/domain/service/ManifestPathDiagnoser.js +0 -43
- package/dist/spec/domain/service/ManifestPathDiagnoser.js.map +0 -1
- package/dist/spec/domain/service/ManifestSourceSpans.d.ts +0 -10
- package/dist/spec/domain/service/ManifestSourceSpans.d.ts.map +0 -1
- package/dist/spec/domain/service/ManifestSourceSpans.js +0 -76
- package/dist/spec/domain/service/ManifestSourceSpans.js.map +0 -1
- package/dist/spec/domain/service/McpToolNaming.d.ts +0 -25
- package/dist/spec/domain/service/McpToolNaming.d.ts.map +0 -1
- package/dist/spec/domain/service/McpToolNaming.js +0 -50
- package/dist/spec/domain/service/McpToolNaming.js.map +0 -1
- package/dist/spec/domain/service/PlanFingerprint.d.ts.map +0 -1
- package/dist/spec/domain/service/PlanFingerprint.js +0 -14
- package/dist/spec/domain/service/PlanFingerprint.js.map +0 -1
- package/dist/spec/domain/service/ProcedureViewSpecChecks.d.ts +0 -4
- package/dist/spec/domain/service/ProcedureViewSpecChecks.d.ts.map +0 -1
- package/dist/spec/domain/service/ProcedureViewSpecChecks.js +0 -211
- package/dist/spec/domain/service/ProcedureViewSpecChecks.js.map +0 -1
- package/dist/spec/domain/service/SchemaAdminUiChecker.d.ts +0 -42
- package/dist/spec/domain/service/SchemaAdminUiChecker.d.ts.map +0 -1
- package/dist/spec/domain/service/SchemaAdminUiChecker.js +0 -289
- package/dist/spec/domain/service/SchemaAdminUiChecker.js.map +0 -1
- package/dist/spec/domain/service/SchemaIndexChecker.d.ts +0 -33
- package/dist/spec/domain/service/SchemaIndexChecker.d.ts.map +0 -1
- package/dist/spec/domain/service/SchemaIndexChecker.js +0 -256
- package/dist/spec/domain/service/SchemaIndexChecker.js.map +0 -1
- package/dist/spec/domain/service/SchemaSearchChecker.d.ts +0 -11
- package/dist/spec/domain/service/SchemaSearchChecker.d.ts.map +0 -1
- package/dist/spec/domain/service/SchemaSearchChecker.js +0 -78
- package/dist/spec/domain/service/SchemaSearchChecker.js.map +0 -1
- package/dist/spec/domain/service/SchemaSpecChecks.d.ts +0 -31
- package/dist/spec/domain/service/SchemaSpecChecks.d.ts.map +0 -1
- package/dist/spec/domain/service/SchemaSpecChecks.js +0 -445
- package/dist/spec/domain/service/SchemaSpecChecks.js.map +0 -1
- package/dist/spec/domain/service/SiteDefaultsValidator.d.ts +0 -39
- package/dist/spec/domain/service/SiteDefaultsValidator.d.ts.map +0 -1
- package/dist/spec/domain/service/SiteDefaultsValidator.js +0 -194
- package/dist/spec/domain/service/SiteDefaultsValidator.js.map +0 -1
- package/dist/spec/domain/service/SqlClassify.d.ts +0 -19
- package/dist/spec/domain/service/SqlClassify.d.ts.map +0 -1
- package/dist/spec/domain/service/SqlClassify.js +0 -42
- package/dist/spec/domain/service/SqlClassify.js.map +0 -1
- package/dist/spec/domain/service/SqlRefusal.d.ts +0 -16
- package/dist/spec/domain/service/SqlRefusal.d.ts.map +0 -1
- package/dist/spec/domain/service/SqlRefusal.js +0 -20
- package/dist/spec/domain/service/SqlRefusal.js.map +0 -1
- package/dist/spec/domain/service/SqlTypes.d.ts +0 -40
- package/dist/spec/domain/service/SqlTypes.d.ts.map +0 -1
- package/dist/spec/domain/service/SqlTypes.js +0 -110
- package/dist/spec/domain/service/SqlTypes.js.map +0 -1
- package/dist/spec/domain/service/StaffRoleHierarchy.d.ts +0 -3
- package/dist/spec/domain/service/StaffRoleHierarchy.d.ts.map +0 -1
- package/dist/spec/domain/service/StaffRoleHierarchy.js +0 -19
- package/dist/spec/domain/service/StaffRoleHierarchy.js.map +0 -1
- package/dist/spec/domain/service/TriggerGraphChecks.d.ts +0 -16
- package/dist/spec/domain/service/TriggerGraphChecks.d.ts.map +0 -1
- package/dist/spec/domain/service/TriggerGraphChecks.js +0 -337
- package/dist/spec/domain/service/TriggerGraphChecks.js.map +0 -1
- package/dist/spec/domain/service/TriggerSpecChecks.d.ts +0 -4
- package/dist/spec/domain/service/TriggerSpecChecks.d.ts.map +0 -1
- package/dist/spec/domain/service/TriggerSpecChecks.js +0 -89
- package/dist/spec/domain/service/TriggerSpecChecks.js.map +0 -1
- package/dist/spec/domain/service/ValidatedAdminUiProjection.d.ts +0 -11
- package/dist/spec/domain/service/ValidatedAdminUiProjection.d.ts.map +0 -1
- package/dist/spec/domain/service/ValidatedAdminUiProjection.js +0 -26
- package/dist/spec/domain/service/ValidatedAdminUiProjection.js.map +0 -1
- package/dist/spec/domain/service/ViewAdminUiChecker.d.ts +0 -14
- package/dist/spec/domain/service/ViewAdminUiChecker.d.ts.map +0 -1
- package/dist/spec/domain/service/ViewAdminUiChecker.js +0 -53
- package/dist/spec/domain/service/ViewAdminUiChecker.js.map +0 -1
- package/dist/spec/domain/service/index.d.ts +0 -24
- package/dist/spec/domain/service/index.d.ts.map +0 -1
- package/dist/spec/domain/service/index.js +0 -24
- package/dist/spec/domain/service/index.js.map +0 -1
- package/dist/spec/index.d.ts +0 -10
- package/dist/spec/index.d.ts.map +0 -1
- package/dist/spec/index.js +0 -12
- package/dist/spec/index.js.map +0 -1
- package/dist/spec/infrastructure/cli/parseArgsError.d.ts +0 -16
- package/dist/spec/infrastructure/cli/parseArgsError.d.ts.map +0 -1
- package/dist/spec/infrastructure/cli/parseArgsError.js +0 -34
- package/dist/spec/infrastructure/cli/parseArgsError.js.map +0 -1
- package/dist/spec/infrastructure/index.d.ts +0 -2
- package/dist/spec/infrastructure/index.d.ts.map +0 -1
- package/dist/spec/infrastructure/index.js +0 -2
- package/dist/spec/infrastructure/index.js.map +0 -1
- package/dist/spec/infrastructure/sql/PgQueryParser.d.ts +0 -18
- package/dist/spec/infrastructure/sql/PgQueryParser.d.ts.map +0 -1
- package/dist/spec/infrastructure/sql/PgQueryParser.js +0 -17
- package/dist/spec/infrastructure/sql/PgQueryParser.js.map +0 -1
- package/dist/spec/infrastructure/sql/compilePlan.d.ts +0 -37
- package/dist/spec/infrastructure/sql/compilePlan.d.ts.map +0 -1
- package/dist/spec/infrastructure/sql/compilePlan.js +0 -282
- package/dist/spec/infrastructure/sql/compilePlan.js.map +0 -1
- package/dist/spec/infrastructure/sql/compileSql.d.ts +0 -35
- package/dist/spec/infrastructure/sql/compileSql.d.ts.map +0 -1
- package/dist/spec/infrastructure/sql/compileSql.js +0 -92
- package/dist/spec/infrastructure/sql/compileSql.js.map +0 -1
- package/dist/spec/infrastructure/sql/frontEnd.d.ts +0 -8
- package/dist/spec/infrastructure/sql/frontEnd.d.ts.map +0 -1
- package/dist/spec/infrastructure/sql/frontEnd.js +0 -100
- package/dist/spec/infrastructure/sql/frontEnd.js.map +0 -1
- package/dist/spec/infrastructure/sql/index.d.ts +0 -4
- package/dist/spec/infrastructure/sql/index.d.ts.map +0 -1
- package/dist/spec/infrastructure/sql/index.js +0 -4
- package/dist/spec/infrastructure/sql/index.js.map +0 -1
- package/dist/spec/kernel/diagnostic.d.ts.map +0 -1
- package/dist/spec/kernel/diagnostic.js +0 -296
- package/dist/spec/kernel/diagnostic.js.map +0 -1
- package/dist/spec/kernel/index.d.ts +0 -8
- package/dist/spec/kernel/index.d.ts.map +0 -1
- package/dist/spec/kernel/index.js +0 -8
- package/dist/spec/kernel/index.js.map +0 -1
- package/dist/spec/usecase/EmitTypes.d.ts +0 -22
- package/dist/spec/usecase/EmitTypes.d.ts.map +0 -1
- package/dist/spec/usecase/EmitTypes.js +0 -182
- package/dist/spec/usecase/EmitTypes.js.map +0 -1
- package/dist/spec/usecase/ValidateManifestsUseCase.d.ts +0 -8
- package/dist/spec/usecase/ValidateManifestsUseCase.d.ts.map +0 -1
- package/dist/spec/usecase/ValidateManifestsUseCase.js +0 -101
- package/dist/spec/usecase/ValidateManifestsUseCase.js.map +0 -1
- package/dist/spec/usecase/dto/ValidateManifestsRequest.d.ts +0 -27
- package/dist/spec/usecase/dto/ValidateManifestsRequest.d.ts.map +0 -1
- package/dist/spec/usecase/dto/ValidateManifestsRequest.js +0 -2
- package/dist/spec/usecase/dto/ValidateManifestsRequest.js.map +0 -1
- package/dist/spec/usecase/dto/ValidateManifestsResponse.d.ts +0 -14
- package/dist/spec/usecase/dto/ValidateManifestsResponse.d.ts.map +0 -1
- package/dist/spec/usecase/dto/ValidateManifestsResponse.js +0 -2
- package/dist/spec/usecase/dto/ValidateManifestsResponse.js.map +0 -1
- package/dist/spec/usecase/dto/index.d.ts +0 -3
- package/dist/spec/usecase/dto/index.d.ts.map +0 -1
- package/dist/spec/usecase/dto/index.js +0 -3
- package/dist/spec/usecase/dto/index.js.map +0 -1
- package/dist/spec/usecase/index.d.ts +0 -10
- package/dist/spec/usecase/index.d.ts.map +0 -1
- package/dist/spec/usecase/index.js +0 -10
- package/dist/spec/usecase/index.js.map +0 -1
- package/dist/testing/cases/before-hook.d.ts +0 -4
- package/dist/testing/cases/before-hook.d.ts.map +0 -1
- package/dist/testing/cases/before-hook.js +0 -71
- package/dist/testing/cases/before-hook.js.map +0 -1
- package/dist/testing/cases/corpus.d.ts +0 -12
- package/dist/testing/cases/corpus.d.ts.map +0 -1
- package/dist/testing/cases/corpus.js +0 -91
- package/dist/testing/cases/corpus.js.map +0 -1
- package/dist/testing/cases/policy.d.ts +0 -74
- package/dist/testing/cases/policy.d.ts.map +0 -1
- package/dist/testing/cases/policy.js +0 -142
- package/dist/testing/cases/policy.js.map +0 -1
- package/dist/testing/cases/printer.d.ts +0 -4
- package/dist/testing/cases/printer.d.ts.map +0 -1
- package/dist/testing/cases/printer.js +0 -32
- package/dist/testing/cases/printer.js.map +0 -1
- package/dist/testing/cases/report-view.d.ts +0 -5
- package/dist/testing/cases/report-view.d.ts.map +0 -1
- package/dist/testing/cases/report-view.js +0 -33
- package/dist/testing/cases/report-view.js.map +0 -1
- package/dist/testing/cases/requisition.d.ts +0 -4
- package/dist/testing/cases/requisition.d.ts.map +0 -1
- package/dist/testing/cases/requisition.js +0 -38
- package/dist/testing/cases/requisition.js.map +0 -1
- package/dist/testing/cases/search-places.d.ts +0 -4
- package/dist/testing/cases/search-places.d.ts.map +0 -1
- package/dist/testing/cases/search-places.js +0 -60
- package/dist/testing/cases/search-places.js.map +0 -1
- package/dist/testing/cases/stock.d.ts +0 -4
- package/dist/testing/cases/stock.d.ts.map +0 -1
- package/dist/testing/cases/stock.js +0 -35
- package/dist/testing/cases/stock.js.map +0 -1
- package/dist/testing/cases/store.d.ts +0 -4
- package/dist/testing/cases/store.d.ts.map +0 -1
- package/dist/testing/cases/store.js +0 -100
- package/dist/testing/cases/store.js.map +0 -1
- package/dist/testing/harness.d.ts +0 -94
- package/dist/testing/harness.d.ts.map +0 -1
- package/dist/testing/harness.js +0 -168
- package/dist/testing/harness.js.map +0 -1
- package/dist/testing/index.d.ts.map +0 -1
- package/dist/testing/index.js.map +0 -1
- package/dist/testing/report.d.ts +0 -15
- package/dist/testing/report.d.ts.map +0 -1
- package/dist/testing/report.js +0 -22
- package/dist/testing/report.js.map +0 -1
- package/dist/web/createRestSurface.d.ts +0 -7
- package/dist/web/createRestSurface.d.ts.map +0 -1
- package/dist/web/createRestSurface.js +0 -41
- package/dist/web/createRestSurface.js.map +0 -1
- package/dist/web/index.d.ts +0 -2
- package/dist/web/index.d.ts.map +0 -1
- package/dist/web/index.js +0 -2
- package/dist/web/index.js.map +0 -1
- package/docs/adr/0001-four-atom-manifest-model.md +0 -440
- package/docs/adr/0002-closed-enums-for-bindings.md +0 -253
- package/docs/adr/0007-ai-as-primary-author.md +0 -473
- package/docs/adr/0008-structured-diagnostic-shape.md +0 -338
- package/docs/adr/0009-consumer-supplied-manifests.md +0 -149
- package/docs/adr/0010-locale-and-translates.md +0 -453
- package/docs/adr/0011-adapter-port-spec.md +0 -281
- package/docs/adr/0012-views-as-public-rest.md +0 -161
- package/docs/adr/0013-agent-provisioned-consumer-projects.md +0 -154
- package/docs/adr/0014-auth-better-auth-and-multi-tenant-mcp.md +0 -939
- package/docs/adr/0016-site-semantic-layer.md +0 -70
- package/docs/adr/0017-media-multi-variant-agent-side-optimization.md +0 -181
- package/docs/adr/0018-core-starters-repository-boundary.md +0 -179
- package/docs/adr/0019-sealed-manifest-runtime-pipeline.md +0 -244
- package/docs/adr/0020-builtin-handler-contracts-and-matched-upsert.md +0 -199
- package/docs/adr/0021-retire-starter-scaffolding.md +0 -30
- package/docs/adr/0022-caller-observed-version-occ.md +0 -212
- package/docs/adr/0023-port-failure-contract.md +0 -69
- package/docs/adr/0024-manifest-native-schema-tables.md +0 -264
- package/docs/adr/0025-reserved-native-columns-and-published-only-public-views.md +0 -105
- package/docs/adr/0026-progressive-generate.md +0 -36
- package/docs/adr/0027-scheduled-procedure-triggers.md +0 -31
- package/docs/adr/0028-schema-ttl-expiry.md +0 -33
- package/docs/adr/0029-mcp-apps-interaction-contracts.md +0 -324
- package/docs/adr/0030-store.md +0 -40
- package/docs/adr/0031-host-cloud-core-contract.md +0 -102
- package/docs/adr/0032-store-centric-core-and-service-contract.md +0 -384
- package/docs/adr/0033-storage-converges-to-the-plan.md +0 -92
- package/docs/adr/0034-store-is-authored-as-sql.md +0 -192
- package/docs/adr/0035-sql-dialects.md +0 -154
- package/docs/adr/0036-host-and-dialect.md +0 -65
- package/docs/adr/0037-postgresql-is-the-reference-dialect.md +0 -124
- package/docs/adr/0038-bun-native-host.md +0 -63
- package/docs/adr/README.md +0 -96
- package/docs/adr/adr-lite-803-request-diagnostics.md +0 -38
- package/docs/adr/adr-lite-808-route-readiness.md +0 -47
- package/docs/adr/adr-lite-809-bounded-public-content.md +0 -71
- package/docs/adr/adr-lite-812-native-parity.md +0 -150
- package/docs/adr/adr-lite-823-home-statistics.md +0 -64
- package/docs/adr/adr-lite-842-mcp-authoring.md +0 -30
- package/docs/adr/adr-lite-845-frontend-client.md +0 -38
- package/docs/adr/adr-lite-861-admin-webmcp.md +0 -48
- package/docs/adr/adr-lite-909-admin-ui-kit.md +0 -37
- package/docs/examples/commerce-inventory.md +0 -481
- package/docs/examples/commerce.md +0 -254
- package/docs/examples/guarded-api.md +0 -238
- package/docs/examples/intake-hooks.md +0 -237
- package/docs/examples/intake.md +0 -127
- package/docs/examples/legal-documents.md +0 -218
- package/docs/examples/procurement.md +0 -226
- package/docs/examples/publication.md +0 -211
- package/docs/examples/reference-service/.mantle/generated/mantle.ts +0 -174
- package/docs/examples/reference-service/.mantle/generated/plan.json +0 -1936
- package/docs/examples/reference-service/README.md +0 -33
- package/docs/examples/reference-service/manifests/catalog.yaml +0 -103
- package/docs/examples/reference-service/manifests/orders.yaml +0 -120
- package/docs/examples/reference-service/mantle.config.json +0 -1
- package/docs/examples/reference-service/package.json +0 -27
- package/docs/examples/reference-service/smoke.mjs +0 -160
- package/docs/examples/reference-service/src/handlers.ts +0 -36
- package/docs/examples/reference-service/src/index.ts +0 -33
- package/docs/examples/reference-service/src/service.ts +0 -78
- package/docs/examples/reference-service/wrangler.jsonc +0 -26
- package/docs/examples/reservation.md +0 -142
- /package/docs/examples/{reference-service → app-shell}/.dev.vars.example +0 -0
|
@@ -1,199 +0,0 @@
|
|
|
1
|
-
# ADR-0020: Builtin Handler Contracts and Matched Upsert
|
|
2
|
-
|
|
3
|
-
**Status:** Accepted + amended by [ADR-0022](0022-caller-observed-version-occ.md)
|
|
4
|
-
|
|
5
|
-
**Date:** 2026-09-01
|
|
6
|
-
|
|
7
|
-
**Related:** [#765](https://github.com/aotter/mantle/issues/765),
|
|
8
|
-
[#766](https://github.com/aotter/mantle/issues/766),
|
|
9
|
-
[#850](https://github.com/aotter/mantle/issues/850),
|
|
10
|
-
ADR-0008, ADR-0010, ADR-0014, ADR-0019, ADR-0022
|
|
11
|
-
|
|
12
|
-
> **Amendment (ADR-0022):** matched-upsert OCC no longer forbids caller
|
|
13
|
-
> `expectedVersion` or substitutes `preloaded.version`. Keep this ADR for
|
|
14
|
-
> builtin static contracts, `handler.match` / uniqueIndexes, `CONFLICT`
|
|
15
|
-
> without auto-retry, and natural-key lookup without system `id`. Read
|
|
16
|
-
> ADR-0022 for caller-observed version on the update branch, create vs
|
|
17
|
-
> update, reserved wire names, and first-party Admin bind.
|
|
18
|
-
|
|
19
|
-
## Context
|
|
20
|
-
|
|
21
|
-
Mantle Procedures can bind to standard entry-mutation operations using `handler.kind: builtin` (e.g. `create`, `update`, `delete`, `archive`, `upsert`).
|
|
22
|
-
|
|
23
|
-
Before this ADR:
|
|
24
|
-
1. **No static contract validation**: Procedure input JSON Schema contracts were not statically verified against the requirements of their builtin operations during manifest linking (`ValidateManifestsUseCase`). Invalid contracts (e.g. `update` missing `id` or `expectedVersion`, nullable union types like `type: ["string", "null"]`, or `archive` on operational Schemas) were only caught at runtime via `requireField` or runtime assertions, causing valid-looking manifests to fail during invocation.
|
|
25
|
-
2. **Missing natural key upsert (`handler.match`)**: Built-in `upsert` only supported legacy ID-based lookup (`id` + `expectedVersion`), requiring client knowledge of internal system IDs. Real-world domains require idempotent upserts matching natural keys (such as `slug`, `siteKey`, or composite unique keys like `[slug, locale]`).
|
|
26
|
-
3. **Concurrency and race conditions**: Matched upsert must handle concurrent writers safely. When two concurrent writers miss preflight lookup, storage-level unique constraints must catch the conflict and surface structured `CONFLICT` diagnostics without retrying or corrupting entries.
|
|
27
|
-
|
|
28
|
-
## Decision
|
|
29
|
-
|
|
30
|
-
### 1. Static Contract Validation for Builtin Handlers
|
|
31
|
-
|
|
32
|
-
Manifest linking (`ManifestGraphValidator.ts`) now validates Procedure `input` schemas against the requirements of their builtin `op`:
|
|
33
|
-
|
|
34
|
-
- **Diagnostic Code**: `BUILTIN_HANDLER_CONTRACT_INVALID` (phase: `validate`).
|
|
35
|
-
- **Common rule**: `input` must be an `object` schema (`type: "object"`).
|
|
36
|
-
- **`update`**:
|
|
37
|
-
- `properties.id` must be strict, non-nullable `string` (`type: "string"`, not union array, not `nullable: true`).
|
|
38
|
-
- `properties.expectedVersion` must be strict, non-nullable `number` (`type: "number"`, not union array, not `nullable: true`).
|
|
39
|
-
- `required` must include both `"id"` and `"expectedVersion"`.
|
|
40
|
-
- **`delete`**:
|
|
41
|
-
- `properties.id` must be strict, non-nullable `string`.
|
|
42
|
-
- `required` must include `"id"`.
|
|
43
|
-
- **`archive`**:
|
|
44
|
-
- Target Schema must have `lifecycle: "publishing"` (operational Schemas have no lifecycle transitions and cannot be archived).
|
|
45
|
-
- `properties.id` must be strict, non-nullable `string`.
|
|
46
|
-
- `required` must include `"id"`.
|
|
47
|
-
- **`upsert` (legacy mode without `match`)** (ADR-0022):
|
|
48
|
-
- `properties.expectedVersion` must be declared as strict `number`.
|
|
49
|
-
- If `id` is declared it must be strict `string`. Neither is in `required`
|
|
50
|
-
because the create branch accepts new entries without IDs or versions.
|
|
51
|
-
|
|
52
|
-
### 2. Matched Upsert Grammar and Static Contract (`handler.match`)
|
|
53
|
-
|
|
54
|
-
Procedures with `op: "upsert"` may declare `match`:
|
|
55
|
-
|
|
56
|
-
```yaml
|
|
57
|
-
apiVersion: cms.mantle.aotter.net/v1
|
|
58
|
-
kind: Procedure
|
|
59
|
-
metadata:
|
|
60
|
-
name: upsertArticleBySlug
|
|
61
|
-
spec:
|
|
62
|
-
input:
|
|
63
|
-
type: object
|
|
64
|
-
properties:
|
|
65
|
-
slug:
|
|
66
|
-
type: string
|
|
67
|
-
title:
|
|
68
|
-
type: string
|
|
69
|
-
body:
|
|
70
|
-
type: string
|
|
71
|
-
expectedVersion:
|
|
72
|
-
type: number
|
|
73
|
-
required:
|
|
74
|
-
- slug
|
|
75
|
-
- title
|
|
76
|
-
output:
|
|
77
|
-
type: object
|
|
78
|
-
handler:
|
|
79
|
-
kind: builtin
|
|
80
|
-
op: upsert
|
|
81
|
-
schema: articles
|
|
82
|
-
match:
|
|
83
|
-
- slug
|
|
84
|
-
```
|
|
85
|
-
|
|
86
|
-
**Grammar and parser validation rules (`ManifestParser.ts`)**:
|
|
87
|
-
- `match` is allowed in `spec.handler` only when `handler.kind === "builtin"` and `op === "upsert"`.
|
|
88
|
-
- `match` must be a non-empty array of unique, non-empty field names.
|
|
89
|
-
|
|
90
|
-
**Static manifest validation rules (`ManifestGraphValidator.ts`)**:
|
|
91
|
-
- `handler.match` must exactly match one declared unique index in the target Schema's `spec.uniqueIndexes` (matching length, field names, and order).
|
|
92
|
-
- Every field in `handler.match` must be declared in the target Schema's `spec.schema.properties`.
|
|
93
|
-
- Every field in `handler.match` must be declared in Procedure `input.properties` and listed in `input.required`.
|
|
94
|
-
- Procedure `input` must NOT declare `id` when using `match`.
|
|
95
|
-
- Procedure `input` **must** declare `expectedVersion` as strict `number`
|
|
96
|
-
(ADR-0022). It is not globally required: create has no version; update
|
|
97
|
-
requires the caller token at runtime. Do not overwrite that token with
|
|
98
|
-
`preloaded.version`.
|
|
99
|
-
|
|
100
|
-
### 3. Runtime Semantics and Atomic Conflict Handling (`InvokeBuiltinUseCase.ts`)
|
|
101
|
-
|
|
102
|
-
When executing matched upsert:
|
|
103
|
-
1. Extract matching field values from `input`.
|
|
104
|
-
2. Query existing entry using `entries.findByDataFields({ collection, fields })`.
|
|
105
|
-
3. **If found**: Execute update path (`opUpdate`):
|
|
106
|
-
- Merge input into existing data using `projectUpdateAndStamp`, preserving omitted fields and system bindings.
|
|
107
|
-
- Require the caller's `expectedVersion` and pass **that** token to the
|
|
108
|
-
atomic repository OCC check. Do not use `existing.version` as the token
|
|
109
|
-
(ADR-0022). Missing token → `INPUT_VALIDATION_FAILED` (do not overwrite).
|
|
110
|
-
- Pass caller's original input to lifecycle hooks (`before_update` / `after_update`).
|
|
111
|
-
4. **If not found**: Execute create path (`opCreate`) only when the caller
|
|
112
|
-
omitted `expectedVersion`. A versioned write for a missing row is
|
|
113
|
-
`NOT_FOUND` (do not recreate).
|
|
114
|
-
- Project and stamp data using `projectAndStamp`.
|
|
115
|
-
- Set status to `"published"` (if `lifecycle: "operational"`) or `"draft"` (if `lifecycle: "publishing"`).
|
|
116
|
-
- Pass caller's original input to lifecycle hooks (`before_create` / `after_create`).
|
|
117
|
-
5. **Concurrency & Race Conditions**:
|
|
118
|
-
- Both update and create operations are wrapped in `withConflictDiagnostic`.
|
|
119
|
-
- Storage-level unique constraint violations (e.g. SQLite `SQLITE_CONSTRAINT_UNIQUE`, Postgres `23505`) and version/status mismatches are converted into structured `CONFLICT` diagnostics (HTTP 409).
|
|
120
|
-
- The runtime does not automatically retry matched upsert on conflict, providing deterministic failure semantics under race conditions.
|
|
121
|
-
|
|
122
|
-
## Consequences
|
|
123
|
-
|
|
124
|
-
- **Fail-fast authoring**: Schema and Procedure mismatches are detected during `mantle validate` or test time rather than failing unpredictably at runtime.
|
|
125
|
-
- **Strict type safety**: Nullable union types cannot bypass static contract validation.
|
|
126
|
-
- **Natural key idempotency**: Clients can author natural-key upsert procedures for ingestion and sync pipelines without managing internal mantle IDs.
|
|
127
|
-
- **Safe concurrency across all adapters**: Concurrent writes are guarded by storage-level unique constraints (SQLite/D1 unique indexes, IndexedDB readwrite transaction assertions) and translated to standard `CONFLICT` diagnostics via typed `EntryUniqueConflict`.
|
|
128
|
-
|
|
129
|
-
## Alternatives considered
|
|
130
|
-
|
|
131
|
-
1. **Automatic retry loops on conflict**: Considered having `InvokeBuiltinUseCase` automatically re-query and retry upon catching unique collisions. Rejected because repeated attempts could fire lifecycle hooks (`before_create` / `before_update`) multiple times with unintended side effects (e.g. duplicate webhook notifications or rate limits) and mask true contention. Failing fast with a structured `CONFLICT` diagnostic gives caller control.
|
|
132
|
-
2. **Arbitrary field matching without Schema unique indexes**: Considered allowing `handler.match` on arbitrary Schema properties. Rejected because storage engines cannot enforce uniqueness without dedicated unique constraints/indexes, which would result in race conditions and duplicate entries under concurrent traffic.
|
|
133
|
-
3. **Permissive nullable unions**: Considered allowing `type: ["string", "null"]` in Procedure input schemas for `id`. Rejected because runtime entry mutations strictly require non-null scalar identifiers; allowing nullable schemas would let schema-valid requests crash inside builtin handlers.
|
|
134
|
-
|
|
135
|
-
## How to apply
|
|
136
|
-
|
|
137
|
-
1. **Declare Schema Unique Indexes**:
|
|
138
|
-
```yaml
|
|
139
|
-
apiVersion: cms.mantle.aotter.net/v1
|
|
140
|
-
kind: Schema
|
|
141
|
-
metadata:
|
|
142
|
-
name: site-settings
|
|
143
|
-
spec:
|
|
144
|
-
title: Site Settings
|
|
145
|
-
lifecycle: publishing
|
|
146
|
-
schema:
|
|
147
|
-
type: object
|
|
148
|
-
required: [siteKey, theme]
|
|
149
|
-
properties:
|
|
150
|
-
siteKey: { type: string }
|
|
151
|
-
theme: { type: string }
|
|
152
|
-
uniqueIndexes:
|
|
153
|
-
- [siteKey]
|
|
154
|
-
```
|
|
155
|
-
|
|
156
|
-
2. **Author a Matched Upsert Procedure**:
|
|
157
|
-
```yaml
|
|
158
|
-
apiVersion: cms.mantle.aotter.net/v1
|
|
159
|
-
kind: Procedure
|
|
160
|
-
metadata:
|
|
161
|
-
name: setSiteSetting
|
|
162
|
-
spec:
|
|
163
|
-
input:
|
|
164
|
-
type: object
|
|
165
|
-
required: [siteKey, theme]
|
|
166
|
-
properties:
|
|
167
|
-
siteKey: { type: string }
|
|
168
|
-
theme: { type: string }
|
|
169
|
-
expectedVersion: { type: number }
|
|
170
|
-
output:
|
|
171
|
-
type: object
|
|
172
|
-
handler:
|
|
173
|
-
kind: builtin
|
|
174
|
-
op: upsert
|
|
175
|
-
schema: site-settings
|
|
176
|
-
match: [siteKey]
|
|
177
|
-
```
|
|
178
|
-
|
|
179
|
-
3. **Validate**:
|
|
180
|
-
Run `mantle validate` to verify input contracts against the declared unique indexes and schema properties.
|
|
181
|
-
|
|
182
|
-
## Implementation status
|
|
183
|
-
|
|
184
|
-
- **`@aotter/mantle-spec`**:
|
|
185
|
-
- `ManifestGrammar.ts`: Added `match?: readonly string[]` to `HandlerBuiltinBinding`.
|
|
186
|
-
- `diagnostic.ts`: Added `BUILTIN_HANDLER_CONTRACT_INVALID` to `DIAGNOSTIC_CODES`.
|
|
187
|
-
- `ManifestParser.ts`: Parser-level validation for `handler.match`.
|
|
188
|
-
- `ManifestGraphValidator.ts`: Static input contract validation in `checkBuiltinHandler`.
|
|
189
|
-
- **`@aotter/mantle-runtime`**:
|
|
190
|
-
- `EntryRow.ts`: Added `EntryUniqueConflict` domain error.
|
|
191
|
-
- `EntryMutationDiagnostics.ts`: `withConflictDiagnostic` converts `EntryUniqueConflict` to `CONFLICT` diagnostic (HTTP 409).
|
|
192
|
-
- `DatabaseEntryRepository.ts`: SQLite/Postgres unique constraint violation translation to `EntryUniqueConflict`.
|
|
193
|
-
- `InvokeBuiltinUseCase.ts`: Matched upsert execution via `findByDataFields` and `projectUpdateAndStamp`.
|
|
194
|
-
- **`@aotter/mantle-indexeddb`**:
|
|
195
|
-
- `IndexedDbEntryRepository.ts`: Atomic transaction-level unique index enforcement and `EntryUniqueConflict` emission.
|
|
196
|
-
- **Documentation**:
|
|
197
|
-
- `docs/adr/0020-builtin-handler-contracts-and-matched-upsert.md` (this document).
|
|
198
|
-
- `docs/adr/README.md`.
|
|
199
|
-
- `docs/design-atoms.md`.
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
# ADR-0021: Author applications directly; retire Starter scaffolding
|
|
2
|
-
|
|
3
|
-
Status: Accepted by owner, 2026-09-08 (#786). Supersedes ADR-0018 for the 0.1.2 line. Its no-initialization clause is superseded by [ADR-0026](0026-progressive-generate.md) for 0.1.5.
|
|
4
|
-
|
|
5
|
-
Core is an embeddable manifest engine. Applications own package manifests,
|
|
6
|
-
Worker entries, provider configuration, business manifests and visitor UI.
|
|
7
|
-
Core no longer creates those files from a Starter bundle. Remove `create` and
|
|
8
|
-
the Starter three-way `update` CLI, their bundle renderer/export, and the
|
|
9
|
-
cross-repository Starter/Landing release gates. Legacy consumers retain the
|
|
10
|
-
immutable 0.1.0-alpha.17 packages, tags and URLs.
|
|
11
|
-
|
|
12
|
-
`generate` remains an explicit compiler for existing manifests and optional
|
|
13
|
-
installed Admin UI assets. It must not initialize a missing project or invent
|
|
14
|
-
a default Schema, frontend or home route. Web remains optional runtime
|
|
15
|
-
composition, with consumer-provided templates and routes.
|
|
16
|
-
|
|
17
|
-
Version-matched install/update skills describe direct authoring and reviewed
|
|
18
|
-
SDK dependency upgrades. Existing project source, provider identity, secrets
|
|
19
|
-
and legacy metadata remain user-owned. No replacement init/template command,
|
|
20
|
-
new preset registry or Builder/Platform implementation belongs to this change.
|
|
21
|
-
|
|
22
|
-
A small Core-owned reference consumer proves generation and a running Worker
|
|
23
|
-
against exact packed packages and public registry candidates. It is a test and
|
|
24
|
-
worked example, not a downloadable scaffolder or another launch product.
|
|
25
|
-
Useful transaction Queue/DO patterns remain documented with immutable sources.
|
|
26
|
-
|
|
27
|
-
Release ownership stays in the existing Core controller: source and packed
|
|
28
|
-
consumer gates → immutable tag → verified registry candidates → public-registry
|
|
29
|
-
consumer gate → monotonic channels → GitHub release. No downstream repo writer
|
|
30
|
-
is required. Wrong public artifacts still require fixing forward; no retagging.
|
|
@@ -1,212 +0,0 @@
|
|
|
1
|
-
# ADR-0022: Caller-observed `expectedVersion` for Admin and builtin upsert
|
|
2
|
-
|
|
3
|
-
**Status:** Accepted; the Admin binding rules are superseded by [ADR-0029](0029-mcp-apps-interaction-contracts.md) (Admin binds `expectedVersion` only from a declared interaction and infers no OCC target). The caller-observed version contract itself stands.
|
|
4
|
-
|
|
5
|
-
**Date:** 2026-09-14
|
|
6
|
-
|
|
7
|
-
**Related:** [#850](https://github.com/aotter/mantle/issues/850),
|
|
8
|
-
[ADR-0020](0020-builtin-handler-contracts-and-matched-upsert.md)
|
|
9
|
-
|
|
10
|
-
## Context
|
|
11
|
-
|
|
12
|
-
ADR-0020 remains the authority for builtin static contracts, `handler.match`
|
|
13
|
-
matching a declared unique index, natural-key lookup without a system `id`,
|
|
14
|
-
and `CONFLICT` without automatic retry.
|
|
15
|
-
|
|
16
|
-
Its **matched-upsert OCC** rule is outdated. Matched upsert forbade
|
|
17
|
-
`expectedVersion` on the Procedure input and, at runtime, substituted the
|
|
18
|
-
preloaded row's `version` for the caller's token. ID-based upsert did the same
|
|
19
|
-
whenever a preloaded row was supplied. The repository still rejected races
|
|
20
|
-
*after* the handler read, but a change made since the **client** read the row
|
|
21
|
-
was overwritten.
|
|
22
|
-
|
|
23
|
-
Admin rendered `expectedVersion` as an editable number. Operators had to type
|
|
24
|
-
a technical version, or a handler that re-read at submit time quietly dropped
|
|
25
|
-
read-time protection. Downstream (mantle-home organization quota) reproduced
|
|
26
|
-
this.
|
|
27
|
-
|
|
28
|
-
The intended contract: callers POST the **observed** native `entry.version`
|
|
29
|
-
from read time. Mantle enforces that token atomically. A successful write
|
|
30
|
-
still bumps storage to `expectedVersion + 1`. The token is **not**
|
|
31
|
-
`version + 1`.
|
|
32
|
-
|
|
33
|
-
## Decision
|
|
34
|
-
|
|
35
|
-
### 1. Wire semantics
|
|
36
|
-
|
|
37
|
-
`expectedVersion` is the observed native `entry.version` at read time.
|
|
38
|
-
|
|
39
|
-
- Successful repository writes still persist `expectedVersion + 1`.
|
|
40
|
-
- Callers must not send the next version.
|
|
41
|
-
- Core does **not** auto-inject `expectedVersion` into Manifests. Authors
|
|
42
|
-
declare it. Omit → fail-closed `BUILTIN_HANDLER_CONTRACT_INVALID`.
|
|
43
|
-
|
|
44
|
-
### 2. Closed reserved wire names
|
|
45
|
-
|
|
46
|
-
The reserved Procedure input wire name for OCC is `expectedVersion`. Business
|
|
47
|
-
fields must not collide with it. Schema `spec.schema.properties` must not
|
|
48
|
-
declare `expectedVersion`; validate fails closed (`INVALID_MANIFEST_ENVELOPE`)
|
|
49
|
-
so `projectUpdateAndStamp` cannot copy the OCC token into `data`. New reserved
|
|
50
|
-
wire names require an ADR. OCC behaviour must not depend on `x-mcp-hint`. The
|
|
51
|
-
magic word is the property name only.
|
|
52
|
-
|
|
53
|
-
### 3. Static contracts (amends ADR-0020 §2 matched upsert)
|
|
54
|
-
|
|
55
|
-
Keep ADR-0020 for `update` (`id` + `expectedVersion` both strict and
|
|
56
|
-
required), `delete`/`archive` (`id` required), `handler.match` vs
|
|
57
|
-
`uniqueIndexes`, and forbidding `id` on matched upsert.
|
|
58
|
-
|
|
59
|
-
**Matched upsert (`op: upsert` + `match`):**
|
|
60
|
-
|
|
61
|
-
- `input.properties.expectedVersion` **must** be a strict, non-nullable
|
|
62
|
-
`number`.
|
|
63
|
-
- `expectedVersion` is **not** globally required: the create branch has no
|
|
64
|
-
version. Authors may list it in `required` only when the Procedure is
|
|
65
|
-
update-only.
|
|
66
|
-
- `input` must still **not** declare `id`.
|
|
67
|
-
|
|
68
|
-
**ID-based upsert (`op: upsert` without `match`):**
|
|
69
|
-
|
|
70
|
-
- `input.properties.expectedVersion` **must** be a strict `number` (fail-closed
|
|
71
|
-
if omitted). It is not in `required`.
|
|
72
|
-
- If `id` is declared, it must be a strict `string`. Neither `id` nor
|
|
73
|
-
`expectedVersion` is required, so create can omit both.
|
|
74
|
-
|
|
75
|
-
### 4. Runtime (amends ADR-0020 §3)
|
|
76
|
-
|
|
77
|
-
Intent is the presence of a finite numeric `expectedVersion`, not the
|
|
78
|
-
presence of an id or a preload hit.
|
|
79
|
-
|
|
80
|
-
| Branch | Caller token | Existing row | Result |
|
|
81
|
-
|---|---|---|---|
|
|
82
|
-
| Create | absent | none | `create` (no version) |
|
|
83
|
-
| Create race | absent | unique collision after miss | `CONFLICT`; no silent overwrite |
|
|
84
|
-
| Update | present | found | atomic OCC with **caller** token; never `preloaded.version` |
|
|
85
|
-
| Update, stale | present | found, version ≠ token | `CONFLICT`; no retry |
|
|
86
|
-
| Update, missing | present | none (deleted / unknown) | `NOT_FOUND`; do **not** create |
|
|
87
|
-
| Create-intent vs existing | absent | found | `INPUT_VALIDATION_FAILED`; do **not** overwrite |
|
|
88
|
-
|
|
89
|
-
`opUpdate` always reads `expectedVersion` from caller input when a versioned
|
|
90
|
-
write is attempted. Preload supplies identity (`id`) and PATCH base data only.
|
|
91
|
-
|
|
92
|
-
There is still **no automatic retry**.
|
|
93
|
-
|
|
94
|
-
### 5. First-party Admin / SDK bind (not grammar)
|
|
95
|
-
|
|
96
|
-
When Procedure `input` declares `expectedVersion`, first-party Admin (and any
|
|
97
|
-
first-party SDK helper) treats the name as magic:
|
|
98
|
-
|
|
99
|
-
- Auto-bind the OCC target row's current `version` captured at read.
|
|
100
|
-
- Hide the field from the editable form (same UX idea as
|
|
101
|
-
`x-mcp-hint: idempotency-key`, keyed by reserved **name**).
|
|
102
|
-
- A resolvable OCC target (row menu, `id` in the form, or
|
|
103
|
-
`targetCollection` binding) **must** be bound before submit is enabled,
|
|
104
|
-
including matched upsert where `expectedVersion` is declared but not
|
|
105
|
-
globally required (opening from a row is update-path intent).
|
|
106
|
-
- If `expectedVersion` is in `input.required` and no OCC target can be
|
|
107
|
-
resolved, submit stays disabled (do not invent a version).
|
|
108
|
-
- Collection create / no-row dialogs may omit the token when it is not
|
|
109
|
-
required (create branch).
|
|
110
|
-
- Rebind when the selected target changes. An organization row must not
|
|
111
|
-
supply `expectedVersion` for a membership mutation.
|
|
112
|
-
- On `CONFLICT` / HTTP 409: keep operator business inputs; require an
|
|
113
|
-
explicit re-read; **no** auto-retry with the latest version.
|
|
114
|
-
- Background refetches of the same target must not replace a captured
|
|
115
|
-
token while the form still holds older values.
|
|
116
|
-
|
|
117
|
-
Other callers (HTTP Trigger, MCP, custom clients) supply the observed
|
|
118
|
-
version themselves. Magic bind/hide is first-party only.
|
|
119
|
-
|
|
120
|
-
OCC target for Admin bind:
|
|
121
|
-
|
|
122
|
-
1. If `input` declares `id`, the target is `form.id` (the membership / row
|
|
123
|
-
being mutated), never a merely contextual parent ref.
|
|
124
|
-
2. Else if the Procedure is builtin, prefer the `rowBindings` entry whose
|
|
125
|
-
`collection` equals `handler.schema`.
|
|
126
|
-
3. Else if another row binding (not the launch collection) identifies an
|
|
127
|
-
entry id, use that once filled.
|
|
128
|
-
4. Else use the launch row (quota-style actions bound only to that row).
|
|
129
|
-
|
|
130
|
-
A not-yet-existing target has no version: omit `expectedVersion` so upsert
|
|
131
|
-
takes the create branch.
|
|
132
|
-
|
|
133
|
-
### 6. Compatibility
|
|
134
|
-
|
|
135
|
-
This is a **breaking** change for:
|
|
136
|
-
|
|
137
|
-
- Matched-upsert Manifests that omitted `expectedVersion` (now fail
|
|
138
|
-
validate).
|
|
139
|
-
- Callers that updated via matched or ID-based upsert without sending an
|
|
140
|
-
observed version (preload OCC). Those writes now fail closed instead of
|
|
141
|
-
overwriting with the version read inside the handler.
|
|
142
|
-
- Matched-upsert Manifests that declared `expectedVersion` (previously
|
|
143
|
-
rejected; now required as a property).
|
|
144
|
-
|
|
145
|
-
Callers that already sent the observed version on `op: update` are
|
|
146
|
-
unchanged. HTTP and MCP share the Procedure input contract; only Admin/SDK
|
|
147
|
-
auto-fill the reserved name.
|
|
148
|
-
|
|
149
|
-
## Consequences
|
|
150
|
-
|
|
151
|
-
- Read-time OCC works through Admin forms, HTTP Triggers, and MCP for both
|
|
152
|
-
`update` and version-checked upsert.
|
|
153
|
-
- Create remains possible without a version; a versioned write cannot
|
|
154
|
-
silently recreate a deleted row.
|
|
155
|
-
- AI authors must declare `expectedVersion` as a strict number on OCC
|
|
156
|
-
builtins. Tool descriptions state **observed** version, not `+1`.
|
|
157
|
-
|
|
158
|
-
## Alternatives considered
|
|
159
|
-
|
|
160
|
-
1. **`x-mcp-hint: entry-version`.** Rejected. OCC must not depend on hints;
|
|
161
|
-
the reserved property name is the contract.
|
|
162
|
-
2. **Keep preload OCC for matched upsert.** Rejected. Accepting
|
|
163
|
-
`expectedVersion` and ignoring it is worse than forbidding it.
|
|
164
|
-
3. **Require `expectedVersion` in `input.required` for every upsert.**
|
|
165
|
-
Rejected: that makes create impossible at validate time.
|
|
166
|
-
4. **Auto-retry upsert on `CONFLICT`.** Rejected in ADR-0020; unchanged.
|
|
167
|
-
5. **Auto-inject the property into Manifests.** Rejected: fail-closed
|
|
168
|
-
grammar; authors (often agents) must see the field.
|
|
169
|
-
|
|
170
|
-
## How to apply
|
|
171
|
-
|
|
172
|
-
```yaml
|
|
173
|
-
apiVersion: cms.mantle.aotter.net/v1
|
|
174
|
-
kind: Procedure
|
|
175
|
-
metadata:
|
|
176
|
-
name: upsert-membership
|
|
177
|
-
spec:
|
|
178
|
-
input:
|
|
179
|
-
type: object
|
|
180
|
-
required: [organizationId, userId, role]
|
|
181
|
-
properties:
|
|
182
|
-
organizationId: { type: string, x-mantle-ref: organizations }
|
|
183
|
-
userId: { type: string }
|
|
184
|
-
role: { type: string }
|
|
185
|
-
expectedVersion: { type: number }
|
|
186
|
-
output:
|
|
187
|
-
type: object
|
|
188
|
-
handler:
|
|
189
|
-
kind: builtin
|
|
190
|
-
op: upsert
|
|
191
|
-
schema: organization-members
|
|
192
|
-
match: [organizationId, userId]
|
|
193
|
-
```
|
|
194
|
-
|
|
195
|
-
- Create: `{ organizationId, userId, role }` — no version.
|
|
196
|
-
- Update: the same fields plus `expectedVersion` equal to the membership
|
|
197
|
-
row's current `version`.
|
|
198
|
-
- Stale token → `CONFLICT` (409). Deleted membership + token → `NOT_FOUND`.
|
|
199
|
-
|
|
200
|
-
## Implementation status
|
|
201
|
-
|
|
202
|
-
- `@aotter/mantle-spec`: `ManifestGraphValidator` / parser fail-closed
|
|
203
|
-
`expectedVersion` on upsert; Schema `spec.schema.properties` must not
|
|
204
|
-
declare reserved Procedure input names; `EXPECTED_VERSION_PROPERTY`
|
|
205
|
-
reserved name.
|
|
206
|
-
- `@aotter/mantle-runtime`: `InvokeBuiltinUseCase` uses the caller token;
|
|
207
|
-
MCP catalog copy states observed version.
|
|
208
|
-
- `@aotter/mantle-admin` / `@aotter/mantle-admin-ui`: operations expose
|
|
209
|
-
builtin `targetCollection`; Admin binds and hides `expectedVersion`,
|
|
210
|
-
and does not enable submit on a resolvable OCC target until the
|
|
211
|
-
observed version is captured.
|
|
212
|
-
- Docs: this ADR, ADR-0020 amendment pointer, design-atoms, handbook.
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
# ADR-0023: Storage and service failure contracts
|
|
2
|
-
|
|
3
|
-
Status: Accepted for alpha.17 under #857 (amends ADR-0008 and media deletion behavior).
|
|
4
|
-
|
|
5
|
-
This is the diagnostic grammar-revise record: add RESOURCE_EXHAUSTED (507),
|
|
6
|
-
RESOURCE_UNAVAILABLE (503), RATE_LIMITED (429), OUTCOME_UNKNOWN (503),
|
|
7
|
-
PARTIAL_FAILURE (503), PRECONDITION_FAILED (412), and optional safe `failure`
|
|
8
|
-
facts to Diagnostic. No Manifest keys, new ports, or parallel wire format.
|
|
9
|
-
Existing codes and envelopes remain compatible. DiagnosticError accepts internal
|
|
10
|
-
ErrorOptions.cause; causes never enter Diagnostic. Unexpected exceptions must not
|
|
11
|
-
be copied into public messages. Core owns no tenant, plan or provider quota policy.
|
|
12
|
-
|
|
13
|
-
## Contract
|
|
14
|
-
|
|
15
|
-
A port rejects with DiagnosticError for recognized failures. The diagnostic
|
|
16
|
-
contains stable code, safe message and optional failure facts: outcome is
|
|
17
|
-
not-applied/partial/unknown; retry is never/after-change/safe/reconcile; resource
|
|
18
|
-
is an optional non-sensitive logical resource name, not credentials or SQL.
|
|
19
|
-
A provider adapter or host policy owns classification. Unknown errors stay
|
|
20
|
-
unexpected; never guess quota from arbitrary exception prose. Existing specific
|
|
21
|
-
validation, not-found and atomic OCC diagnostics remain authoritative.
|
|
22
|
-
|
|
23
|
-
`safe` requires idempotence of the same operation against the same resource.
|
|
24
|
-
It does not request automatic retry. Timeouts after write/send default to unknown
|
|
25
|
-
outcome and reconciliation, not unconditional retry. Do not downgrade unknown
|
|
26
|
-
outcome to not-applied merely because no reply arrived. Not-found on an
|
|
27
|
-
idempotent object delete is success. Read absence may be null per the port.
|
|
28
|
-
|
|
29
|
-
## Operation matrix (public contracts)
|
|
30
|
-
|
|
31
|
-
| Contract | Success | Failure / effect / retry |
|
|
32
|
-
| --- | --- | --- |
|
|
33
|
-
| EntryReader / ViewQueryExecutor | documented rows/null/page | denied/unavailable/rate limit; reads have no business mutation; explicit retry after transient failure |
|
|
34
|
-
| EntryRepository | semantic mutation with atomic expectedVersion | existing NOT_FOUND/CONFLICT; host capacity/denial; unknown write requires readback by stable id/version, never latest-version substitution |
|
|
35
|
-
| SiteConfigRepository | validated settings/locale | reads as above; writes same conditional and uncertain-effect rules as entries |
|
|
36
|
-
| MediaAssetRepository / PendingUploadRepository | metadata persisted/deleted | capacity/availability/unknown write; reconcile by asset/upload id; removal of missing metadata is idempotent where specified |
|
|
37
|
-
| MantleStorageAdapter.prepare / migrations | ready prepared storage | invalid plan/readiness; completed migration steps may persist; journal/readback before retry, no cross-provider rollback promise |
|
|
38
|
-
| DatabaseDriver | driver rows/batch result | constraint/precondition or recognized provider failure; transaction guarantees remain driver-specific; ambiguous writes require readback, SQL is never public |
|
|
39
|
-
| MediaStorage.createUpload | authorized capabilities, not uploaded bytes | policy/size/denied/unavailable; adapter must state any reservations created; no general single-use guarantee |
|
|
40
|
-
| MediaStorage.commitUpload | verified asset, then use case stores metadata | missing/type/size/precondition or partial/unknown provider effect; reconcile same upload group and objects before retry |
|
|
41
|
-
| MediaStorage.deleteObject | object absent | idempotent same-key retry; unavailable/unknown; use case retains metadata if any variant fails and returns PARTIAL_FAILURE |
|
|
42
|
-
| EmailSender | provider accepted, not guaranteed recipient delivery | known rejection not-applied; lost acknowledgement unknown/reconcile; do not resend automatically without provider idempotency/readback |
|
|
43
|
-
| DeferredHookDispatcher | accepted for at-least-once delivery | ambiguous enqueue may duplicate; existing fallback preserves eventId + trigger idempotency identity; consumers must deduplicate |
|
|
44
|
-
| HandlerRegistry / custom handler | application output | DiagnosticError/InvokeFailure preserved; unknown exceptions internal only; handler owns side-effect semantics |
|
|
45
|
-
| Clock / IdGenerator | timestamp / unpredictable unique id | unexpected environmental/programming errors; never silently substitute insecure ids |
|
|
46
|
-
| selected Auth contract (outside Runtime) | authentication/session/admin operation | preserve supported validation/denial; provider/email/storage failure handled at Auth adapter boundary; no assumption that Procedure catches Auth errors |
|
|
47
|
-
|
|
48
|
-
HTTP and Admin use the existing central mapping; MCP retains the diagnostic
|
|
49
|
-
code/failure facts rather than deriving application recovery from HTTP status.
|
|
50
|
-
Admin OCC recovery applies to structured CONFLICT only, not all 409 responses.
|
|
51
|
-
Unknown provider bodies, SQL and causes remain internal. Host-supplied messages
|
|
52
|
-
and resource labels are explicitly public and must not include sensitive data.
|
|
53
|
-
|
|
54
|
-
## Media partial deletion change
|
|
55
|
-
|
|
56
|
-
Previously object errors were logged and the asset row removed. Now every
|
|
57
|
-
variant deletion is attempted; any failure retains the row and returns partial
|
|
58
|
-
failure. A retry deletes the same keys (including already absent objects), then
|
|
59
|
-
removes metadata. If metadata deletion itself has an uncertain result, reconcile
|
|
60
|
-
by asset id; no new object identities are created. No cross-store transaction is
|
|
61
|
-
implied. Remaining metadata may reference already removed bytes during recovery.
|
|
62
|
-
|
|
63
|
-
## Compatibility / verification
|
|
64
|
-
|
|
65
|
-
New failure fields are additive; old consumers still have code/message. Media
|
|
66
|
-
partial-delete clients now receive failure rather than misleading success.
|
|
67
|
-
Focused tests cover diagnostic serialization, transport redaction, host rejection
|
|
68
|
-
and retry of partial deletion. Concrete adapter conformance must preserve
|
|
69
|
-
provider constraints and no automatic retry of uncertain writes/sends.
|