@aotter/mantle 0.2.0-alpha.8 → 0.2.0

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 (176) hide show
  1. package/README.md +26 -3
  2. package/dist/auth/adapter.js +10 -34
  3. package/dist/auth/admin.js +2 -5
  4. package/dist/auth/caller.js +0 -27
  5. package/dist/auth/consent.js +100 -0
  6. package/dist/auth/hardening.js +0 -7
  7. package/dist/auth/identity.js +0 -11
  8. package/dist/auth/oauth.js +0 -32
  9. package/dist/auth/resource-seeds.js +0 -2
  10. package/dist/auth/route-http.js +33 -0
  11. package/dist/auth/routes.js +8 -153
  12. package/dist/build/compiler.d.ts +19 -609
  13. package/dist/build/compiler.js +3 -6896
  14. package/dist/build/spec/domain/model/SqlIr.d.ts +2 -0
  15. package/dist/build/spec/domain/model/UserFields.d.ts +1 -0
  16. package/dist/bun/assets.js +0 -2
  17. package/dist/domain/adminOrder.js +0 -2
  18. package/dist/domain/columns.js +7 -20
  19. package/dist/domain/describe/chunk-SGMRVDGE.js +1 -0
  20. package/dist/domain/describe/index.js +1 -115
  21. package/dist/domain/describe/target-hash.js +1 -12
  22. package/dist/domain/entry.js +0 -14
  23. package/dist/domain/generated-tools.js +0 -1
  24. package/dist/domain/input.js +0 -2
  25. package/dist/domain/paging.js +0 -17
  26. package/dist/domain/recipes.js +10 -7
  27. package/dist/domain/userReferences.js +0 -1
  28. package/dist/domain/wireScalars.js +0 -6
  29. package/dist/infrastructure/adminEntries.js +10 -7
  30. package/dist/infrastructure/adminPaging.js +55 -57
  31. package/dist/infrastructure/artifacts.js +0 -4
  32. package/dist/infrastructure/authSchema.js +0 -9
  33. package/dist/infrastructure/bundle.js +17 -32
  34. package/dist/infrastructure/cli.js +25 -11
  35. package/dist/infrastructure/generate.js +18 -17
  36. package/dist/infrastructure/generateAuth.js +48 -5
  37. package/dist/infrastructure/help.js +55 -0
  38. package/dist/infrastructure/init.js +50 -0
  39. package/dist/infrastructure/inputs.js +0 -9
  40. package/dist/infrastructure/mounts.js +22 -0
  41. package/dist/infrastructure/wrangler.js +18 -9
  42. package/dist/kernel/authorization.js +0 -1
  43. package/dist/kernel/binds.d.ts +16 -7
  44. package/dist/kernel/binds.js +4 -10
  45. package/dist/kernel/caller-identity.d.ts +0 -3
  46. package/dist/kernel/caller-identity.js +0 -15
  47. package/dist/kernel/caller-mode.d.ts +4 -0
  48. package/dist/kernel/caller-mode.js +14 -0
  49. package/dist/kernel/contracts.d.ts +7 -11
  50. package/dist/kernel/contracts.js +8 -44
  51. package/dist/kernel/cron.js +0 -4
  52. package/dist/kernel/dialect/common.d.ts +0 -1
  53. package/dist/kernel/dialect/common.js +0 -3
  54. package/dist/kernel/dialect/postgres.js +0 -2
  55. package/dist/kernel/dialect/sqlite.js +1 -6
  56. package/dist/kernel/drain.js +2 -8
  57. package/dist/kernel/driver/bun-sqlite.js +0 -4
  58. package/dist/kernel/driver/d1.js +0 -1
  59. package/dist/kernel/driver/postgres.js +3 -17
  60. package/dist/kernel/driver/transaction-context.js +0 -1
  61. package/dist/kernel/email.js +0 -4
  62. package/dist/kernel/host-access.js +2 -3
  63. package/dist/kernel/host-caller.d.ts +1 -1
  64. package/dist/kernel/host-caller.js +3 -6
  65. package/dist/kernel/json-body.js +0 -2
  66. package/dist/kernel/mcp-apps.js +1 -6
  67. package/dist/kernel/mcp-call.js +0 -1
  68. package/dist/kernel/mcp-handler.js +3 -27
  69. package/dist/kernel/mcp.d.ts +5 -1
  70. package/dist/kernel/mcp.js +2 -6
  71. package/dist/kernel/media.js +0 -18
  72. package/dist/kernel/paging.js +1 -9
  73. package/dist/kernel/publishing.js +3 -4
  74. package/dist/kernel/r2-media.js +0 -7
  75. package/dist/kernel/rest-dispatch.js +0 -1
  76. package/dist/kernel/rest-router.js +2 -3
  77. package/dist/kernel/rest.js +0 -3
  78. package/dist/kernel/scalars.js +4 -11
  79. package/dist/kernel/search.js +0 -1
  80. package/dist/kernel/site.js +0 -2
  81. package/dist/kernel/store.d.ts +11 -1
  82. package/dist/kernel/store.js +21 -34
  83. package/dist/kernel/surface-failure.d.ts +10 -0
  84. package/dist/kernel/surface-failure.js +29 -0
  85. package/dist/kernel/surface.js +0 -3
  86. package/dist/kernel/sweep.js +0 -1
  87. package/dist/kernel/translations.js +0 -1
  88. package/dist/kernel/user-caller.js +2 -8
  89. package/dist/kernel/user-fields.d.ts +3 -2
  90. package/dist/kernel/user-fields.js +9 -9
  91. package/dist/kernel/validation.js +0 -8
  92. package/dist/kernel/web-gateway.js +0 -2
  93. package/dist/kernel/web-head.js +0 -1
  94. package/dist/kernel/web-index.js +39 -0
  95. package/dist/kernel/web-response.js +0 -1
  96. package/dist/kernel/web-serve.js +97 -0
  97. package/dist/kernel/web.d.ts +1 -1
  98. package/dist/kernel/web.js +10 -125
  99. package/dist/kernel/where.js +0 -6
  100. package/dist/usecase/adminBindings.js +30 -21
  101. package/dist/usecase/adminClient.js +0 -21
  102. package/dist/usecase/adminDescriptors.js +2 -9
  103. package/dist/usecase/generate.js +7 -12
  104. package/dist/usecase/handlers.js +0 -3
  105. package/dist/usecase/mcp-media.js +0 -1
  106. package/dist/usecase/mcp.js +0 -4
  107. package/dist/usecase/paging.js +1 -3
  108. package/dist/usecase/publishing.js +1 -5
  109. package/dist/usecase/rest.js +0 -1
  110. package/dist/usecase/site.js +0 -2
  111. package/dist/usecase/stores.js +4 -14
  112. package/dist/usecase/tool-version.js +0 -3
  113. package/dist/usecase/translations.js +0 -2
  114. package/dist/usecase/validation.js +8 -20
  115. package/docs/examples/README.md +13 -5
  116. package/docs/examples/app-shell/README.md +43 -8
  117. package/docs/examples/app-shell/accept.mjs +91 -0
  118. package/docs/examples/app-shell/gitignore +7 -0
  119. package/docs/examples/app-shell/package.json +7 -6
  120. package/docs/examples/app-shell/smoke-kit.mjs +29 -15
  121. package/docs/examples/app-shell/src/auth.ts +3 -2
  122. package/docs/examples/app-shell/src/routes.ts +6 -3
  123. package/docs/examples/app-shell/src/service.ts +4 -3
  124. package/docs/examples/club-events/README.md +7 -2
  125. package/docs/examples/club-events/manifests/club-events.yaml +22 -0
  126. package/docs/examples/club-events/smoke.mjs +7 -1
  127. package/docs/examples/club-events/src/handlers.ts +1 -1
  128. package/docs/examples/purchasing/README.md +12 -3
  129. package/docs/examples/purchasing/manifests/purchasing.yaml +36 -3
  130. package/docs/examples/purchasing/smoke.mjs +14 -0
  131. package/docs/examples/purchasing/src/handlers.ts +1 -1
  132. package/docs/examples/recipes/README.md +5 -3
  133. package/docs/handbook/cloudflare/authentication.md +21 -4
  134. package/docs/handbook/cloudflare/chatgpt-sites.md +4 -2
  135. package/docs/handbook/cloudflare/deploy-and-operate.md +24 -1
  136. package/docs/handbook/cloudflare/media-r2.md +2 -3
  137. package/docs/handbook/cloudflare/service-entry.md +17 -4
  138. package/docs/handbook/concepts/runtime-and-adapters.md +1 -1
  139. package/docs/handbook/examples/hub.md +1 -1
  140. package/docs/handbook/guides/agent-setup.md +15 -10
  141. package/docs/handbook/guides/agent-workflow-acceptance.md +232 -0
  142. package/docs/handbook/guides/local-testing.md +40 -0
  143. package/docs/handbook/guides/mcp-apps.md +78 -1
  144. package/docs/handbook/guides/native-admin.md +29 -6
  145. package/docs/handbook/guides/native-execution.md +5 -4
  146. package/docs/handbook/guides/oauth.md +58 -0
  147. package/docs/handbook/guides/public-pages.md +44 -4
  148. package/docs/handbook/guides/sql-patterns.md +266 -0
  149. package/docs/handbook/guides/typed-queries.md +173 -0
  150. package/docs/handbook/navigation.json +16 -0
  151. package/docs/handbook/reference/admin-descriptors.md +4 -1
  152. package/docs/handbook/reference/authorization.md +1 -1
  153. package/docs/handbook/reference/diagnostics.md +6 -1
  154. package/docs/handbook/reference/procedure.md +5 -5
  155. package/docs/handbook/reference/schema.md +10 -4
  156. package/docs/handbook/reference/sql.md +64 -0
  157. package/docs/handbook/reference/surface.md +11 -4
  158. package/docs/handbook/reference/trigger.md +9 -0
  159. package/docs/handbook/reference/view.md +11 -3
  160. package/docs/handbook/releases/index.md +27 -6
  161. package/docs/handbook/start/agents.md +45 -0
  162. package/docs/handbook/start/project-and-cli.md +15 -1
  163. package/docs/handbook/start/quickstart-worker.md +1 -1
  164. package/docs/skills/develop/SKILL.md +44 -16
  165. package/docs/skills/integrate/SKILL.md +4 -9
  166. package/docs/skills/provision/SKILL.md +15 -12
  167. package/docs/skills/update/SKILL.md +21 -18
  168. package/package.json +24 -4
  169. package/skills/README.md +1 -1
  170. package/skills/mantle/SKILL.md +48 -107
  171. package/dist/domain/describe/chunk-ZVXBGP7Y.js +0 -424
  172. package/docs/skills/develop/mcp-app.md +0 -39
  173. package/skills/.keep +0 -0
  174. package/skills/mantle/references/local-testing.md +0 -15
  175. package/skills/mantle/references/web.md +0 -41
  176. package/skills/mantle/references/website.md +0 -49
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aotter/mantle",
3
- "version": "0.2.0-alpha.8",
3
+ "version": "0.2.0",
4
4
  "type": "module",
5
5
  "sideEffects": false,
6
6
  "engines": {
@@ -92,7 +92,7 @@
92
92
  }
93
93
  },
94
94
  "devDependencies": {
95
- "@modelcontextprotocol/client": "2.1.0",
95
+ "@modelcontextprotocol/client": "2.2.0",
96
96
  "@modelcontextprotocol/server": "2.2.0",
97
97
  "@better-auth/core": "1.7.7",
98
98
  "@better-auth/oauth-provider": "1.7.7",
@@ -106,7 +106,24 @@
106
106
  "wrangler": "4.145.0",
107
107
  "vitest": "^5.0.1"
108
108
  },
109
- "description": "Mantle: a manifest-driven service core. Store authored as SQL, surfaces as Fetch functions, and the mantle CLI.",
109
+ "description": "Agent-native app SDK and backend compiler: YAML manifests to native SQL (SQLite, Cloudflare D1, PostgreSQL) and typed TypeScript; optional REST and MCP.",
110
+ "keywords": [
111
+ "mantle",
112
+ "agent-native",
113
+ "sdk",
114
+ "backend",
115
+ "yaml",
116
+ "code-generation",
117
+ "sql",
118
+ "sqlite",
119
+ "postgresql",
120
+ "cloudflare-d1",
121
+ "cloudflare-workers",
122
+ "bun",
123
+ "typescript",
124
+ "mcp",
125
+ "model-context-protocol"
126
+ ],
110
127
  "license": "Apache-2.0",
111
128
  "homepage": "https://mantle.tools/",
112
129
  "repository": {
@@ -114,13 +131,16 @@
114
131
  "url": "git+https://github.com/aotter/mantle.git",
115
132
  "directory": "packages/mantle"
116
133
  },
134
+ "bugs": {
135
+ "url": "https://github.com/aotter/mantle/issues"
136
+ },
117
137
  "publishConfig": {
118
138
  "access": "public",
119
139
  "tag": "alpha",
120
140
  "registry": "https://registry.npmjs.org"
121
141
  },
122
142
  "scripts": {
123
- "build": "node -e \"require('node:fs').rmSync('dist',{recursive:true,force:true})\" && tsc -p tsconfig.lib.json && node scripts/bundle-compiler.mjs && node scripts/prune-declarations.mjs",
143
+ "build": "node -e \"require('node:fs').rmSync('dist',{recursive:true,force:true})\" && tsc -p tsconfig.lib.json && node ../../scripts/strip-comments.mjs tsconfig.lib.json && node scripts/bundle-compiler.mjs && node scripts/prune-declarations.mjs",
124
144
  "typecheck": "tsc --noEmit -p tsconfig.json",
125
145
  "test": "bun test tests/*.test.ts && bun run test:compiler",
126
146
  "generate": "bun src/infrastructure/cli.ts",
package/skills/README.md CHANGED
@@ -27,7 +27,7 @@ release tag as the application's SDK; alpha releases on `develop` can be newer
27
27
  than the default `main` branch. For a skill-only installation:
28
28
 
29
29
  ```sh
30
- npx skills add https://github.com/aotter/mantle/tree/v0.2.0-alpha.8 --skill mantle
30
+ npx skills add https://github.com/aotter/mantle/tree/v0.2.0 --skill mantle
31
31
  ```
32
32
 
33
33
  The explicit skill name excludes repository maintainer skills. The manifests
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: mantle
3
- description: Create or continue a Mantle application, test it locally and deploy to a user-owned host using the installed SDK docs.
3
+ description: Create, continue, test or deploy a Mantle application using installed @aotter/mantle docs, including manifests, SQL Views and Procedures, MCP tools, app-built Admin, mantle generate and Mantle upgrades.
4
4
  metadata:
5
5
  source: "@aotter/mantle"
6
6
  sourcePath: skills/mantle/SKILL.md
@@ -17,119 +17,60 @@ authority: `node_modules/@aotter/mantle/README.md` and
17
17
  `node_modules/@aotter/mantle/docs/`. Prefer them over this file, the SDK
18
18
  checkout, or any online copy.
19
19
 
20
+ ## Start with `mantle help`
21
+
22
+ Run `mantle help` first (in a project: `npx mantle help`; before one exists:
23
+ `npx @aotter/mantle@<exact version> help`). It prints the installed version's
24
+ entry page and every topic; `mantle help <topic>` prints one page with the next
25
+ and linked topics as commands. Follow it rather than browsing the SDK checkout
26
+ or an online copy.
27
+
20
28
  ## Find the project and its version
21
29
 
22
30
  Work in the user's application, outside the SDK checkout. Read package.json, the lockfile, installed SDK README and node_modules/@aotter/mantle/docs/. Those files define the exact version's contract. Preserve existing identity, handles, routes and resources.
31
+ For existing older applications, use their installed docs until the user requests an upgrade; if an older version
32
+ lacks a guide named here, record the missing guidance and keep that version's contract.
23
33
 
24
- For a new project, install an exact published SDK version with matching selected Admin/UI packages. Node must be 22.22 or newer. Add TypeScript and target types; Workers also need Wrangler. `node_modules/@aotter/mantle/docs/examples/app-shell/package.json` lists the Wrangler, TypeScript and type-package versions this release is tested with. Optional auth/MCP peers use the installed SDK's package.json versions. Read the installed handbook's start/project-and-cli.md before choosing a target.
25
-
26
- For a new Cloudflare app, copy `node_modules/@aotter/mantle/docs/examples/app-shell/` first, then the closest example from `docs/examples/README.md` on top of it, and edit from there: manifests, `src/handlers.ts`, `src/routes.ts`, `src/schedule.ts`, `smoke.mjs`. Search for `AGENT:` to find what the app must fill in; the example pages are unstyled on purpose, so styling them is part of that work. Before reporting done, resolve each `AGENT:` or name the ones you left. Keep the two roles `admin` and `user` unless the user asks for more.
27
-
28
- For existing older applications, use their installed docs until the user requests an upgrade. For partial adoption read node_modules/@aotter/mantle/docs/skills/integrate/SKILL.md.
29
-
30
- ## Generated native applications
31
-
32
- Follow the installed (or workspace-linked) package README for generation, Workers
33
- builds and D1 Sessions; the app owns its entry and routing. Read that
34
- version's `docs/handbook/reference/features.md` before choosing declarations. Keep auth behind
35
- `authLoader(() => import(...))` to pass the startup guard. Install only the exact
36
- released version shown by the installed/target package
37
- contract. Replacing Core needs explicit app wiring and reviewed deployment
38
- migrations; never use initial schema.sql as an in-place production upgrade.
39
- Pass outgoing `responseHeaders` to `resolveCaller` so Better Auth's session cookie
40
- can slide. Native auth adapters use joins by default; keep the joined primary
41
- session/user check, including before any refresh from secondary storage.
42
- Only positively classified View/web reads may pass `readOnly: true`, with official
43
- cookieCache `{enabled:true,maxAge:60,refreshCache:false,version:"read-60-v1"}` and
44
- no KV. Bump version when enabling/changing the policy; writes, Admin, consent,
45
- unknown/ref/media calls stay fresh. Read the installed auth docs before MCP caching.
46
-
47
- Use the workflow **generate → typecheck → implement listed handlers**. For example:
48
-
49
- ```sh
50
- pnpm exec mantle generate cloudflare-d1 generated manifests/*.yaml
51
- pnpm exec tsc --noEmit
52
- pnpm exec mantle generate cloudflare-d1 generated manifests/*.yaml --check
53
- ```
54
- Implement every printed `Handlers` key
55
- and pass the implementations at `store(db, caller, { handlers })` (and selected
56
- surface options). Run `tsc --noEmit` again before local acceptance.
57
- Generated Store metadata initializes on its first use, once per module. Bind
58
- `store(db, caller, options?)` for the current request; never reuse one caller's
59
- bound Store for another caller.
60
-
61
- Use `paged/views/<encoded-name>.ts` for bounded cursor walks, including internal
62
- Views that satisfy the installed package's generation-time paging proofs.
63
- Call its default export with `(db, caller, input, { limit?, cursor? })`; it returns
64
- `{ rows, nextCursor? }`. Internal paging creates no public route/tool. Keep bare
65
- Views for authored-query row arrays, and inspect native EXPLAIN/source indexes
66
- when grouping: cursor paging does not eliminate aggregation work.
67
- Bare Views, Store and SQL Procedure results keep driver-native scalar values.
68
- Selected REST/MCP/Admin boundaries return target-identical `WireRow` types:
69
- declared integers become safe numbers or exact decimal strings, SQLite/D1
70
- JSON/booleans become JSON values/booleans, and compiler-declared decimals become
71
- strings. Selected SQL reads integer text before driver rounding; it cannot repair
72
- already-rounded writes. Use exported `WireRow` for clients and `Row` for bare
73
- queries. Computed/ref results remain app-owned.
74
-
75
- Commit everything `mantle generate` writes, including generated TypeScript, SQL and
76
- Wrangler edits; keep bundle `dist/` untracked. Never hand-edit generated files.
77
- Resolve conflicts by merging manifests/options and regenerating. Add the printed
78
- `.gitattributes` line and run the same generate command with `--check` in CI.
79
- Compose the app-owned `fetch` using `docs/handbook/cloudflare/service-entry.md`: auth/consent, Admin,
80
- MCP, REST behind one request-local origin-checked resolver; keep heavy auth dynamic.
81
-
82
- For selected native Admin, follow the version-matched
83
- `docs/handbook/guides/native-admin.md`: select `--admin` (or `admin: true`),
84
- mount `entries(bindings.schemas, bindings.adapter)` and serve the Admin assets
85
- separately. The three-package preview is one Core SDK, the Admin product and the
86
- shared UI kit.
87
- Admin reads share generated whitelisted native View templates, writes use native
88
- Procedure fragments and generated checks. Ref operations retain typed `ctx.store`
89
- at request time. Verify member/frontend and admin/Admin OTP, tenant/privacy/TTL,
90
- publishing, paging, statistics, exact OCC, ref effects and the actual console;
91
- never retry unknown 503 writes automatically. Read the installed Admin README
92
- for raw-body limits, CSP/assets, 22 languages and the developer workspace.
93
- Use only versions actually published, or the explicitly linked workspace packages.
94
-
95
- For generated native applications, optional site settings/media are selected
96
- with `--site <module>` exporting `siteDefaults`. Apply the emitted deployment DDL;
97
- wire application-owned object storage as documented in `docs/handbook/cloudflare/media-r2.md`.
98
-
99
- For a generated public website, follow [web mounting and acceptance](references/web.md).
100
- The app renders HTML and inserts `site.head()`; generated `web.ts` serves the
101
- indexes and Markdown alternates.
102
-
103
- ## Complete websites
104
-
105
- For a requested complete website, apply [website defaults](references/website.md)
106
- without asking the user to enumerate OTP, media, Admin or SEO. Defaults are
107
- acceptance requirements, not evidence that a missing renderer is implemented.
108
- Do not report a complete website with blocked required checks.
109
-
110
- Run the [local HTTP acceptance](references/local-testing.md) for handlers and selected interfaces; compilation does not execute their behavior. Account for every declared interface as verified, intentionally not exposed, or deferred/unverified with a reason in the existing application handoff. An early preview may defer remote MCP; preserve that pending work. WebMCP, cookie-session discovery and OAuth Bearer/client integration are separate checks.
111
-
112
- ## Self-hosted deployment
113
-
114
- Deploy only when the user requests it. Follow the application's selected host
115
- and the installed `docs/skills/provision/SKILL.md`; use the platform's native
116
- workflow. Local project creation alone is not deployment authorization.
34
+ ## Choose the installed package skill
117
35
 
118
- ## Existing project and handoff
36
+ - Read `node_modules/@aotter/mantle/docs/skills/develop/SKILL.md` to change an existing project's manifests, SQL, handlers, service entry or surfaces.
37
+ - Read `node_modules/@aotter/mantle/docs/skills/integrate/SKILL.md` to add Mantle to an application with existing code, users or data.
38
+ - Read `node_modules/@aotter/mantle/docs/skills/update/SKILL.md` to upgrade Mantle, including from 0.1.x.
39
+ - Read `node_modules/@aotter/mantle/docs/skills/provision/SKILL.md` only for an authorized production deployment.
40
+ - Read `node_modules/@aotter/mantle/docs/skills/media-gc/SKILL.md` only to audit or remove stale uncommitted media uploads.
41
+
42
+ ## New application
43
+
44
+ Node must be 22.22 or newer. Stable 0.2.0 is available as `@aotter/mantle@0.2.0`; pin selected Mantle packages to that exact version. Create it with `npx @aotter/mantle@<exact version> init <directory>`, then follow
45
+ `mantle help` ("Build from a product brief") and the app's `README.md`. Without the user listing them, a complete app
46
+ includes:
119
47
 
120
- Preserve the user's manifests, `src/` files, identity, package versions and
121
- provider resources. The app writes its entry (`src/worker.ts` by default;
122
- `--entry` selects another). Workers generation creates or updates Wrangler's
123
- split-build settings and public-fetch compatibility flags. Run the same generation command (target, output directory,
124
- manifests and options) with `--check`, and the project's own tests,
125
- before and after a change.
48
+ - Email OTP sign-in, the two roles `admin` and `user`, Admin for `admin`, MCP for both roles (`/mcp`, `/mcp/admin`)
49
+ and REST: the shell already wires them; keep them.
50
+ - Real business rules in SQL Procedures (`mantle help sql-patterns`), not in handler code around separate writes.
51
+ - For visitor pages, everything in `mantle help public-pages` (SEO, AEO, sitemap, robots, `llms.txt`), styled.
52
+ - Local HTTP checks (`mantle help local-testing`), then independent acceptance with `pnpm accept`
53
+ (`mantle help agent-workflow-acceptance`).
126
54
 
127
- To add Mantle to an application that has its own code, users and data, read
128
- `node_modules/@aotter/mantle/docs/skills/integrate/SKILL.md` first.
55
+ Take patterns from `mantle help examples` into the app's own manifests and `src/`; do not copy an example directory
56
+ over the app. Resolve each `AGENT:` or name the ones you left. Generation only, inside an app you already have: skip
57
+ `init` and use `mantle generate` (`mantle help project-and-cli`).
129
58
 
130
- Report the project path, the exact Mantle version, what you changed, the checks
131
- you ran with their results, and anything left for the user.
59
+ ## Accept before reporting done
60
+
61
+ Before reporting any new app or feature as done, follow `mantle help agent-workflow-acceptance`: a private rubric,
62
+ then one fresh agent per role given only its role and the URLs `pnpm accept` prints, at most three rounds. If it was
63
+ not run, report the work as UNVERIFIED rather than done; if it could not run, BLOCKED.
64
+
65
+ ## Deployment
66
+
67
+ Deploy only when the user requests it, following the installed `docs/skills/provision/SKILL.md` and the selected
68
+ host's native workflow. Local project creation alone is not deployment authorization.
69
+
70
+ ## Existing project and handoff
132
71
 
133
- ## Data paths
72
+ Preserve the user's manifests, `src/` files, identity, package versions and provider resources. Run the project's
73
+ generate command with `--check` and its own tests before and after a change.
134
74
 
135
- Writes use Store `insert` / `update` / `delete`, atomic `batch` / supported `transaction`, or declared Procedures. Raw SQL writes bypass row rules. Use internal Views for joins, aggregates, OR and reusable reads; Store `findById` / `find` / `first` are for id lookups and simple AND filters. Ref handlers receive `ctx.store` with the same Caller and transaction.
75
+ Report the project path, the exact Mantle version, what you changed, the checks you ran with their results, the
76
+ independent acceptance verdict (CONVERGED / BLOCKED / UNVERIFIED), and anything left for the user.