@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
@@ -0,0 +1,158 @@
1
+ # Spec-only adoption in an existing host
2
+
3
+ An existing application can reuse Mantle's Schema grammar and validation by
4
+ consuming the published `@aotter/mantle-spec` package, without running Mantle
5
+ Runtime. This Spec-only path is allowed by
6
+ [ADR-0019](adr/0019-sealed-manifest-runtime-pipeline.md), not a new adapter,
7
+ manifest grammar, or fork of Core.
8
+
9
+ This recipe targets `0.1.0-alpha.16`. Its public APIs and peer requirements are
10
+ prerelease contracts: pin the package, record the tested version, and rerun
11
+ compatibility checks when upgrading.
12
+
13
+ ## What stays with the host
14
+
15
+ | Concern | Spec reuse | Host responsibility |
16
+ |---|---|---|
17
+ | Model definitions | Schema grammar, parse/link diagnostics | Project existing definitions into supported JSON Schema |
18
+ | Input | `EntryDataValidator` and structured errors | Authentication, authorization, normalization, write orchestration |
19
+ | Model browser | Parsed/linked Schema metadata | UI, metadata visibility, field display, graph layout |
20
+ | Relationships | Translation declaration/link validation | Existing slug joins, record integrity, locale policy |
21
+ | Storage and publishing | None in this recipe | Files, database, transactions, revisions, release/recovery |
22
+ | Operations and tools | None in this recipe | No automatic View, Procedure, Trigger, REST or MCP execution |
23
+
24
+ Mantle's Web, Admin UI and platform adapters remain optional. A Vue host does
25
+ not have to embed the React Admin SPA to reuse Spec. Avoid importing SDK
26
+ internals or maintaining a second manifest interpreter.
27
+
28
+ ## One definition, several projections
29
+
30
+ The motivating Aotter official-website implementation keeps its existing
31
+ Nuxt/Nitro host and Git/D1 storage. Shared content definitions drive the site's
32
+ content layer, admin write validation, a responsive model/ER browser, and
33
+ Schema export. That website implementation was validated locally; this SDK
34
+ contribution does not deploy it or claim a production rollout.
35
+
36
+ ```text
37
+ Host-owned content definitions
38
+ ├─ existing CMS/content queries
39
+ └─ JSON Schema in Mantle Schema manifests
40
+ ├─ parse + link → model browser / metadata export
41
+ └─ EntryDataValidator → host-authorized write path
42
+ ```
43
+
44
+ Use the existing definitions as the source of truth. If the host starts with
45
+ Zod or another schema language, conversion is a host concern: verify that the
46
+ result uses supported JSON Schema keywords and preserves the intended
47
+ validation semantics. Do not hand-maintain a second field list for the graph.
48
+
49
+ ## Minimal public-API recipe
50
+
51
+ Install the exact Spec package and its supported peer, without Runtime:
52
+
53
+ ```sh
54
+ npm install --save-exact @aotter/mantle-spec@0.1.0-alpha.16 zod@4.5.4
55
+ ```
56
+
57
+ The [synthetic fixture](../packages/mantle-spec/test/fixtures/spec-only-host.yaml)
58
+ contains categories, articles and article translations. It contains no real
59
+ website records, account configuration or credentials. Given that fixture as
60
+ `manifestYaml`, the application can prepare its validated model once:
61
+
62
+ ```ts
63
+ import {
64
+ EntryDataValidator,
65
+ parseManifestSources,
66
+ ValidateManifestsUseCase,
67
+ } from "@aotter/mantle-spec";
68
+
69
+ const parsed = parseManifestSources({
70
+ sources: [{ sourceId: "host:content-model", text: manifestYaml }],
71
+ });
72
+ if (!parsed.ok) throw new Error(JSON.stringify(parsed.diagnostics));
73
+
74
+ const checked = ValidateManifestsUseCase.run({
75
+ parsed: parsed.value,
76
+ siteLocales: ["zh-TW", "en-US"],
77
+ });
78
+ if (checked.errorCount || !checked.linked) {
79
+ throw new Error(JSON.stringify(checked.diagnostics));
80
+ }
81
+
82
+ const article = checked.linked.schemas.find(
83
+ ({ manifest }) => manifest.metadata.name === "articles",
84
+ )!.manifest;
85
+ const validator = new EntryDataValidator();
86
+ const diagnostics = validator.validate(article, { category: 42 }, { partial: true });
87
+ // INPUT_VALIDATION_FAILED at /category. The host must reject the write.
88
+ ```
89
+
90
+ The non-null assertion is specific to this known fixture. A dynamic host must
91
+ handle an unknown collection explicitly and fail closed. Do not fabricate
92
+ sealed parser/linker values or re-parse the same revision in each request.
93
+
94
+ `EntryDataValidator` returns diagnostics, not a sanitized payload. It does not
95
+ persist, authorize, coerce the original object, or enforce storage integrity.
96
+ Normalize explicitly in the host before validation and write only after
97
+ successful validation and authorization. An `additionalProperties: true`
98
+ compatibility policy accepts legacy fields; it is not a reason to expose those
99
+ fields publicly.
100
+
101
+ `partial: true` relaxes top-level required fields for drafts, while still
102
+ checking supplied types and nested required fields. Validate without `partial`
103
+ when the host needs a complete record, alongside its own publication rules.
104
+ Create a fresh validator for each model revision: its compiled cache is keyed
105
+ by manifest name (and partial/full mode), not by a changing schema body.
106
+
107
+ ## Honest ER diagrams and metadata export
108
+
109
+ - Derive model nodes and field details from Schema properties. Use a small
110
+ host-owned relationship registry for relations not represented by Mantle
111
+ grammar; show logical joins distinctly from actual database foreign keys.
112
+ - The fixture's `x-example-source` and `x-example-relations` live inside JSON
113
+ Schema. They are illustrative vendor annotations, **not new Mantle keys or
114
+ executable relationship definitions**. Core may preserve them without
115
+ interpreting them. The host must validate their shape and endpoint fields.
116
+ - Do not label a filename/slug join as `x-mantle-ref`: that keyword represents
117
+ Mantle entry-ID references. A category slug matching a key inside a YAML
118
+ array remains a host-specific relation, not a generated SQL foreign key.
119
+ - `translates` validates the parent and join-field declarations, not whether
120
+ actual translation records exist. A Spec-only host still owns allowed
121
+ locales, uniqueness, fallback, and orphan handling. See
122
+ [ADR-0010](adr/0010-locale-and-translates.md); Runtime locale/storage gates
123
+ are not installed by this recipe.
124
+ - A read-only inventory can add derived fields such as filename `slug` or
125
+ directory `locale` without changing stored files. Document that projection;
126
+ it is not evidence that existing data is ready for Runtime import.
127
+ - The fixture uses JSON Schema `readOnly` as an inventory annotation. It is
128
+ not a security boundary: entry validation does not enforce host write
129
+ permissions. Export only after applying the host's metadata access policy.
130
+ - Exclude credential/account models and private data. Export schemas, not
131
+ records. Where appropriate, require an administrator and use
132
+ `Cache-Control: private, no-store` for model and export endpoints.
133
+ - Keep the graph usable on narrow screens: searchable model selection,
134
+ focused relationships, zoom/scroll, keyboard controls and a field-table
135
+ alternative. A graph must not be the only accessible representation.
136
+
137
+ ## Reproducible evidence
138
+
139
+ From this SDK checkout:
140
+
141
+ ```sh
142
+ pnpm --filter @aotter/mantle-spec test -- test/spec-only-host.test.ts
143
+ pnpm --filter @aotter/mantle-spec typecheck
144
+ ```
145
+
146
+ The [regression test](../packages/mantle-spec/test/spec-only-host.test.ts)
147
+ exercises the public export surface, manifest round trips, translation linking,
148
+ and strict/partial entry validation without Runtime. It is an SDK regression
149
+ fixture, not a new Starter workspace or a certification test suite.
150
+
151
+ An adopting host must also test its own installed package, real content
152
+ compatibility, HTTP authorization/invalid-input paths, metadata exclusions and
153
+ responsive UI. Existing data need not be published or uploaded to prove this.
154
+ Keep sensitive evidence internal and expose only an agreed verification report.
155
+
156
+ Spec validation against an exact SDK version is not official certification or
157
+ proof of Runtime compatibility, data migration, or security. Recognition policy
158
+ is tracked separately in [#840](https://github.com/aotter/mantle/issues/840).
@@ -0,0 +1,5 @@
1
+ # Transaction patterns
2
+
3
+ This guide moved into the handbook: [`docs/handbook/examples/commerce-transaction.md`](handbook/examples/commerce-transaction.md).
4
+
5
+ The handbook ships inside the `@aotter/mantle` package under `node_modules/@aotter/mantle/docs/handbook/` and describes the installed release.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aotter/mantle",
3
- "version": "0.1.0-alpha.9",
3
+ "version": "0.1.2-alpha.2",
4
4
  "description": "Embeddable Mantle Core umbrella with Spec and Runtime; Web, Admin, Bun, Vercel, Cloudflare, and Admin UI are optional peer packages.",
5
5
  "license": "Apache-2.0",
6
6
  "homepage": "https://mantle.tools/",
@@ -27,10 +27,6 @@
27
27
  "types": "./dist/spec.d.ts",
28
28
  "import": "./dist/spec.js"
29
29
  },
30
- "./provision": {
31
- "types": "./dist/provision.d.ts",
32
- "import": "./dist/provision.js"
33
- },
34
30
  "./spec": {
35
31
  "types": "./dist/spec.d.ts",
36
32
  "import": "./dist/spec.js"
@@ -83,21 +79,21 @@
83
79
  "README.md"
84
80
  ],
85
81
  "dependencies": {
86
- "@aotter/mantle-runtime": "0.1.0-alpha.9",
87
- "@aotter/mantle-spec": "0.1.0-alpha.9"
82
+ "@aotter/mantle-runtime": "0.1.2-alpha.2",
83
+ "@aotter/mantle-spec": "0.1.2-alpha.2"
88
84
  },
89
85
  "peerDependencies": {
90
86
  "aws4fetch": "^1.0.20",
91
- "better-auth": "^1.7.1",
87
+ "better-auth": "1.7.2",
92
88
  "hono": "^4.12.0",
93
89
  "@libsql/client": "^0.17.4",
94
- "zod": "^4.0.0",
95
- "@aotter/mantle-admin": "0.1.0-alpha.9",
96
- "@aotter/mantle-admin-ui": "0.1.0-alpha.9",
97
- "@aotter/mantle-cloudflare": "0.1.0-alpha.9",
98
- "@aotter/mantle-vercel": "0.1.0-alpha.9",
99
- "@aotter/mantle-web": "0.1.0-alpha.9",
100
- "@aotter/mantle-bun": "0.1.0-alpha.9"
90
+ "zod": "^4.5.0",
91
+ "@aotter/mantle-admin": "0.1.2-alpha.2",
92
+ "@aotter/mantle-admin-ui": "0.1.2-alpha.2",
93
+ "@aotter/mantle-bun": "0.1.2-alpha.2",
94
+ "@aotter/mantle-vercel": "0.1.2-alpha.2",
95
+ "@aotter/mantle-web": "0.1.2-alpha.2",
96
+ "@aotter/mantle-cloudflare": "0.1.2-alpha.2"
101
97
  },
102
98
  "peerDependenciesMeta": {
103
99
  "@aotter/mantle-admin": {
@@ -134,18 +130,18 @@
134
130
  "devDependencies": {
135
131
  "@types/node": "^26",
136
132
  "aws4fetch": "^1.0.20",
137
- "better-auth": "^1.7.1",
138
- "hono": "^4.12.34",
133
+ "better-auth": "1.7.2",
134
+ "hono": "^4.13.3",
139
135
  "@libsql/client": "^0.17.4",
140
136
  "typescript": "^6.0.3",
141
- "vitest": "^4.1.10",
142
- "zod": "^4.4.3",
143
- "@aotter/mantle-admin": "0.1.0-alpha.9",
144
- "@aotter/mantle-bun": "0.1.0-alpha.9",
145
- "@aotter/mantle-cloudflare": "0.1.0-alpha.9",
146
- "@aotter/mantle-admin-ui": "0.1.0-alpha.9",
147
- "@aotter/mantle-vercel": "0.1.0-alpha.9",
148
- "@aotter/mantle-web": "0.1.0-alpha.9"
137
+ "vitest": "^4.1.11",
138
+ "zod": "^4.5.4",
139
+ "@aotter/mantle-admin-ui": "0.1.2-alpha.2",
140
+ "@aotter/mantle-admin": "0.1.2-alpha.2",
141
+ "@aotter/mantle-bun": "0.1.2-alpha.2",
142
+ "@aotter/mantle-cloudflare": "0.1.2-alpha.2",
143
+ "@aotter/mantle-vercel": "0.1.2-alpha.2",
144
+ "@aotter/mantle-web": "0.1.2-alpha.2"
149
145
  },
150
146
  "engines": {
151
147
  "node": ">=22"
package/skills/README.md CHANGED
@@ -8,8 +8,8 @@ Agent-readable skill briefs for consumers of `@aotter/mantle-*`. Discoverable by
8
8
  | [`media-gc`](media-gc/SKILL.md) | `mantle:media-gc`: audit or remove stale uncommitted public media objects with the connected Cloudflare API. |
9
9
  | [`plugin`](plugin/SKILL.md) | `mantle:plugin`: Core-owned marketplace workflow for plan-first capability installs across starters and adapters. |
10
10
  | [`theme`](theme/SKILL.md) | `mantle:theme`: Core-owned visual workflow. Reads project context but does not depend on starter-owned skill semantics. |
11
- | [`update`](update/SKILL.md) | `mantle:update`: Core-owned drift check workflow for SDK, starter snapshots, and plugin lockfiles. |
12
- | [`install`](install/SKILL.md) | User wants to create a local Mantle site from a deterministic starter bundle or continue an existing local / landing-generated project. |
11
+ | [`update`](update/SKILL.md) | `mantle:update`: Core-owned drift check workflow for SDK dependencies, local skills, and plugin lockfiles. |
12
+ | [`install`](install/SKILL.md) | User wants to create a local Mantle site by direct authoring or continue an existing local / landing-generated project. |
13
13
  | [`provision`](provision/SKILL.md) | User wants a local or landing-generated project shipped to Cloudflare with production auth and operator handoff. |
14
14
 
15
15
  The skills target Mantle's v0.1 grammar. The installed package version, not
@@ -28,8 +28,8 @@ enforces the columns below.
28
28
  | `develop` | existing project; manifest, runtime, handler, adapter, or MCP work | four-atom model; adapter neutrality; no direct D1/KV/Postgres writes; no committed secrets | performance harness; local MCP client; locale rules | project, plugin | — |
29
29
  | `plugin` | user wants an installable capability | plan before apply; lock entry is the removal manifest; delete only plugin-owned files and atoms | apply; remove | project, plugin | — |
30
30
  | `theme` | brand or visual direction in a generated project | repo-owned theme and UI contracts | — | project, plugin | — |
31
- | `update` | drift check against SDK, starter, or plugin locks | never blindly overwrite user-owned code | — | project, plugin | — |
32
- | `install` | new site, or opening an existing generated one | do not use the SDK checkout as the application; no push/deploy/provider config during cold start | create local project; continue existing project | plugin | Creates a new project; nothing to project into an existing one. |
31
+ | `update` | SDK upgrade or plugin lock review | never blindly overwrite user-owned code | — | project, plugin | — |
32
+ | `install` | new site, or opening an existing generated one | do not use the SDK checkout as the application; no push/deploy/provider config during cold start | author local project; continue existing project | plugin | Creates a new project; nothing to project into an existing one. |
33
33
  | `provision` | ship to Cloudflare and finish production auth | secrets never enter source or logs; explicit auth mode | hosted auth; self-managed auth | plugin | Platform-specific deploy that handles production secrets; opt-in only. |
34
34
  | `media-gc` | audit or remove stale uncommitted media objects | audit by default; confirm exact account, bucket, cutoff, and candidate digest; re-audit before applying; never prefix-delete; never print keys | apply | plugin | Destructive remote object deletion and Cloudflare-specific; opt-in only. |
35
35
 
@@ -30,24 +30,19 @@ version; never use `develop` branch docs for a versioned consumer project.
30
30
 
31
31
  ## Existing Examples
32
32
 
33
- Before inventing a Mantle pattern, inspect
34
- [`aotter/mantle-starters`](https://github.com/aotter/mantle-starters).
35
- Use a tag matching the installed Mantle version when available; use `develop`
36
- only for unreleased work. `blank/` shows the base application shape and
37
- `overlays/<type>/` contains working examples of manifests, handlers, routes,
38
- page seeds, and feature wiring. Copy the smallest matching pattern. Do not edit
39
- or copy generated `provision-bundles/*.json` by hand.
33
+ Read installed `docs/handbook/start/project-and-cli.md`, `docs/examples/minimal-worker/`
34
+ and `docs/handbook/examples/commerce-transaction.md` before inventing a pattern. The reference
35
+ consumer is test/documentation, not a Starter or a fixed application shape.
40
36
 
41
37
  Public rendering is opt-in consumer wiring: `mountPublicRoutes`, a
42
38
  `TemplateRegistry`, and a matching `publicPathResolver` must agree on the
43
- exposed collections. Do not auto-publish every Schema. Generated projects list
44
- their mounted URL surface in their own README.
39
+ exposed collections. Do not auto-publish every Schema. Applications document their mounted URL surface in their own README.
45
40
  Import the registry and resolver from `@aotter/mantle/web`; Core runtime does
46
41
  not install public rendering by itself.
47
42
 
48
43
  ## Authoring CLI
49
44
 
50
- Use the project's scripts first; generated projects expose the shipping
45
+ Use the project's scripts first; applications use the shipping
51
46
  `mantle` authoring CLI from `@aotter/mantle`. Ask the installed CLI for its
52
47
  command list instead of trusting one copied into prose — the surface is
53
48
  version-matched and changes between releases:
@@ -57,8 +52,8 @@ pnpm exec mantle --help
57
52
  pnpm validate
58
53
  ```
59
54
 
60
- This CLI validates and derives artifacts from an existing materialized
61
- project; starter creation is owned by the provision-bundle flow.
55
+ This CLI validates and derives artifacts from application-authored manifests.
56
+ It does not create projects, business schemas or a visitor homepage.
62
57
 
63
58
  ## Core Model
64
59
 
@@ -77,9 +72,9 @@ the atoms cannot express the behavior.
77
72
 
78
73
  ## Content Edits
79
74
 
80
- - A generated homepage reads its repo seed before auth. Change that seed for
81
- local/static page copy; after auth, use Admin or Staff MCP for runtime-backed
82
- content.
75
+ - If a legacy homepage imports a repo seed, edit it for local/static copy.
76
+ Otherwise follow the actual frontend content source. Use Admin or Staff MCP
77
+ for runtime-backed content.
83
78
  - For a new submitted field, update the stored `Schema` and the public
84
79
  `Procedure.spec.input` before the seed/form. Keep public mutation inputs
85
80
  `additionalProperties: false`; otherwise JSON Schema's default may strip an
@@ -91,10 +86,10 @@ the atoms cannot express the behavior.
91
86
  archive, and every other status transition whose target is not `published`;
92
87
  do not use them for edit-only work.
93
88
  - When a form's fixed option values change, update the stored Schema and public
94
- Procedure input `enum` together. Keep translated labels in the page seed;
89
+ Procedure input `enum` together. Keep translated labels in the frontend content source;
95
90
  Admin and Staff MCP derive their typed controls from the manifest values.
96
- - For a new section display property, update the content type and the `page`
97
- Schema's `sections[].properties`; an undeclared property has no
91
+ - If the application has a `page` Schema with sections, update its declared
92
+ section properties when adding display fields; an undeclared property has no
98
93
  runtime-backed Admin or Staff MCP path.
99
94
  - Update notification handlers when they need the new field. Test the stored
100
95
  entry, not only the HTTP `{ "ok": true }` response.
@@ -120,17 +115,17 @@ the atoms cannot express the behavior.
120
115
 
121
116
  ## Adapter Boundary
122
117
 
123
- The runtime is adapter-neutral. Required runtime ports are `DatabaseDriver`
124
- and `AssetServer`. Optional feature ports, such as `MediaStorage`
125
- or `DeferredHookDispatcher`, are enabled only when the current adapter wires
126
- them.
118
+ The runtime is adapter-neutral. A `MantleStorageAdapter` prepares the compiled
119
+ plan into semantic storage ports; `createMantleRuntime` binds that prepared
120
+ storage and selected capabilities. Database drivers and asset serving belong
121
+ to the host/optional composition. Follow the installed adapter guide.
127
122
 
128
123
  Do not assume Cloudflare unless the project imports `@aotter/mantle/cloudflare`
129
124
  or its adapter config is visible. A future Netlify adapter should satisfy the
130
125
  same Core workflow through its own ports and provider setup.
131
126
 
132
127
  Site code is a consumer of this abstraction. Use Manifests, runtime use cases,
133
- `entryReader`, and `siteConfig`; do not query Mantle-owned `entries` or
128
+ `runtime.entries`, and optional `runtime.siteConfig`; do not query Mantle-owned `entries` or
134
129
  `site_config`, reach through deprecated `runtime.db`, copy generated-column
135
130
  names, or construct SDK KV keys. Cloudflare bindings belong only at the
136
131
  composition root. If a normal feature cannot be expressed through a
@@ -141,8 +136,8 @@ teaching the project Mantle internals.
141
136
 
142
137
  Conventional Cloudflare projects declare `MANTLE_AUTH_MODE=hosted` or
143
138
  `self-managed`; Core owns that standard Auth composition and rejects partial
144
- or mixed bindings. Preserve the explicit mode recorded in launch state and
145
- Worker config, keep provider secrets out of source, and do not infer a mode
139
+ or mixed bindings. Preserve the explicit mode recorded in Worker config
140
+ and any legacy launch state, keep provider secrets out of source, and do not infer a mode
146
141
  from whichever credentials happen to be present. A repo with an explicit
147
142
  `createMantleWorker({ auth })` override owns that custom composition; follow
148
143
  its handoff instead of replacing it with the conventional factory.
@@ -191,7 +186,7 @@ Use `pnpm dev` for local preview when the project provides it.
191
186
  ## Connect a Local MCP Client
192
187
 
193
188
  Start the project with `pnpm dev`, then use the exact local origin it prints.
194
- Generated Cloudflare projects normally expose:
189
+ The conventional Cloudflare adapter exposes:
195
190
 
196
191
  - `http://localhost:8787/mcp` for public tools;
197
192
  - `http://localhost:8787/mcp/staff` for authenticated authoring tools.
@@ -216,8 +211,8 @@ cache.
216
211
 
217
212
  ## Rules
218
213
 
219
- - Put all content model changes in `manifests/site.yaml`; other manifest
220
- filenames are rejected.
214
+ - Keep content models in the configured manifest directory; its immediate
215
+ `.yaml` and `.yml` files are loaded together.
221
216
  - Use a generated overlay `seed.json` for the auth-free local first page when
222
217
  it is already imported by `src/web/content/*`.
223
218
  - Add TypeScript only for handlers, rendering, adapter wiring, or real behavior.
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: install
3
- description: Start a new Mantle site locally from a deterministic starter bundle, or orient and continue an existing local or Mantle landing project. Use when the user gives a Mantle repository URL and asks to try or build with it, invokes the Mantle install skill, wants a new Mantle site, or opens an existing generated site.
3
+ description: Author a new Mantle application directly from version-matched SDK docs, or continue an existing project. Use when asked to install Mantle, build a Mantle application, or open a Mantle repository.
4
4
  metadata:
5
5
  source: "@aotter/mantle"
6
6
  sourcePath: skills/install/SKILL.md
@@ -11,160 +11,68 @@ metadata:
11
11
 
12
12
  # Mantle Install
13
13
 
14
- Route by the working directory:
15
-
16
- - If it already contains `.mantle/launch-state.json` or depends on
17
- `@aotter/mantle`, continue the existing project.
18
- - Otherwise create a new local project from a deterministic provision bundle.
19
- Do not use the Mantle SDK checkout as the application.
20
-
21
- Mantle landing uses the same bundles but continues through GitHub, Cloudflare,
22
- and optional paid hosted auth. Use landing only when the user wants that
23
- hosted provider flow.
24
-
25
- ## Create a Local Project
26
-
27
- 1. Infer the closest starter from the user's request. Ask only when two choices
28
- would materially change the result.
29
-
30
- | Intent | Type |
31
- |---|---|
32
- | API/MCP backend or empty base | `blank` |
33
- | Small public or company site | `presence` |
34
- | Form, application, or submission flow | `intake` |
35
- | Blog, docs, posts, or editorial site | `publication` |
36
- | Catalog or order intent | `transaction` |
37
- | Booking or request intent | `reservation` |
38
-
39
- Community and membership types are not released; `create` refuses them. Build
40
- those on `blank` or the closest released type.
41
-
42
- 2. Choose a target directory outside both Mantle repositories; its name
43
- becomes the project slug. Derive a brand, one-sentence description, and
44
- locales from the user's prompt. Require Node 22+ and pnpm 9+; check
45
- `node --version` and `pnpm --version` before creating.
46
-
47
- 3. Create the project with the Core CLI. It resolves the official immutable
48
- starter tag for its own version, so no starters checkout is involved:
49
-
50
- ```bash
51
- npx -y @aotter/mantle@alpha create <type> <target-dir> \
52
- --brand "<brand>" \
53
- --description "<one sentence>" \
54
- --locales <comma-separated-locales>
55
- ```
56
-
57
- Pin an exact version (`@aotter/mantle@<version>`) when the user asked for one.
58
- `create` writes files and stops: it installs nothing, initializes no
59
- repository, configures no auth, and deploys nothing. It refuses to write into
60
- a path that already exists, and there is no force flag — choose a new
61
- directory instead.
62
-
63
- Do not clone the starters repository, copy `blank/`, merge overlays, or edit a
64
- provision bundle by hand. The CLI renders the same immutable bundle Mantle
65
- landing uses.
66
-
67
- 4. For a typed launch, read `.mantle/handoff.md`, the selected overlay's
68
- `layout.md`, `seed-prompt.md`, and `seed.json`. Shape the first local page by
69
- editing that checked-in seed; generated content modules import it directly.
70
- This is application source, not direct D1 authoring. Do not use Staff MCP
71
- until an auth provider is configured.
72
-
73
- 5. Initialize and verify the local project:
74
-
75
- ```bash
76
- cd <target-dir>
77
- git init -b main
78
- pnpm install --frozen-lockfile
14
+ Mantle is an embeddable manifest engine. The application owns its source and
15
+ provider configuration. There is no Starter/type picker or `mantle create`.
16
+ Do not use the SDK checkout as the application, copy an old Starter tree, or
17
+ turn `generate` into implicit scaffolding.
18
+
19
+ ## New application
20
+
21
+ 1. Determine the actual host and required surfaces from the request. Reuse an
22
+ existing application when available; otherwise work in its own directory.
23
+ Do not assume Cloudflare, public HTML or Admin is required. Check Node 22+
24
+ and pnpm 9+ for these SDK examples.
25
+ 2. Choose the requested exact SDK version, or resolve the intended release
26
+ channel once. Pin all selected `@aotter/mantle*` dependencies to that same
27
+ version. Install only the adapter/optional packages the application needs.
28
+ If a global scope registry overrides public npmjs, use a project-owned
29
+ `.npmrc` with `@aotter:registry=https://registry.npmjs.org/`.
30
+ 3. Read the installed `node_modules/@aotter/mantle/docs/handbook/start/project-and-cli.md`.
31
+ The version-matched `docs/examples/minimal-worker/` is a runnable Cloudflare
32
+ reference, not a template to install wholesale. Other hosts use the embedded
33
+ adapter guides. Author package scripts, manifests, entry and configuration
34
+ for the user's requirements. No default notes model, home page, icon,
35
+ launch metadata or frontend is required.
36
+ 4. Compile and verify using the application's commands. The fundamental CLI
37
+ sequence is:
38
+
39
+ ```sh
40
+ pnpm exec mantle generate
41
+ pnpm exec mantle generate --check
42
+ pnpm exec mantle validate
79
43
  pnpm exec mantle skills
80
44
  pnpm exec mantle skills --check
81
- pnpm validate
82
- pnpm typecheck
83
- pnpm dev
84
- ```
85
-
86
- Open `http://localhost:8787`. Public preview works before auth is configured;
87
- auth-gated routes may return `503 setup_incomplete`. `blank` is intentionally
88
- empty; typed launches must show the selected seed. Do not infer SDK public
89
- render routes from the Core README—generated projects mount only the URL
90
- surface documented in their own README.
91
-
92
- ## Continue an Existing Project
93
-
94
- Read these before editing:
95
-
96
- 1. `.mantle/launch-state.json`, `.mantle/features.json`, and
97
- `.mantle/handoff.md`.
98
- 2. `package.json` for the installed `@aotter/mantle*` versions.
99
-
100
- Install the locked dependency graph and replace any stale projected Core
101
- skills before reading them:
102
-
103
- ```bash
104
- pnpm install --frozen-lockfile
105
- pnpm exec mantle skills
106
- pnpm exec mantle skills --check
107
- ```
108
-
109
- Then read:
110
-
111
- 3. Repo-local Mantle skills under `.agents/skills/` or `.claude/skills/`. A
112
- project created before this layout may also carry `.agent/skills/`; read it
113
- if present, but never write there and never delete it.
114
- 4. Matching embedded docs under `node_modules/@aotter/mantle/docs/`.
115
-
116
- Use remote docs only when embedded docs are unavailable, and use a tag matching
117
- the installed version. Never use `develop` docs for a versioned project.
118
-
119
- Do not branch on how the project was created. Verify the current git remote,
120
- live URL, and auth response, then skip work that is already complete.
121
-
122
- Then run:
123
-
124
- ```bash
125
- pnpm exec mantle skills --check
126
- pnpm validate
127
- pnpm typecheck
128
- ```
129
-
130
- Inspect the already composed manifest, page, and seed files before changing
131
- them. Use the project's scripts first; ask the installed CLI for its command
132
- list rather than trusting one copied into prose:
133
-
134
- ```bash
135
- pnpm exec mantle --help
136
- pnpm validate
137
45
  ```
138
46
 
139
- ## Production
47
+ Run the project's TypeScript check and start its actual local server. Probe a
48
+ route the application declares; an API-only project may correctly return 404
49
+ at `/`. Auth routes may return `503 setup_incomplete` until the selected auth
50
+ provider is configured. Do not introduce an auth bypass to make smoke pass.
140
51
 
141
- Local cold start intentionally stops before GitHub and Cloudflare operations.
142
- When the user asks to ship, use `mantle:provision` from the installed plugin or
143
- `node_modules/@aotter/mantle/skills/provision/SKILL.md`.
52
+ Commit the resolved lockfile in the application's normal workflow; subsequent
53
+ installs use `pnpm install --frozen-lockfile`. Do not initialize/push a remote,
54
+ provision resources, deploy or commit secrets as part of local verification.
144
55
 
145
- Mantle landing is the first-run option when the user wants Mantle to create the
146
- private GitHub repo, connect Cloudflare, and offer paid hosted auth. Free
147
- self-hosted auth requires the owner to configure their GitHub OAuth App and
148
- provider secrets.
56
+ ## Existing application
149
57
 
150
- ## Report
58
+ Read package.json, lockfile, actual entry, manifest files, provider config and
59
+ project instructions. `.mantle/launch-state.json`, features or handoff files
60
+ are optional legacy context, never prerequisites. Preserve them and user code.
61
+ Install the frozen dependency graph, project installed Core skills, then read
62
+ those skills and embedded docs. Never apply develop docs to an older package.
63
+ Use the installed `mantle --help` and the project's scripts as authority.
151
64
 
152
- Return:
65
+ For legacy alpha.17 projects, retain their pinned behavior until an explicit
66
+ upgrade is requested; read `docs/migration-0.1.2.md` before upgrading. Do not
67
+ rewrite provider identities, delete metadata or fetch a nonexistent new Starter
68
+ tag. SDK upgrades follow the update skill, not a bundle comparison command.
153
69
 
154
- - created or opened project path;
155
- - selected type and why;
156
- - local URL;
157
- - validation and typecheck results;
158
- - observed GitHub, deploy, and auth state;
159
- - three tailored next options: shape the visual experience, build the first
160
- real business workflow, or finish deploy/auth if incomplete. Never leave
161
- auth or seed data as the only next step.
70
+ ## Ship and report
162
71
 
163
- ## Don't
72
+ When deployment is requested, follow the installed provision skill and the
73
+ observed host configuration. Legacy Landing remains an alpha.17 product; it
74
+ is not a launch dependency for new Core projects.
164
75
 
165
- - Don't use the Mantle SDK checkout as the generated application.
166
- - Don't hand-compose starter layers; materialize the generated provision
167
- bundle.
168
- - Don't push, deploy, or configure providers during local cold start.
169
- - Don't commit provider secrets.
170
- - Don't block the first useful page on optional media storage.
76
+ Report the project path, exact SDK version, local URL/HTTP result and checks,
77
+ plus any genuinely missing auth/provider setup. Do not claim a working homepage
78
+ or authenticated MCP based only on successful generation.
@@ -16,8 +16,9 @@ user asks to create remote resources or ship production.
16
16
 
17
17
  ## Source of Truth
18
18
 
19
- 1. Read `.mantle/launch-state.json`, `.mantle/handoff.md`, `wrangler.toml`,
20
- and the current git remotes.
19
+ 1. Read the actual provider config (`wrangler.jsonc` or `wrangler.toml`),
20
+ application entry and git remotes. Read legacy `.mantle/launch-state.json`
21
+ and `.mantle/handoff.md` only when present; do not create them as prerequisites.
21
22
  2. Read installed `@aotter/mantle*` versions from `package.json`.
22
23
  3. Use matching embedded docs under `node_modules/@aotter/mantle/docs/`.
23
24
  4. Never infer provider authority from launch state. Confirm the active GitHub
@@ -142,7 +143,7 @@ authenticates, then skip the self-hosted flow.
142
143
 
143
144
  Media uploads are optional. Configure R2 only when the owner asks for
144
145
  staff-managed files; then read
145
- `node_modules/@aotter/mantle/docs/media-uploads.md`.
146
+ `node_modules/@aotter/mantle/docs/handbook/cloudflare/media-r2.md`.
146
147
 
147
148
  ## Handoff
148
149