@quickback-dev/cli 0.66.4 → 0.66.6

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 (77) hide show
  1. package/README.md +0 -1
  2. package/dist/index.js +1 -1
  3. package/dist/skill/SKILL.md +0 -2
  4. package/dist/skill/docs/api/openapi.md +1 -1
  5. package/dist/skill/docs/configure/auth.md +8 -8
  6. package/dist/skill/docs/configure/domains.md +1 -1
  7. package/dist/skill/docs/configure/index.md +4 -4
  8. package/dist/skill/docs/configure/security.md +3 -3
  9. package/dist/skill/docs/define/access.md +52 -9
  10. package/dist/skill/docs/define/actions/defining.md +2 -2
  11. package/dist/skill/docs/define/actions/record-and-standalone.md +1 -2
  12. package/dist/skill/docs/define/areas.md +14 -15
  13. package/dist/skill/docs/define/changesets.md +5 -0
  14. package/dist/skill/docs/define/diagnostics.md +2 -2
  15. package/dist/skill/docs/define/fga.md +1 -1
  16. package/dist/skill/docs/define/firewall.md +5 -5
  17. package/dist/skill/docs/define/guards.md +17 -11
  18. package/dist/skill/docs/define/masking.md +2 -2
  19. package/dist/skill/docs/define/relationships.md +8 -10
  20. package/dist/skill/docs/define/scopes.md +2 -1
  21. package/dist/skill/docs/index.md +0 -6
  22. package/dist/skill/docs/platform/auth/jwt-optimization.md +2 -2
  23. package/dist/skill/docs/platform/realtime/durable-objects.md +1 -1
  24. package/dist/skill/docs/platform/realtime/partyserver-rooms.md +4 -4
  25. package/dist/skill/docs/platform/webhooks/inbound.md +1 -1
  26. package/dist/skill/docs/tooling/claude-skill.md +0 -7
  27. package/dist/skill/docs/tooling/cloud-compiler/endpoints.md +1 -1
  28. package/dist/skill/docs/tooling/output.md +7 -6
  29. package/dist/skill/docs/ui/account/features/admin.md +1 -1
  30. package/dist/skill/docs/ui/account/features/organizations.md +1 -1
  31. package/dist/skill/docs/ui/admin/index.md +1 -1
  32. package/dist/skill/docs/ui/admin/owned-records.md +81 -0
  33. package/dist/skill/docs/ui/admin/schema-format.md +16 -0
  34. package/package.json +1 -1
  35. package/src/skill/SKILL.md +0 -2
  36. package/src/skill/docs/api/openapi.md +1 -1
  37. package/src/skill/docs/configure/auth.md +8 -8
  38. package/src/skill/docs/configure/domains.md +1 -1
  39. package/src/skill/docs/configure/index.md +4 -4
  40. package/src/skill/docs/configure/security.md +3 -3
  41. package/src/skill/docs/define/access.md +52 -9
  42. package/src/skill/docs/define/actions/defining.md +2 -2
  43. package/src/skill/docs/define/actions/record-and-standalone.md +1 -2
  44. package/src/skill/docs/define/areas.md +14 -15
  45. package/src/skill/docs/define/changesets.md +5 -0
  46. package/src/skill/docs/define/diagnostics.md +2 -2
  47. package/src/skill/docs/define/fga.md +1 -1
  48. package/src/skill/docs/define/firewall.md +5 -5
  49. package/src/skill/docs/define/guards.md +17 -11
  50. package/src/skill/docs/define/masking.md +2 -2
  51. package/src/skill/docs/define/relationships.md +8 -10
  52. package/src/skill/docs/define/scopes.md +2 -1
  53. package/src/skill/docs/index.md +0 -6
  54. package/src/skill/docs/platform/auth/jwt-optimization.md +2 -2
  55. package/src/skill/docs/platform/realtime/durable-objects.md +1 -1
  56. package/src/skill/docs/platform/realtime/partyserver-rooms.md +4 -4
  57. package/src/skill/docs/platform/webhooks/inbound.md +1 -1
  58. package/src/skill/docs/tooling/claude-skill.md +0 -7
  59. package/src/skill/docs/tooling/cloud-compiler/endpoints.md +1 -1
  60. package/src/skill/docs/tooling/output.md +7 -6
  61. package/src/skill/docs/ui/account/features/admin.md +1 -1
  62. package/src/skill/docs/ui/account/features/organizations.md +1 -1
  63. package/src/skill/docs/ui/admin/index.md +1 -1
  64. package/src/skill/docs/ui/admin/owned-records.md +81 -0
  65. package/src/skill/docs/ui/admin/schema-format.md +16 -0
  66. package/dist/skill/docs/changelog/index.md +0 -928
  67. package/dist/skill/docs/changelog/v0.1x.md +0 -1202
  68. package/dist/skill/docs/changelog/v0.2x.md +0 -589
  69. package/dist/skill/docs/changelog/v0.3x.md +0 -1152
  70. package/dist/skill/docs/changelog/v0.4x.md +0 -1108
  71. package/dist/skill/docs/changelog/v0.5x.md +0 -885
  72. package/src/skill/docs/changelog/index.md +0 -928
  73. package/src/skill/docs/changelog/v0.1x.md +0 -1202
  74. package/src/skill/docs/changelog/v0.2x.md +0 -589
  75. package/src/skill/docs/changelog/v0.3x.md +0 -1152
  76. package/src/skill/docs/changelog/v0.4x.md +0 -1108
  77. package/src/skill/docs/changelog/v0.5x.md +0 -885
@@ -1,885 +0,0 @@
1
- # v0.50 – v0.54
2
-
3
- ## v0.54.0 — July 17, 2026
4
-
5
- ### Realtime: named invalidations
6
-
7
- Actions can now fire typed, targeted *"this changed — refresh"* signals after commit. A `defineRealtime` registry declares typed events (wire name, contract `version`, named variants with strict Zod payloads); a `defineRealtimeDelivery` profile sets the maximum audience (a scope room or the org/user lane + required roles); and an optional `defineRealtimeRecipients` resolver narrows delivery to a resolved identity set — post-commit on the firewalled db, intersecting `scope ∩ roles ∩ recipients`, fail-closed (a throw or `[]` reaches nobody, never a wider audience). Bind them with `invalidates:` on an action and call `invalidate.<binding>.<variant>(payload)` inside `execute`. Delivery is after-commit + best-effort (discarded on throw/dryRun), projects the payload to declared keys, and works on every action kind — standalone, per-record, bulk, and namespace-hoisted. See [Named invalidations](/platform/realtime/named-invalidations).
8
-
9
- ### Access: `SESSION` and `SCOPED` pseudo-role tiers
10
-
11
- `AUTHENTICATED` is now explicitly the wrapper over two auth flavors: **`SESSION`** (a full Better Auth session only) and **`SCOPED`** (a sessionless scope-token principal only — e.g. an event attendee with no account). Use the specific tier when a route must admit or exclude one flavor; `AUTHENTICATED` still admits both and excludes only external delegated principals. See [Access → Pseudo-roles](/define/access).
12
-
13
- ### Access: fail-closed scope/firewall coherence guardrail
14
-
15
- Granting a scope caller (`SCOPED` or a `scope:<kind>:<role>` role) on a resource whose firewall can't filter that caller now **fails the build** instead of silently returning `200 + []` — the trap that pushes apps toward a fake "active organization." The fix is named in the error: compose org **or** scope in an `{ any: [...] }` firewall group, use a `via:` relationship, or `firewall: [{ exception: true }]`.
16
-
17
- ## v0.53.0 — July 17, 2026
18
-
19
- ### Realtime: the broadcast surface tracks `contract.version`
20
-
21
- The `/api` and `/auth` bases already move to `/api/v2` and `/auth/v2` under
22
- `contract.version: 'v2'`, but the realtime/broadcast surface stayed pinned
23
- at `/broadcast/v1` — so a v2 project's WebSocket mount, ws-ticket mint, DO
24
- route matcher, notify helper, auth skip-set, and discovery all disagreed
25
- with the rest of the contract. The broadcast base now derives from the same
26
- resolved contract version (single source of truth in `resolveSystemRoutes`),
27
- threaded through every emitter:
28
-
29
- - **contract v1 (or omitted)** → `/broadcast/v1` everywhere, byte-identical
30
- to prior output.
31
- - **contract v2** → `/broadcast/v2` everywhere, with **no hidden v1 alias**.
32
-
33
- An explicit `compiler.routes.broadcast` override still wins. Existing v1
34
- projects are unaffected.
35
-
36
- ### Web Push: VAPID delivery, queue fan-out, and identity-tag targeting
37
-
38
- `push.provider: 'web-push'` turns on a full push pillar: a self-contained
39
- delivery module (RFC 8292 VAPID JWTs + RFC 8291 aes128gcm, `crypto.subtle`
40
- only — no Node polyfills), a Cloudflare Queues fan-out with a dead-letter
41
- queue, and a hardened `push_subscriptions` schema. The crypto core is
42
- verified against the RFC 8291 Appendix A known-answer vector — the emitted
43
- module reproduces the RFC's ciphertext byte-for-byte.
44
-
45
- - **Send path** — `enqueuePushFanout(queue, target, payload)` from an
46
- action's after-commit phase (`effects.enqueue`), so rolled-back writes
47
- never notify and `dryRun` sends nothing. Declarative targets
48
- (`{ userIds }`, `{ targetTags }`, `{ targetRoles }`, `{ all: true }`)
49
- resolve server-side in the queue consumer — subscription crypto never
50
- enters action code. Targeting speaks the realtime identity-tag dialect
51
- and is fail-closed: `[]` selects nobody, broadcast requires an explicit
52
- `{ all: true }`.
53
- - **Default schema** (`push.defaultSchema: true`) — owner-firewalled,
54
- INTERNAL-read `push_subscriptions` with a `views.mine` device list.
55
- Creates validate `https:` endpoints (SSRF blocker), 65-byte P-256
56
- `p256dh`, 16-byte `auth`; `tags` is stamped server-side from the
57
- session's proven identity (client tags ignored); 10/min create rate
58
- limit; per-user cap keeps the newest 10 live subscriptions.
59
- - **Fail-closed config** — a literal `vapidPrivateKey` in config is a
60
- compile error (`env:VAPID_PRIVATE_KEY` only); the worker refuses to boot
61
- without the three VAPID vars; the private key never lands in
62
- `wrangler.toml`, SPA bundles, or logs (DLQ chunks log counts only).
63
- - **SPA bake** — the VAPID public key ships to CMS/Account bundles as
64
- `VITE_QUICKBACK_VAPID_PUBLIC_KEY` and `window.__QUICKBACK_RUNTIME.vapidPublicKey`.
65
- - **CLI** — `quickback push generate-keys [--out <file>]`; `--out` writes
66
- the private key to a `0600` file so it never touches stdout or shell
67
- history.
68
-
69
- See [Web Push](/platform/push) for the full guide.
70
-
71
- ## v0.52.1 — July 17, 2026
72
-
73
- ### CLI: cold-start tolerance for the cloud compiler
74
-
75
- Right after a service deploy, the first compile pays a fresh container image
76
- pull — which routinely exceeds the CLI's old 60-second readiness budget and
77
- surfaced as `Compiler container did not become ready in time` even while
78
- `/health` was green. `waitForReady` now allows 4 minutes, reports elapsed
79
- warm-up progress, and the timeout message explains the deploy-in-progress
80
- case.
81
-
82
- ## v0.52.0 — July 17, 2026
83
-
84
- ### Five action primitives: afterCommit, realtime emit, transitions v2, refs, bundles
85
-
86
- One release, five primitives that collapse the most-repeated hand-written
87
- patterns in real Quickback projects (measured across a 349-action production
88
- corpus). Every one is additive — existing projects compile unchanged, and
89
- plain `{ field, fromTo, to|via }` transitions keep their emission
90
- byte-identical.
91
-
92
- - **`afterCommit` hooks + `effects.enqueue`** — named best-effort side
93
- effects that run after `execute` returns. Each hook is independently
94
- wrapped (failures log as `[<action>] afterCommit:<hook> failed`, never
95
- touching the response), non-blocking hooks ride `executionCtx.waitUntil`,
96
- `{ blocking: true }` awaits before responding, and everything skips when
97
- `execute` throws or returns `dryRun: true`. The execute context also gains
98
- `effects.enqueue(name, fn)` for mid-execute captures and `now` — one ISO
99
- timestamp per invocation. Replaces the per-leg `try/catch + waitUntil`
100
- idiom. See [After-commit hooks](/define/triggers#after-commit-hooks).
101
-
102
- - **Realtime emit for custom actions** — tables that lock auto-CRUD no
103
- longer hand-roll frames. `realtime: { emitFromActions: true, scopeKeyFrom:
104
- "events:{eventId}" }` makes scoped-db writes inside record-bound and bulk
105
- actions emit auto-CRUD-byte-compatible frames after commit (masking +
106
- audience applied at fanout; the fail-closed audience requirement extends to
107
- action emission). Actions can also declare `emit:` for a pre-bound
108
- `emitCrud(row, oldRow?)`. Updates/deletes pre-select old rows on the same
109
- WHERE; raw `unsafeDb` writes stay invisible. See
110
- [When auto-broadcast fires](/platform/realtime/durable-objects#when-auto-broadcast-fires-and-when-you-call-it-manually).
111
-
112
- - **Transitions v2** — `transition` grows `guard` (equality / null / notNull
113
- / `custom(record)`), `onIllegal { code, status, message }`, `idempotent:
114
- "noop"`, and `stamp`/`clears` that ride a compiler-applied, TOCTOU-safe
115
- UPDATE (guards fold into the WHERE; a lost race is 409
116
- `ACCESS_TRANSITION_LOST`). With an applied write, `execute` becomes
117
- optional. Table-level `transitions: { publish: { field, from, to, access } }`
118
- *generates* the action files — including `undo:` inverses and `onEnter`
119
- cascades — mounted exactly where hand-written files would be (explicit
120
- files win, with a warning). The ten byte-identical publish/revert files in
121
- the podcast fixture become two lines per entity. See
122
- [Transitions](/define/transitions).
123
-
124
- - **`refs` — scoped foreign-key inputs** — the "load the id, 404 if missing,
125
- assert it belongs to this event" preamble becomes declarative. Loads run
126
- through the scoped db (a cross-org id 404s by construction), batch into one
127
- `Promise.all`, assert `matchScope` / cross-input `matchWith` parenthood, and
128
- inject rows under their `as` names. Ref keys are validated against the
129
- inline `z.object` input (with agreeing optionality) at compile time. See
130
- [Refs](/define/actions/defining#refs-scoped-foreign-key-inputs).
131
-
132
- - **`defineBundle` — single-round-trip bootstrap reads** — declarative
133
- `list()` slices with the firewall, the table's *real* mask functions, and
134
- `{ data }` cache-seed envelopes; `custom()` escape-hatch sections; a SHA-1
135
- ETag over `{ scopeSeed, userId, payload }` with the `ifNoneMatch →
136
- notModified` short-circuit; and `Server-Timing`. Fail-closed: a bundle's
137
- roles must be a subset of every list table's `read.access` roles — a bundle
138
- can never widen read access. The digest ships as `sha1Hex` in `lib/etag`
139
- so hand-written reads can delete their copies. See
140
- [Bundles](/define/bundles).
141
-
142
- Supporting changes: `ActionError` / `TransitionLostError` are re-exported
143
- from the generated `.quickback/define-action` helpers (routes duck-type on
144
- `error.name`, so project-local copies keep working); `sendQueueBatched` in
145
- `lib/effects` chunks queue sends at the Cloudflare 100-message cap; and the
146
- `$record.*` / `$ctx.*` substitution grammar used by `onEnter` and bundle
147
- `where` is one strict allowlist, always parameterized — never interpolated
148
- into SQL.
149
-
150
- ### CLI device login fixed: /cli/authorize now claims the code before approving
151
-
152
- Better Auth's `deviceAuthorization` plugin requires the verifying session to
153
- claim a device code (`GET /device?user_code=…`) before it accepts an approve
154
- or deny. The account SPA's `/cli/authorize` page posted the approval directly,
155
- so every `quickback login` failed with *"Device code has not been claimed by
156
- a verifying session."* The page now claims first, then approves — and surfaces
157
- claim failures (expired or mistyped codes) with the server's message.
158
-
159
- ## v0.51.1 — July 16, 2026
160
-
161
- ### Generated builds no longer rewrite the auth schema
162
-
163
- Generated Better Auth projects now run `tsc` directly from `npm run build`.
164
- `quickback compile` already generates, qualifies, and envelopes
165
- `src/auth/schema.ts`; invoking `auth:schema` again during every build rewrote
166
- that compiler-owned artifact and made an otherwise clean release worktree
167
- dirty. The explicit `auth:schema` diagnostic command remains available, while
168
- normal build, Wrangler, and deployment preflight paths are source-read-only.
169
- When recompiling an existing project, compiler-owned `package.json` script
170
- names now converge to their current generated commands while unrelated custom
171
- scripts are preserved. This upgrades projects whose previous generated
172
- `build` script still invoked `auth:schema`.
173
-
174
- ### Non-cross-tenant unsafe actions preserve delegated RLS claims
175
-
176
- Generated Neon handlers now reserve `createServiceDb` for actions that
177
- explicitly enable `unsafe.crossTenant`. An action that enables raw database
178
- access with `crossTenant: false` keeps the request database, so organization
179
- and delegated-principal claims survive into Hyperdrive transactions instead of
180
- being cleared by the service-role preamble. True cross-tenant sysadmin actions
181
- retain their audited RLS bypass.
182
-
183
- Neon Hyperdrive guidance now also calls out Postgres' `SELECT … FOR UPDATE`
184
- authorization rule: a locked row must pass both `SELECT` and `UPDATE` policies.
185
- Delegated actions should use ordinary selects for read-only eligibility tables
186
- and lock only mutable rows they are authorized to update. A PGlite regression
187
- proves that ordinary delegated reads remain visible while the generated
188
- restrictive update fence blocks an unauthorized row lock.
189
-
190
- ### Atomic email-OTP auth routing no longer recurses on ordinary requests
191
-
192
- The generated atomic email-OTP wrapper now captures and binds Better Auth's
193
- original request handler before replacing the public `handler` property.
194
- Session reads and every other non-atomic auth route therefore forward to Better
195
- Auth exactly once instead of re-entering the wrapper until the Worker exhausts
196
- its call stack. The exact email-OTP sign-in route retains its transactional
197
- admission and rollback behavior.
198
-
199
- ### Generated Better Auth CLI dependencies no longer retain vulnerable Lodash
200
-
201
- Better Auth projects now emit a root npm override for `lodash@4.18.1`. This
202
- keeps the supported stable `auth@1.6.x` CLI and its `better-auth` executable,
203
- while lifting the CLI's dev-only Prisma parser chain off Lodash releases
204
- affected by the 2026 code-injection and prototype-pollution advisories. Runtime
205
- Better Auth packages and generated authentication behavior are unchanged.
206
-
207
- The CLI now merges generated npm overrides explicitly when recompiling an
208
- existing project: unrelated user overrides remain, while compiler-owned
209
- security pins win a conflict. Recompile and reinstall dependencies to refresh
210
- the project lockfile. `npm audit --omit=dev` remains the production dependency
211
- view; upstream development-server advisories may still appear separately.
212
-
213
- ### Postgres constraint replacements apply in dependency-safe order
214
-
215
- Neon migration post-processing now orders both halves of a Drizzle constraint
216
- replacement. A dependent foreign key is dropped before its referenced unique
217
- or primary-key constraint, then the replacement key is added before the
218
- foreign key that consumes it. This prevents Postgres `2BP01` failures when
219
- Drizzle emits the parent key drop first, while preserving byte-identical output
220
- for already-correct migrations and the relative order of unrelated statements.
221
-
222
- ### Schema registry output is byte-reproducible
223
-
224
- `schema-registry.json` no longer includes the wall-clock `generatedAt` field.
225
- Its remaining metadata and schema content are derived entirely from compiler
226
- inputs, so consecutive compiles of identical logical input now produce the
227
- same registry bytes. This makes artifact hashes, caches, and deployment diffs
228
- stable without timestamp normalization.
229
-
230
- ### Generated auth and discovery surfaces now remain truthful and type-safe
231
-
232
- Atomic email-OTP generation now imports and invokes
233
- `before-email-otp-activate.ts` exactly once and preserves the transaction's
234
- real Drizzle `select` capability in the hook context. Strict generated
235
- TypeScript therefore accepts both the base Neon service database and its
236
- interactive transaction without erasing the hook's read contract.
237
-
238
- Contract-v2 projects that omit `auth.jwt` no longer advertise the disabled
239
- Quickback JWT fast path in `llms.txt` or RFC 8414 metadata. Bearer-JWT guidance,
240
- the fallback `/api/v2/token` endpoint, and JWT scopes are emitted only when the
241
- corresponding JWT surface exists; real Better Auth OAuth-provider discovery is
242
- unchanged.
243
-
244
- Cloudflare Email callbacks now all enter the shared credential-delivery
245
- scheduler exactly once. The scheduler anchors the observed rejection with
246
- `waitUntil`, emits the metadata-only `auth.credential_delivery_failed` event,
247
- and never leaks the provider error. Generated CRUD routes also keep delegated
248
- principal and account authority disjoint: `?organizationId=` is rejected for a
249
- delegated principal instead of synthesizing `activeOrgId` on its context. This
250
- closes both the authority ambiguity and the generated `AppContext` union type
251
- errors.
252
-
253
- ### Email-OTP activation can be admitted atomically in the API layer
254
-
255
- Contract-v2 Cloudflare projects using one Neon Hyperdrive database can opt the
256
- exact Better Auth `POST /sign-in/email-otp` handler into an interactive
257
- transaction with `atomicAuthRoutes: ["emailOtpSignIn"]`. The paired recognized
258
- hook, `quickback/hooks/before-email-otp-activate.ts`, receives a proven dormant
259
- user `{ userId, email, user }` plus transaction-bound `db` / full `schema` and
260
- `authDb` / `authSchema` handles. Quickback owns only identity proof and atomic
261
- orchestration; application admission, status, event, pass, and eligibility
262
- rules remain authored in the project API hook.
263
-
264
- The hook executes after OTP validation but in Better Auth's
265
- `databaseHooks.user.update.before`, before the user update lock. This preserves
266
- application-first lock ordering and avoids the user-to-application inversion a
267
- session-create hook would introduce. Unknown-email signup must be disabled;
268
- already-verified users do not rerun dormant activation.
269
-
270
- The generated handler rebuilds Better Auth over the transaction handle, so OTP
271
- consumption, project hook writes, the `emailVerified` update, and session insert
272
- commit together. Admission denial, a non-ok response after activation starts,
273
- and any 5xx response throw a private rollback sentinel. Expected policy denial
274
- returns a generic 403. Operational rollback emits the metadata-only
275
- `auth.atomic_email_otp_operational_rollback` event and returns a generic 503,
276
- without exposing raw errors. Ordinary invalid-OTP 4xx responses still commit
277
- Better Auth's attempt accounting, and the OTP-send route remains outside the
278
- transaction. Unsupported contracts, runtimes, database modes,
279
- missing/duplicated config, enabled signup,
280
- and a hook/config mismatch now fail at compile time.
281
-
282
- ### Neon migrations can declare cross-schema foreign keys
283
-
284
- Neon projects can now declare fully qualified, single-column or composite
285
- foreign keys under `compiler.migrations.foreignKeys`. Each entry names the
286
- constraint, source and target schema/table/column tuples, and explicit
287
- `onDelete` / `onUpdate` actions. The compiler rejects unsafe identifiers,
288
- mismatched tuple arity, duplicate or ambiguous declarations, unknown keys,
289
- and non-Neon providers before generating SQL.
290
-
291
- Declared constraints are sorted deterministically and folded into Quickback's
292
- content-addressed Postgres journal after the Drizzle schema migration. A new
293
- constraint is added `NOT VALID` and then validated, so existing orphan rows
294
- fail the migration; replay verifies an exact catalog match and rejects a
295
- same-named constraint with different semantics. This surface enforces
296
- relational integrity only—business rules remain in generated or authored API
297
- actions, not database triggers.
298
-
299
- ### Compile completion steps honor the Neon connection mode
300
-
301
- The CLI's successful-compile footer now distinguishes Neon HTTP from
302
- Hyperdrive. HTTP projects retain the direct `DATABASE_URL` Worker setup.
303
- Hyperdrive projects show `DATABASE_MIGRATION_URL` only as a local or CI
304
- migration input, point local development at the configured Hyperdrive
305
- `localConnectionString`, and never recommend deploying `DATABASE_URL` as a
306
- Worker secret.
307
-
308
- Named Hyperdrive environments also show their configured Neon branches,
309
- required-secret inventories, and explicit Wrangler `--env` targets. The footer
310
- no longer suggests the unnamed `.env.neon` / `.dev.vars` workflow or a bare
311
- deploy for an isolated `dev` / `prod` setup.
312
-
313
- ### Cloudflare email delivery and named Neon targets fail visibly and deploy explicitly
314
-
315
- Generated Cloudflare email code now uses the native Workers `SendEmail`,
316
- `EmailAddress`, attachment, and `EmailSendResult` contracts. The Workers
317
- builder keeps its camel-case fields and `{ email, name }` address shape, while
318
- the REST transport retains its separate snake-case fields and `{ address,
319
- name }` shape. Generated projects move to `@cloudflare/workers-types` v5 with
320
- Wrangler 4.110 so the binding and result types agree without `any` casts.
321
-
322
- Every Better Auth email callback now creates an observed delivery promise. On
323
- Workers, the callback hands that still-rejecting promise to
324
- `executionCtx.waitUntil(...)` and returns after the task is accepted; outside a
325
- request lifecycle it returns the promise for the caller to await. Failures emit
326
- only a structured generic event, never provider error content, and remain
327
- rejected instead of being detached or swallowed. SES and SNS background sends
328
- use the same lifecycle rule.
329
-
330
- Neon Hyperdrive's generated postgres.js client now caps each request-scoped
331
- pool at five connections. Named environments gain explicit `deploy:dev` and
332
- `deploy:prod` package scripts (mapped to their configured Wrangler environment
333
- names), while the unsafe bare `deploy` script remains absent and migrations
334
- remain a separate target-owned step.
335
-
336
- ### Contract v2 auth and Neon authority boundaries are fail-closed
337
-
338
- Contract-v2 projects no longer emit Quickback's generic JWT mint endpoint,
339
- JWT helper, middleware verification/mint fast-path, or related imports unless
340
- the project explicitly declares `auth.jwt`. Contract v1 retains its existing
341
- default for compatibility. Adding `auth.jwt: {}` to a v2 config opts back into
342
- the custom Quickback JWT with its normal default settings.
343
-
344
- Configured delegated authenticators now produce closed TypeScript unions in
345
- both generated `AppContext` and Neon RLS context. Request contexts contain only
346
- resolved principal variants; the compiler-internal credential-lookup variants
347
- exist only in the database context. Delegated standalone actions do not require
348
- Better Auth `activeOrgId` / `activeTeamId` before their declared principal
349
- access tree runs, and their context cannot acquire account, organization, team,
350
- membership, or scope authority.
351
-
352
- On Cloudflare + Neon, the API-key organization membership lookup now runs with
353
- request-scoped user/org RLS claims before it stamps verified organization and
354
- role authority into `AppContext`. Generated security migrations also converge
355
- direct privilege drift: the audit schema/table revoke all direct grants from
356
- `PUBLIC`, the runtime, and admin before restoring their exact write-only/admin
357
- sets, while the Drizzle journal schema/table/sequences and database `CREATE`
358
- capability explicitly revoke `PUBLIC` and runtime access before granting the
359
- migration role.
360
-
361
- ### Standalone action routes preserve their exact authority context
362
-
363
- Generated standalone routes now pass each action the context and scoped
364
- database types inferred from that action's own `execute` signature. Account actions therefore receive a
365
- required account identity, while `event_pass`, `event_delegate`, and other
366
- delegated-principal actions retain their exact principal literal at the route
367
- boundary. Relationship `loads` / `exposeAs` hydration is intersected with that
368
- authority context, including required shared targets and optional distinct
369
- multi-lane targets, instead of replacing it with the broad application
370
- context.
371
-
372
- The same boundary keeps ordinary request databases and temporary
373
- service-role-backed scoped databases assignable to the generated Hyperdrive
374
- action helper without widening the handler's schema-aware `db` type.
375
-
376
- Generated principal-auth identity guards also emit explicit strict TypeScript
377
- parameter and return types. Contract-v2 Cloudflare + Neon output no longer
378
- fails `tsc` on implicit-`any` guard parameters.
379
-
380
- ### Parameterized actions keep complete v2 schema harvests
381
-
382
- The action-input harvest plan now converts Hono-style `:param` segments to the
383
- OpenAPI `{param}` form for standalone actions and parameterized resource paths.
384
- Previously the CLI could harvest every schema successfully, but the compiler
385
- could apply only parameter-free actions because it looked up parameterized
386
- operations under the wrong OpenAPI key. Contract v2 now counts and patches the
387
- same canonical path emitted by OpenAPI and MCP.
388
-
389
- Generated standalone-action routes also remove template-only trailing spaces
390
- when optional audit blocks are absent, keeping regenerated source diffs clean.
391
-
392
- ### Action-schema harvest uses the generated runtime dependency tree
393
-
394
- The CLI now resolves action-harvest dependencies from the configured
395
- `build.outputDir/node_modules` before unrelated ancestor installs. This fixes
396
- isolated projects that keep authored definitions under `quickback/` and the
397
- generated runtime under a sibling directory such as `src/`: their actions can
398
- use the runtime's Zod 4 and Drizzle installation without adding workspace-root
399
- symlinks. An older user-level or monorepo-level Zod can no longer shadow the
400
- runtime's declared version during schema evaluation.
401
-
402
- Schema-only evaluation also emits inert named table proxies for authored
403
- Drizzle exports. Shared input/DTO modules may therefore construct top-level
404
- selection objects such as `{ id: records.id }` without executing a database
405
- operation or losing the action's Zod schema.
406
-
407
- Harvest failures now retain the exact action key, failing phase (`bundle` or
408
- `evaluation`), and bounded underlying error. Contract v2 includes those
409
- per-action diagnostics in its fail-closed compile error; v1 retains its
410
- best-effort static-schema fallback.
411
-
412
- ### Contract v2 delegated principals and RLS-only action tables
413
-
414
- Cloudflare + Neon Hyperdrive projects on `contract.version: "v2"` can now
415
- declare framework-generic delegated authenticators under `auth.principals`.
416
- Each named principal owns an exact, non-`Bearer` Authorization scheme, a
417
- project hook that proves the credential and returns only `{ digest }`, and one
418
- compiler-owned indexed lookup that resolves the actor, optional session/family,
419
- string claims, and active status. The hook receives no database handle. Proof
420
- hooks authored under `quickback/lib` are staged into generated `src/lib`, even
421
- when no action imports them directly.
422
-
423
- Delegated authority is structurally disjoint from Better Auth accounts:
424
- `ctx.principal` is populated while user, organization, team, and membership
425
- fields remain absent. Access arms may use `principals: [...]`; fields inside an
426
- arm are ANDed and sibling arms are ORed. Generated action helpers preserve
427
- that boundary in TypeScript, including the anonymous possibility of a
428
- `PUBLIC` sibling arm. Mixed credential transport rejects Authorization plus an
429
- API key or an actual Better Auth session cookie, while unrelated analytics
430
- cookies do not create a false conflict. `Bearer` remains reserved for account
431
- authentication.
432
-
433
- Resources can also declare operation-specific `databaseAccess` policies for
434
- authored actions and support tables. This is an RLS-only surface: it emits no
435
- generic route or OpenAPI operation and is accepted only on Cloudflare + Neon
436
- Hyperdrive. Every authorization path must contain a nonempty SQL-lowerable
437
- record equality; unbounded principal/role leaves, any unbounded OR arm, empty
438
- records, ambiguous mixed boolean nodes, app-only predicates, and unsupported
439
- providers fail compilation. This keeps business logic in authored API actions
440
- while Postgres independently enforces the same event/person or account/org row
441
- boundary.
442
-
443
- Principal claims use the same transaction-local Hyperdrive preamble as account
444
- claims, with query caching disabled. Restrictive per-operation principal
445
- fences prevent a public, exception, or legacy permissive policy from admitting
446
- the wrong principal type. Credential lookup indexes and RLS journal entries are
447
- content-addressed and converge when a table, digest column, or definition
448
- changes; generated Postgres identifiers include collision-resistant hashes and
449
- stay within the 63-byte limit. Each security migration also drops the complete
450
- compiler-owned `databaseAccess` policy family before recreating the current
451
- operations, so removing or moving an operation revokes the old permissive
452
- policy instead of leaving it active. Record fields resolve through authoritative
453
- Drizzle metadata to exact quoted physical identifiers, unknown fields fail the
454
- compile, and DB-only pseudo-roles follow the same ADMIN/SYSADMIN/INTERNAL
455
- contract as the application surface.
456
-
457
- ### Action execute helpers preserve their typed boundary
458
-
459
- Generated per-feature `defineAction` helpers no longer erase `services`, the
460
- Hono request context, record predicates, or the action's return value to
461
- `any`. Zod input and record inference remain intact, `whereRecord` and
462
- `whereTransition` accept only the helper's bound table, and the existing D1 /
463
- Neon Hyperdrive scoped `db` and interactive `tx` types now flow through the
464
- same execute boundary. The returned value is inferred exactly; this does not
465
- add a response schema, invalid-return rule, or new output contract.
466
-
467
- HTTP/WebSocket Neon retains its intentionally dynamic `db`, and `AppContext`
468
- retains its open index signature for runtime-hydrated namespace fields.
469
-
470
- ### Neon Hyperdrive is now the only Worker database lane, including Better Auth
471
-
472
- For `connectionMode: "hyperdrive"`, generated Better Auth code now uses the
473
- same HYPERDRIVE-backed, service-role-scoped database handle as the rest of the
474
- generated API. `DATABASE_URL` is no longer emitted or required as a Worker
475
- secret in Hyperdrive mode; migration credentials remain inputs to the compiler
476
- or CI environment. HTTP-mode Neon retains its existing `DATABASE_URL` runtime
477
- contract.
478
-
479
- ### Public contract v2 now compiles as one coherent API/auth surface
480
-
481
- Projects may set `contract: { version: "v2" }` to select `/api/v2/*` feature
482
- routes and `/auth/v2/*` Better Auth routes. The compiler now threads that
483
- selection through generated route mounts, Better Auth configuration and
484
- middleware, OpenAPI paths and server metadata, MCP internal tool calls, OAuth
485
- discovery, `llms.txt`, schema/embeddings/system routes, live views, namespace
486
- actions, and dedicated-domain `/v2/*` shortcuts. The option is no longer
487
- fail-closed. Omitting `contract` or selecting `v1` preserves the existing v1
488
- output.
489
-
490
- Bundled CMS and Account clients now receive the selected API and auth base
491
- paths through both their Vite build environment and the Worker-injected runtime
492
- config. CMS CRUD, schema, sysadmin, and live-view requests and Account auth,
493
- data, and live-view requests therefore stay on `/api/v2` and `/auth/v2` for a
494
- v2 project instead of falling back to client-side v1 literals. V1 SPA config
495
- retains its historical byte shape.
496
-
497
- V2 compiles also require a complete client-side action input-schema harvest.
498
- The current CLI reports the exact action files that failed to produce a JSON
499
- Schema, and the compiler independently rejects missing, invalid, or partial
500
- maps at the shared parse boundary used by both complete and validation-only
501
- compiles. `POST /compile?complete=false` can no longer bypass the v2 gate. For
502
- record actions with `bulkVariant: true`, the harvested schema now patches both
503
- the single-record request body and the bulk operation's nested `input`; the
504
- action is counted complete only when both OpenAPI targets exist. Harvest
505
- planning also normalizes filename-based action bindings to the table's declared
506
- name and resource path, so kebab-case filenames exporting snake/camel-case
507
- tables are not silently omitted. V1 remains best-effort for backward
508
- compatibility.
509
-
510
- ### Complete, isolated Wrangler targets for named Neon environments
511
-
512
- `providers.database.environments` now defines deployable Neon Hyperdrive
513
- targets instead of emitting empty `[env.*]` shells. Because Wrangler does not
514
- inherit vars or bindings into named environments, each target must explicitly
515
- own its generated vars, required-secret contract, Hyperdrive and KV IDs,
516
- rate-limit namespace IDs, and Cloudflare Email binding. The compiler rejects
517
- missing overrides, shared stateful IDs, optional secret declarations, invalid
518
- target semantics, and unsupported binding families rather than generating a
519
- Worker that starts without part of its runtime.
520
-
521
- The required-secret inventory is now centralized and includes generated
522
- credentials as well as custom declarations: `BETTER_AUTH_SECRET`, a configured
523
- `auth.jwt.secretEnv`, `ENCRYPTION_KEK` when envelope encryption is present, and
524
- every `bindings.secrets` entry marked `required`. Generated Better Auth SES/SNS
525
- credentials, AWS-backed anonymous-upgrade credentials, enabled social-provider
526
- client id/secret pairs, and R2 presign credential env names are included as
527
- well. Cloudflare social auth now reads those credentials from the Worker `env`
528
- binding instead of relying on `process.env` compatibility behavior. Named
529
- targets also reject every generated top-level custom-domain source — including
530
- runtime routes, the primary/CMS/Account/Admin/Auth/API domains, and app domains
531
- or aliases — until routes can be declared with explicit per-environment
532
- ownership; top-level routes can no longer produce an ambiguous deployment
533
- target.
534
-
535
- Named targets are currently limited to Neon Hyperdrive with Better Auth.
536
- External auth remains fail-closed until its service binding can be declared
537
- independently for every named environment.
538
-
539
- For named-environment projects, the base Worker has no deployable stateful
540
- bindings, local development selects a named target, and that selected target
541
- is always the required logical `dev` environment, which must own an explicit
542
- development-only Hyperdrive `localConnectionString`. Quickback emits it only
543
- in the selected named binding, rejects a top-level
544
- override when named environments exist, and rejects local URLs on staging or
545
- production targets; deployed targets continue to resolve the remote
546
- Hyperdrive configuration by ID. The generated package omits the unsafe bare
547
- deploy script. Existing projects that omit
548
- `environments` keep byte-identical Wrangler output and the existing dev/deploy
549
- scripts. See [Neon → Named Cloudflare deployment environments](/platform/database/neon#named-cloudflare-deployment-environments).
550
-
551
- ### Local compiler trust boundary and deterministic Drizzle commands
552
-
553
- The supported Docker launcher now opts into unauthenticated local compilation
554
- explicitly and publishes the compiler only on `127.0.0.1`; missing or unknown
555
- compiler modes retain hosted authentication. The CLI recognizes only exact
556
- loopback hostnames as local. Migration post-commands now use the configured
557
- package manager's local binary execution form, with npm forced offline and its
558
- implicit install prompt disabled, so a missing `drizzle-kit` fails clearly
559
- instead of fetching an unpinned package.
560
-
561
- ## v0.51.0 — July 12, 2026
562
-
563
- ### Action rate limits now emit — documented since the rate-limit pillar, wired now
564
-
565
- The [rate-limit docs](/define/rate-limit#actions) have described
566
- per-action rate limiting since the pillar shipped: record-based actions inherit
567
- the resource's `update` bucket, standalone actions inherit the project-default
568
- `update` bucket, and actions may declare a `rateLimit` override or opt out with
569
- `rateLimit: false`. The generated routes never contained the checks. They now
570
- do, exactly per the documented contract:
571
-
572
- - Record-based actions (and their bulk variants, which share the same counter —
573
- one token per batch request) are keyed
574
- `<resource>:action:<name>:<user>`; standalone actions are keyed
575
- `standalone:<declaredPath>:<user>`. The `:action:`/`standalone:` infixes mean
576
- action counters never collide with CRUD counters.
577
- - `rateLimit: { limit, period }` on an action emits its own binding
578
- (deduped by tuple, same `RL_<limit>_<period>` scheme); `rateLimit: false`
579
- opts the action out entirely.
580
- - Record-based action routes are now **exempted** from the per-resource CRUD
581
- catch-all middleware. Previously a `POST /:id/approve` was incidentally
582
- counted against the resource's `create` bucket — wrong bucket, wrong key.
583
- - Actions-only (tableless) projects now provision the project-default binding;
584
- previously they shipped with none.
585
-
586
- **Behavior change:** standalone actions were previously *unlimited*; they now
587
- inherit the project-default `update` bucket (200 requests / 60s per user/IP
588
- with shipped defaults). PUBLIC webhook-style endpoints that absorb provider
589
- bursts should declare their own budget (`rateLimit: { limit: 1000, period: 10 }`)
590
- or opt out (`rateLimit: false`). The compiler emits a warning when a PUBLIC
591
- standalone action silently inherits the default, so affected actions are
592
- flagged at compile time.
593
-
594
- ### Better Auth CLI pinned and shipped as a generated devDependency
595
-
596
- The generated `auth:schema` script runs `npx better-auth generate`, but the
597
- `better-auth` runtime package ships no executable — the `better-auth` bin
598
- lives in the npm package `auth` (the official Better Auth CLI; the team took
599
- over that name at 1.5.0, superseding the frozen `@better-auth/cli`). Generated
600
- projects now declare `auth` as a devDependency pinned to the runtime's minor
601
- line, so `npm run auth:schema` resolves the CLI locally instead of requiring a
602
- global install. The compiler image's global CLI is pinned to the same version,
603
- eliminating silent skew between the CLI on `latest` and the pinned runtime.
604
-
605
- ### Compile warning when an action's input schema degrades to untyped
606
-
607
- When action input schemas aren't harvested client-side (older CLI, or a direct
608
- `/compile` API call), the static Zod parser supplies OpenAPI/MCP input schemas
609
- — and silently degrades unrecognized constructs (discriminated unions,
610
- refinements, `z.record`, transforms) to the accept-anything `{}`. That
611
- degradation is no longer silent: the compile result now carries a warning per
612
- affected action naming the route, source file, and the exact untyped field
613
- paths. Actions covered by the CLI harvest are never warned on, and actions
614
- that declare no input are skipped.
615
-
616
- ### Auth docs: JWT security posture stated up front
617
-
618
- The [Auth & JWT page](/configure/auth) now leads with the posture
619
- summary instead of burying it: the default 180-second auto-refreshed TTL plus
620
- `revocationCheck: 'kv'` (seconds-level revocation, auto-stamped on ban /
621
- member removal / role change / scope-conferring row changes) is the
622
- recommended configuration and covers the vast majority of deployments — with
623
- the residual trade-offs (per-principal granularity, fail-open on KV outage,
624
- ~60s cross-PoP propagation) stated explicitly for strict threat models.
625
-
626
- ### Neon via-user reads: generated list handlers now typecheck against the concretely-typed service handle
627
-
628
- On Neon, a read firewall carrying a via-user multi-hop relationship predicate
629
- routes the generated read handlers to `createServiceDb(c.env)` — a genuine
630
- `NeonHttpDatabase<typeof schema>` — instead of the loosely-typed request db.
631
- The list handler's query construction declared drizzle select builders with
632
- `let` and reassigned them (`query = query.where(…)`, `.orderBy(…)`,
633
- `.limit(…).offset(…)`, and the count/aggregation/group-by variants), which is
634
- a type error against drizzle's immutable builder typing: `.where()` returns
635
- `Omit<PgSelectBase<…>, "where">`, not the declared type. Every affected
636
- declaration now appends `.$dynamic()`, drizzle's sanctioned mode for
637
- incremental query building — types only; the emitted SQL is unchanged. Reads
638
- routed through `c.get('db')` were never affected at runtime (the handler code
639
- is identical); they simply never surfaced the latent typing defect because the
640
- request-db handle is not concretely typed. The Neon output `tsc` gate now also
641
- stages the emitted service-read route files (via-user fixture) with a control
642
- that re-strips `.$dynamic()` and asserts the failure, so query-builder typing
643
- regressions in generated route files fail CI.
644
-
645
- ### ws-ticket minting now accepts all three authorization vocabularies
646
-
647
- `POST /broadcast/v1/ws-ticket` could previously be gated only by an authz
648
- relationship role (`wsTicket.role`) or a namespace. The mint gate now takes an
649
- explicit discriminated `access` form — the arm names the vocabulary, so a bare
650
- name can never silently shadow across vocabularies:
651
-
652
- - `access: { roles: ["member+"] }` — **org-membership roles**, with
653
- `auth.roleHierarchy` `+` expansion (compile error without a hierarchy).
654
- Firewall-consistent: the route verifies the caller's org role **and** that
655
- the requested `scopeTable` row belongs to the caller's *active* organization
656
- — an org-A member cannot mint a ticket to org B's room. Requires an
657
- organization column on the scope table (compile error otherwise). UPPERCASE
658
- pseudo-roles are rejected: a `PUBLIC`/`AUTHENTICATED` ticket factory would
659
- hand signed room credentials to callers with no org standing.
660
- - `access: { authzRole: "attendee" }` — the existing **relationship-role**
661
- gate, unchanged. The legacy `role: "attendee"` string remains the shorthand
662
- and compiles byte-identically (regression-pinned against a golden fixture).
663
- - `access: { fga: { relation: "viewer", object: "event:{id}" } }` — an **FGA
664
- relation** on the object derived from the tenant-bound scope row. The object
665
- template is the read path's `access: { fga }` language, and the check runs
666
- through the same org-scoped evaluator (`ctx.fga.check`) — not a second one.
667
- The object type and relation are validated against the `authz.fga` model at
668
- compile time; a non-tenant-scoped `scopeTable` is rejected like the
669
- namespace path.
670
-
671
- Everything fails closed at compile time with actionable errors: exactly one
672
- authorization source (`access` never coexists with `role` or `namespace`),
673
- exactly one `access` arm, ambiguous names living in two vocabularies, missing
674
- hierarchy, missing FGA model, and missing organization columns all fail the
675
- build. See [Realtime](/platform/realtime#enabling-realtime).
676
-
677
-
678
- ## v0.50.8 — July 12, 2026
679
-
680
- > No changelog entry was written for this release. Reconstructed from git:
681
- > audit-wrapper coverage for `onConflictDoUpdate` upserts (`e8e208c6`, #121), a
682
- > `Date`-stamped `onConflict` in the Neon `upsertBatch` path (`4fd78f77`, #120),
683
- > and compile-outcome telemetry (`84e6c1d1`).
684
-
685
- ## v0.50.7 — July 12, 2026
686
-
687
- > No changelog entry was written for this release. Reconstructed from git: a
688
- > version bump only, to clear an npm publish collision on `0.50.6`
689
- > (`b4292c05`).
690
-
691
- ## v0.50.6 — July 12, 2026
692
-
693
- ### Neon hyperdrive: generated `env.d.ts` now types the `HYPERDRIVE` binding
694
-
695
- `connectionMode: "hyperdrive"` projects emit a `[[hyperdrive]] binding =
696
- "HYPERDRIVE"` wrangler block and a db runtime that requires
697
- `env.HYPERDRIVE.connectionString` — but the generated `src/env.d.ts` omitted
698
- the binding, so every generated `createDb(c.env)` / `createServiceDb(c.env)`
699
- call site (middleware, routes, webhooks, seal routes) failed `tsc` with
700
- `Property 'HYPERDRIVE' is missing in type 'CloudflareBindings'`. The Env
701
- interface now declares `HYPERDRIVE: Hyperdrive` (the `@cloudflare/workers-types`
702
- global) whenever the resolved Neon connection mode is `hyperdrive`. The
703
- wrangler-binding completeness matrix gained neon http/hyperdrive cases pinning
704
- `env.d.ts` ↔ `wrangler.toml` agreement, and a new test typechecks the real
705
- emitted env/db files with the exact generated call shape.
706
-
707
- ### Neon hyperdrive: typed action `db` accepts explicit values for defaulted columns
708
-
709
- On the hyperdrive typed action surface, `db.insert(table).values({ id: ..., ... })`
710
- failed `tsc` with `'id' does not exist in type 'QbPgScopedInsertValue<…>'` for
711
- any column with a schema default — explicit ids on `$defaultFn` primary keys,
712
- explicit `status` on defaulted enums, explicit audit timestamps. The scoped
713
- insert model was derived from drizzle's `PgInsertValue<TTable>`, which drops
714
- every optional (defaulted) key when instantiated through a generic type
715
- parameter under TypeScript 5.9. It is now derived from the table's own
716
- `$inferInsert` (which survives generic instantiation), preserving optionality
717
- and drizzle's per-column `SQL | Placeholder` escape hatch. Required columns,
718
- unknown-column rejection, and the auto-scope-column relaxation
719
- (`organizationId`/`ownerId`/`teamId` optional) are unchanged. Note: pg
720
- `timestamp` columns are `Date`-typed — passing `new Date().toISOString()`
721
- (the D1 string convention) into a typed insert or update still fails `tsc`,
722
- matching stock drizzle semantics; pass a `Date`.
723
-
724
- ### Production 500 bodies are now generic — error internals stay in the logs
725
-
726
- Unhandled-error responses (`INTERNAL_ERROR` from the global `onError`,
727
- `ACTION_EXECUTION_FAILED` from action handlers) previously forwarded the
728
- underlying error message, cause-chain message, and the top three stack frames
729
- in the response body by default. Those can carry SQL fragments, file paths, or
730
- secrets, so the default body is now generic: `{ error, code, layer, hint,
731
- requestId }` plus `details.name` (error class only) on action failures. The
732
- full error — message, cause, stack — is always `console.error`'d keyed by the
733
- `requestId` echoed in the body. Setting `EXPOSE_ERROR_STACK=1` (dev/staging)
734
- restores the verbose body: message, `details.cause`, sanitized
735
- `details.frames`, and the full `details.stack`. See
736
- [Errors](/api/errors#exposing-error-details-in-dev--staging).
737
-
738
- ### wrangler.toml now declares every binding the generated code references
739
-
740
- Two configurations generated code referencing a binding that `wrangler.toml`
741
- never declared — the env key was `undefined` at runtime and the first use 500s:
742
-
743
- - **Resource-level realtime** (`realtime: { enabled: true }` on a table,
744
- without the top-level `realtime: true` database flag) emitted the realtime
745
- routes, the `BROADCASTER` env type, and the worker's `Broadcaster` DO export,
746
- but no `[[durable_objects.bindings]]` / `[[migrations]]` block — every
747
- broadcast failed at runtime. The wrangler emitter now derives realtime from
748
- the same resolved surface as the rest of the compiler (top-level flag OR any
749
- resource opt-in), so the DO binding and migration are always emitted together
750
- with the code that uses them.
751
- - **`splitDatabases: false` + webhooks** dropped the `WEBHOOKS_DB`
752
- `[[d1_databases]]` block that the generated webhooks lib reads. Single-db
753
- projects with webhooks now get the block, matching split mode.
754
-
755
- A compile-level test matrix (split on/off × files × webhooks × realtime) now
756
- pins binding uniqueness and completeness: every `D1Database` /
757
- `DurableObjectNamespace` binding typed in `src/env.d.ts` appears in
758
- `wrangler.toml` exactly once.
759
-
760
- ## v0.50.5 — July 12, 2026
761
-
762
- > No changelog entry was written for this release. Reconstructed from git: a Neon
763
- > role-bootstrap fix for fresh PG16+ deploys — `GRANT quickback_owner … WITH SET`
764
- > (`ff175ccc`). The rest of the window is `quickback start` funnel work that does
765
- > not affect compiled output.
766
-
767
- ## v0.50.4 — July 12, 2026
768
-
769
- ### Security: three fail-closed fixes in the generated runtime
770
-
771
- - **Scoped `db` blocks Drizzle's relational query API.** `db.query.<table>.findFirst()` / `findMany()` build their SQL outside the scoped wrapper's reach, so they read across organizations. The scoped `db` handed to actions now **throws** on any `db.query.<table>` access (and the Neon hyperdrive typed `db`/`tx` fails `tsc` on it) with directions to `db.select()` (auto-scoped) or an `unsafe: true` action's `unsafeDb.query` with an explicit scope predicate. Handlers that relied on the unscoped pass-through were reading other tenants' rows and must be updated. See [Scoped relational-query safety](/define/actions/scoped-db#scoped-relational-query-safety).
772
- - **`POST /api/v1/token` requires session authentication.** The auth middleware now stamps `ctx.authMethod` (`'session' | 'jwt' | 'api-key' | 'oauth'`), and the token endpoint rejects anything but `'session'` with `401 AUTH_SESSION_REQUIRED`. Pre-fix, a JWT could mint its own replacement — a stolen or revoked token (banned user, removed member, demoted role) could roll a 180s-TTL token forever without re-validating the session.
773
- - **Broadcaster DO no longer trusts the `X-Internal-Call` header alone.** Inline-mode `checkAuth` now requires `X-Internal-Secret` to match `BETTER_AUTH_SECRET` (already provisioned; the secret never leaves the worker/DO boundary on a stub call), separate mode compares `ACCESS_TOKEN` constant-time, and every generated internal caller (`lib/realtime.ts` senders, the live-view seq reader, the Better Auth role-change hook) sends the secret. A spoofed header can no longer reach broadcast injection or webhook repointing through any forwarded route.
774
-
775
- ## v0.50.3 — July 11, 2026
776
-
777
- ### Neon reads through user-anchored relationships
778
-
779
- Resources readable via a multi-hop chain anchored on the caller's user id (e.g. a
780
- conference attendee reaching their own registrations through
781
- `person_account_links → people → event_people → registrations`) now work on Neon.
782
- Declare the chain once with the `hops` form on an `authz.relationships` entry and
783
- reference it from a resource `firewall` via `{ field, via }`. Because the
784
- correlated multi-hop join reaches across intermediate tables that each `FORCE ROW
785
- LEVEL SECURITY`, caller-claims RLS would deny such a read to zero rows — so the
786
- compiler routes **only that resource's read handlers** (collection `GET /`,
787
- `GET /:id`, and views) through the service-role handle (`createServiceDb`), with
788
- the compiled app-layer reachability WHERE as the sole row filter. Org/owner/team
789
- reads are untouched (caller claims + RLS backstop); writes are unchanged. The
790
- swap is fail-closed — a service-handle read with no firewall WHERE is a compile
791
- error. The anchor table is required to be caller-read-own on the subject column
792
- and service-role-write-only (a forgeable link would mint reachability to a
793
- victim's data); this link-integrity check is target-independent and fails the
794
- compile on **both** Neon and D1. The same config compiles identically on D1,
795
- where the app-layer WHERE was already the whole firewall. See
796
- [Reads through a user-anchored relationship](/platform/database/neon#reads-through-a-user-anchored-relationship).
797
-
798
- ## v0.50.2 — July 11, 2026
799
-
800
- ### Neon interactive transactions via Hyperdrive
801
-
802
- A Neon project can now opt into `connectionMode: 'hyperdrive'` to run its feature
803
- database over a Cloudflare Hyperdrive binding (`postgres.js` /
804
- `drizzle-orm/postgres-js`), unlocking **real interactive transactions** in
805
- generated actions: read current state, lock it (`for update`), decide in
806
- TypeScript, then write dependent rows — committed atomically, rolled back on
807
- throw. `tx` is fully schema-typed (invalid columns fail `tsc`), the verified RLS
808
- claims run as the first transaction-local statement inside the transaction (no
809
- leak across the connection pool), and Hyperdrive query caching is force-disabled
810
- (ETags cache at the correct post-auth layer). `http` mode stays the lightweight
811
- batch-only default and is byte-identical; requesting `db.transaction()` outside
812
- hyperdrive mode is a fail-closed compile error. WebSocket mode is deprecated —
813
- Hyperdrive supersedes it as the full-capability path. See
814
- [Interactive transactions](/platform/database/neon#interactive-transactions).
815
-
816
- ### Neon migration & environment tooling
817
-
818
- `environments` config maps dev/staging/prod to Neon branches + Cloudflare envs;
819
- `quickback canary <env>` branches the target DB, applies pending migrations to
820
- the branch, diffs, and (with `--apply`) promotes — verifying schema changes
821
- against real state before they touch a live environment. Record-condition
822
- firewall predicates now lower to Postgres RLS policy arms (enforced twice — app
823
- layer and database). Opt-in API `contract.version` scaffolding landed (`v1`
824
- default; `v2` fail-closed pending completion).
825
-
826
- ## v0.50.1 — July 10, 2026
827
-
828
- > No changelog entry was written for this release. Reconstructed from git: Neon
829
- > driver 1.1 compatibility (claim-scoped SQL wrapper, `9a3e82a5`) and
830
- > migration-journal hardening — admin-runnable Drizzle journal, UNIQUE-before-FK
831
- > ordering (`88697e0b`).
832
-
833
- ## v0.50.0 — July 10, 2026
834
-
835
- ### Neon PostgreSQL reaches deploy parity with D1
836
-
837
- A Neon-backed service now compiles, typechecks, migrates, and deploys with the
838
- same capability surface as a D1 service — over HTTP (`@neondatabase/serverless`),
839
- the Cloudflare default. There is no Hyperdrive binding and no Neon Authorize /
840
- JWKS configuration: the Worker verifies each caller, then writes the trusted
841
- user/org/team context into transaction-local Postgres settings
842
- (`set_config('request.jwt.claim.sub' | 'org_id' | 'team_id', …, true)`) as the
843
- first statement of every query batch. RLS reads them through a compiler-defined
844
- `auth.user_id()` shim and the `get_active_org_id()` helper — **not** a persisted
845
- `user_sessions` mirror (which never shipped).
846
-
847
- - **Background contexts run under a service-role handle.** Queue consumers, cron
848
- schedules, and cross-tenant `unsafe` actions acquire `createServiceDb(env)`,
849
- which sets `quickback.service_role = 'true'` (all request claims cleared);
850
- every feature table carries a `<table>_service_role` RLS policy admitting
851
- exactly that context. Unsafe-action audit events are unchanged.
852
- - **Webhooks port to a `webhooks` Postgres schema** in the same database (no
853
- `WEBHOOKS_DB` binding). `webhooksBinding` is a pure enable flag on Neon; the
854
- D1-only `webhooksDatabaseId` / `webhooksDatabaseName` keys are rejected. The
855
- store is service-role-only.
856
- - **`.encrypted()` / `.sealed()` columns are supported** on Neon over HTTP: the
857
- key/vault tables fold into the journaled migration set with org-scoped and
858
- service-role-only RLS.
859
- - **Batch transactions advertise the truth.** Neon HTTP is fail-fast and
860
- non-transactional (`meta.transactional: false`, like D1) because
861
- `drizzle-orm/neon-http` has no interactive transactions; Neon WebSocket
862
- (Node/Bun) gets real rollback (`meta.transactional: true`).
863
- - **Deploy glue matches D1:** a generated `deploy` script
864
- (`npm run db:migrate && wrangler deploy`), a boot check asserting
865
- `DATABASE_URL`, `.dev.vars.example` (wrangler dev reads `.dev.vars`, not
866
- `.env`) gitignored, and `drizzle.config.ts` preferring
867
- `DATABASE_MIGRATION_URL ?? DATABASE_URL` for the privileged migration role.
868
- - **Fail-closed capability gates:** managed file storage (use presign-only R2),
869
- the Better Auth `subscriptions` plugin, raw `sqliteTable` interop sources on a
870
- Postgres target, and — under WebSocket mode — webhooks / unsafe actions /
871
- encrypted columns are all compile-time errors rather than silently-broken
872
- output. Mixed database providers remain unsupported.
873
- - **Docs corrected:** the [Neon page](/platform/database/neon)
874
- no longer describes Neon Authorize, a `user_sessions` table, or Hyperdrive —
875
- none of which the compiler emits.
876
- - **Migration-journal hardening.** The role bootstrap now grants
877
- `quickback_admin` everything the pinned Drizzle runner's journal needs —
878
- database-level `CREATE` (so `CREATE SCHEMA IF NOT EXISTS drizzle` passes even
879
- as a no-op) plus ownership of the `drizzle` schema and
880
- `drizzle.__drizzle_migrations` — so routine migrates after the owner-run
881
- bootstrap need no owner credential. Generated Postgres migrations are also
882
- post-processed so a referenced composite `UNIQUE` / `PRIMARY KEY` constraint
883
- always precedes the foreign keys that consume it (an upgrade delta applies
884
- unedited instead of failing with "no unique constraint matching given keys").
885
-