@quickback-dev/cli 0.61.1 → 0.63.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.
@@ -15,7 +15,7 @@ feature("name", {
15
15
  // Security — the five pillars
16
16
  firewall: {}, // which ROWS (auto-derived from organizationId / ownerId / teamId)
17
17
  read: {}, // who may read + `views` — named column projections
18
- create: {}, // who may write
18
+ create: {}, // who may write — `action: "send"` maps the URL to an action file
19
19
  update: {},
20
20
  delete: {}, // + `mode: "soft" | "hard"`
21
21
  guards: {}, // which FIELDS a caller may set
@@ -41,6 +41,7 @@ feature("name", {
41
41
  | Tenant isolation, role gates, field and value control | `firewall`, `read`/`create`/`update`/`delete`, `guards`, `masking` | [Security](/define/security) |
42
42
  | A narrower shape for a broader audience | `read.views` | [Views](/define/views) |
43
43
  | `publish` / `approve` / `checkIn` — a state change | `transitions` | [Transitions](/define/transitions) |
44
+ | A live CRUD URL that needs custom `execute` | `create.action` / `update.action` / `delete.action` | [Actions](/define/actions#replace-a-crud-verb) |
44
45
  | A side-effect or data rule on every write | `triggers` | [Triggers](/define/triggers) |
45
46
  | Parent plus its children written atomically | `owns` | [Changesets](/define/changesets) |
46
47
  | Clients updated live | `realtime` | [Realtime](/platform/realtime/using-realtime) |
@@ -60,10 +60,14 @@ The server probes **every declared role** for the proposed instance (one DB touc
60
60
 
61
61
  ```jsonc
62
62
  // a shuttle driver who is also a confirmed guest
63
- "scope": { "event": { "id": "evt_123", "roles": ["attendee", "shuttleDriver"], "shuttleId": "shA" } }
63
+ "scope": { "event": { "id": "evt_123", "roles": ["attendee", "shuttleDriver"], "shuttleId": "shA", "sctMs": "m1700000000000" } }
64
64
  ```
65
65
 
66
- The client sends that JWT as `Authorization: Bearer …` on subsequent requests. The auth middleware verifies the signature and sets `ctx.scope` — **no DB**. The claim is carried forward on every authed call (rolling refresh) for up to **15 minutes from the last actual relationship proof** — the mint stamps a proof timestamp (`sct`) that the refresh carries forward verbatim and checks against the carry-forward cap. Past the cap the refresh stops, the token expires within one TTL, and the client re-proves via `enter` (or any namespace route that mints) to restart the window.
66
+ `sctMs` is on **every** entry: the server's proof timestamp for that kind (epoch milliseconds, written `m<ms>`) — see [Revocation & TTL](#revocation--ttl). The examples below elide it to keep the key under discussion in view.
67
+
68
+ The client sends that JWT as `Authorization: Bearer …` on subsequent requests. The auth middleware verifies the signature and sets `ctx.scope` — **no DB**. The claim is carried forward on every authed call (rolling refresh) for up to **15 minutes from the last actual relationship proof** — the mint stamps a proof timestamp that the refresh carries forward verbatim and checks against the carry-forward cap. Past the cap the refresh stops, the token expires within one TTL, and the client re-proves via `enter` (or any namespace route that mints) to restart the window.
69
+
70
+ The proof timestamp is **per scope kind**. A mint proves the kind it was asked for and carries every other kind forward *with the stamp it already had* (`sctMs` on the entry, epoch milliseconds written `m<ms>`), so entering one relationship never extends — or resurrects — another. Re-proving `event` restarts `event`'s window and nothing else.
67
71
 
68
72
  > **Invariant:** the client only *proposes* the instance id (from the URL). The server proves membership before signing. No client-asserted scope is ever trusted.
69
73
 
@@ -631,11 +635,11 @@ the socket gate stay identical for accountless principals too.
631
635
  The scope claim is trusted between proofs — it is never re-checked against the database while it rides. Two bounds keep that window finite:
632
636
 
633
637
  - **The TTL** (default 180s, `auth.jwt.expiresIn`, clamped ≤180s on scope-bearing tokens) bounds an *idle* client: a token that stops being used dies within one TTL.
634
- - **The carry-forward cap** (15 minutes) bounds an *active* client: the rolling refresh re-signs the claim on every authed call, but only while the claim's proof timestamp (`sct`, stamped exclusively by the proven mint sites) is younger than the cap. Past it the refresh refuses, the token expires, and the next `enter` (or namespace-route mint) re-probes the relationship — which won't re-mint a revoked role.
638
+ - **The carry-forward cap** (15 minutes) bounds an *active* client: the rolling refresh re-signs the claim on every authed call, but only while its proof timestamp (stamped exclusively by the proven mint sites) is younger than the cap. The cap is applied **per scope kind** — a kind whose own proof is past it is dropped from the re-signed claim, so re-proving one relationship cannot roll another forward. Past the cap the refresh refuses, the token expires, and the next `enter` (or namespace-route mint) re-probes the relationship — which won't re-mint a revoked role.
635
639
 
636
640
  So removing a guest/staff row takes effect within **cap + one TTL** for a client that keeps polling, and within one TTL once it goes idle. Two ways to tighten that:
637
641
 
638
- - **`auth.jwt.revocationCheck: 'kv'`** (v0.45+, Cloudflare runtime) — sub-TTL revocation: updating or deleting a conferring relationship row stamps a revocation timestamp in KV, and the bearer fast-path rejects a carried scope claim whose proof (`sct`, with its millisecond companion `sctMs`) is at or before it — no same-second gap. Both halves of the proof time are carried forward verbatim by the rolling refresh; a refresh never substitutes its own mint time for proof time. The check fails closed — a scope claim whose revocation state can't be read is not trusted either. See [auth config](/configure/auth).
642
+ - **`auth.jwt.revocationCheck: 'kv'`** (v0.45+, Cloudflare runtime) — sub-TTL revocation: updating or deleting a conferring relationship row stamps a revocation timestamp in KV, and the bearer fast-path rejects a carried scope claim whose proof is at or before it — no same-second gap. Each kind is compared against **its own** proof time (`sctMs` on the entry; older tokens without one fall back to the token-level `sct`/`sctMs`), so a mint of one kind can't carry a revoked kind past its marker. Neither the refresh nor a re-mint ever substitutes its own clock for a proof it didn't take. The check fails closed — a scope claim whose revocation state can't be read is not trusted either. See [auth config](/configure/auth).
639
643
  - **`via` arms** — for tables where any caching is too wide, gate with a `via` arm instead of a bare `ctx.scope.<kind>` arm: `via` emits a live subquery against the relationship table on every request, immune to a stale claim entirely.
640
644
 
641
645
  ## Reference
@@ -662,6 +666,7 @@ ctx.mintScope(opts: { via: string; subject: string; setAuthToken?: boolean }):
662
666
  - `requestField` must equal every role-relationship's `resource.column`.
663
667
  - Each relationship's `from` table must exist and ship a generated firewall (it can't be `exception`).
664
668
  - A `subKeys` entry ending in `[]` is **set-valued** (lowers to `inArray`, minted as `string[]`); without the marker it's scalar (`eq`, minted as `string`).
669
+ - `id`, `roles`, `subjectId`, and `sctMs` are **reserved** on the claim entry — the mint owns them, so a `subKeys` entry of that name is a compile error rather than a row value overwriting proven state.
665
670
  - `subject` defaults to `'user'`. `'supplied'`/`'both'` enable [`ctx.mintScope`](#sessionless-scope-mint--ctxmintscope) (sessionless mint); `'supplied'` is **not** mintable via `/scope/v1/enter`.
666
671
  - `ctx.mintScope({ via, subject })` mints a **scope-only** token (no user identity, `ctx.userId` undefined) from the `from`-row whose PK is `subject` — reading the role, resource id, sub-keys, and `subjectId` off that row.
667
672
  - `subjectId` is the conferring row's primary key, populated on **both** proof paths — scope self-data on `ctx.scope.<kind>.subjectId`.
@@ -111,6 +111,24 @@ export default defineAction({
111
111
  });
112
112
  ```
113
113
 
114
+ ## The default becomes v2 in v0.64.0
115
+
116
+ `contract.version` resolves to `'v1'` when unset. That default becomes `'v2'`
117
+ in Quickback **v0.64.0**. Every project without an explicit `contract.version`
118
+ moves the entire matrix below on its next compile after that release.
119
+
120
+ Pin the current wire:
121
+
122
+ ```typescript
123
+ {/* doc-compile: skip — config fragment */}
124
+ contract: { version: "v1" }
125
+ ```
126
+
127
+ **Pinning your CLI version does not pin the contract.** The default lives in the
128
+ compiler, which is a hosted service — an older CLI inherits the flip too. The
129
+ config key is the only pin. v0.63.0 warns on every compile that leaves
130
+ `contract.version` unset.
131
+
114
132
  ## Contract version matrix
115
133
 
116
134
  Flipping `contract.version` moves the **entire** contract at once — plan the
@@ -128,7 +146,7 @@ client migration as one move:
128
146
  | Aggregate changesets (`application/vnd.quickback.changeset+json` on PATCH/POST, [`owns`](/define/changesets)) | not available | available where `owns` is declared |
129
147
  | Bare `?fields=` unknown names | silently dropped | **400** |
130
148
  | `fields[<fk>]=` unknown names | n/a | **400** |
131
- | Action input schemas | best-effort static parse | complete client-side harvest **required** |
149
+ | Action input schemas | complete client-side harvest **required** (since v0.63.0) | complete client-side harvest **required** |
132
150
 
133
151
  Sequencing a migration: ship clients that speak the v2 paths, CloudEvents
134
152
  frames, and session-first auth (or declare `auth.jwt`); confirm webhook
@@ -31,7 +31,7 @@ The JWT encodes everything needed for auth middleware:
31
31
  | `iatMs` | Issued-at in epoch **milliseconds** — Quickback ordering metadata, not a standard claim. Same clock sample as `iat`, set by the signer only. Lets [revocation](#revocation--revocationcheck-kv) order a token against a marker written in the same second |
32
32
  | `exp` | Expiry — **180 seconds** (3 minutes) after `iat` by default; set via [`auth.jwt.expiresIn`](/configure/auth) |
33
33
 
34
- Scope-bearing tokens also carry `sct` (proof timestamp, unix seconds) and its millisecond companion `sctMs` — see [Scopes](/define/scopes). Read `iat` / `sct` from external tooling; `iatMs` / `sctMs` exist only so revocation can break ties inside a second.
34
+ Scope-bearing tokens also carry `sct` (proof timestamp, unix seconds) and its millisecond companion `sctMs`, plus a per-kind `sctMs` stamp (`m<ms>`) inside each `scope.<kind>` entry — a mint proves one kind and carries the others forward with the proof time they already had. See [Scopes](/define/scopes). Read `iat` / `sct` from external tooling; the millisecond values exist only so revocation can break ties inside a second.
35
35
 
36
36
  ### Signing
37
37
 
@@ -116,7 +116,7 @@ auth: {
116
116
  },
117
117
  ```
118
118
 
119
- The fast-path then consults per-principal revocation timestamps in your project's existing `KV` binding (keys prefixed `qbrev:`, self-expiring) *before* trusting a token. A token is rejected when its mint timestamp (`iat`/`iatMs`, or `sct`/`sctMs` for the scope claim) is **at or before** the stored timestamp. Cost: 2+ edge-cached KV reads per bearer verify.
119
+ The fast-path then consults per-principal revocation timestamps in your project's existing `KV` binding (keys prefixed `qbrev:`, self-expiring) *before* trusting a token. A token is rejected when its mint timestamp (`iat`/`iatMs`, or the proof time of the scope kind being checked) is **at or before** the stored timestamp. Cost: 2+ edge-cached KV reads per bearer verify.
120
120
 
121
121
  There is no same-second gap: markers are epoch milliseconds (written `m<ms>`, v0.61.0+), tokens carry millisecond companions, and the comparison denies a tie — so a token minted a few milliseconds *before* the revocation is rejected, while one legitimately re-minted *after* it in that same second is still accepted. Pre-v0.61.0 workers don't understand that marker format and read it as "not revoked" — don't roll back across the upgrade or share one KV namespace between versions; see [`revocationCheck`](/configure/auth#revocationcheck-none--kv--token-revocation-strategy).
122
122
 
@@ -1,6 +1,8 @@
1
1
  # Endpoints
2
2
 
3
- The cloud compiler API is hosted at `https://compiler.quickback.dev`.
3
+ The cloud compiler API is hosted at `https://compiler.quickback.dev`
4
+ (alias: `https://build.quickback.dev` — same Worker, same auth via
5
+ `quickback-api`, identical `/health` / `/templates` / `/compile`).
4
6
 
5
7
  ## Public (No Auth)
6
8
 
@@ -184,6 +184,27 @@ authentication behavior. Quickback preserves unrelated overrides already in
184
184
  your package manifest, but the compiler-owned Lodash security pin wins if an
185
185
  existing override conflicts.
186
186
 
187
+ A project that declares an in-worker Durable Object also gets `hono-party`
188
+ plus a second entry in the same block:
189
+
190
+ ```json
191
+ {
192
+ "overrides": {
193
+ "hono-party": {
194
+ "@cloudflare/workers-types": "$@cloudflare/workers-types"
195
+ }
196
+ }
197
+ }
198
+ ```
199
+
200
+ `hono-party` still declares a peer dependency on `@cloudflare/workers-types`
201
+ major 4, which cannot be satisfied alongside the major 5 the compiler pins, so
202
+ a plain `npm install` would fail with `ERESOLVE`. The override is scoped to
203
+ `hono-party` — nothing else in the tree is relaxed — and the `$` form resolves
204
+ to whatever your `package.json` already declares, so it tracks the pin instead
205
+ of drifting from it. Projects without an in-worker Durable Object do not get
206
+ this entry.
207
+
187
208
  After recompiling, run your package manager's install command so its lockfile
188
209
  records the patched transitive version. Use `npm audit --omit=dev` when
189
210
  evaluating the production dependency tree; development-tool advisories are a
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@quickback-dev/cli",
3
- "version": "0.61.1",
3
+ "version": "0.63.0",
4
4
  "description": "CLI for Quickback — define your backend in TypeScript, compile to a fully wired Cloudflare Worker (or Bun / Node) with auth, database, migrations, security, CMS, and Account UI.",
5
5
  "author": "Kardoe Incorporated <paul@kardoe.com>",
6
6
  "license": "MIT",
@@ -55,6 +55,23 @@ For a resource named `jobs`, Quickback generates:
55
55
  | `PUT` | `/jobs/:id` | Upsert a record (requires config) |
56
56
  | `PUT` | `/jobs/batch` | Batch upsert multiple records (requires config) |
57
57
 
58
+ ## Replace a generated verb with an action
59
+
60
+ Map `create`, `update`, or `delete` to a named action when the public URL
61
+ must stay and the handler has to become real code. See
62
+ [Replace a CRUD verb](/define/actions#replace-a-crud-verb).
63
+
64
+ {/* doc-compile: skip — one-key excerpt; the whole-file form is on the actions page. */}
65
+ ```ts
66
+ create: {
67
+ access: { roles: ["member"] },
68
+ action: "send",
69
+ }
70
+ ```
71
+
72
+ `POST /api/v1/jobs` then runs `send`'s `execute`. Clients, OpenAPI, and MCP
73
+ keep the CRUD path and operation id. Unmapped verbs are unchanged.
74
+
58
75
  ## List & Get Records
59
76
 
60
77
  `GET /{resource}` and `GET /{resource}/:id` are part of the [read pipeline](/define/read). Configuration (access, pagination, view projections) lives under `read:`. Filtering, sorting, and pagination query parameters work the same on both endpoints — see [Query Parameters](/api/query-params).
@@ -8,7 +8,113 @@ The current release series. Older entries are archived by version range:
8
8
  - [v0.20 – v0.29](/changelog/v0.2x)
9
9
  - [v0.18 and earlier](/changelog/v0.1x)
10
10
 
11
- ## Unreleased
11
+ ## v0.63.0 — August 14, 2026
12
+
13
+ ### Action input schemas now fail the compile instead of degrading
14
+
15
+ **Affects every project with actions, on every contract version.**
16
+
17
+ The CLI harvests each action's `input` locally with `z.toJSONSchema`. When an
18
+ action failed to harvest, the compiler fell back to a static parser that reads
19
+ Zod as text — and that parser cannot emit `required` or `additionalProperties`.
20
+ The resulting operation kept its `properties` and looked fully typed in
21
+ `openapi.json` and the MCP tool list while enforcing nothing: generated clients
22
+ treated required fields as optional and unknown keys passed. Constructs the
23
+ parser could not read at all degraded further, to a bare `{}`.
24
+
25
+ None of it was visible in a diff. One project shipped ~346 unenforced request
26
+ schemas this way; the change read as reformatting.
27
+
28
+ A failed harvest is now a compile error naming each action, whether bundling or
29
+ evaluation failed, and the underlying local error. This was previously the
30
+ behavior of `contract.version: 'v2'` only.
31
+
32
+ `quickback compile --allow-degraded-schemas` restores degrade-and-continue for a
33
+ single compile. It prints every action that fell back and why.
34
+
35
+ The compiler also warns when a caller supplies no schemas at all — `rawFiles`
36
+ callers such as the Start app cannot harvest — naming how many actions of the
37
+ total lost `required`, with sampled paths.
38
+
39
+ ### `contract.version` default flips to v2 in v0.64.0
40
+
41
+ An unset `contract.version` resolves to `'v1'` today. That default becomes
42
+ `'v2'` in **v0.64.0**, which moves `/api/v1` → `/api/v2` (plus `/auth` and
43
+ `/broadcast`), switches realtime frames to CloudEvents 1.0 envelopes, drops the
44
+ legacy `X-Webhook-*` signing headers, and disables the Quickback HMAC-JWT lane
45
+ unless `auth.jwt` is declared. See the
46
+ [contract matrix](/platform/api-contract#contract-version-matrix).
47
+
48
+ Every compile that leaves `contract.version` unset now warns. Pin
49
+ `contract: { version: "v1" }` to keep the current wire, or set `"v2"` to migrate
50
+ now.
51
+
52
+ **Pinning your CLI version does not pin the contract.** The default lives in the
53
+ compiler, which is a hosted service, so an older CLI inherits the flip too. The
54
+ config key is the only pin.
55
+
56
+ ### MCP tool grouping no longer assumes a `v1` path segment
57
+
58
+ Internal. Group derivation matched the literal segment `v1`, so a contract-v2
59
+ path would have fallen through and grouped under `api`. Operation tags take
60
+ precedence and every generated operation carries one, so no shipped tool list
61
+ was affected — the fallback is now correct for any `/api/v<n>/` prefix ahead of
62
+ the v0.64.0 default flip.
63
+
64
+ ## v0.62.0 — August 13, 2026
65
+
66
+ ### Security: `record:` access arms on `GET /:id` were never evaluated
67
+
68
+ **Affects any resource whose `read.access` contains a `record:` arm.**
69
+
70
+ A code rewrite corrupted `"$ctx.userId"` into `"$effectiveCtx.userId"` inside the
71
+ serialized access tree, and only the `$ctx.` prefix is recognised at runtime. The
72
+ arm therefore compared a column against the literal string and was permanently
73
+ false: a caller the config named was denied with 403 on the single-record read,
74
+ while the same tree admitted them everywhere else.
75
+
76
+ Those arms now evaluate. **Callers your config grants access to will start
77
+ receiving 200 where they previously received 403.** That is the documented
78
+ behavior being restored, not a widening — no caller is admitted whom the tree
79
+ does not name. Durable Object room gates already behaved correctly, so this also
80
+ removes a divergence where a room admitted a caller that `GET /:id` refused.
81
+
82
+ ### Security: revocation is per scope kind, not per token
83
+
84
+ **Affects projects using `authz.scopes`.**
85
+
86
+ A token carried one proof timestamp for a claim map whose kinds were proven at
87
+ different moments, so re-proving one kind restamped the others. A revoked kind
88
+ survived indefinitely as long as the caller kept re-proving any sibling.
89
+
90
+ Each entry now carries its own proof time, and both readers use it: the
91
+ revocation check, and the carry-forward cap. **The cap matters more** — it
92
+ applies on the default configuration, where `revocationCheck` is unset and no
93
+ KV marker is ever read, so it was the only bound on a carried claim.
94
+
95
+ Tokens minted before this release have no per-entry stamp and fall back to the
96
+ token-level proof time, conservatively. `authz.scopes[].roles[].subKeys` may no
97
+ longer declare `id`, `roles`, `subjectId`, or `sctMs` — those are server-minted,
98
+ and a row value overwriting one would forge a proof time. Compile fails naming
99
+ the path.
100
+
101
+ ### Generated projects with in-worker Durable Objects can install again
102
+
103
+ `npm install` failed with `ERESOLVE` immediately after a successful compile:
104
+ `hono-party` requires `@cloudflare/workers-types@^4`, and Quickback pins `^5`.
105
+ Unsatisfiable at any version — no `hono-party` release accepts 5.x.
106
+
107
+ Generated `package.json` now carries a scoped override so the peer resolves to
108
+ the project's own pin. Nothing outside `hono-party` is relaxed. Only projects
109
+ declaring an in-worker Durable Object receive it.
110
+
111
+ ### Fixed: two configurations that emitted uncompilable projects
112
+
113
+ - `plugins: { apiKey: false }` emitted a `problemJson(...)` call without its
114
+ import, so the generated project failed `tsc`.
115
+ - `organization: { allowUserToCreateOrganization: … }` in object form emitted the
116
+ key twice in one object literal (`TS1117`). `organizationHooks` had the same
117
+ collision and is now stripped from the merged options — the compiler owns it.
12
118
 
13
119
  ### `defineEmail` — inbound mail, provider-agnostic execute
14
120
 
@@ -109,7 +109,7 @@ Default `'none'`.
109
109
 
110
110
  `'kv'` (v0.45+, **Cloudflare runtime only**) keeps the fast-path stateless against the auth DB (still 0 D1 queries). There is nothing extra to provision — entries ride the `KV` binding every project already has, prefixed `qbrev:` and self-expiring after the maximum token lifetime, so the store never accumulates.
111
111
 
112
- A token is rejected when its mint timestamp (`iat`/`iatMs`, or `sct`/`sctMs` for the relationship-scope claim) is **at or before** the stored timestamp for any principal key it rides on:
112
+ A token is rejected when its mint timestamp (`iat`/`iatMs`, or the scope claim's proof time) is **at or before** the stored timestamp for any principal key it rides on:
113
113
 
114
114
  | Key | Revokes | Written automatically on |
115
115
  |---|---|---|
@@ -122,6 +122,7 @@ A token is rejected when its mint timestamp (`iat`/`iatMs`, or `sct`/`sctMs` for
122
122
  Semantics worth knowing:
123
123
 
124
124
  - **Revoke-on-touch for scopes:** any update or delete of a conferring row stamps the revocation, without evaluating whether the change actually ended the relationship. A false positive just forces a cheap re-prove (`/scope/v1/enter` or a minting namespace route).
125
+ - **Scope proof time is per kind:** a token can carry several scope kinds proven at different instants, so each entry carries its own proof stamp (`sctMs`, `m<ms>`) and is compared against its own marker. Proving one kind never restamps the others — re-entering `event` cannot bring a revoked `location` claim back to life. Entries minted before the release that added the stamp carry none, and fall back to the token-level `sct`/`sctMs` until they expire (bounded by the carry-forward cap plus one TTL).
125
126
  - **No same-second gap:** markers are stored in epoch milliseconds (written `m<ms>` — an explicit format version, not a magnitude the reader guesses at) and tokens carry millisecond companions (`iatMs` / `sctMs`) alongside the standards-compatible seconds claims, so a token minted a few milliseconds before the revocation is rejected — while one legitimately re-minted *after* it in that same second is still accepted. Tokens and markers written by v0.60.4 or earlier are handled **conservatively**: with no sub-second information on one side, the whole marker second is revoked. That over-revocation is bounded — the last old token expires within its TTL, and the last old marker within the entry lifetime. Like any rejected token it costs the caller a `401`, not a silent recovery: the bearer falls through unauthenticated (its cookie having been stripped, per the next bullet), and the client re-authenticates for a fresh token.
126
127
  - **Do not straddle the v0.61.0 upgrade.** A worker from **before** v0.61.0 reads `m<ms>` markers as `NaN` and treats them as *no revocation at all* — not as a corrupt entry. So rolling back across this release, or pointing two differently-versioned deploy targets at one shared KV namespace, means every revocation written by the new version is **silently unenforced** by the old one until the entry expires (`ENTRY_TTL_SECONDS`, ~19 minutes at default settings). Upgrade all targets sharing a namespace together; if you must roll back, treat outstanding bearer tokens as unrevoked for that window — lower `expiresIn`, or purge the `qbrev:` keys and re-stamp from the old version.
127
128
  - **Fails closed:** a missing binding, a failed read, or a corrupt entry means the token's revocation state is *unknown* — and an unknown bearer is not authenticated. The caller gets `503 AUTH_REVOCATION_UNAVAILABLE` (RFC 9457, retryable). Recovery is a **separate cookie-only request**: a request carrying `Authorization` has its cookie stripped before session auth, so within that one request there is nothing left to fall back to. Reads are never silently skipped, because the outage that hides a revocation is exactly the moment this check exists for.
@@ -81,11 +81,24 @@ Before sending a compile request, the CLI loads each action in an isolated
81
81
  local bundle and converts `action.input` plus an optional `action.output` with
82
82
  Zod 4's `z.toJSONSchema`. It does not call `execute`; the hosted compiler never
83
83
  evaluates project code. The output contract feeds OpenAPI and
84
- `Api.<feature>.actions.<action>.Output` in `quickback.gen.ts`. Under
85
- contract v2, every action input must produce a schema; output remains optional.
86
- A failure names the exact
87
- action, whether bundling or evaluation failed, and the underlying local error.
88
- V1 can still fall back to the lower-fidelity static schema parser.
84
+ `Api.<feature>.actions.<action>.Output` in `quickback.gen.ts`.
85
+
86
+ **Every action input must produce a schema, on every contract version.** Since
87
+ v0.63.0 a failed harvest fails the compile, naming the exact action, whether
88
+ bundling or evaluation failed, and the underlying local error. Output remains
89
+ optional.
90
+
91
+ **Why it fails instead of degrading.** The compiler's static fallback parser
92
+ reads your Zod as text and can only produce `type` and `properties`. It never
93
+ emits `required` or `additionalProperties` — so a fallback request schema looks
94
+ fully typed in `openapi.json` and the MCP tool list while enforcing nothing:
95
+ generated clients treat every required field as optional, and unknown keys pass.
96
+ Constructs it cannot parse at all degrade further, to a bare `{}` with no
97
+ `properties`. Neither is visible in a diff.
98
+
99
+ `--allow-degraded-schemas` restores the old degrade-and-continue behavior for a
100
+ single compile. It still prints every action that fell back and why, and the
101
+ compiler warns again with the count and sampled paths.
89
102
 
90
103
  Bare imports are resolved from the generated runtime's configured
91
104
  `build.outputDir/node_modules` first. If definitions live in `quickback/` and
@@ -91,6 +91,79 @@ For shared Zod schemas or helpers, put them under `<feature>/lib/` and import
91
91
  from each action file. Files under `lib/` are copied verbatim into the
92
92
  generated output.
93
93
 
94
+ ## Replace a CRUD verb
95
+
96
+ CRUD routes are compiler-owned. When a live `POST /messages` (or
97
+ `PATCH` / `DELETE /:id`) has to grow — side effects, a different body, a
98
+ protocol-shaped response — map that verb to a named action. The URL, OpenAPI
99
+ operation id, and MCP tool stay; `execute` becomes the handler.
100
+
101
+ {/* doc-compile: skip — two files (table + action); the gate compiles each fence as an isolated project. */}
102
+ ```ts
103
+ // features/messages/messages.ts
104
+ export default feature("messages", {
105
+ columns: { /* … */ },
106
+ read: { access: { roles: ["member"] } },
107
+ create: {
108
+ access: { roles: ["member"] },
109
+ action: "send", // features/messages/actions/send.ts
110
+ },
111
+ update: { access: { roles: ["member"] } },
112
+ delete: { access: { roles: ["admin"] } },
113
+ });
114
+ ```
115
+
116
+ ```ts
117
+ // features/messages/actions/send.ts
118
+ import { z } from "zod";
119
+ import { defineAction, messages } from "../.quickback/define-action";
120
+
121
+ export default defineAction({
122
+ description: "Send a message",
123
+ path: "/messages", // must equal the collection URL
124
+ method: "POST",
125
+ input: z.object({ body: z.string().min(1) }),
126
+ access: { roles: ["member"] },
127
+ async execute({ db, input, ctx }) {
128
+ const [row] = await db.insert(messages).values({
129
+ body: input.body,
130
+ organizationId: ctx.activeOrgId!,
131
+ }).returning();
132
+ return row;
133
+ },
134
+ });
135
+ ```
136
+
137
+ Expected:
138
+
139
+ - `POST /api/v1/messages` runs `send`'s `execute`. Status is `201`.
140
+ - OpenAPI / MCP keep `createMessages` (or the table's CRUD operation id). The
141
+ request body is the action's `input`, not the table's createable fields.
142
+ - Unmapped verbs keep the generated handler. Mapping is per-verb.
143
+ - The action's own route is not mounted — there is no second `POST /messages/send`.
144
+ - Auto-promoted `POST /batch` is suppressed (the stock batch would skip `send`).
145
+ Set `batch: false` explicitly if you also declare a batch config.
146
+
147
+ ### Composition
148
+
149
+ Fail-closed, one rule:
150
+
151
+ | Layer | Who owns it |
152
+ |---|---|
153
+ | URL, method, operation id | The CRUD verb |
154
+ | Access | Both: `create.access` AND the action's `access` must pass |
155
+ | Guards | Skipped — the action's `input` is the body contract |
156
+ | Firewall | Table firewall on update/delete record fetch; create uses scoped `db` in `execute` |
157
+
158
+ ### Compile errors
159
+
160
+ The compile fails if the named action is missing, bound to a different table,
161
+ the wrong shape (create needs a standalone `path:` equal to the collection URL;
162
+ update/delete need a record-based action with no `path:`), declares a
163
+ conflicting `method`, is already mapped to another verb, or the table also
164
+ declares `owns` (changeset dispatch lives on the stock handler). `read.action`
165
+ is not supported.
166
+
94
167
  ## The rest of this section
95
168
 
96
169
  - **[Defining actions](/define/actions/defining)** — the action file, its configuration options, protected fields, and refs
@@ -15,7 +15,7 @@ feature("name", {
15
15
  // Security — the five pillars
16
16
  firewall: {}, // which ROWS (auto-derived from organizationId / ownerId / teamId)
17
17
  read: {}, // who may read + `views` — named column projections
18
- create: {}, // who may write
18
+ create: {}, // who may write — `action: "send"` maps the URL to an action file
19
19
  update: {},
20
20
  delete: {}, // + `mode: "soft" | "hard"`
21
21
  guards: {}, // which FIELDS a caller may set
@@ -41,6 +41,7 @@ feature("name", {
41
41
  | Tenant isolation, role gates, field and value control | `firewall`, `read`/`create`/`update`/`delete`, `guards`, `masking` | [Security](/define/security) |
42
42
  | A narrower shape for a broader audience | `read.views` | [Views](/define/views) |
43
43
  | `publish` / `approve` / `checkIn` — a state change | `transitions` | [Transitions](/define/transitions) |
44
+ | A live CRUD URL that needs custom `execute` | `create.action` / `update.action` / `delete.action` | [Actions](/define/actions#replace-a-crud-verb) |
44
45
  | A side-effect or data rule on every write | `triggers` | [Triggers](/define/triggers) |
45
46
  | Parent plus its children written atomically | `owns` | [Changesets](/define/changesets) |
46
47
  | Clients updated live | `realtime` | [Realtime](/platform/realtime/using-realtime) |
@@ -60,10 +60,14 @@ The server probes **every declared role** for the proposed instance (one DB touc
60
60
 
61
61
  ```jsonc
62
62
  // a shuttle driver who is also a confirmed guest
63
- "scope": { "event": { "id": "evt_123", "roles": ["attendee", "shuttleDriver"], "shuttleId": "shA" } }
63
+ "scope": { "event": { "id": "evt_123", "roles": ["attendee", "shuttleDriver"], "shuttleId": "shA", "sctMs": "m1700000000000" } }
64
64
  ```
65
65
 
66
- The client sends that JWT as `Authorization: Bearer …` on subsequent requests. The auth middleware verifies the signature and sets `ctx.scope` — **no DB**. The claim is carried forward on every authed call (rolling refresh) for up to **15 minutes from the last actual relationship proof** — the mint stamps a proof timestamp (`sct`) that the refresh carries forward verbatim and checks against the carry-forward cap. Past the cap the refresh stops, the token expires within one TTL, and the client re-proves via `enter` (or any namespace route that mints) to restart the window.
66
+ `sctMs` is on **every** entry: the server's proof timestamp for that kind (epoch milliseconds, written `m<ms>`) — see [Revocation & TTL](#revocation--ttl). The examples below elide it to keep the key under discussion in view.
67
+
68
+ The client sends that JWT as `Authorization: Bearer …` on subsequent requests. The auth middleware verifies the signature and sets `ctx.scope` — **no DB**. The claim is carried forward on every authed call (rolling refresh) for up to **15 minutes from the last actual relationship proof** — the mint stamps a proof timestamp that the refresh carries forward verbatim and checks against the carry-forward cap. Past the cap the refresh stops, the token expires within one TTL, and the client re-proves via `enter` (or any namespace route that mints) to restart the window.
69
+
70
+ The proof timestamp is **per scope kind**. A mint proves the kind it was asked for and carries every other kind forward *with the stamp it already had* (`sctMs` on the entry, epoch milliseconds written `m<ms>`), so entering one relationship never extends — or resurrects — another. Re-proving `event` restarts `event`'s window and nothing else.
67
71
 
68
72
  > **Invariant:** the client only *proposes* the instance id (from the URL). The server proves membership before signing. No client-asserted scope is ever trusted.
69
73
 
@@ -631,11 +635,11 @@ the socket gate stay identical for accountless principals too.
631
635
  The scope claim is trusted between proofs — it is never re-checked against the database while it rides. Two bounds keep that window finite:
632
636
 
633
637
  - **The TTL** (default 180s, `auth.jwt.expiresIn`, clamped ≤180s on scope-bearing tokens) bounds an *idle* client: a token that stops being used dies within one TTL.
634
- - **The carry-forward cap** (15 minutes) bounds an *active* client: the rolling refresh re-signs the claim on every authed call, but only while the claim's proof timestamp (`sct`, stamped exclusively by the proven mint sites) is younger than the cap. Past it the refresh refuses, the token expires, and the next `enter` (or namespace-route mint) re-probes the relationship — which won't re-mint a revoked role.
638
+ - **The carry-forward cap** (15 minutes) bounds an *active* client: the rolling refresh re-signs the claim on every authed call, but only while its proof timestamp (stamped exclusively by the proven mint sites) is younger than the cap. The cap is applied **per scope kind** — a kind whose own proof is past it is dropped from the re-signed claim, so re-proving one relationship cannot roll another forward. Past the cap the refresh refuses, the token expires, and the next `enter` (or namespace-route mint) re-probes the relationship — which won't re-mint a revoked role.
635
639
 
636
640
  So removing a guest/staff row takes effect within **cap + one TTL** for a client that keeps polling, and within one TTL once it goes idle. Two ways to tighten that:
637
641
 
638
- - **`auth.jwt.revocationCheck: 'kv'`** (v0.45+, Cloudflare runtime) — sub-TTL revocation: updating or deleting a conferring relationship row stamps a revocation timestamp in KV, and the bearer fast-path rejects a carried scope claim whose proof (`sct`, with its millisecond companion `sctMs`) is at or before it — no same-second gap. Both halves of the proof time are carried forward verbatim by the rolling refresh; a refresh never substitutes its own mint time for proof time. The check fails closed — a scope claim whose revocation state can't be read is not trusted either. See [auth config](/configure/auth).
642
+ - **`auth.jwt.revocationCheck: 'kv'`** (v0.45+, Cloudflare runtime) — sub-TTL revocation: updating or deleting a conferring relationship row stamps a revocation timestamp in KV, and the bearer fast-path rejects a carried scope claim whose proof is at or before it — no same-second gap. Each kind is compared against **its own** proof time (`sctMs` on the entry; older tokens without one fall back to the token-level `sct`/`sctMs`), so a mint of one kind can't carry a revoked kind past its marker. Neither the refresh nor a re-mint ever substitutes its own clock for a proof it didn't take. The check fails closed — a scope claim whose revocation state can't be read is not trusted either. See [auth config](/configure/auth).
639
643
  - **`via` arms** — for tables where any caching is too wide, gate with a `via` arm instead of a bare `ctx.scope.<kind>` arm: `via` emits a live subquery against the relationship table on every request, immune to a stale claim entirely.
640
644
 
641
645
  ## Reference
@@ -662,6 +666,7 @@ ctx.mintScope(opts: { via: string; subject: string; setAuthToken?: boolean }):
662
666
  - `requestField` must equal every role-relationship's `resource.column`.
663
667
  - Each relationship's `from` table must exist and ship a generated firewall (it can't be `exception`).
664
668
  - A `subKeys` entry ending in `[]` is **set-valued** (lowers to `inArray`, minted as `string[]`); without the marker it's scalar (`eq`, minted as `string`).
669
+ - `id`, `roles`, `subjectId`, and `sctMs` are **reserved** on the claim entry — the mint owns them, so a `subKeys` entry of that name is a compile error rather than a row value overwriting proven state.
665
670
  - `subject` defaults to `'user'`. `'supplied'`/`'both'` enable [`ctx.mintScope`](#sessionless-scope-mint--ctxmintscope) (sessionless mint); `'supplied'` is **not** mintable via `/scope/v1/enter`.
666
671
  - `ctx.mintScope({ via, subject })` mints a **scope-only** token (no user identity, `ctx.userId` undefined) from the `from`-row whose PK is `subject` — reading the role, resource id, sub-keys, and `subjectId` off that row.
667
672
  - `subjectId` is the conferring row's primary key, populated on **both** proof paths — scope self-data on `ctx.scope.<kind>.subjectId`.
@@ -111,6 +111,24 @@ export default defineAction({
111
111
  });
112
112
  ```
113
113
 
114
+ ## The default becomes v2 in v0.64.0
115
+
116
+ `contract.version` resolves to `'v1'` when unset. That default becomes `'v2'`
117
+ in Quickback **v0.64.0**. Every project without an explicit `contract.version`
118
+ moves the entire matrix below on its next compile after that release.
119
+
120
+ Pin the current wire:
121
+
122
+ ```typescript
123
+ {/* doc-compile: skip — config fragment */}
124
+ contract: { version: "v1" }
125
+ ```
126
+
127
+ **Pinning your CLI version does not pin the contract.** The default lives in the
128
+ compiler, which is a hosted service — an older CLI inherits the flip too. The
129
+ config key is the only pin. v0.63.0 warns on every compile that leaves
130
+ `contract.version` unset.
131
+
114
132
  ## Contract version matrix
115
133
 
116
134
  Flipping `contract.version` moves the **entire** contract at once — plan the
@@ -128,7 +146,7 @@ client migration as one move:
128
146
  | Aggregate changesets (`application/vnd.quickback.changeset+json` on PATCH/POST, [`owns`](/define/changesets)) | not available | available where `owns` is declared |
129
147
  | Bare `?fields=` unknown names | silently dropped | **400** |
130
148
  | `fields[<fk>]=` unknown names | n/a | **400** |
131
- | Action input schemas | best-effort static parse | complete client-side harvest **required** |
149
+ | Action input schemas | complete client-side harvest **required** (since v0.63.0) | complete client-side harvest **required** |
132
150
 
133
151
  Sequencing a migration: ship clients that speak the v2 paths, CloudEvents
134
152
  frames, and session-first auth (or declare `auth.jwt`); confirm webhook
@@ -31,7 +31,7 @@ The JWT encodes everything needed for auth middleware:
31
31
  | `iatMs` | Issued-at in epoch **milliseconds** — Quickback ordering metadata, not a standard claim. Same clock sample as `iat`, set by the signer only. Lets [revocation](#revocation--revocationcheck-kv) order a token against a marker written in the same second |
32
32
  | `exp` | Expiry — **180 seconds** (3 minutes) after `iat` by default; set via [`auth.jwt.expiresIn`](/configure/auth) |
33
33
 
34
- Scope-bearing tokens also carry `sct` (proof timestamp, unix seconds) and its millisecond companion `sctMs` — see [Scopes](/define/scopes). Read `iat` / `sct` from external tooling; `iatMs` / `sctMs` exist only so revocation can break ties inside a second.
34
+ Scope-bearing tokens also carry `sct` (proof timestamp, unix seconds) and its millisecond companion `sctMs`, plus a per-kind `sctMs` stamp (`m<ms>`) inside each `scope.<kind>` entry — a mint proves one kind and carries the others forward with the proof time they already had. See [Scopes](/define/scopes). Read `iat` / `sct` from external tooling; the millisecond values exist only so revocation can break ties inside a second.
35
35
 
36
36
  ### Signing
37
37
 
@@ -116,7 +116,7 @@ auth: {
116
116
  },
117
117
  ```
118
118
 
119
- The fast-path then consults per-principal revocation timestamps in your project's existing `KV` binding (keys prefixed `qbrev:`, self-expiring) *before* trusting a token. A token is rejected when its mint timestamp (`iat`/`iatMs`, or `sct`/`sctMs` for the scope claim) is **at or before** the stored timestamp. Cost: 2+ edge-cached KV reads per bearer verify.
119
+ The fast-path then consults per-principal revocation timestamps in your project's existing `KV` binding (keys prefixed `qbrev:`, self-expiring) *before* trusting a token. A token is rejected when its mint timestamp (`iat`/`iatMs`, or the proof time of the scope kind being checked) is **at or before** the stored timestamp. Cost: 2+ edge-cached KV reads per bearer verify.
120
120
 
121
121
  There is no same-second gap: markers are epoch milliseconds (written `m<ms>`, v0.61.0+), tokens carry millisecond companions, and the comparison denies a tie — so a token minted a few milliseconds *before* the revocation is rejected, while one legitimately re-minted *after* it in that same second is still accepted. Pre-v0.61.0 workers don't understand that marker format and read it as "not revoked" — don't roll back across the upgrade or share one KV namespace between versions; see [`revocationCheck`](/configure/auth#revocationcheck-none--kv--token-revocation-strategy).
122
122
 
@@ -1,6 +1,8 @@
1
1
  # Endpoints
2
2
 
3
- The cloud compiler API is hosted at `https://compiler.quickback.dev`.
3
+ The cloud compiler API is hosted at `https://compiler.quickback.dev`
4
+ (alias: `https://build.quickback.dev` — same Worker, same auth via
5
+ `quickback-api`, identical `/health` / `/templates` / `/compile`).
4
6
 
5
7
  ## Public (No Auth)
6
8
 
@@ -184,6 +184,27 @@ authentication behavior. Quickback preserves unrelated overrides already in
184
184
  your package manifest, but the compiler-owned Lodash security pin wins if an
185
185
  existing override conflicts.
186
186
 
187
+ A project that declares an in-worker Durable Object also gets `hono-party`
188
+ plus a second entry in the same block:
189
+
190
+ ```json
191
+ {
192
+ "overrides": {
193
+ "hono-party": {
194
+ "@cloudflare/workers-types": "$@cloudflare/workers-types"
195
+ }
196
+ }
197
+ }
198
+ ```
199
+
200
+ `hono-party` still declares a peer dependency on `@cloudflare/workers-types`
201
+ major 4, which cannot be satisfied alongside the major 5 the compiler pins, so
202
+ a plain `npm install` would fail with `ERESOLVE`. The override is scoped to
203
+ `hono-party` — nothing else in the tree is relaxed — and the `$` form resolves
204
+ to whatever your `package.json` already declares, so it tracks the pin instead
205
+ of drifting from it. Projects without an in-worker Durable Object do not get
206
+ this entry.
207
+
187
208
  After recompiling, run your package manager's install command so its lockfile
188
209
  records the patched transitive version. Use `npm audit --omit=dev` when
189
210
  evaluating the production dependency tree; development-tool advisories are a