@aotter/mantle 0.1.0-alpha.9 → 0.1.2-alpha.2

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.
Files changed (109) hide show
  1. package/README.md +38 -38
  2. package/dist/cli/generate.d.ts +10 -1
  3. package/dist/cli/generate.d.ts.map +1 -1
  4. package/dist/cli/generate.js +49 -4
  5. package/dist/cli/generate.js.map +1 -1
  6. package/dist/cli/main.js +0 -8
  7. package/dist/cli/main.js.map +1 -1
  8. package/dist/codegen/emitMantleModule.js +8 -0
  9. package/dist/codegen/emitMantleModule.js.map +1 -1
  10. package/docs/adapter-guide.md +23 -26
  11. package/docs/adr/0008-structured-diagnostic-shape.md +7 -2
  12. package/docs/adr/0010-locale-and-translates.md +14 -16
  13. package/docs/adr/0011-adapter-port-spec.md +2 -1
  14. package/docs/adr/0014-auth-better-auth-and-multi-tenant-mcp.md +100 -0
  15. package/docs/adr/0018-core-starters-repository-boundary.md +3 -0
  16. package/docs/adr/0019-sealed-manifest-runtime-pipeline.md +38 -2
  17. package/docs/adr/0020-builtin-handler-contracts-and-matched-upsert.md +199 -0
  18. package/docs/adr/0021-retire-starter-scaffolding.md +30 -0
  19. package/docs/adr/0022-caller-observed-version-occ.md +212 -0
  20. package/docs/adr/0023-port-failure-contract.md +69 -0
  21. package/docs/adr/0024-manifest-native-schema-tables.md +260 -0
  22. package/docs/adr/README.md +19 -3
  23. package/docs/adr/adr-lite-803-request-diagnostics.md +38 -0
  24. package/docs/adr/adr-lite-808-route-readiness.md +47 -0
  25. package/docs/adr/adr-lite-809-bounded-public-content.md +71 -0
  26. package/docs/adr/adr-lite-812-native-parity.md +150 -0
  27. package/docs/adr/adr-lite-823-home-statistics.md +64 -0
  28. package/docs/adr/adr-lite-842-mcp-authoring.md +30 -0
  29. package/docs/adr/adr-lite-861-admin-webmcp.md +42 -0
  30. package/docs/adr/adr-lite-909-admin-ui-kit.md +37 -0
  31. package/docs/api-mcp-authorization.md +3 -664
  32. package/docs/auth-hosting-model.md +4 -4
  33. package/docs/cloudflare-low-level-composition.md +3 -104
  34. package/docs/deferred-lifecycle-queues.md +2 -243
  35. package/docs/design-atoms.md +16 -796
  36. package/docs/direct-authoring.md +5 -0
  37. package/docs/examples/minimal-worker/README.md +37 -0
  38. package/docs/examples/minimal-worker/manifests/site.yaml +25 -0
  39. package/docs/examples/minimal-worker/package.json +26 -0
  40. package/docs/examples/minimal-worker/smoke.mjs +23 -0
  41. package/docs/examples/minimal-worker/src/index.ts +4 -0
  42. package/docs/examples/minimal-worker/tsconfig.json +17 -0
  43. package/docs/examples/minimal-worker/wrangler.jsonc +22 -0
  44. package/docs/handbook/cloudflare/authentication.md +167 -0
  45. package/docs/handbook/cloudflare/bindings.md +236 -0
  46. package/docs/handbook/cloudflare/conventional-worker.md +162 -0
  47. package/docs/handbook/cloudflare/deferred-hooks-queues.md +171 -0
  48. package/docs/handbook/cloudflare/deploy-and-operate.md +105 -0
  49. package/docs/handbook/cloudflare/low-level-composition.md +169 -0
  50. package/docs/handbook/cloudflare/media-r2.md +216 -0
  51. package/docs/handbook/cloudflare/public-web.md +144 -0
  52. package/docs/handbook/concepts/authorization.md +116 -0
  53. package/docs/handbook/concepts/four-atoms.md +173 -0
  54. package/docs/handbook/concepts/lifecycle-and-locales.md +142 -0
  55. package/docs/handbook/concepts/mcp-and-agents.md +109 -0
  56. package/docs/handbook/concepts/procedures-and-triggers.md +221 -0
  57. package/docs/handbook/concepts/runtime-and-adapters.md +177 -0
  58. package/docs/handbook/concepts/views.md +191 -0
  59. package/docs/handbook/examples/commerce-transaction.md +813 -0
  60. package/docs/handbook/examples/guarded-api.md +427 -0
  61. package/docs/handbook/examples/intake-form.md +319 -0
  62. package/docs/handbook/examples/legal-documents.md +218 -0
  63. package/docs/handbook/examples/procurement-approvals.md +240 -0
  64. package/docs/handbook/examples/publication.md +240 -0
  65. package/docs/handbook/examples/reservation.md +220 -0
  66. package/docs/handbook/navigation.json +63 -0
  67. package/docs/handbook/reference/authorization.md +295 -0
  68. package/docs/handbook/reference/diagnostics.md +183 -0
  69. package/docs/handbook/reference/manifest.md +132 -0
  70. package/docs/handbook/reference/procedure.md +263 -0
  71. package/docs/handbook/reference/schema.md +250 -0
  72. package/docs/handbook/reference/site-config.md +233 -0
  73. package/docs/handbook/reference/surface.md +207 -0
  74. package/docs/handbook/reference/trigger.md +193 -0
  75. package/docs/handbook/reference/view.md +256 -0
  76. package/docs/handbook/start/project-and-cli.md +122 -0
  77. package/docs/handbook/start/quickstart-worker.md +193 -0
  78. package/docs/labels.md +3 -1
  79. package/docs/media-uploads.md +3 -184
  80. package/docs/migration-0.1.2.md +60 -3
  81. package/docs/performance-harness.md +127 -10
  82. package/docs/release-process.md +85 -231
  83. package/docs/schema-indexes.md +3 -180
  84. package/docs/sealed-pipeline-ownership.md +6 -5
  85. package/docs/spec-only-host-adoption.md +158 -0
  86. package/docs/transaction-patterns.md +5 -0
  87. package/package.json +21 -25
  88. package/skills/README.md +4 -4
  89. package/skills/develop/SKILL.md +23 -28
  90. package/skills/install/SKILL.md +55 -147
  91. package/skills/provision/SKILL.md +4 -3
  92. package/skills/theme/SKILL.md +6 -6
  93. package/skills/update/SKILL.md +32 -68
  94. package/dist/cli/create.d.ts +0 -2
  95. package/dist/cli/create.d.ts.map +0 -1
  96. package/dist/cli/create.js +0 -243
  97. package/dist/cli/create.js.map +0 -1
  98. package/dist/cli/update.d.ts +0 -2
  99. package/dist/cli/update.d.ts.map +0 -1
  100. package/dist/cli/update.js +0 -413
  101. package/dist/cli/update.js.map +0 -1
  102. package/dist/provision/renderProvisionBundle.d.ts +0 -70
  103. package/dist/provision/renderProvisionBundle.d.ts.map +0 -1
  104. package/dist/provision/renderProvisionBundle.js +0 -367
  105. package/dist/provision/renderProvisionBundle.js.map +0 -1
  106. package/dist/provision.d.ts +0 -2
  107. package/dist/provision.d.ts.map +0 -1
  108. package/dist/provision.js +0 -2
  109. package/dist/provision.js.map +0 -1
package/README.md CHANGED
@@ -5,7 +5,7 @@ engine built around a 4-atom YAML model (Schema / View / Procedure / Trigger)
5
5
  where agents write config and the runtime carries the complexity.
6
6
 
7
7
  > Mantle is prerelease software. Use this package's `package.json` as the exact
8
- > installed version; APIs may change between prereleases until v0.1.0.
8
+ > installed version; APIs may change between prereleases until the first stable 0.1.2 release.
9
9
 
10
10
  ## Install
11
11
 
@@ -49,18 +49,18 @@ by the application.
49
49
  The package also installs `mantle` and `mantle-harness`:
50
50
 
51
51
  ```bash
52
- npx -y @aotter/mantle@alpha create <type> <directory>
53
52
  pnpm exec mantle generate
54
53
  pnpm exec mantle generate --check
55
54
  pnpm exec mantle skills
56
55
  pnpm exec mantle skills --check
57
- pnpm exec mantle update --ref <immutable-starter-ref>
58
56
  pnpm exec mantle-harness indexes --require-public
59
57
  pnpm exec mantle-harness http --base-url http://127.0.0.1:8787 --route page=/en/example
60
58
  ```
61
59
 
62
60
  `mantle generate` validates and compiles `./manifests/`, then writes one typed
63
- `.mantle/generated/mantle.ts` module. It performs no Admin asset installation,
61
+ `.mantle/generated/mantle.ts` module. When `@aotter/mantle-admin-ui` is
62
+ installed, it also syncs the Admin SPA to `public/_mantle/admin/` (excluding
63
+ `server.*` package exports). Core-only installs skip that copy. It performs no
64
64
  skill sync, package update, styling, provisioning, or deployment.
65
65
  The same pure emitter is available from `@aotter/mantle/codegen` when a host
66
66
  wants to own parsing and filesystem IO.
@@ -86,10 +86,9 @@ does not cache or retry. Dynamic and platform hosts can keep their own lifecycle
86
86
  use generated `bindMantle(runtime)`, or skip code generation and call
87
87
  `runtime.executeView({ view: "published-notes" })` directly.
88
88
 
89
- `mantle create` materializes one version-matched starter bundle into a new
90
- directory and stops: it installs nothing, initializes no repository, configures
91
- no auth, and deploys nothing. It resolves only the official immutable starter
92
- tag for the CLI's own version, and refuses to write into an existing path.
89
+ Author the application directly using [the installed guide](docs/handbook/start/project-and-cli.md).
90
+ The CLI has no scaffold/type picker; missing manifests fail without creating
91
+ an application or a visitor home page.
93
92
 
94
93
  `mantle skills` copies every skill the installed package marks
95
94
  `projection: project` in its front matter into matching
@@ -100,15 +99,10 @@ receive identical bytes; `--check` detects drift without writing. An older
100
99
  project may also carry `.agent/skills/`, which is left untouched. Manifest
101
100
  generation never rewrites agent instructions.
102
101
 
103
- `mantle update` compares the recorded source bundle, a target bundle, and the
104
- local project, then writes `.mantle/update-report.json`. It never applies the
105
- diff. Configure `.mantle/features.json` `registry.bundleBaseUrl` with a URL
106
- containing `{ref}`, or pass `--bundle-base-url` for the alpha.63 bridge. The
107
- report carries the only supported metadata migration; review and apply it
108
- after porting selected upstream changes. Format-versioned bundles use the same
109
- strict renderer as `mantle create`; an invalid current launch state fails
110
- instead of producing a guessed diff. Older bundles without `formatVersion`
111
- retain a read-only compatibility renderer.
102
+ SDK upgrades use the package manager and the version-matched update skill.
103
+ For npm peer-resolution troubleshooting, see [the authoring guide](docs/handbook/start/project-and-cli.md).
104
+ See [0.1.2 migration](docs/migration-0.1.2.md) for removed bundle APIs and how to
105
+ preserve legacy application source and provider configuration.
112
106
 
113
107
  ## Conventional Cloudflare Worker
114
108
 
@@ -134,7 +128,8 @@ configuration keeps public routes available but returns `503 setup_incomplete`
134
128
  from Auth-owned private routes. Pass `auth: (env) => Auth` only when the site
135
129
  needs to replace this conventional factory; Core still owns the Auth routes.
136
130
  The exact bindings and validation rules are in the
137
- [Cloudflare adapter README](../adapters/cloudflare/README.md#conventional-auth).
131
+ `node_modules/@aotter/mantle-cloudflare/README.md`, under “Conventional Auth”
132
+ (path relative to the application root).
138
133
 
139
134
  Extensions may add routes but may not replace Core surfaces. These paths are
140
135
  reserved:
@@ -181,22 +176,18 @@ identity reused by browser favicons, Admin chrome, and MCP `serverInfo.icons`;
181
176
  PNG is the compatibility rendition and SVG remains the editable source.
182
177
 
183
178
  For an uncommon deployment that must own the top-level assembly, use the
184
- embedded [`docs/cloudflare-low-level-composition.md`](docs/cloudflare-low-level-composition.md)
179
+ embedded [`docs/handbook/cloudflare/low-level-composition.md`](docs/handbook/cloudflare/low-level-composition.md)
185
180
  fixture. It composes the same public primitives without importing package
186
181
  internals or rebuilding Mantle's adapters.
187
182
 
188
183
  ## Getting started
189
184
 
190
- Give the [Mantle repo](https://github.com/aotter/mantle) to a coding agent or
191
- install its agent plugin, then ask it to create a site. The install skill picks
192
- a deterministic bundle from
193
- [`aotter/mantle-starters`](https://github.com/aotter/mantle-starters),
194
- materializes a local project, and verifies it before any provider work.
195
-
196
- [Mantle landing](https://mantle.tools) uses the same bundles and continues
197
- through private GitHub repo creation, Cloudflare deployment, and optional paid
198
- hosted auth. Generated repos project Core-owned `mantle:*` skills from their
199
- installed package for repo-local use.
185
+ Use the installed install skill and [direct-authoring guide](docs/handbook/start/project-and-cli.md).
186
+ The owner or agent writes the application's manifests, entry and configuration;
187
+ `generate` compiles them and `skills` projects the version-matched instructions.
188
+ The [minimal Worker reference](docs/examples/minimal-worker/README.md) is an
189
+ executable example, not a scaffold command. Legacy Landing/Starters remain on
190
+ alpha.17 and are not required by new applications.
200
191
 
201
192
  ## Agent marketplace install
202
193
 
@@ -249,16 +240,20 @@ adapter is a port-implementation exercise, not a runtime refactor.
249
240
 
250
241
  ## Documentation
251
242
 
243
+ - The handbook is the user documentation and ships inside this npm package:
244
+ `node_modules/@aotter/mantle/docs/handbook/` (start, concepts, Cloudflare
245
+ guides, examples, reference; `navigation.json` lists every page in order).
246
+ The copy in `node_modules` describes the installed release.
252
247
  - Embedded docs and agent skills ship inside this npm package for
253
248
  generated-site agents:
254
- - `node_modules/@aotter/mantle/docs/design-atoms.md`
255
- - `node_modules/@aotter/mantle/docs/api-mcp-authorization.md` (anonymous,
249
+ - `node_modules/@aotter/mantle/docs/handbook/reference/manifest.md`
250
+ - `node_modules/@aotter/mantle/docs/handbook/examples/guarded-api.md` (anonymous,
256
251
  API-key, paid guard, personal-token, OAuth, REST, and MCP examples)
257
- - `node_modules/@aotter/mantle/docs/media-uploads.md` (Cloudflare R2 adapter recipe)
258
- - `node_modules/@aotter/mantle/docs/deferred-lifecycle-queues.md` (versioned
252
+ - `node_modules/@aotter/mantle/docs/handbook/cloudflare/media-r2.md` (Cloudflare R2 adapter recipe)
253
+ - `node_modules/@aotter/mantle/docs/handbook/cloudflare/deferred-hooks-queues.md` (versioned
259
254
  Queue wiring, retry/DLQ, idempotency, and delivery guarantees)
260
- - `node_modules/@aotter/mantle/docs/schema-indexes.md` (ordered composite
261
- JSON-field indexes, D1 query plans, and the safe Procedure SQL helper)
255
+ - `node_modules/@aotter/mantle/docs/handbook/reference/schema.md` (Schema grammar,
256
+ ordered composite JSON-field indexes and the safe Procedure SQL helper)
262
257
  - `node_modules/@aotter/mantle/docs/performance-harness.md` (crowded SQLite,
263
258
  Wrangler-local D1 origin paths and coding-agent guardrails)
264
259
  - `node_modules/@aotter/mantle/docs/adr/`
@@ -269,9 +264,9 @@ adapter is a port-implementation exercise, not a runtime refactor.
269
264
  - `node_modules/@aotter/mantle/skills/install/SKILL.md`
270
265
  - `node_modules/@aotter/mantle/skills/provision/SKILL.md`
271
266
  - [4-atom manifest model (ADR-0001)](docs/adr/0001-four-atom-manifest-model.md)
272
- - [API and MCP authorization](docs/api-mcp-authorization.md)
273
- - [Deferred lifecycle Queues](docs/deferred-lifecycle-queues.md)
274
- - [Schema indexes on D1](docs/schema-indexes.md)
267
+ - [API and MCP authorization](docs/handbook/examples/guarded-api.md)
268
+ - [Deferred lifecycle Queues](docs/handbook/cloudflare/deferred-hooks-queues.md)
269
+ - [Schema indexes on D1](docs/handbook/reference/schema.md)
275
270
  - [Release process](docs/release-process.md)
276
271
  - [Source repository](https://github.com/aotter/mantle)
277
272
  - [Issues](https://github.com/aotter/mantle/issues)
@@ -279,3 +274,8 @@ adapter is a port-implementation exercise, not a runtime refactor.
279
274
  ## License
280
275
 
281
276
  Apache-2.0
277
+
278
+ Pure extension routes do not await content preparation. Before an extension
279
+ uses Mantle data or database-backed Auth, await its supplied `getRuntime()`
280
+ (or `ref.get()`). Standard protected routes establish this readiness themselves;
281
+ queue/scheduled handlers continue to use `worker.getRuntime(env)`.
@@ -1,2 +1,11 @@
1
- export declare function runGenerate(rawArgs: readonly string[]): Promise<number>;
1
+ /** Test seam for Core-only vs Admin-present installs. */
2
+ export interface GenerateDeps {
3
+ readonly resolveAdminUiIndexHtml?: () => string | null;
4
+ }
5
+ /**
6
+ * Locate the optional Admin SPA. A Core-only install does not have
7
+ * `@aotter/mantle-admin-ui`, so resolution failure is not an error.
8
+ */
9
+ export declare function resolveAdminUiIndexHtml(): string | null;
10
+ export declare function runGenerate(rawArgs: readonly string[], deps?: GenerateDeps): Promise<number>;
2
11
  //# sourceMappingURL=generate.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"generate.d.ts","sourceRoot":"","sources":["../../src/cli/generate.ts"],"names":[],"mappings":"AAeA,wBAAsB,WAAW,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,GAAG,OAAO,CAAC,MAAM,CAAC,CAyC7E"}
1
+ {"version":3,"file":"generate.d.ts","sourceRoot":"","sources":["../../src/cli/generate.ts"],"names":[],"mappings":"AAiBA,yDAAyD;AACzD,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,uBAAuB,CAAC,EAAE,MAAM,MAAM,GAAG,IAAI,CAAC;CACxD;AAED;;;GAGG;AACH,wBAAgB,uBAAuB,IAAI,MAAM,GAAG,IAAI,CAOvD;AAED,wBAAsB,WAAW,CAC/B,OAAO,EAAE,SAAS,MAAM,EAAE,EAC1B,IAAI,GAAE,YAAiB,GACtB,OAAO,CAAC,MAAM,CAAC,CA+CjB"}
@@ -1,11 +1,26 @@
1
- import { mkdir, readFile, writeFile } from "node:fs/promises";
1
+ import { existsSync } from "node:fs";
2
+ import { mkdir, readFile, readdir, rm, writeFile } from "node:fs/promises";
2
3
  import { dirname, join, resolve } from "node:path";
3
4
  import { cwd, stderr, stdout } from "node:process";
5
+ import { fileURLToPath } from "node:url";
4
6
  import { parseArgs } from "node:util";
5
7
  import { ValidateManifestsUseCase } from "@aotter/mantle-spec";
6
8
  import { loadManifestsFromRoot } from "@aotter/mantle-spec/cli";
7
9
  import { assertMantleNamespace, emitMantleModule } from "../codegen/emitMantleModule.js";
8
- export async function runGenerate(rawArgs) {
10
+ /**
11
+ * Locate the optional Admin SPA. A Core-only install does not have
12
+ * `@aotter/mantle-admin-ui`, so resolution failure is not an error.
13
+ */
14
+ export function resolveAdminUiIndexHtml() {
15
+ try {
16
+ const path = fileURLToPath(import.meta.resolve("@aotter/mantle-admin-ui/index.html"));
17
+ return existsSync(path) ? path : null;
18
+ }
19
+ catch {
20
+ return null;
21
+ }
22
+ }
23
+ export async function runGenerate(rawArgs, deps = {}) {
9
24
  let options;
10
25
  try {
11
26
  const parsed = parseGenerateArgs(rawArgs);
@@ -38,7 +53,13 @@ export async function runGenerate(rawArgs) {
38
53
  return 1;
39
54
  }
40
55
  const output = resolve(cwd(), options.output);
41
- const stale = !(await syncText(join(output, "mantle.ts"), emitted.source, options.check));
56
+ let stale = !(await syncText(join(output, "mantle.ts"), emitted.source, options.check));
57
+ const adminIndex = (deps.resolveAdminUiIndexHtml ?? resolveAdminUiIndexHtml)();
58
+ if (adminIndex !== null) {
59
+ const adminSource = dirname(adminIndex);
60
+ const adminTarget = resolve(cwd(), "public/_mantle/admin");
61
+ stale = !(await syncAdminAssets(adminSource, adminTarget, options.check)) || stale;
62
+ }
42
63
  if (stale && options.check) {
43
64
  stderr.write("Mantle generated files are stale; run `mantle generate`.\n");
44
65
  return 1;
@@ -76,7 +97,7 @@ Options:
76
97
  --manifests <dir> Manifest directory (default: ./manifests)
77
98
  -o, --output <dir> Generated root (default: .mantle/generated)
78
99
  --namespace <name> Generated type namespace (default: Mantle)
79
- --check Fail without writing when generated code is stale
100
+ --check Fail without writing when generated code or Admin assets are stale
80
101
  -h, --help This help
81
102
  `);
82
103
  }
@@ -95,6 +116,30 @@ async function syncText(path, expected, check) {
95
116
  await writeFile(path, expected, "utf8");
96
117
  return true;
97
118
  }
119
+ async function syncAdminAssets(source, target, check) {
120
+ const sourceFiles = (await listFiles(source)).filter((path) => !path.startsWith("server."));
121
+ const targetFiles = await listFiles(target).catch(() => []);
122
+ const current = sourceFiles.length === targetFiles.length
123
+ && sourceFiles.every((path, index) => path === targetFiles[index])
124
+ && (await Promise.all(sourceFiles.map(async (path) => (await readFile(join(source, path))).equals(await readFile(join(target, path)))))).every(Boolean);
125
+ if (current || check)
126
+ return current;
127
+ await rm(target, { recursive: true, force: true });
128
+ for (const path of sourceFiles) {
129
+ const destination = join(target, path);
130
+ await mkdir(dirname(destination), { recursive: true });
131
+ await writeFile(destination, await readFile(join(source, path)));
132
+ }
133
+ return true;
134
+ }
135
+ async function listFiles(root, prefix = "") {
136
+ const entries = await readdir(join(root, prefix), { withFileTypes: true });
137
+ const files = await Promise.all(entries.map((entry) => {
138
+ const path = join(prefix, entry.name);
139
+ return entry.isDirectory() ? listFiles(root, path) : [path];
140
+ }));
141
+ return files.flat().sort();
142
+ }
98
143
  function message(error) {
99
144
  return error instanceof Error ? error.message : String(error);
100
145
  }
@@ -1 +1 @@
1
- {"version":3,"file":"generate.js","sourceRoot":"","sources":["../../src/cli/generate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC9D,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACnD,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACnD,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,EAAE,wBAAwB,EAAmB,MAAM,qBAAqB,CAAC;AAChF,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,qBAAqB,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AASzF,MAAM,CAAC,KAAK,UAAU,WAAW,CAAC,OAA0B;IAC1D,IA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AAG,CAAC,CAAC,KAAK,EAAE,EAAE;QACpD,MAAM,IAAI,GAAG,IAAI,CAAC,MAAM,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC;QACtC,OAAO,KAAK,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;IAC9D,CAAC,CAAC,CAAC,CAAC;IACJ,OAAO,KAAK,CAAC,IAAI,EAAE,CAAC,IAAI,EAAE,CAAC;AAC7B,CAAC;AAED,SAAS,OAAO,CAAC,KAAc;IAC7B,OAAO,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AAChE,CAAC"}
package/dist/cli/main.js CHANGED
@@ -1,10 +1,8 @@
1
1
  #!/usr/bin/env node
2
2
  import { argv, stderr, stdout } from "node:process";
3
3
  import { runEmitOpenapi, runValidate, } from "@aotter/mantle-spec/cli";
4
- import { runCreate } from "./create.js";
5
4
  import { runGenerate } from "./generate.js";
6
5
  import { runSkills } from "./skills.js";
7
- import { runUpdate } from "./update.js";
8
6
  async function main() {
9
7
  const command = argv[2];
10
8
  if (!command || command === "--help" || command === "-h") {
@@ -13,10 +11,8 @@ async function main() {
13
11
  Usage: mantle <subcommand> [options]
14
12
 
15
13
  Subcommands:
16
- create Materialize a version-matched starter into a new directory
17
14
  generate Compile manifests and handler types
18
15
  skills Project version-matched Core skills
19
- update Compare local work with provision bundles
20
16
  validate Static manifest + handler-source validation
21
17
  emit-openapi Emit OpenAPI 3.1 from Triggers + Views
22
18
  `);
@@ -24,14 +20,10 @@ Subcommands:
24
20
  }
25
21
  const rest = argv.slice(3);
26
22
  switch (command) {
27
- case "create":
28
- return runCreate(rest);
29
23
  case "generate":
30
24
  return runGenerate(rest);
31
25
  case "skills":
32
26
  return runSkills(rest);
33
- case "update":
34
- return runUpdate(rest);
35
27
  case "validate":
36
28
  return runValidate(rest);
37
29
  case "emit-openapi":
@@ -1 +1 @@
1
- {"version":3,"file":"main.js","sourceRoot":"","sources":["../../src/cli/main.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,EACL,cAAc,EACd,WAAW,GACZ,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,KAAK,UAAU,IAAI;IACjB,MAAM,OAAO,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;IACxB,IAAI,CAAC,OAAO,IAAI,OAAO,KAAK,QAAQ,IAAI,OAAO,KAAK,IAAI,EAAE,CAAC;QACzD,MAAM,CAAC,KAAK,CAAC;;;;;;;;;;;CAWhB,CAAC,CAAC;QACC,OAAO,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IACzB,CAAC;IACD,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IAC3B,QAAQ,OAAO,EAAE,CAAC;QAChB,KAAK,QAAQ;YACX,OAAO,SAAS,CAAC,IAAI,CAAC,CAAC;QACzB,KAAK,UAAU;YACb,OAAO,WAAW,CAAC,IAAI,CAAC,CAAC;QAC3B,KAAK,QAAQ;YACX,OAAO,SAAS,CAAC,IAAI,CAAC,CAAC;QACzB,KAAK,QAAQ;YACX,OAAO,SAAS,CAAC,IAAI,CAAC,CAAC;QACzB,KAAK,UAAU;YACb,OAAO,WAAW,CAAC,IAAI,CAAC,CAAC;QAC3B,KAAK,cAAc;YACjB,OAAO,cAAc,CAAC,IAAI,CAAC,CAAC;QAC9B;YACE,MA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AAC,CAAC;QAC3B,KAAK,QAAQ;YACX,OAAO,SAAS,CAAC,IAAI,CAAC,CAAC;QACzB,KAAK,UAAU;YACb,OAAO,WAAW,CAAC,IAAI,CAAC,CAAC;QAC3B,KAAK,cAAc;YACjB,OAAO,cAAc,CAAC,IAAI,CAAC,CAAC;QAC9B;YACE,MAAM,CAAC,KAAK,CAAC,uBAAuB,OAAO,IAAI,CAAC,CAAC;YACjD,OAAO,CAAC,CAAC;IACb,CAAC;AACH,CAAC;AAED,IAAI,EAAE,CAAC,IAAI,CACT,CAAC,IAAI,EAAE,EAAE;IACP,OAAO,CAAC,QAAQ,GAAG,IAAI,CAAC;AAC1B,CAAC,EACD,CAAC,KAAK,EAAE,EAAE;IACR,MAAM,CAAC,KAAK,CAAC,mBAAmB,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAC3G,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;AACvB,CAAC,CACF,CAAC"}
@@ -113,6 +113,14 @@ function schemaLines(name, namespace) {
113
113
  ` runtime.createDraft.execute({ ...request, collection: ${JSON.stringify(name)}, data: request.data as unknown as Record<string, unknown> }),`,
114
114
  ` get: (request: Omit<Parameters<CoreMantleRuntime["getEntry"]["execute"]>[0], "collection">) =>`,
115
115
  ` runtime.getEntry.execute({ ...request, collection: ${JSON.stringify(name)} }),`,
116
+ ` updateDraft: (request: Omit<Parameters<CoreMantleRuntime["updateDraft"]["execute"]>[0], "collection">) =>`,
117
+ ` runtime.updateDraft.execute({ ...request, collection: ${JSON.stringify(name)} }),`,
118
+ ` requestPublish: (request: Omit<Parameters<CoreMantleRuntime["requestPublish"]["execute"]>[0], "collection">) =>`,
119
+ ` runtime.requestPublish.execute({ ...request, collection: ${JSON.stringify(name)} }),`,
120
+ ` unpublish: (request: Omit<Parameters<CoreMantleRuntime["unpublish"]["execute"]>[0], "collection">) =>`,
121
+ ` runtime.unpublish.execute({ ...request, collection: ${JSON.stringify(name)} }),`,
122
+ ` archive: (request: Omit<Parameters<CoreMantleRuntime["archive"]["execute"]>[0], "collection">) =>`,
123
+ ` runtime.archive.execute({ ...request, collection: ${JSON.stringify(name)} }),`,
116
124
  ` list: (request: Omit<Parameters<CoreMantleRuntime["listEntries"]["execute"]>[0], "collection"> = {}) =>`,
117
125
  ` runtime.listEntries.execute({ ...request, collection: ${JSON.stringify(name)} }),`,
118
126
  ` delete: (request: Omit<Parameters<CoreMantleRuntime["deleteEntry"]["execute"]>[0], "collection">) =>`,
@@ -1 +1 @@
1
- {"version":3,"file":"emitMantleModule.js","sourceRoot":"","sources":["../../src/codegen/emitMantleModule.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,EAChB,sBAAsB,EACtB,kBAAkB,GAGnB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,kBAAkB,EAAoB,MAAM,wBAAwB,CAAC;AAW9E,MAAM,eAAe,GAAG,IAAI,GAAG,CAAC;IAC9B,uBAAuB;IACvB,mBAAmB;IACnB,qBAAqB;IACrB,iBAAiB;IACjB,gBAAgB;IAChB,mBAAmB;IACnB,uBAAuB;IACvB,kBAAkB;IAClB,YAAY;IACZ,mBAAmB;IACnB,cAAc;IACd,MAAM;IACN,iBAAiB;CAClB,CAAC,CAAC;AAEH,MAAM,UAAU,qBAAqB,CAAC,SAAiB,EAAE,KAAK,GAAG,WAAW;IAC1E,IAAI,CAAC,4BAA4B,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,eAAe,CAAC,GAAG,CAAC,SAAS,CAAC,EAAE,CAAC;QACpF,MAAM,IAAI,KAAK,CAAC,GAAG,KAAK,sDAAsD,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC;IAC7G,CAAC;AACH,CAAC;AAED,6EAA6E;AAC7E,MAAM,UAAU,gBAAgB,CAAC,OAAgC;IAC/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,CAC3C,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACX,OAAO,aAAa,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,MAAM,EAAE,CAAC;AAC5D,CAAC"}
@@ -4,7 +4,7 @@ This guide is the fresh-developer entry point for implementing a new mantle plat
4
4
 
5
5
  Read this with [ADR-0019](adr/0019-sealed-manifest-runtime-pipeline.md). The source of truth for TypeScript shapes is `packages/mantle-runtime/src/domain/port/`.
6
6
 
7
- Adapter packages live under `packages/adapters/<platform>/` using a plural `adapters` bucket. The npm package names stay unchanged, for example `@aotter/mantle-cloudflare`. Keep adapters in this monorepo until the runtime/spec API is stable enough that coordinated releases across separate repositories would not create version skew for starters.
7
+ Adapter packages live under `packages/adapters/<platform>/` using a plural `adapters` bucket. The npm package names stay unchanged, for example `@aotter/mantle-cloudflare`. Keep adapters in this monorepo until the runtime/spec API is stable enough that coordinated releases across separate repositories would not create version skew for consumers.
8
8
 
9
9
  ## Required storage boundary
10
10
 
@@ -82,8 +82,9 @@ The prepared revision carries its exact plan, but exposes both `plan` and
82
82
  capabilities. Omit `handlerNames` only for a read-only embedding that never
83
83
  dispatches Procedures.
84
84
 
85
- The official SQLite adapter runs canonical migrations, defaults, indexes, and
86
- schema-View reconciliation, and skips mutation for an unchanged revision. A
85
+ The official SQLite adapter runs canonical migrations, materializes one native
86
+ table per Schema, prepares indexes and Views, and skips mutation for an
87
+ unchanged storage revision. A
87
88
  custom adapter owns its own preparation and returns application-owned semantic
88
89
  ports. Unsupported native View dialects fail before the adapter mutates state.
89
90
 
@@ -106,6 +107,15 @@ optional `/libsql` subpath adapts a caller-owned remote Turso/libSQL client to
106
107
  the canonical SQLite chain; the default entry has no database-vendor policy.
107
108
  Vercel's read-only filesystem and writable `/tmp` are never durable state.
108
109
 
110
+ ### Browser IndexedDB embedding
111
+
112
+ `@aotter/mantle-indexeddb` implements the same required semantic storage ports
113
+ over one application-owned IndexedDB database. It keeps browser globals out of
114
+ Runtime Core, supports declarative Views with a documented O(n) collection
115
+ scan, and exposes `deleteDatabase()` only on the concrete adapter. The host owns
116
+ database naming, `navigator.storage` persistence requests, active-runtime
117
+ selection, UI invalidation, and any remote synchronization.
118
+
109
119
  ## HTTP and MCP surfaces
110
120
 
111
121
  The runtime is a library, not an HTTP server. A new adapter must mount equivalent framework routes:
@@ -126,7 +136,7 @@ adapter. A narrow adapter extension seam may let consumer code verify its own
126
136
  API-key or personal-token formats, but credential storage/issuance must not
127
137
  become a runtime port. The Cloudflare reference is
128
138
  `mount/resolveCaller.ts`; consumer usage is documented in
129
- [API and MCP authorization](api-mcp-authorization.md).
139
+ [API and MCP authorization](handbook/examples/guarded-api.md).
130
140
 
131
141
  Minimum HTTP behavior for a full adapter:
132
142
 
@@ -134,7 +144,7 @@ Minimum HTTP behavior for a full adapter:
134
144
  - Route `GET /api/views/<name>` to `runtime.executeView`.
135
145
  - Mount admin content APIs with session/role checks before calling runtime content use cases.
136
146
  - Serve selected Admin SPA assets through `AdminAssetServer`, with an SPA catchall for client-side routes.
137
- - Mount public render routes and markdown mirrors when the starter exposes public pages.
147
+ - Mount public render routes and markdown mirrors when the application exposes public pages.
138
148
  - Translate runtime diagnostics and validation failures into stable HTTP JSON responses instead of throwing raw errors.
139
149
  - Evaluate target auth and dynamic guards through the runtime use cases; do
140
150
  not duplicate guard logic in HTTP handlers.
@@ -152,27 +162,10 @@ its document operations into their own routing and cache conventions.
152
162
 
153
163
  ### HTTP cache contract
154
164
 
155
- The Cloudflare adapter is private by default. Consumers must apply its final
156
- cache policy after admin, auth, API, OAuth, MCP, application routes, redirects,
157
- and errors.
158
- Those responses receive `Cache-Control: private, no-store`; Cloudflare-specific
159
- CDN cache overrides are removed.
160
-
161
- `mountPublicRoutes(...)` renders canonical D1 state and opts only successful HTML, markdown,
162
- `llms.txt`, and sitemap responses into the shared cache with
163
- `Cache-Control: public, max-age=0, s-maxage=300` and the site-level
164
- `Cache-Tag: mantle-public`. The top-level policy preserves
165
- that opt-in only for anonymous `GET`/`HEAD` responses with status 200, explicit
166
- shared freshness, no request `Cookie` or `Authorization`, and no response
167
- `Set-Cookie`. It also varies public responses by `Cookie` and `Authorization`.
168
-
169
- A starter-level Workers Cache may therefore store only responses that still
170
- meet that exact public contract. It must bypass credentialed/cookie requests
171
- and must never infer cacheability from a URL prefix. Cache entries remain
172
- version-local; cross-version caching is outside this contract. Successful
173
- publishing-content and site-setting mutations purge `mantle-public` through
174
- Cloudflare's native cache API. Operational records and immutable assets do not
175
- purge the public render cache.
165
+ Keep responses private by default. For Cloudflare, apply the final policy after
166
+ all routes and preserve only explicit anonymous public opt-in. Follow the
167
+ [public cache contract](handbook/cloudflare/public-web.md#cache-contract) and the
168
+ [performance harness](performance-harness.md#cache-contract) for verification.
176
169
 
177
170
  Minimum auth/MCP behavior:
178
171
 
@@ -195,6 +188,10 @@ storage preparation and binding do not accept or require a static asset port.
195
188
 
196
189
  ## Implementation checklist
197
190
 
191
+ - [ ] Run `runStorageConformance` from `@aotter/mantle-runtime/testing/storage`
192
+ against a disposable prepared-storage factory. See the
193
+ [Runtime conformance guide](../packages/mantle-runtime/README.md#storage-adapter-conformance)
194
+ for coverage, cleanup, locale setup, and remaining adapter-specific tests.
198
195
  - [ ] Implement `MantleStorageAdapter` returning existing semantic ports, or reuse `SqliteMantleStorageAdapter` with an already-owned handle.
199
196
  - [ ] Call `bootMantleRuntime()` once per semantic revision, or explicitly prepare before binding.
200
197
  - [ ] Mount HTTP Trigger and View REST surfaces.
@@ -3,7 +3,7 @@
3
3
  **Status:** Carried over from POC v0.0.x; amended for the shipped v0.1
4
4
  diagnostic emitters and measured harnesses.
5
5
 
6
- **Date:** 2026-04-30 (POC); last amended 2026-08-03.
6
+ **Date:** 2026-04-30 (POC); last amended 2026-08-31.
7
7
 
8
8
  **Deciders**: phsu
9
9
 
@@ -215,8 +215,13 @@ admin SPA and CF Workers could share a CSP-safe path with no
215
215
  `Function`-constructor codegen. The v0.1.0 rebuild inherits zod
216
216
  from day 1 — manifest authoring stays JSON Schema, but the
217
217
  runtime validator a manifest author's request body hits is a
218
- zod schema, produced by the JSON-Schema → zod converter in
218
+ zod schema, produced by Zod's official `z.fromJSONSchema` importer behind the
219
+ compatibility boundary in
219
220
  `@aotter/mantle-spec` (see [`docs/design-atoms.md`](../design-atoms.md) § "Manifest validation — JSON Schema in, zod at runtime").
221
+ Mantle validates its supported keyword/ref policy before import and emits
222
+ `JSON_SCHEMA_UNSUPPORTED`, `JSON_SCHEMA_REF_INVALID`, or
223
+ `JSON_SCHEMA_LIMIT_EXCEEDED`; Zod owns the accepted keywords' validation
224
+ semantics.
220
225
 
221
226
  Concretely, runtime entry validation consumes `ZodError.issues`:
222
227
 
@@ -1,6 +1,8 @@
1
1
  # ADR-0010: Locale three-layer model and parent/child translates pattern
2
2
 
3
- **Status:** Carried over from POC v0.0.x; refreshed for v0.1.0.
3
+ **Status:** Carried over from POC v0.0.x; storage details superseded by
4
+ [ADR-0024](0024-manifest-native-schema-tables.md). Locale semantics remain in
5
+ force, but `locale` is now a native field on each localized Schema table.
4
6
 
5
7
  **Date**: 2026-05-01 (POC) / refreshed 2026-05-03 (v0.1.0 rebuild)
6
8
 
@@ -122,18 +124,18 @@ canonicalize-on-write keeps the cold-start path free of ceremony and
122
124
  lets the manifest, the CmsConfig, and the D1 row drift apart safely
123
125
  (the runtime gate in Layer 3 is what reconciles them).
124
126
 
125
- ### Layer 3 — Per-entry data (`data.locale`)
127
+ ### Layer 3 — Per-entry data (`locale`)
126
128
 
127
129
  ```jsonc
128
- // entries.data for a localized Schema
130
+ // a localized Schema record
129
131
  { "title": "...", "body": "...", "locale": "zh-TW" }
130
132
 
131
- // entries.data for a non-localized Schema
133
+ // a non-localized Schema record
132
134
  { "name": "...", "color": "..." } // no locale field
133
135
  ```
134
136
 
135
- - There is no top-level `entries.locale` column. Locale lives inside
136
- the `data` JSON.
137
+ - There is no shared `entries.locale` column. `locale` is the authored native
138
+ field on each localized Schema table.
137
139
  - The runtime locale gate (in `mantle-runtime`'s content-ops
138
140
  `helpers.ts`) is the **authoritative per-request check**. On every
139
141
  read and write the gate validates:
@@ -145,10 +147,8 @@ lets the manifest, the CmsConfig, and the D1 row drift apart safely
145
147
  - `localized: false` Schema → `data.locale` MUST be absent
146
148
  (`null` is treated as absent and stripped on the read path; any
147
149
  other value is rejected to catch typos like `locaIe: en`).
148
- - Indexed via virtual generated column + partial unique index on
149
- `json_extract(data, '$.locale')`, scoped to the Schema's
150
- `collection`. Same pattern as `Schema.spec.unique`. Created only
151
- for localized Schemas; non-localized Schemas have no locale index.
150
+ - Indexed directly on the localized Schema table. Non-localized Schemas have
151
+ no locale field or locale index.
152
152
 
153
153
  The boot/runtime split is the load-bearing change carried over from
154
154
  the POC's issue #60 fix (POC PR #71, plus the canonicalize follow-up
@@ -310,10 +310,8 @@ Validation rules introduced:
310
310
  must resolve all Schema names before checking `translates.parent`
311
311
  references. The two-pass pattern (collect names → check references)
312
312
  handles this; it's just one more reference type.
313
- - **Index pattern adds DDL complexity.** Virtual generated columns +
314
- partial unique indexes per Schema means the migration emitter
315
- generates more SQL than before. Acceptable given the pattern is
316
- already used by `Schema.spec.unique`.
313
+ - **Index pattern adds DDL complexity.** Each localized native Schema table
314
+ needs its declared locale index. The migration artifact owns that SQL.
317
315
  - **Two places define "what locales exist."** Manifest declares
318
316
  `localized: true`; D1 declares which actual locales the site
319
317
  serves. The runtime gate reconciles them; if they drift, the gate
@@ -444,8 +442,8 @@ for `createCmsRuntime().bootInit()` + `DatabaseSiteConfigRepository.seed`):
444
442
  - Grammar in `packages/mantle-spec/src/domain/model/ManifestGrammar.ts`
445
443
  + the manifest parser.
446
444
  - Cross-Schema validation in the validate + boot phases.
447
- - D1 schema: no `entries.locale` column; `data.locale` is the
448
- authoritative storage; partial unique index per localized Schema.
445
+ - D1 schema: no shared `entries.locale` column; each localized native Schema
446
+ table owns its `locale` field and declared index.
449
447
  - `site_config` key/value table with the `locales` key.
450
448
  - Runtime locale gate in `packages/mantle-runtime/src/domain/service/ContentLocaleGate.ts`.
451
449
  - `CmsConfig.siteDefaults` consumed by runtime `bootInit()`, with
@@ -1,6 +1,7 @@
1
1
  # ADR-0011: Adapter port spec
2
2
 
3
- **Status:** Superseded for Core storage and Admin composition by ADR-0019.
3
+ **Status:** Superseded for Core storage and Admin composition by ADR-0019 and
4
+ for SQLite/D1 physical storage by ADR-0024.
4
5
  Retained as the alpha.7 Cloudflare adapter record; `DatabaseDriver` is now an
5
6
  implementation detail of the SQLite/D1 `MantleStorageAdapter`, while the asset
6
7
  contract belongs to optional `@aotter/mantle-admin`.