@aotter/mantle 0.2.0-alpha.7 → 0.2.0-alpha.9

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 (126) hide show
  1. package/README.md +27 -5
  2. package/dist/auth/adapter.js +9 -6
  3. package/dist/auth/caller.js +2 -1
  4. package/dist/auth/identity.d.ts +2 -2
  5. package/dist/auth/oauth.d.ts +33 -1
  6. package/dist/auth/oauth.js +121 -28
  7. package/dist/auth/routes.js +6 -4
  8. package/dist/build/compiler.d.ts +44 -122
  9. package/dist/build/compiler.js +202 -277
  10. package/dist/build/spec/domain/model/ManifestGrammar.d.ts +6 -5
  11. package/dist/build/spec/domain/model/SqlIr.d.ts +2 -0
  12. package/dist/build/spec/domain/service/PlanFingerprint.d.ts +2 -0
  13. package/dist/build/spec/kernel/diagnostic.d.ts +1 -1
  14. package/dist/domain/describe/{chunk-ZIQVLA7X.js → chunk-ZVXBGP7Y.js} +69 -8
  15. package/dist/domain/describe/index.js +1 -1
  16. package/dist/domain/describe/target-hash.js +1 -1
  17. package/dist/domain/describe/targets.d.ts +1 -1
  18. package/dist/domain/generated-tools.js +2 -0
  19. package/dist/domain/paging.js +41 -15
  20. package/dist/infrastructure/bundle.js +118 -15
  21. package/dist/infrastructure/cli.js +11 -15
  22. package/dist/infrastructure/generate.d.ts +1 -3
  23. package/dist/infrastructure/generate.js +11 -3
  24. package/dist/infrastructure/generateAuth.js +57 -0
  25. package/dist/infrastructure/inputs.js +8 -3
  26. package/dist/infrastructure/wrangler.js +50 -12
  27. package/dist/kernel/binds.d.ts +0 -3
  28. package/dist/kernel/contracts.d.ts +1 -1
  29. package/dist/kernel/contracts.js +4 -4
  30. package/dist/kernel/dialect/common.d.ts +0 -1
  31. package/dist/kernel/drain.d.ts +5 -0
  32. package/dist/kernel/drain.js +35 -0
  33. package/dist/kernel/driver/postgres.js +6 -2
  34. package/dist/kernel/host-caller.d.ts +1 -0
  35. package/dist/kernel/host-caller.js +1 -0
  36. package/dist/kernel/mcp-apps.d.ts +29 -9
  37. package/dist/kernel/mcp-apps.js +3 -3
  38. package/dist/kernel/mcp-handler.js +101 -18
  39. package/dist/kernel/mcp.d.ts +12 -3
  40. package/dist/kernel/mcp.js +31 -6
  41. package/dist/kernel/rest-router.js +3 -2
  42. package/dist/kernel/scalars.js +3 -2
  43. package/dist/kernel/site.d.ts +1 -3
  44. package/dist/kernel/site.js +2 -2
  45. package/dist/kernel/web-index.js +40 -0
  46. package/dist/kernel/web.d.ts +3 -1
  47. package/dist/kernel/web.js +6 -37
  48. package/dist/usecase/adminBindings.js +2 -3
  49. package/dist/usecase/adminClient.js +87 -0
  50. package/dist/usecase/adminDescriptors.js +19 -65
  51. package/dist/usecase/generate.js +5 -4
  52. package/dist/usecase/mcp-media.js +2 -2
  53. package/dist/usecase/mcp.js +16 -12
  54. package/dist/usecase/paging.js +2 -3
  55. package/dist/usecase/publishing.js +3 -3
  56. package/dist/usecase/site.js +0 -1
  57. package/dist/usecase/tool-version.js +9 -0
  58. package/dist/usecase/translations.js +1 -1
  59. package/dist/usecase/validation.js +128 -19
  60. package/dist/usecase/web.js +3 -2
  61. package/docs/examples/README.md +1 -1
  62. package/docs/examples/app-shell/README.md +45 -3
  63. package/docs/examples/app-shell/package.json +14 -6
  64. package/docs/examples/app-shell/smoke-kit.mjs +54 -0
  65. package/docs/examples/app-shell/src/auth.ts +6 -3
  66. package/docs/examples/app-shell/src/service.ts +3 -3
  67. package/docs/examples/app-shell/tsconfig.json +4 -1
  68. package/docs/examples/app-shell/worker-configuration.d.ts +2 -2
  69. package/docs/examples/app-shell/wrangler.jsonc +5 -4
  70. package/docs/examples/club-events/manifests/club-events.yaml +7 -0
  71. package/docs/examples/club-events/src/handlers.ts +1 -1
  72. package/docs/examples/generated-web/README.md +6 -2
  73. package/docs/examples/generated-web/wrangler.jsonc +1 -0
  74. package/docs/examples/purchasing/README.md +1 -1
  75. package/docs/examples/purchasing/manifests/purchasing.yaml +17 -1
  76. package/docs/examples/purchasing/smoke.mjs +10 -4
  77. package/docs/examples/purchasing/src/admin.tsx +13 -0
  78. package/docs/examples/purchasing/src/handlers.ts +1 -1
  79. package/docs/examples/purchasing/wrangler.jsonc +5 -4
  80. package/docs/examples/recipes/wrangler.jsonc +5 -4
  81. package/docs/handbook/cloudflare/authentication.md +43 -6
  82. package/docs/handbook/cloudflare/chatgpt-sites.md +4 -2
  83. package/docs/handbook/cloudflare/deploy-and-operate.md +45 -1
  84. package/docs/handbook/cloudflare/media-r2.md +2 -3
  85. package/docs/handbook/cloudflare/service-entry.md +68 -31
  86. package/docs/handbook/concepts/authorization.md +1 -1
  87. package/docs/handbook/concepts/mcp-and-agents.md +19 -0
  88. package/docs/handbook/concepts/runtime-and-adapters.md +1 -1
  89. package/docs/handbook/examples/hub.md +1 -1
  90. package/docs/handbook/guides/admin-ui.md +107 -1
  91. package/docs/handbook/guides/agent-setup.md +27 -9
  92. package/docs/handbook/guides/agent-workflow-acceptance.md +222 -0
  93. package/docs/handbook/guides/mcp-apps.md +522 -6
  94. package/docs/handbook/guides/native-admin.md +300 -51
  95. package/docs/handbook/guides/oauth.md +119 -5
  96. package/docs/handbook/guides/public-pages.md +2 -2
  97. package/docs/handbook/guides/size-and-startup.md +1 -1
  98. package/docs/handbook/guides/typed-queries.md +35 -0
  99. package/docs/handbook/navigation.json +0 -4
  100. package/docs/handbook/reference/admin-descriptors.md +0 -35
  101. package/docs/handbook/reference/procedure.md +6 -2
  102. package/docs/handbook/reference/schema.md +13 -3
  103. package/docs/handbook/reference/surface.md +129 -15
  104. package/docs/handbook/reference/trigger.md +43 -1
  105. package/docs/handbook/reference/view.md +1 -1
  106. package/docs/handbook/releases/index.md +74 -2
  107. package/docs/handbook/start/overview.md +1 -1
  108. package/docs/handbook/start/project-and-cli.md +16 -8
  109. package/docs/handbook/start/quickstart-worker.md +1 -1
  110. package/docs/skills/develop/SKILL.md +46 -18
  111. package/docs/skills/integrate/SKILL.md +4 -9
  112. package/docs/skills/media-gc/SKILL.md +7 -5
  113. package/docs/skills/provision/SKILL.md +18 -12
  114. package/docs/skills/update/SKILL.md +19 -18
  115. package/docs/upgrade-0.1-to-0.2.md +6 -6
  116. package/package.json +2 -1
  117. package/skills/README.md +11 -16
  118. package/skills/mantle/SKILL.md +39 -17
  119. package/skills/mantle/references/local-testing.md +9 -0
  120. package/skills/mantle/references/web.md +1 -1
  121. package/skills/mantle/references/website.md +26 -22
  122. package/docs/examples/app-shell/src/admin.ts +0 -10
  123. package/docs/examples/purchasing/src/admin.ts +0 -12
  124. package/docs/handbook/guides/admin-extensions.md +0 -20
  125. package/docs/skills/develop/mcp-app.md +0 -39
  126. package/skills/.keep +0 -0
@@ -10,13 +10,21 @@ description: Generation targets, CLI options and ownership of native application
10
10
  | `generated/` | Generator: TypeScript, native SQL and selected bindings |
11
11
  | `migrations/` | App's agent and native migration tool |
12
12
  | `wrangler.jsonc` | App configuration; generator maintains selected split-build keys |
13
- | `dist/` | Disposable bundle output; do not commit |
13
+ | `dist/` | Disposable bundle output (`dist/worker`, `dist/client`); do not commit |
14
+
15
+ ## Accept user-facing work
16
+
17
+ Before reporting any user-facing deliverable as done, run the installed
18
+ version's [independent acceptance
19
+ flow](../guides/agent-workflow-acceptance.md) with a fresh agent on the surface
20
+ its user uses. For MCP work, also run that guide's design audit before choosing
21
+ tool names or writing manifests/handlers.
14
22
 
15
23
  ## Commands
16
24
 
17
25
  ```sh
18
26
  mantle generate <target> <output-directory> <manifest>... [options]
19
- mantle bundle <entry> <outdir>
27
+ mantle bundle <entry> <outdir> [--assets <dir>]
20
28
  ```
21
29
 
22
30
  | Target | Dialect | Handle |
@@ -34,24 +42,24 @@ Other handles may adapt to the same [structural driver contracts](../guides/adap
34
42
  | `--admin` | Emit native Admin bindings and `admin/*` modules; install the separate Admin package. |
35
43
  | `--auth <module>` | Read plain `authOptions(env)` (or an exported auth instance's options) and append selected Better Auth DDL. Repeat it once per Better Auth instance. Prefer plain options without initialization side effects. |
36
44
  | `--site <module>` | Read `siteDefaults`; emit site/media bindings and deployment SQL. |
37
- | `--admin-extensions <module>` | Read the named/default `adminExtensions` array and the optional `navGroups` (sidebar groups; see native-admin.md "Sidebar"). The app shell passes `src/admin.ts`. |
38
45
  | `--wrangler <path>` | Existing JSONC/JSON/TOML config; default finds one or creates `wrangler.jsonc`. TOML receives manual-edit instructions. |
39
46
  | `--entry <path>` | Worker source entry; default `src/worker.ts`. |
40
- | `--outdir <path>` | Split bundle output; default `dist`. Keep separate from source/generated files. |
47
+ | `--outdir <path>` | Bundle output; default `dist`. The Worker goes to `<outdir>/worker`. Keep separate from source/generated files. |
48
+ | `--assets <path>` | With `--admin`: the static assets directory `mantle bundle` builds Admin into (`<assets>/admin`); default `<outdir>/client`. Written to Wrangler's `assets.directory`, and to the build command when not the default. New assets blocks default to `ASSETS`, Worker-first routing and no HTML rewriting; existing blocks keep their binding/routing. |
41
49
 
42
50
  ## Outputs
43
51
 
44
- `generated/.mantle-inputs.json` records the Mantle version and a hash of every input the run read (manifests and the
45
- `--auth`, `--site`, `--admin-extensions` modules). `mantle bundle`, which Wrangler runs for `wrangler dev` and every
52
+ `generated/.mantle-inputs.json` records the Mantle version, the target, and a hash of every input the run read (manifests and the
53
+ `--auth` and `--site` modules). `mantle bundle`, which Wrangler runs for `wrangler dev` and every
46
54
  deploy, refuses to build when an input changed since, so stale generated code cannot run; regenerate and rebuild.
47
55
  Commit it with the other generated files.
48
56
  The bundle also prints notes, never errors, for SQL in the app's own code against Better Auth's tables (read users
49
57
  through `userOf(caller)` or `readIdentity(auth)` instead) and for Better Auth roles beyond `admin` and `user`.
50
58
 
51
- `generated.ts` exports typed queries and Store. Direct `views/<encoded-name>.ts` and `procedures/<encoded-name>.ts` entries export an operation and its types. Proved pageable Views also have `paged/views/*`; boundary checks live in `validation/*`. `admin-descriptors.ts`, `rest.ts` and `web.ts` are always emitted. Manifest exposure selects `mcp.ts`; `admin-bindings.ts` and `admin/*` require `--admin`. Auth and site are explicit options.
59
+ `generated.ts` exports typed queries and Store. Direct `views/<encoded-name>.ts` and `procedures/<encoded-name>.ts` entries export an operation and its types. Proved pageable Views also have `paged/views/*`; boundary checks live in `validation/*`. `admin-descriptors.ts`, `rest.ts` and `web.ts` are always emitted. Manifest exposure selects `mcp.ts`; `admin-bindings.ts`, `admin-client.ts` (browser-side types and hooks for `admin.tsx`) and `admin/*` require `--admin`. Auth and site are explicit options.
52
60
 
53
61
  Apply `schema.sql` only to an empty database. Later changes require [explicit migrations](../concepts/runtime-and-adapters.md#schema-installation-and-migrations); generation and runtime do not inspect the database. Ref declarations print the `Handlers` keys to implement.
54
62
 
55
63
  Never edit generated output by hand. Merge manifests/options, regenerate with the same command, then review TypeScript and SQL diffs. Use that exact command with `--check` in CI. Unmarked app files are preserved. Imported option modules must be pure; generation does not make their side effects safe.
56
64
 
57
- On Workers, generation configures `mantle bundle` as Wrangler's build command. It emits minified split ESM with a startup guard for eager Better Auth imports. On Bun, the app owns `Bun.serve`, its Database/SQL pool and scheduler. See [service composition](../cloudflare/service-entry.md).
65
+ On Workers, generation configures `mantle bundle` as Wrangler's build command. It emits minified split ESM into `<outdir>/worker` with a startup guard for eager Better Auth imports and for Admin's browser code (`@aotter/mantle-admin/app` and `/hooks`, which `generated/admin-client.ts` imports; they belong to `admin.tsx`). When the Worker imports `@aotter/mantle-admin/server`, it also builds Admin with Vite into `<assets>/admin` (`--assets`, default `<outdir>/client`), from `admin.tsx` beside the Worker entry or Admin's built-in entry; `src/admin.ts` is not an entry. The assets directory must not overlap the Worker directory, and neither the outdir nor the assets directory may be the working directory or contain the Worker entry. The built-in entry is not rebuilt while the installed `@aotter/mantle-admin` keeps its path and version and its direct dependencies and its `react`/`react-dom` peers keep theirs; an `admin.tsx` entry builds every time. The build needs no install scripts (`npm ci --ignore-scripts` works). A `package-lock.json` made on one OS can lack the native build binaries (rolldown, `@tailwindcss/oxide`, lightningcss) that npm installs per platform from `optionalDependencies`, so a lockfile made on macOS can fail the build on a Linux host; create the lockfile on the build platform or use pnpm. `wrangler dev` and `wrangler deploy` run that build command, so they need `node_modules`. The built output (`<outdir>/worker`, `<assets>`) never reads it, so a pipeline that deletes `node_modules` must run `wrangler deploy` first. On Bun, the app owns `Bun.serve`, its Database/SQL pool and scheduler; Bun runs the server as TypeScript, so for a `bun-*` target recorded in `.mantle-inputs.json`, `mantle bundle src/server.ts dist` skips the Worker bundle and builds only Admin, into `dist/client/admin` (read with `bunAdminAssets("dist/client/admin")`, adapted for `adminShell` as in service composition). See [service composition](../cloudflare/service-entry.md).
@@ -3,7 +3,7 @@ description: Generate a small native D1 service and mount an application-owned W
3
3
  ---
4
4
  # Quickstart: a service on Workers
5
5
 
6
- Create an application outside the SDK checkout. Install an exact released `@aotter/mantle` version, TypeScript, Wrangler and Cloudflare Worker types. Read that installed version's handbook; this page describes the native 0.2.0 contract.
6
+ Create an application outside the SDK checkout. Install an exact released `@aotter/mantle` version, TypeScript, Wrangler and Cloudflare Worker types; `node_modules/@aotter/mantle/docs/examples/app-shell/package.json` lists the versions this release is tested with. Read that installed version's handbook; this page describes the native 0.2.0 contract.
7
7
 
8
8
  Save `manifests/tickets.yaml`:
9
9
 
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: develop
3
- description: Work on an existing Mantle 0.2 project — manifests, SQL Views and Procedures, ref handlers, the service entry, surfaces, identity and MCP — using the installed package's contract.
3
+ description: Work on an existing Mantle 0.2 project — manifests, SQL Views and Procedures, ref handlers, the service entry, surfaces, identity, MCP tool design and independent acceptance — using the installed package's contract.
4
4
  metadata:
5
5
  source: "@aotter/mantle"
6
6
  sourcePath: docs/skills/develop/SKILL.md
@@ -12,28 +12,48 @@ metadata:
12
12
 
13
13
  ## Workflow
14
14
 
15
- Read the installed SDK README and version-matched handbook before editing.
15
+ Read the installed SDK README, then follow the version-matched [project and CLI
16
+ workflow](../../handbook/start/project-and-cli.md) before editing.
16
17
 
17
- Follow the installed [native generation and service workflow](../../handbook/cloudflare/service-entry.md)
18
- with its [native contract](../../handbook/guides/native-execution.md) and [supported declarations](../../handbook/reference/features.md). Commit
19
- all generated output, run the same generation command with `--check`, and keep
20
- bundle `dist/` untracked. The app owns its verified Caller, handlers and native
21
- resources; Better Auth’s admin plugin `adminRoles` defines the admin layer (default `["admin"]`); `ctx.admin` accepts open role names.
22
-
23
- Use the native Store/query/surface entries and app-owned fetch from the service composition guide.
18
+ Use the native Store/query/surface entries and app-owned fetch from the [service
19
+ composition guide](../../handbook/cloudflare/service-entry.md).
20
+ Pair every HTTP Trigger with an MCP Trigger by default; see [Trigger](../../handbook/reference/trigger.md)
21
+ for the generate warning and deliberate asymmetry exception.
24
22
  Keep optional modules out of unused entry imports and auth dynamically loaded.
25
23
  Run actual public/member/admin HTTP, MCP and UI scenarios; verify stored state,
26
24
  visibility, OCC and restart persistence, not just a 200 response.
25
+ Before reporting any user-facing work as done, follow the [independent
26
+ acceptance guide](../../handbook/guides/agent-workflow-acceptance.md): run it
27
+ with a fresh agent on the surface its user uses. This is not limited to MCP; if
28
+ it was not run, say so explicitly and report the work as UNVERIFIED rather than
29
+ done. For MCP workflows, also run the guide's design audit before implementing
30
+ tools.
27
31
 
28
- For native Admin, read the [current guide](../../handbook/guides/native-admin.md).
29
- Select `--admin` / `admin: true`; mount `entries(bindings.schemas, bindings.adapter)`
30
- from the optional Admin package. Keep one Core SDK, the Admin product and shared
31
- UI kit at matching versions. Generate → typecheck → implement listed handlers →
32
- typecheck. Ref handlers retain caller-bound `ctx.store`; generic Admin reads
33
- use shared generated View templates and writes use native Procedure fragments.
32
+ For native Admin, read the [current guide](../../handbook/guides/native-admin.md):
33
+ the app builds Admin with `mantle bundle`. To customise pages, slots, hooks or
34
+ MCP-host-safe components, follow [Customising Admin](../../handbook/guides/native-admin.md#customising-admin).
35
+ Keep matching SDK, Admin and UI versions. Ref handlers retain caller-bound
36
+ `ctx.store`; generic Admin reads use shared generated View templates and writes
37
+ use native Procedure fragments.
34
38
  Check actual member/Admin OTP, private scope/TTL/translation visibility, paging,
35
39
  statistics, safe/exact OCC and no automatic retry after unknown 503 outcomes.
36
40
 
41
+ For application-owned MCP App entries and host checks, follow the [MCP Apps
42
+ guide](../../handbook/guides/mcp-apps.md).
43
+
44
+ Build a custom frontend with `App` from `@modelcontextprotocol/ext-apps`: register
45
+ `ontoolinput`/`ontoolresult` before `connect()`, and use `callServerTool` for
46
+ host-proxied calls. Keep protocol negotiation and message routing in the official
47
+ client; importing its types while writing a second `postMessage` bridge is
48
+ insufficient.
49
+
50
+ For Admin UI upgrades, follow the installed handbook's
51
+ [retained-page recipe](../../handbook/guides/mcp-apps.md#keep-old-conversations-working-after-an-upgrade).
52
+ Keep deployed snapshots in source/artifact storage and pass `previous` to
53
+ `adminMcpApps`; verify old conversations after a changed UI build without host
54
+ tool refresh, reconnection or cache clearing. Keep tool contracts compatible
55
+ through the declared retention window.
56
+
37
57
 
38
58
  Place admin MCP Procedures in Admin deliberately: `spec.uiSchema.collectionAction:
39
59
  <schema-name>` adds a collection-header action; `spec.target: { schema, id,
@@ -41,8 +61,9 @@ version? }` selects row actions and binds the row id / reviewed OCC version to
41
61
  the named inputs. Other admin operations appear under Operations in the sidebar.
42
62
  Keep state conditions in the SQL WHERE: simple AND equality/IN literals become
43
63
  row-menu hints, while the Procedure remains the authority. Required-ref child
44
- collections fold under their parent's sidebar group; use Schema
45
- `uiSchema.nav.standalone: true` for a top-level entry.
64
+ collections fold under their parent's sidebar group; with two or more required
65
+ `id` refs, set Schema `uiSchema.nav.parentField` to the parent's ref (generate
66
+ refuses otherwise); use `uiSchema.nav.standalone: true` for a top-level entry.
46
67
 
47
68
  ## Database changes
48
69
 
@@ -50,10 +71,17 @@ The runtime never creates, alters or checks tables. Boot and requests run no DDL
50
71
 
51
72
  For the first install, apply generated `schema.sql`, including selected auth/site DDL, to an empty database. Apply selected seed SQL explicitly.
52
73
 
53
- For every later schema change, the application's coding agent diffs the regenerated `schema.sql`, writes a migration with the host's native tool (`wrangler d1 migrations` or the app's PostgreSQL migration tool), rehearses it on a copy, and applies it before deploying the new code. Cloud executes migrations at deploy time.
74
+ For every later schema change, the application's coding agent diffs the regenerated `schema.sql`, writes a migration with the host's native tool (`wrangler d1 migrations` or the app's PostgreSQL migration tool), rehearses it on a copy, and applies it before deploying the new code.
54
75
 
55
76
  Destructive changes and type changes need explicit data migration. Mantle drops nothing. Initial `schema.sql` is not an upgrade script.
56
77
 
57
78
  ## Data paths
58
79
 
59
80
  Writes use Store `insert` / `update` / `delete`, `batch`, `transaction`, or declared Procedures. Never use raw SQL writes: they bypass scope, TTL, publishing and system-column rules. For reads beyond an id lookup or simple AND filter (joins, aggregates, OR, reuse), declare an internal View so the SQL is reviewable and typed. Store `findById`, `find` and `first` remain suitable for handler lookups and embedding in an existing app. Ref handlers receive `ctx.store` bound to the same Caller and transaction.
81
+
82
+ For simple creates/partial updates, prefer Store-backed ref Procedures; keep
83
+ Procedure `requires`/generated input checks, use only allowed patch fields and
84
+ return safe business fields with the actual returned ID/version. Preserve
85
+ omitted fields and document null semantics. Retain SQL for atomic conditional
86
+ or related writes; D1 batches cannot consume an earlier result. Follow the
87
+ [Store write guidance](../../handbook/guides/typed-queries.md#prefer-store-backed-ref-procedures-for-simple-writes).
@@ -12,13 +12,8 @@ metadata:
12
12
 
13
13
  ## Workflow
14
14
 
15
- Read the installed SDK README and version-matched handbook before editing.
16
-
17
- Follow the installed [native generation and service workflow](../../handbook/cloudflare/service-entry.md)
18
- with its [native contract](../../handbook/guides/native-execution.md) and [supported declarations](../../handbook/reference/features.md). Commit
19
- all generated output, run the same generation command with `--check`, and keep
20
- bundle `dist/` untracked. The app owns its verified Caller, handlers and native
21
- resources; Better Auth’s admin plugin `adminRoles` defines the admin layer (default `["admin"]`); `ctx.admin` accepts open role names.
15
+ Read the installed SDK README, then follow the version-matched [project and CLI
16
+ workflow](../../handbook/start/project-and-cli.md) before editing.
22
17
 
23
18
  Keep the application router, database/pool, identity and frontend. Replace
24
19
  Core consumers explicitly and compose only selected generated entries. Resolve
@@ -30,8 +25,8 @@ the configured OAuth resource row (see [OAuth](../../handbook/guides/oauth.md)).
30
25
  Verify cutover with actual app tests.
31
26
 
32
27
  Preserve the app router, verified identity and native resources. For selected
33
- Admin use the [native guide](../../handbook/guides/native-admin.md): three matching
34
- packages, generated checks and `entries(bindings.schemas, bindings.adapter)`.
28
+ Admin, follow the [native guide](../../handbook/guides/native-admin.md) for its
29
+ application-built bundle and service composition.
35
30
  Do not import old `/spec`, `/core` or runtime surface APIs. Review data/role
36
31
  migrations explicitly; full cross-target int64 parity and automated transfer
37
32
  are not this release's upgrade contract.
@@ -41,11 +41,13 @@ objects approved by the user.
41
41
 
42
42
  `POST /admin/api/media/uploads` issues presigned PUT URLs that expire after 15
43
43
  minutes, for keys under `uploads/<purpose>/<group>/<role>.<ext>`. Commit
44
- copies each checked object to `<purpose>/<group>/<role>.<ext>` (with
45
- `committedAt` metadata) and deletes the upload key; a rejected group's upload
46
- keys are deleted. So an object still under `uploads/` long after its URL
47
- expired belongs to an upload that was never committed, and nothing can commit
48
- it any more. Objects outside `uploads/` are committed media: never candidates.
44
+ copies each checked object to `committed/<group>/<attempt>/<role>.<ext>` (with
45
+ `committedAt` metadata); the attempt UUID isolates concurrent commits. Upload
46
+ keys are removed after the database commit succeeds, or when a group is
47
+ rejected. An old upload key may also be leftover cleanup from a successful or
48
+ uncertain commit: it is not evidence that the media row is absent. Once expired,
49
+ it cannot create a new asset. Objects outside `uploads/` are never candidates;
50
+ reconcile attempt copies separately with live database references.
49
51
 
50
52
  ## Audit
51
53
 
@@ -13,13 +13,8 @@ metadata:
13
13
 
14
14
  ## Workflow
15
15
 
16
- Read the installed SDK README and version-matched handbook before editing.
17
-
18
- Follow the installed [native generation and service workflow](../../handbook/cloudflare/service-entry.md)
19
- with its [native contract](../../handbook/guides/native-execution.md) and [supported declarations](../../handbook/reference/features.md). Commit
20
- all generated output, run the same generation command with `--check`, and keep
21
- bundle `dist/` untracked. The app owns its verified Caller, handlers and native
22
- resources; Better Auth’s admin plugin `adminRoles` defines the admin layer (default `["admin"]`); `ctx.admin` accepts open role names.
16
+ Read the installed SDK README, then follow the version-matched [project and CLI
17
+ workflow](../../handbook/start/project-and-cli.md) before editing.
23
18
 
24
19
  Deploy/create resources only within the user's authorization; reuse configured
25
20
  host resources. Apply reviewed and rehearsed migrations before routing traffic;
@@ -27,12 +22,23 @@ imports/first requests perform no DDL or schema checks. Keep auth dynamic, produ
27
22
  secrets in the host store, trusted HTTPS origin and verified bootstrap rule,
28
23
  production email and selected media wiring. Configure Admin ASSETS worker-first
29
24
  as in [Workers assets and secrets](../../handbook/cloudflare/service-entry.md#workers-assets-and-secrets). Hyperdrive caching stays off; PG settings are deployment-owned.
25
+ Keep the Workers [public-fetch flags](../../handbook/cloudflare/deploy-and-operate.md#public-fetch-routing),
26
+ including environment overrides; verify deployed MCP with a real OAuth bearer
27
+ (`initialize` and `tools/list`), not only a browser session cookie.
28
+ For MCP Apps, also follow [deployed host acceptance](../../handbook/guides/mcp-apps.md#verify-a-deployed-app-in-chatgpt):
29
+ compare the current resource URI and visibly verify a newly invoked render tool.
30
+ Archive deployed Admin pages using the guide's `previous` recipe and carry them
31
+ through clean builds. Test the same old conversation after changing the UI build,
32
+ without reconnecting, refreshing host tools or clearing caches. A deliberate tool
33
+ contract change has its own migration/host rediscovery step. OAuth renewal, `tools/call` success and a
34
+ local official-host replay do not establish that the deployed App rendered.
30
35
  Bun uses native Database/SQL, an app server and scheduler. Verify admin sign-in
31
36
  (role admin), denied access, public reads, a persisted write, MCP and selected UI.
32
37
  Report artifact/resources/checks and keep rollback artifacts.
33
38
 
34
- Use the installed [Native Admin](../../handbook/guides/native-admin.md) asset
35
- contract and `entries(bindings.schemas, bindings.adapter)`. Admin SPA assets
36
- belong to `@aotter/mantle-admin`, while UI supplies the shared kit. Verify both
37
- member and admin OTP/UI flows. Deployment of an authorized application does
38
- not authorize SDK publication; a workspace preview remains a preview.
39
+ For ChatGPT Sites, follow [Mantle on ChatGPT Sites](../../handbook/cloudflare/chatgpt-sites.md).
40
+
41
+ The app builds Admin with `mantle bundle`; serve it as [Native
42
+ Admin](../../handbook/guides/native-admin.md) describes. Verify both member and
43
+ admin OTP/UI flows. Deployment of an authorized application does not authorize
44
+ SDK publication; a workspace preview remains a preview.
@@ -12,24 +12,25 @@ metadata:
12
12
 
13
13
  ## Workflow
14
14
 
15
- Read the installed SDK README and version-matched handbook before editing.
15
+ Read the installed SDK README, then follow the version-matched [project and CLI
16
+ workflow](../../handbook/start/project-and-cli.md) before editing.
16
17
 
17
- Follow the installed [native generation and service workflow](../../handbook/cloudflare/service-entry.md)
18
- with its [native contract](../../handbook/guides/native-execution.md) and [supported declarations](../../handbook/reference/features.md). Commit
19
- all generated output, run the same generation command with `--check`, and keep
20
- bundle `dist/` untracked. The app owns its verified Caller, handlers and native
21
- resources; Better Auth’s admin plugin `adminRoles` defines the admin layer (default `["admin"]`); `ctx.admin` accepts open role names.
18
+ For 0.1.x, follow [Upgrade 0.1 to 0.2](../../upgrade-0.1-to-0.2.md): give the
19
+ 0.2 service a new database and move data by export and import; never boot 0.2
20
+ against a 0.1.x database. Between 0.2 versions, apply reviewed migrations
21
+ rehearsed on a copy.
22
22
 
23
- Pin exact target SDK/peer versions and read its release notes and Admin asset
24
- installation instructions. Core-to-native replaces app imports/wiring; it is not
25
- a package-only update. Preserve users, sessions, content and application code.
26
- Review emitted SQL/policy diffs and rehearse explicit data-preserving schema/auth/role
27
- migrations on a copy. Initial schema.sql never authorizes rebuilding production
28
- tables. Verify auth/Admin/MCP/REST, locks and persistence before authorized cutover.
23
+ Pin exact target SDK/peer versions and read its release notes and Admin build
24
+ instructions. Core-to-native replaces app imports/wiring; it is not
25
+ a package-only update. For 0.2-to-0.2 updates, preserve users, sessions, content
26
+ and application code; review emitted SQL/policy diffs and rehearse explicit
27
+ data-preserving schema/auth/role migrations on a copy. Initial schema.sql never
28
+ authorizes rebuilding production tables. Verify auth/Admin/MCP/REST, locks and
29
+ persistence before authorized cutover.
29
30
 
30
- Follow [Native Admin](../../handbook/guides/native-admin.md) for the three-package
31
- SDK/Admin/shared-kit split and asset/extension/MCP App subpath moves; old UI
32
- subpaths have no compatibility aliases. Pin only actually published versions,
33
- or explicitly use a matching workspace preview. Recheck member and Admin OTP,
34
- all affected native routes, private field visibility, OCC and unknown outcomes.
35
- Do not publish a package as part of an application dependency update.
31
+ Follow [Customising Admin](../../handbook/guides/native-admin.md#customising-admin)
32
+ for the current application-built Admin; old UI subpaths have no compatibility
33
+ aliases. Pin only actually published versions, or explicitly use a matching
34
+ workspace preview. Recheck member and Admin OTP, all affected native routes,
35
+ private field visibility, OCC and unknown outcomes. Do not publish a package as
36
+ part of an application dependency update.
@@ -13,12 +13,12 @@ The remainder describes the earlier alpha contract for historical reference.
13
13
 
14
14
  No codemod, and no in-place upgrade of a 0.1.x database. A coding agent moves
15
15
  one project by hand with this guide. When it and
16
- [ADR-0032](https://github.com/aotter/mantle/blob/develop/docs/adr/0032-store-centric-core-and-service-contract.md),
17
- [ADR-0033](https://github.com/aotter/mantle/blob/develop/docs/adr/0033-storage-converges-to-the-plan.md),
18
- [ADR-0034](https://github.com/aotter/mantle/blob/develop/docs/adr/0034-store-is-authored-as-sql.md),
19
- [ADR-0035](https://github.com/aotter/mantle/blob/develop/docs/adr/0035-sql-dialects.md),
20
- [ADR-0036](https://github.com/aotter/mantle/blob/develop/docs/adr/0036-host-and-dialect.md) or
21
- [ADR-0038](https://github.com/aotter/mantle/blob/develop/docs/adr/0038-bun-native-host.md) disagree, the ADR wins.
16
+ [ADR-0032](https://github.com/aotter/mantle/blob/v0.2.0-alpha.7/docs/adr/0032-store-centric-core-and-service-contract.md),
17
+ [ADR-0033](https://github.com/aotter/mantle/blob/v0.2.0-alpha.7/docs/adr/0033-storage-converges-to-the-plan.md),
18
+ [ADR-0034](https://github.com/aotter/mantle/blob/v0.2.0-alpha.7/docs/adr/0034-store-is-authored-as-sql.md),
19
+ [ADR-0035](https://github.com/aotter/mantle/blob/v0.2.0-alpha.7/docs/adr/0035-sql-dialects.md),
20
+ [ADR-0036](https://github.com/aotter/mantle/blob/v0.2.0-alpha.7/docs/adr/0036-host-and-dialect.md) or
21
+ [ADR-0038](https://github.com/aotter/mantle/blob/v0.2.0-alpha.7/docs/adr/0038-bun-native-host.md) disagree, the ADR wins.
22
22
 
23
23
  ## Rules
24
24
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aotter/mantle",
3
- "version": "0.2.0-alpha.7",
3
+ "version": "0.2.0-alpha.9",
4
4
  "type": "module",
5
5
  "sideEffects": false,
6
6
  "engines": {
@@ -92,6 +92,7 @@
92
92
  }
93
93
  },
94
94
  "devDependencies": {
95
+ "@modelcontextprotocol/client": "2.2.0",
95
96
  "@modelcontextprotocol/server": "2.2.0",
96
97
  "@better-auth/core": "1.7.7",
97
98
  "@better-auth/oauth-provider": "1.7.7",
package/skills/README.md CHANGED
@@ -21,25 +21,20 @@ distributions (ADR-0032 decision 13):
21
21
 
22
22
  ## Install
23
23
 
24
- ```bash
25
- # Claude Code: two separate prompts
26
- /plugin marketplace add aotter/mantle
27
- /plugin install mantle@mantle
24
+ Use the [agent setup guide](../docs/handbook/guides/agent-setup.md) for Codex,
25
+ Claude Code, Cursor and GitHub Copilot. Pin the plugin checkout to the same
26
+ release tag as the application's SDK; alpha releases on `develop` can be newer
27
+ than the default `main` branch. For a skill-only installation:
28
28
 
29
- # Codex
30
- codex plugin marketplace add aotter/mantle
31
- codex plugin add mantle@mantle
29
+ ```sh
30
+ npx skills add https://github.com/aotter/mantle/tree/v0.2.0-alpha.9 --skill mantle
32
31
  ```
33
32
 
34
- Cursor and GitHub Copilot read the manifests from the repository
35
- (`.cursor-plugin/plugin.json`, `.copilot-plugin/plugin.json`). Without a
36
- plugin host, `npx skills add aotter/mantle` installs the `mantle` skill and its
37
- references. The manifests are generated by
38
- `scripts/sync-plugin-manifests.mjs` and checked with `--check`.
39
-
40
- Claude Code updates an installed plugin only when its manifest version
41
- changes, and that version is Core's, so a skill or script update reaches
42
- Claude Code users with the next Core release.
33
+ The explicit skill name excludes repository maintainer skills. The manifests
34
+ are generated by `scripts/sync-plugin-manifests.mjs` and checked with `--check`.
35
+ When upgrading, update the marketplace ref or local tagged checkout and refresh
36
+ the plugin. Verify the loaded manifest version; Claude Code's plugin version
37
+ is Core's, so packaged skill changes reach users through the next Core release.
43
38
 
44
39
  ## Disclosure audit
45
40
 
@@ -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
@@ -21,10 +21,29 @@ checkout, or any online copy.
21
21
 
22
22
  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.
23
23
 
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. 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.
24
+ ## Choose the installed package skill
25
+
26
+ - Read `node_modules/@aotter/mantle/docs/skills/develop/SKILL.md` to change an existing project's manifests, SQL, handlers, service entry or surfaces.
27
+ - Read `node_modules/@aotter/mantle/docs/skills/integrate/SKILL.md` to add Mantle to an application with existing code, users or data.
28
+ - Read `node_modules/@aotter/mantle/docs/skills/update/SKILL.md` to upgrade Mantle, including from 0.1.x.
29
+ - Read `node_modules/@aotter/mantle/docs/skills/provision/SKILL.md` only for an authorized production deployment.
30
+ - Read `node_modules/@aotter/mantle/docs/skills/media-gc/SKILL.md` only to audit or remove stale uncommitted media uploads.
31
+
32
+ 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
33
 
26
34
  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
35
 
36
+ Before reporting any user-facing work as done, follow the installed
37
+ `node_modules/@aotter/mantle/docs/handbook/guides/agent-workflow-acceptance.md`:
38
+ run independent acceptance with a fresh agent on the surface its user uses.
39
+ This is not limited to MCP; if it was not run, say so explicitly and report the
40
+ work as UNVERIFIED rather than done. For MCP workflows, also run the guide's
41
+ design audit before implementing tools. This workflow practice applies to every
42
+ installed SDK version: if its guide is older or MCP-scoped, apply its fresh-agent
43
+ round loop to the user-facing surface actually built. If an older installed
44
+ version lacks this guide, record the missing guidance and preserve that version's
45
+ contract; do not silently upgrade or substitute checkout/online docs.
46
+
28
47
  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
48
 
30
49
  ## Generated native applications
@@ -44,16 +63,16 @@ cookieCache `{enabled:true,maxAge:60,refreshCache:false,version:"read-60-v1"}` a
44
63
  no KV. Bump version when enabling/changing the policy; writes, Admin, consent,
45
64
  unknown/ref/media calls stay fresh. Read the installed auth docs before MCP caching.
46
65
 
47
- Use the workflow **generate → typecheck → implement listed handlers**. For example:
66
+ Use the workflow **generate → implement listed handlers → check**. In an app
67
+ copied from the installed app shell, its scripts are the canonical commands:
48
68
 
49
69
  ```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
70
+ pnpm generate
71
+ pnpm check
53
72
  ```
54
- Implement every printed `Handlers` key
73
+ Implement every printed `Handlers` key
55
74
  and pass the implementations at `store(db, caller, { handlers })` (and selected
56
- surface options). Run `tsc --noEmit` again before local acceptance.
75
+ surface options).
57
76
  Generated Store metadata initializes on its first use, once per module. Bind
58
77
  `store(db, caller, options?)` for the current request; never reuse one caller's
59
78
  bound Store for another caller.
@@ -78,18 +97,18 @@ Resolve conflicts by merging manifests/options and regenerating. Add the printed
78
97
  `.gitattributes` line and run the same generate command with `--check` in CI.
79
98
  Compose the app-owned `fetch` using `docs/handbook/cloudflare/service-entry.md`: auth/consent, Admin,
80
99
  MCP, REST behind one request-local origin-checked resolver; keep heavy auth dynamic.
100
+ Pair every HTTP Trigger with an MCP Trigger by default; see `docs/handbook/reference/trigger.md` for the generate warning and deliberate asymmetry exception.
81
101
 
82
102
  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.
103
+ `docs/handbook/guides/native-admin.md`: select `--admin` (or `admin: true`), then
104
+ build and serve the application-owned Admin with `mantle bundle` as that guide
105
+ describes.
87
106
  Admin reads share generated whitelisted native View templates, writes use native
88
107
  Procedure fragments and generated checks. Ref operations retain typed `ctx.store`
89
108
  at request time. Verify member/frontend and admin/Admin OTP, tenant/privacy/TTL,
90
109
  publishing, paging, statistics, exact OCC, ref effects and the actual console;
91
110
  never retry unknown 503 writes automatically. Read the installed Admin README
92
- for extensions, raw-body limits, CSP/assets, 22 languages and the developer workspace.
111
+ for raw-body limits, CSP/assets, 22 languages and the developer workspace.
93
112
  Use only versions actually published, or the explicitly linked workspace packages.
94
113
 
95
114
  For generated native applications, optional site settings/media are selected
@@ -107,7 +126,7 @@ without asking the user to enumerate OTP, media, Admin or SEO. Defaults are
107
126
  acceptance requirements, not evidence that a missing renderer is implemented.
108
127
  Do not report a complete website with blocked required checks.
109
128
 
110
- Run the [local HTTP acceptance](references/local-testing.md) for handlers and websites; compilation does not execute their behavior.
129
+ 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
130
 
112
131
  ## Self-hosted deployment
113
132
 
@@ -120,7 +139,7 @@ workflow. Local project creation alone is not deployment authorization.
120
139
  Preserve the user's manifests, `src/` files, identity, package versions and
121
140
  provider resources. The app writes its entry (`src/worker.ts` by default;
122
141
  `--entry` selects another). Workers generation creates or updates Wrangler's
123
- split-build settings. Run the same generation command (target, output directory,
142
+ split-build settings and public-fetch compatibility flags. Run the same generation command (target, output directory,
124
143
  manifests and options) with `--check`, and the project's own tests,
125
144
  before and after a change.
126
145
 
@@ -128,8 +147,11 @@ To add Mantle to an application that has its own code, users and data, read
128
147
  `node_modules/@aotter/mantle/docs/skills/integrate/SKILL.md` first.
129
148
 
130
149
  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.
150
+ you ran with their results, the independent acceptance verdict (CONVERGED / NOT
151
+ CONVERGED / BLOCKED / UNVERIFIED), and anything left for the user.
132
152
 
133
153
  ## Data paths
134
154
 
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.
155
+ Follow the installed `docs/handbook/guides/typed-queries.md` for Store,
156
+ Procedure and View data paths; the service composition guide owns request-local
157
+ Caller binding.
@@ -7,5 +7,14 @@ Better Auth limits each email-OTP path to 3 requests/minute per IP; `authHardeni
7
7
 
8
8
  - Exercise actual HTTP Triggers for every custom Procedure handler: valid input/output, invalid input, anonymous refusal on protected operations, authorized synthetic caller and expected stored result. A status below 500 alone is not success; assert the expected status and JSON envelope/body. Use only the generated contract's routes, inputs and permissions.
9
9
  - For an app-owned `fetch`, exercise its real public routes, not just dist files. Assert HTML content type, visible content and metadata/canonical/JSON-LD with no JavaScript execution, sitemap, robots and an unknown URL returning 404. Create a local synthetic draft and assert it is hidden anonymously; publish, edit and delete it through authorized operations and check the page and sitemap after each change. Reuse the application's existing smoke-test pattern and clean up test rows/server in `finally`.
10
+ - If the app serves Admin, run `npm run build` and then `node --test generated/admin-mcp-app.check.mjs` (the examples name it `npm test`): the generated `generated/admin-mcp-app.check.mjs` loads the Admin MCP App in an MCP host and fails on a network request, console error or exception. It needs `playwright-core` (a devDependency) and Chrome (`npx playwright-core install chromium` or `MANTLE_TEST_CHROMIUM`); with no browser it fails, so report it as blocked rather than skipped. See `docs/handbook/guides/mcp-apps.md`.
10
11
  - Keep caller authority explicit: use supplied `resolveCaller` and caller-scoped Store/Procedure APIs from the installed service-entry docs. Use the actual local host capabilities; local tests do not prove remote identity/provider wiring.
12
+ - Account for each declared interface separately: verified with the command/identity/result, intentionally not exposed, or deferred/unverified with a reason. Generation proves declaration and artifacts, not route mounting. An early Admin preview or a WebMCP-only application may defer remote MCP; preserve that pending item in the application's existing README, handoff or test report, without a new status/configuration format.
13
+ - For selected remote MCP, use the installed `docs/examples/app-shell/smoke-kit.mjs` `assertMcpDiscovery(endpoint, { tools, headers })` in the application's smoke scenario. Derive `tools` from the generated `mcp.ts` exports, or the pure static `developerConsole.interfaces.callable` in generated `admin-descriptors.ts`; filter to the selected surface and explicitly select the expected permitted subset when application authorization narrows it. Include app-composed tools when present. Do not count `describe.targets` or reconstruct authorization rules in the harness. Assert initialized discovery and all `tools/list` pages; a 404, HTML 200, protocol error or missing expected tools must fail. Keep anonymous/member denial assertions separate. Discovery never needs a business-write `tools/call`.
14
+ - Supply test credentials from the application's normal authorized sign-in/test setup (the smoke kit's console OTP sign-in is valid). The discovery assertion only receives credentials: it must not acquire credentials itself, scrape other sessions or manufacture authority. Report local cookie-session discovery, OAuth Bearer/client integration and browser WebMCP as separate evidence. Cookie or WebMCP success does not prove remote OAuth/ChatGPT wiring; missing credentials leave that case unverified, not passed. Do not enable remote routes or OAuth merely to make acceptance pass.
11
15
  - Record commands and passed/failed/blocked cases for the exact commit. Fix failures before source admission; rerun relevant checks after changing source. Packing does not run these checks and an agent's checklist is not server build attestation.
16
+
17
+ Independent acceptance for every user-facing workflow follows the installed
18
+ `docs/handbook/guides/agent-workflow-acceptance.md`. Scripted smoke is separate
19
+ evidence; browser or host rendering is the acceptance surface for UI and MCP App
20
+ deliverables.
@@ -3,7 +3,7 @@
3
3
  Use this flow only when the installed package README documents concrete native
4
4
  queries and generated `web.ts`.
5
5
  Earlier Core versions use their own installed handbook. Read the installed
6
- `docs/handbook/reference/surface.md` and `docs/examples/generated-web/README.md` before writing
6
+ `docs/handbook/reference/surface.md` and `docs/examples/generated-web/README.md` under `node_modules/@aotter/mantle/` before writing
7
7
  routes; the installed version is authoritative.
8
8
 
9
9
  Mount `web()` when the application serves public HTML and needs `llms.txt`, a