@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.
- package/README.md +38 -38
- package/dist/cli/generate.d.ts +10 -1
- package/dist/cli/generate.d.ts.map +1 -1
- package/dist/cli/generate.js +49 -4
- package/dist/cli/generate.js.map +1 -1
- package/dist/cli/main.js +0 -8
- package/dist/cli/main.js.map +1 -1
- package/dist/codegen/emitMantleModule.js +8 -0
- package/dist/codegen/emitMantleModule.js.map +1 -1
- package/docs/adapter-guide.md +23 -26
- package/docs/adr/0008-structured-diagnostic-shape.md +7 -2
- package/docs/adr/0010-locale-and-translates.md +14 -16
- package/docs/adr/0011-adapter-port-spec.md +2 -1
- package/docs/adr/0014-auth-better-auth-and-multi-tenant-mcp.md +100 -0
- package/docs/adr/0018-core-starters-repository-boundary.md +3 -0
- package/docs/adr/0019-sealed-manifest-runtime-pipeline.md +38 -2
- package/docs/adr/0020-builtin-handler-contracts-and-matched-upsert.md +199 -0
- package/docs/adr/0021-retire-starter-scaffolding.md +30 -0
- package/docs/adr/0022-caller-observed-version-occ.md +212 -0
- package/docs/adr/0023-port-failure-contract.md +69 -0
- package/docs/adr/0024-manifest-native-schema-tables.md +260 -0
- package/docs/adr/README.md +19 -3
- package/docs/adr/adr-lite-803-request-diagnostics.md +38 -0
- package/docs/adr/adr-lite-808-route-readiness.md +47 -0
- package/docs/adr/adr-lite-809-bounded-public-content.md +71 -0
- package/docs/adr/adr-lite-812-native-parity.md +150 -0
- package/docs/adr/adr-lite-823-home-statistics.md +64 -0
- package/docs/adr/adr-lite-842-mcp-authoring.md +30 -0
- package/docs/adr/adr-lite-861-admin-webmcp.md +42 -0
- package/docs/adr/adr-lite-909-admin-ui-kit.md +37 -0
- package/docs/api-mcp-authorization.md +3 -664
- package/docs/auth-hosting-model.md +4 -4
- package/docs/cloudflare-low-level-composition.md +3 -104
- package/docs/deferred-lifecycle-queues.md +2 -243
- package/docs/design-atoms.md +16 -796
- package/docs/direct-authoring.md +5 -0
- package/docs/examples/minimal-worker/README.md +37 -0
- package/docs/examples/minimal-worker/manifests/site.yaml +25 -0
- package/docs/examples/minimal-worker/package.json +26 -0
- package/docs/examples/minimal-worker/smoke.mjs +23 -0
- package/docs/examples/minimal-worker/src/index.ts +4 -0
- package/docs/examples/minimal-worker/tsconfig.json +17 -0
- package/docs/examples/minimal-worker/wrangler.jsonc +22 -0
- package/docs/handbook/cloudflare/authentication.md +167 -0
- package/docs/handbook/cloudflare/bindings.md +236 -0
- package/docs/handbook/cloudflare/conventional-worker.md +162 -0
- package/docs/handbook/cloudflare/deferred-hooks-queues.md +171 -0
- package/docs/handbook/cloudflare/deploy-and-operate.md +105 -0
- package/docs/handbook/cloudflare/low-level-composition.md +169 -0
- package/docs/handbook/cloudflare/media-r2.md +216 -0
- package/docs/handbook/cloudflare/public-web.md +144 -0
- package/docs/handbook/concepts/authorization.md +116 -0
- package/docs/handbook/concepts/four-atoms.md +173 -0
- package/docs/handbook/concepts/lifecycle-and-locales.md +142 -0
- package/docs/handbook/concepts/mcp-and-agents.md +109 -0
- package/docs/handbook/concepts/procedures-and-triggers.md +221 -0
- package/docs/handbook/concepts/runtime-and-adapters.md +177 -0
- package/docs/handbook/concepts/views.md +191 -0
- package/docs/handbook/examples/commerce-transaction.md +813 -0
- package/docs/handbook/examples/guarded-api.md +427 -0
- package/docs/handbook/examples/intake-form.md +319 -0
- package/docs/handbook/examples/legal-documents.md +218 -0
- package/docs/handbook/examples/procurement-approvals.md +240 -0
- package/docs/handbook/examples/publication.md +240 -0
- package/docs/handbook/examples/reservation.md +220 -0
- package/docs/handbook/navigation.json +63 -0
- package/docs/handbook/reference/authorization.md +295 -0
- package/docs/handbook/reference/diagnostics.md +183 -0
- package/docs/handbook/reference/manifest.md +132 -0
- package/docs/handbook/reference/procedure.md +263 -0
- package/docs/handbook/reference/schema.md +250 -0
- package/docs/handbook/reference/site-config.md +233 -0
- package/docs/handbook/reference/surface.md +207 -0
- package/docs/handbook/reference/trigger.md +193 -0
- package/docs/handbook/reference/view.md +256 -0
- package/docs/handbook/start/project-and-cli.md +122 -0
- package/docs/handbook/start/quickstart-worker.md +193 -0
- package/docs/labels.md +3 -1
- package/docs/media-uploads.md +3 -184
- package/docs/migration-0.1.2.md +60 -3
- package/docs/performance-harness.md +127 -10
- package/docs/release-process.md +85 -231
- package/docs/schema-indexes.md +3 -180
- package/docs/sealed-pipeline-ownership.md +6 -5
- package/docs/spec-only-host-adoption.md +158 -0
- package/docs/transaction-patterns.md +5 -0
- package/package.json +21 -25
- package/skills/README.md +4 -4
- package/skills/develop/SKILL.md +23 -28
- package/skills/install/SKILL.md +55 -147
- package/skills/provision/SKILL.md +4 -3
- package/skills/theme/SKILL.md +6 -6
- package/skills/update/SKILL.md +32 -68
- package/dist/cli/create.d.ts +0 -2
- package/dist/cli/create.d.ts.map +0 -1
- package/dist/cli/create.js +0 -243
- package/dist/cli/create.js.map +0 -1
- package/dist/cli/update.d.ts +0 -2
- package/dist/cli/update.d.ts.map +0 -1
- package/dist/cli/update.js +0 -413
- package/dist/cli/update.js.map +0 -1
- package/dist/provision/renderProvisionBundle.d.ts +0 -70
- package/dist/provision/renderProvisionBundle.d.ts.map +0 -1
- package/dist/provision/renderProvisionBundle.js +0 -367
- package/dist/provision/renderProvisionBundle.js.map +0 -1
- package/dist/provision.d.ts +0 -2
- package/dist/provision.d.ts.map +0 -1
- package/dist/provision.js +0 -2
- package/dist/provision.js.map +0 -1
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
# ADR-lite: native and full-facade performance evidence (#812)
|
|
2
|
+
|
|
3
|
+
Status: implemented; local gates passed. The deployment report and per-block
|
|
4
|
+
budget verdicts are maintained in [PR #821](https://github.com/aotter/mantle/pull/821).
|
|
5
|
+
|
|
6
|
+
The existing HTTP harness now records TTFB and full-body timing separately,
|
|
7
|
+
response bytes, and bounded concurrent arrivals. `pnpm bench:wrangler` keeps the
|
|
8
|
+
old row/query regressions and adds a native smoke matrix. `pnpm bench:parity`
|
|
9
|
+
runs the larger matrix, real Better Auth PKCE/OTP/consent/JWT/DPoP issuance,
|
|
10
|
+
revocation/role/replay denials, prepared D1 across fresh workerd processes, and
|
|
11
|
+
R2 transfers. No token, cookie, proof, user ID, SQL, argument or object key enters
|
|
12
|
+
the diagnostic record. Only the secret-protected synthetic fixture has control
|
|
13
|
+
endpoints; never bind it to a consumer database or bucket.
|
|
14
|
+
|
|
15
|
+
## Controls and boundaries
|
|
16
|
+
|
|
17
|
+
| Layer | Work |
|
|
18
|
+
|---|---|
|
|
19
|
+
| F0 | Fixed fetch response; standalone `floor-worker.ts` measures module/bundle floor. R2 F0 performs HEAD only. |
|
|
20
|
+
| F1 | Hono + native SQL and the same public payload; no authentication. |
|
|
21
|
+
| F2 | Native Worker, shared real Auth/session/consent/fresh-role/DPoP checks, SQL compiler and validators, response envelope. MCP shares protocol dispatch and View execution; unmeasured mutations fail closed. |
|
|
22
|
+
| M | Full `createMantleWorker`, same sealed plan, bindings, data and security policy. R2 uses the production storage commit adapter directly. |
|
|
23
|
+
|
|
24
|
+
Protected parity is F2/M. The View and catalog response bodies must match, drafts
|
|
25
|
+
stay private, and auth/protocol errors must fail correctly. Procedure input errors
|
|
26
|
+
compare status/code, not complete diagnostic wording. Admin/Web are facade coverage,
|
|
27
|
+
not a matched-native claim. R2 measures native stream metadata commits and failure/
|
|
28
|
+
retry; D1 MediaAsset publication is covered by the separate #810 integration test.
|
|
29
|
+
The shared comparison bundle intentionally keeps dependencies/configuration equal;
|
|
30
|
+
it cannot measure the difference between standalone application bundle sizes.
|
|
31
|
+
|
|
32
|
+
The planner runs outside workerd. Route/Schema/View axes each use 1/10/100/1,000;
|
|
33
|
+
extra Schemas are unindexed to keep the index-count axis fixed. Each Schema is a
|
|
34
|
+
native table, so the axis is not a claim that 1,000 simultaneous Schema tables
|
|
35
|
+
are an advisable production design. Body/row axes use 64 B/4 KiB and
|
|
36
|
+
100/10,000/50,000;
|
|
37
|
+
locales use 1/3/10, MCP client concurrency uses 1/4/8, R2 uses 1/3/12 variants at
|
|
38
|
+
1/64/256 KiB. Actual simultaneous arrivals can be below client concurrency. The remote fleet
|
|
39
|
+
can add isolates during a batch. A request is repeat-in-isolate only after that
|
|
40
|
+
exact workload previously completed there; overlapping first arrivals stay in
|
|
41
|
+
the first-for-workload cohort. Two global warmups alone cannot prove a warm fleet.
|
|
42
|
+
First requests retain their raw records and a bounded extra-six-statement setup
|
|
43
|
+
allowance; repeat MCP requests must meet the exact two/three/four-statement gate.
|
|
44
|
+
Parity summaries use repeat cohorts; first-for-workload does not necessarily mean
|
|
45
|
+
cold module startup (another workload may already have used that isolate).
|
|
46
|
+
|
|
47
|
+
## Stable gates and measured signals
|
|
48
|
+
|
|
49
|
+
- Indexed public View: one statement and at most 100 available rows read at every
|
|
50
|
+
tested data size. MCP catalog: two statements (grant + fresh role), one KV GET;
|
|
51
|
+
View: three statements with Bearer, four with native DPoP replay reservation.
|
|
52
|
+
- Selected Trigger: four segment lookups at every route count in the portable
|
|
53
|
+
regression; native last-route requests retain one statement at 1,000 routes.
|
|
54
|
+
- Public HTML/llms: two warm statements and less than 1 MiB selected JSON. Sitemap
|
|
55
|
+
index remains explicit O(N) metadata work to enumerate complete part links.
|
|
56
|
+
- R2: exactly N GET + N PUT, known full-body bytes, at most three transfers in
|
|
57
|
+
flight; a first-batch failure starts no later batch and a retry succeeds.
|
|
58
|
+
- Fixture HTTP bodies at most 2 MiB; inspector heap after each batch at most
|
|
59
|
+
96 MiB. This is an observed JS heap ceiling, not instantaneous peak memory or
|
|
60
|
+
retained-after-GC heap. Custom application templates retain their own limits.
|
|
61
|
+
|
|
62
|
+
The default fixture bundle gate is 4,500 KiB raw / 800 KiB gzip (measured
|
|
63
|
+
3,699.93 / 647.98 KiB). The standalone F0 is 0.52 / 0.34 KiB; a 1,000-route
|
|
64
|
+
fixture is 4,051.18 / 668.60 KiB. Larger manifest-axis builds are reported
|
|
65
|
+
separately. Module startup profiles are a local diagnostic; actual deployed
|
|
66
|
+
startup must remain below the provider limit and is recorded during acceptance.
|
|
67
|
+
|
|
68
|
+
No cross-machine latency gate is used. CDP batch samples estimate local active JS
|
|
69
|
+
(including warmup); they are not per-request or billing CPU. Native Tail CPU/wall
|
|
70
|
+
are correlated by random request ID only in remote runs; unavailable timing stays
|
|
71
|
+
null. D1 metadata sums cover only `metadataStatements`; native Auth `.first()` does
|
|
72
|
+
not return rows/duration, and zero cannot substitute for that missing coverage.
|
|
73
|
+
|
|
74
|
+
The 2026-09-08 full local run contained 2,697 measured requests / 144 cases, no
|
|
75
|
+
unexpected HTTP status, max response 84,185 B, and max observed heap 67,103,480 B.
|
|
76
|
+
The observed F2/M p50 full-body delta for the 50k-row/4KiB View was -0.347 ms
|
|
77
|
+
(95% within-run bootstrap interval [-0.727, 0.128]); MCP catalog +0.903 ms
|
|
78
|
+
[0.470, 1.070]; Bearer MCP View -0.578 ms [-1.235, 0.329]. These are localhost
|
|
79
|
+
measurements, not a remote parity conclusion. Ten orthogonal route/Schema/View
|
|
80
|
+
runs and both extra locale runs also passed. Self-review corrected a fixture that
|
|
81
|
+
accidentally scaled indexes with Schemas, an English-only page assertion in the
|
|
82
|
+
multilingual fixture, and missing D1 metadata incorrectly summarized as zero.
|
|
83
|
+
|
|
84
|
+
## Remote difference budget (calibrated 2026-09-08)
|
|
85
|
+
|
|
86
|
+
The first complete off-a block (05:44:20–05:57:16 UTC, SDK 1798e78) contains
|
|
87
|
+
1,385 requests with 100% native CPU coverage, 46 first-for-workload arrivals and
|
|
88
|
+
no unexpected status failures. Public cache returned MISS then HIT; the HIT
|
|
89
|
+
had no invocation record. Warm F2/M CPU medians match at 0 ms health, 2 ms View,
|
|
90
|
+
1 ms Procedure, 2 ms MCP catalog and 3 ms Bearer MCP View. DPoP medians differ
|
|
91
|
+
by 0–1 ms; the largest within-run CPU delta upper interval is 2 ms. One hundred
|
|
92
|
+
requests per layer/diagnostics mode measure roughly +1 ms median CPU for the
|
|
93
|
+
collector itself on both layers. This is native millisecond-resolution telemetry.
|
|
94
|
+
|
|
95
|
+
Freeze this initial budget before evaluating the on-a/off-b/on-b blocks:
|
|
96
|
+
|
|
97
|
+
- At least 20 repeat-in-isolate samples per layer, equivalent successful payloads
|
|
98
|
+
and current authorization checks; expected denial cases are functional gates.
|
|
99
|
+
- Upper 95% bootstrap interval for M minus F2 median platform CPU: at most 2 ms.
|
|
100
|
+
- Upper 95% bootstrap interval for M minus F2 median full-body latency: at most
|
|
101
|
+
max(15 ms, 5% of the paired F2 median). Compare consistent placement contexts;
|
|
102
|
+
report changes in ingress/execution placement separately.
|
|
103
|
+
- Exact warm statement/binding budgets and zero unexpected outcomes still apply.
|
|
104
|
+
Latency/CPU differences are a matched deployment acceptance budget, not an
|
|
105
|
+
absolute cross-machine CI timer gate. First-for-workload records stay visible;
|
|
106
|
+
the budget makes no blanket claim about cold setup or all native workloads.
|
|
107
|
+
|
|
108
|
+
## Reproduction and remote acceptance
|
|
109
|
+
|
|
110
|
+
Run from the repository root with built workspace dependencies:
|
|
111
|
+
|
|
112
|
+
```sh
|
|
113
|
+
pnpm bench:wrangler
|
|
114
|
+
pnpm bench:parity
|
|
115
|
+
BENCH_ROUTES=1000 BENCH_CASES=scaling pnpm bench:parity
|
|
116
|
+
BENCH_SCHEMAS=1000 BENCH_CASES=scaling pnpm bench:parity
|
|
117
|
+
BENCH_VIEWS=1000 BENCH_CASES=scaling pnpm bench:parity
|
|
118
|
+
BENCH_LOCALES=en,fr,de BENCH_QUICK=1 pnpm bench:parity
|
|
119
|
+
node scripts/summarize-wrangler-parity.mjs /path/to/report.json
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
For remote acceptance, provision dedicated synthetic D1/KV (R2 when enabled),
|
|
123
|
+
put a random 32+ character BENCHMARK_KEY secret, and deploy the fixture with
|
|
124
|
+
BENCH_REMOTE_RECORDS=1. Run with BENCH_ORIGIN, BENCHMARK_KEY, BENCH_ACCOUNT_ID,
|
|
125
|
+
BENCH_PROFILE_NAME, BENCH_BLOCK and BENCH_PLACEMENT in the process environment.
|
|
126
|
+
The runner uses Wrangler's existing named-profile authentication to open the
|
|
127
|
+
same native trace-v1 API used by `wrangler tail`. It retains only the nonce-
|
|
128
|
+
correlated diagnostic fields and native CPU/wall timing in memory, never request
|
|
129
|
+
headers/body/URL, credentials or unrelated logs. The tail session is deleted at
|
|
130
|
+
completion. No paid Tail Worker, sink database writes or elevated log API token
|
|
131
|
+
is needed. Off-mode records also correlate platform CPU to measure overhead.
|
|
132
|
+
|
|
133
|
+
PHSU has no R2 subscription; its remote run uses BENCH_SKIP_R2=1. R2 coverage
|
|
134
|
+
comes from native workerd, with no remote R2 latency claim. A paid Tail Worker
|
|
135
|
+
attempt was rejected by the provider, then replaced by the verified real-time API.
|
|
136
|
+
|
|
137
|
+
Alternate off/on/off/on deployment blocks and BENCH_ORDER=reverse for the second
|
|
138
|
+
pair. Record actual placement status, request `cf-placement` when supplied,
|
|
139
|
+
ingress colo, deployment version, SDK/Wrangler/compatibility date, sampling window
|
|
140
|
+
and errors. Origin timings force private/no-store; a separate probe requires a
|
|
141
|
+
real public MISS followed by HIT with no invocation record. Local runs never
|
|
142
|
+
invent HITs. A deployed Worker with existing D1 is labeled deployment-first.
|
|
143
|
+
|
|
144
|
+
Use `wrangler deploy --dry-run --outfile <bundle>` followed by
|
|
145
|
+
`wrangler check startup --worker <bundle> --outfile <profile>` for module startup.
|
|
146
|
+
Record standalone F0, the full fixture and the actual packed consumer separately.
|
|
147
|
+
Set the remote F2/M CPU/latency difference budget after collecting the baseline,
|
|
148
|
+
then evaluate repeated blocks with bootstrap intervals, explaining shared-host
|
|
149
|
+
and cross-request correlation. Smart Placement provisioning belongs to #803;
|
|
150
|
+
INSUFFICIENT_INVOCATIONS is not evidence of a placement latency improvement.
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
# ADR-lite: collection creation statistics on Admin home
|
|
2
|
+
|
|
3
|
+
Status: proposed with #823; implementation stays in an unmerged demo PR.
|
|
4
|
+
Context: ADR-0019 semantic storage and optional Admin composition.
|
|
5
|
+
|
|
6
|
+
Add one optional `EntryReader.readCreationStatistics` read. SQLite/D1 implements
|
|
7
|
+
it; custom adapters without it return an explicit unavailable state in Admin.
|
|
8
|
+
The staff guard runs before storage access, and successful responses are private,
|
|
9
|
+
no-store. The endpoint accepts only primary, visible collections and four range
|
|
10
|
+
presets. No manifest keys, generic aggregation language or new cache port.
|
|
11
|
+
|
|
12
|
+
Each card independently persists its range and interval/cumulative mode in
|
|
13
|
+
`cms.preference.collection-statistics.<collection>`. Only preferences enter
|
|
14
|
+
localStorage. The chart and CSV describe current retained rows by native
|
|
15
|
+
`createdAt`, all statuses, with current `uiSchema.list.filterField` classification.
|
|
16
|
+
Unknown values share an Other series. Deleted rows are absent: these are creation
|
|
17
|
+
cohorts of retained rows, not an event log or historical inventory. Cumulative
|
|
18
|
+
means a prefix sum inside the selected range, starting from zero.
|
|
19
|
+
|
|
20
|
+
Ranges are 1h/5m, 24h/1h, 7d/6h and 20d/1d. Every interval is half-open; the last
|
|
21
|
+
ends at the observation time. CSV uses ISO UTC bounds while chart labels use the
|
|
22
|
+
browser's timezone. SVG steps preserve exact bucket extents without interpolation.
|
|
23
|
+
The toolbar download exports the current card's mode, current total and series;
|
|
24
|
+
CSV cells are quoted and formula-shaped headers are neutralized.
|
|
25
|
+
|
|
26
|
+
## Aggregation and freshness
|
|
27
|
+
|
|
28
|
+
A single SQL statement returns a total and sparse grouped counts from one SQLite
|
|
29
|
+
snapshot. Each native Schema table carries `_mantle_created_at` and its own
|
|
30
|
+
creation index. The range branch searches that index, and the total branch
|
|
31
|
+
counts index entries. Other field columns stay in the database; only count rows
|
|
32
|
+
reach the Worker.
|
|
33
|
+
|
|
34
|
+
The existing Cloudflare KV decorator caches MCP site configuration, not entry
|
|
35
|
+
queries. Reusing that key/projection would mix unrelated data and mutation
|
|
36
|
+
ownership. Direct aggregation is sufficient for this demo: Wrangler-local with
|
|
37
|
+
10,000 rows returned 897 bytes with one statement, 30,002 engine rows read and
|
|
38
|
+
p50/p95 of 4.26/5.80 ms (10 samples). A real SQLite test also aggregates 50,000
|
|
39
|
+
4-KiB rows into at most 40 count rows / 4 KiB and verifies immediate updates and
|
|
40
|
+
deletes. These are local measurements, not remote latency guarantees.
|
|
41
|
+
|
|
42
|
+
There is no server statistics cache to evict or repopulate after a racing write.
|
|
43
|
+
Every Admin/MCP/Procedure committed write is visible on the next read, including
|
|
44
|
+
subtype updates and deletes. React Query data stays in memory, becomes stale
|
|
45
|
+
immediately, and refetches on mount/focus and every 60 seconds while the home is
|
|
46
|
+
active. Successful UI mutations invalidate its common statistics query prefix.
|
|
47
|
+
Changing only cumulative mode reuses the same count data without another query.
|
|
48
|
+
|
|
49
|
+
`ponytail:` exact totals still take O(N) index work and filtered time ranges may
|
|
50
|
+
read JSON for subtype grouping; returned bytes are bounded by bucket/enum count,
|
|
51
|
+
not row count. If measured production read volume makes this expensive, add a
|
|
52
|
+
transactionally maintained collection revision/projection and revision-keyed KV
|
|
53
|
+
snapshots. Plain KV delete-after-write is insufficient because eventual
|
|
54
|
+
consistency and racing miss fills can serve old aggregates. No cron, event store,
|
|
55
|
+
generic cache framework or eager write-through aggregate is justified here.
|
|
56
|
+
|
|
57
|
+
## Verification
|
|
58
|
+
|
|
59
|
+
Runtime SQLite tests cover lower/upper edges, unknown subtype, collection
|
|
60
|
+
isolation, zero rows, edits/deletes, invalid windows, range index use and 50k rows.
|
|
61
|
+
Admin tests cover 401/403 before storage, invalid collection/range (including
|
|
62
|
+
prototype names), all presets, no-store, and unsupported adapters. UI tests cover
|
|
63
|
+
all preference combinations, zero filling, stacking, prefix sums and CSV safety.
|
|
64
|
+
Browser QA covers independent per-card preferences, reload, both themes and CSV.
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# ADR-lite #842: Applicable generic MCP authoring
|
|
2
|
+
|
|
3
|
+
Status: Accepted for implementation following maintainer approval.
|
|
4
|
+
|
|
5
|
+
The staff catalog and dispatcher remain shared by remote MCP and Admin
|
|
6
|
+
WebMCP (ADR-0014, ADR-0019, ADR-lite-861). No new manifest switch or tool
|
|
7
|
+
registry is introduced. Adapters retain current staff-role verification;
|
|
8
|
+
declared Procedures and Views retain their own authorization and guards.
|
|
9
|
+
|
|
10
|
+
Generic lifecycle tools are offered only when at least one writable content
|
|
11
|
+
Schema exists. Delete is offered only when a writable Schema exists. Read
|
|
12
|
+
tools list actual collection names, lifecycle, searchable and sortable fields.
|
|
13
|
+
Root readOnly remains the existing way to require Procedure-owned writes;
|
|
14
|
+
declaring a Procedure alone does not disable normal authoring.
|
|
15
|
+
|
|
16
|
+
Discovery is not enforcement: the dispatcher rejects absent catalog names,
|
|
17
|
+
checks the target row for readOnly and lifecycle suitability, and binds
|
|
18
|
+
per-collection updates to their declared collection before mutation. Unsupported
|
|
19
|
+
lifecycle calls return CONFLICT with an explicit reason; wrong-collection IDs
|
|
20
|
+
return NOT_FOUND. Existing status/OCC checks remain in the use cases.
|
|
21
|
+
Generic staff tools also apply Admin's rank table at `tools/call`:
|
|
22
|
+
contributor may create/update drafts; editor+ is required for lifecycle,
|
|
23
|
+
delete, media, and operational record tools. Declared Procedures keep their
|
|
24
|
+
own `requires` predicates. `tools/list` may still show editor tools to
|
|
25
|
+
contributors; a guessed call is `AUTH_DENIED`.
|
|
26
|
+
|
|
27
|
+
Compatibility: operational-only and read-only sites lose unusable generic
|
|
28
|
+
tools. Clients must rediscover tools rather than retaining a global tool list.
|
|
29
|
+
Mixed sites must choose a collection listed in the tool description. Public
|
|
30
|
+
catalogs remain only declared capabilities and gain no collection metadata.
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# ADR-lite #861: Staff MCP through the Admin session
|
|
2
|
+
|
|
3
|
+
Status: Accepted for implementation following maintainer approval.
|
|
4
|
+
|
|
5
|
+
Admin WebMCP uses the canonical staff MCP catalog and JSON-RPC dispatcher.
|
|
6
|
+
`GET /admin/api/webmcp` supplies the same tool definitions plus UI route hints;
|
|
7
|
+
`POST /admin/api/mcp` carries MCP requests using the current Admin session.
|
|
8
|
+
Both endpoints check the current mutable staff role. POST retains Admin's
|
|
9
|
+
cross-origin mutation rejection and body limit. Procedure predicates still
|
|
10
|
+
see a session credential, never a fabricated OAuth scope. Public/member MCP
|
|
11
|
+
capabilities and HTTP-only staff procedures are not added to this catalog.
|
|
12
|
+
This extends ADR-0014/0019 without changing manifest grammar.
|
|
13
|
+
|
|
14
|
+
Descriptions, input schemas, OCC and error diagnostics come from the existing
|
|
15
|
+
MCP catalog/dispatcher. Media tools appear only with media storage and declared
|
|
16
|
+
purposes. Agents PUT binaries directly to the authorized upload URLs between
|
|
17
|
+
create_media_upload and commit_media_upload; WebMCP carries no binary payload.
|
|
18
|
+
|
|
19
|
+
Admin owns two UI-only tools: admin_get_context and admin_navigate. Successful
|
|
20
|
+
operations invalidate query data and navigate when a known result target is
|
|
21
|
+
available. Unknown custom operations stay on the current page. Failure never
|
|
22
|
+
triggers navigation or an automatic mutation retry. Navigation input must be
|
|
23
|
+
an Admin page, not an external URL or API/auth path.
|
|
24
|
+
|
|
25
|
+
The green indicator appears after document.modelContext registration succeeds.
|
|
26
|
+
Its dialog shows the registered tool catalog and uses Admin i18n with the
|
|
27
|
+
established English fallback. The prompt tells the agent to inspect the catalog;
|
|
28
|
+
tool descriptions own operation-specific guidance. Developer interface docs
|
|
29
|
+
show the same live catalog. The initial translations include English,
|
|
30
|
+
Traditional Chinese and Simplified Chinese.
|
|
31
|
+
Registration uses AbortSignal lifetime cleanup. Browsers without WebMCP retain
|
|
32
|
+
the existing UI. The browser API is feature-detected, not polyfilled.
|
|
33
|
+
|
|
34
|
+
Only the explicitly marked, same-origin sandbox preview accepts the parent
|
|
35
|
+
message-port tool bridge. It reuses the same executor even in browsers without
|
|
36
|
+
native WebMCP. Canonical Admin refuses embedding and installs no parent bridge.
|
|
37
|
+
Builder keeps reset/seed/observe and member/anonymous sandbox tests; owner
|
|
38
|
+
staff calls traverse the iframe Admin executor and existing sandbox HTTP bridge.
|
|
39
|
+
Timeout/cancellation does not imply a write was rolled back; reconcile before
|
|
40
|
+
retry. Preview remains isolated from live network APIs.
|
|
41
|
+
|
|
42
|
+
Reference: https://webmachinelearning.github.io/webmcp/
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# ADR-lite 909: Mantle Admin UI kit export
|
|
2
|
+
|
|
3
|
+
**Status:** Accepted
|
|
4
|
+
|
|
5
|
+
## Context
|
|
6
|
+
|
|
7
|
+
Mantle applications need the Admin product's React/shadcn visual language
|
|
8
|
+
without copying components or embedding the full Admin SPA. The Admin package
|
|
9
|
+
previously exposed only static product assets and a server-side token string.
|
|
10
|
+
Its same-origin `preview.html` contract remains the correct boundary for a
|
|
11
|
+
complete embedded Admin or Developer UI.
|
|
12
|
+
|
|
13
|
+
## Decision
|
|
14
|
+
|
|
15
|
+
`@aotter/mantle-admin-ui/kit` exports the existing domain-neutral shadcn
|
|
16
|
+
primitives and Mantle one-time-code input. `kit.css` contains their compiled
|
|
17
|
+
Tailwind styles and complete Admin theme; `tokens.css` contains only the stable
|
|
18
|
+
Mantle design variables.
|
|
19
|
+
|
|
20
|
+
The kit does not export the Admin application, authenticated layout, router,
|
|
21
|
+
queries, API client, or feature views. Those modules assume Admin routes and
|
|
22
|
+
transport contracts and remain private. Consumers needing the complete product
|
|
23
|
+
use the canonical Admin assets or the explicit same-origin sandbox preview.
|
|
24
|
+
|
|
25
|
+
Copy-owned shadcn recipes may compose the public kit into working defaults.
|
|
26
|
+
They are installed as source in the consuming application rather than exposed
|
|
27
|
+
as another runtime framework. The first recipe is an email OTP page with
|
|
28
|
+
optional legal links.
|
|
29
|
+
|
|
30
|
+
## Consequences
|
|
31
|
+
|
|
32
|
+
- Applications can share Mantle controls and visual tokens without depending
|
|
33
|
+
on Builder internals or duplicating Admin CSS.
|
|
34
|
+
- The static Admin SPA remains unchanged and optional.
|
|
35
|
+
- New public kit components require package-level contract and rendering tests.
|
|
36
|
+
- Authentication and legal-consent policy remain application concerns, not UI
|
|
37
|
+
primitive behavior.
|