@quickback-dev/cli 0.10.16 → 0.10.20

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 (249) hide show
  1. package/dist/commands/compile.d.ts.map +1 -1
  2. package/dist/commands/compile.js +40 -2
  3. package/dist/commands/compile.js.map +1 -1
  4. package/dist/docs/content.js +6 -6
  5. package/dist/docs/content.js.map +1 -1
  6. package/dist/index.js +1 -1
  7. package/dist/skill/SKILL.md +142 -1051
  8. package/dist/skill/agents/quickback-specialist/AGENT.md +36 -0
  9. package/dist/skill/docs/changelog.md +1192 -0
  10. package/dist/skill/docs/compiler/claude-code-skill.md +312 -0
  11. package/dist/skill/docs/compiler/cloud-compiler/authentication.md +63 -0
  12. package/dist/skill/docs/compiler/cloud-compiler/cli.md +307 -0
  13. package/dist/skill/docs/compiler/cloud-compiler/endpoints.md +78 -0
  14. package/dist/skill/docs/compiler/cloud-compiler/index.md +65 -0
  15. package/dist/skill/docs/compiler/cloud-compiler/local-compiler.md +115 -0
  16. package/dist/skill/docs/compiler/cloud-compiler/troubleshooting.md +76 -0
  17. package/dist/skill/docs/compiler/config/agents.md +144 -0
  18. package/dist/skill/docs/compiler/config/auth.md +109 -0
  19. package/dist/skill/docs/compiler/config/bindings.md +176 -0
  20. package/dist/skill/docs/compiler/config/domains.md +149 -0
  21. package/dist/skill/docs/compiler/config/index.md +419 -0
  22. package/dist/skill/docs/compiler/config/output.md +338 -0
  23. package/dist/skill/docs/compiler/config/providers.md +248 -0
  24. package/dist/skill/docs/compiler/config/security.md +255 -0
  25. package/dist/skill/docs/compiler/config/single-tenant.md +128 -0
  26. package/dist/skill/docs/compiler/config/variables.md +157 -0
  27. package/dist/skill/docs/compiler/definitions/access.md +445 -0
  28. package/dist/skill/docs/compiler/definitions/actions.md +884 -0
  29. package/dist/skill/docs/compiler/definitions/concepts.md +52 -0
  30. package/dist/skill/docs/compiler/definitions/feature.md +164 -0
  31. package/dist/skill/docs/compiler/definitions/firewall.md +285 -0
  32. package/dist/skill/docs/compiler/definitions/guards.md +241 -0
  33. package/dist/skill/docs/compiler/definitions/index.md +219 -0
  34. package/dist/skill/docs/compiler/definitions/masking.md +241 -0
  35. package/dist/skill/docs/compiler/definitions/read.md +220 -0
  36. package/dist/skill/docs/compiler/definitions/schema.md +697 -0
  37. package/dist/skill/docs/compiler/definitions/validation.md +35 -0
  38. package/dist/skill/docs/compiler/definitions/views.md +292 -0
  39. package/dist/skill/docs/compiler/getting-started/claude-code.md +126 -0
  40. package/dist/skill/docs/compiler/getting-started/full-example.md +431 -0
  41. package/dist/skill/docs/compiler/getting-started/hand-crafted.md +178 -0
  42. package/dist/skill/docs/compiler/getting-started/index.md +192 -0
  43. package/dist/skill/docs/compiler/getting-started/patterns.md +225 -0
  44. package/dist/skill/docs/compiler/getting-started/template-blog.md +280 -0
  45. package/dist/skill/docs/compiler/getting-started/template-cloudflare.md +260 -0
  46. package/dist/skill/docs/compiler/getting-started/template-empty.md +112 -0
  47. package/dist/skill/docs/compiler/getting-started/templates.md +111 -0
  48. package/dist/skill/docs/compiler/index.md +85 -0
  49. package/dist/skill/docs/compiler/targets/hono-api/cloudflare.md +94 -0
  50. package/dist/skill/docs/compiler/targets/hono-api/database/d1.md +246 -0
  51. package/dist/skill/docs/compiler/targets/hono-api/database/index.md +16 -0
  52. package/dist/skill/docs/compiler/targets/hono-api/database/neon.md +144 -0
  53. package/dist/skill/docs/compiler/targets/hono-api/database/using-d1.md +39 -0
  54. package/dist/skill/docs/compiler/targets/hono-api/index.md +37 -0
  55. package/dist/skill/docs/compiler/targets/hono-api/using-the-api/actions-api.md +323 -0
  56. package/dist/skill/docs/compiler/targets/hono-api/using-the-api/batch-operations.md +357 -0
  57. package/dist/skill/docs/compiler/targets/hono-api/using-the-api/caching.md +105 -0
  58. package/dist/skill/docs/compiler/targets/hono-api/using-the-api/crud.md +652 -0
  59. package/dist/skill/docs/compiler/targets/hono-api/using-the-api/errors.md +224 -0
  60. package/dist/skill/docs/compiler/targets/hono-api/using-the-api/index.md +37 -0
  61. package/dist/skill/docs/compiler/targets/hono-api/using-the-api/openapi.md +203 -0
  62. package/dist/skill/docs/compiler/targets/hono-api/using-the-api/query-params.md +199 -0
  63. package/dist/skill/docs/compiler/targets/hono-api/using-the-api/views-api.md +161 -0
  64. package/dist/skill/docs/compiler/targets/index.md +47 -0
  65. package/dist/skill/docs/compiler/targets/supabase-rls/index.md +55 -0
  66. package/dist/skill/docs/compiler/targets/supabase-rls/limitations.md +48 -0
  67. package/dist/skill/docs/compiler/targets/supabase-rls/mappings.md +99 -0
  68. package/dist/skill/docs/compiler/targets/supabase-rls/setup.md +88 -0
  69. package/dist/skill/docs/compiler/troubleshooting.md +120 -0
  70. package/dist/skill/docs/index.md +77 -0
  71. package/dist/skill/docs/stack/account-ui/customization.md +378 -0
  72. package/dist/skill/docs/stack/account-ui/environment-variables.md +325 -0
  73. package/dist/skill/docs/stack/account-ui/features/admin.md +76 -0
  74. package/dist/skill/docs/stack/account-ui/features/api-keys.md +22 -0
  75. package/dist/skill/docs/stack/account-ui/features/avatars.md +37 -0
  76. package/dist/skill/docs/stack/account-ui/features/cli-authorize.md +21 -0
  77. package/dist/skill/docs/stack/account-ui/features/index.md +291 -0
  78. package/dist/skill/docs/stack/account-ui/features/organizations.md +29 -0
  79. package/dist/skill/docs/stack/account-ui/features/passkeys.md +31 -0
  80. package/dist/skill/docs/stack/account-ui/features/passwordless.md +28 -0
  81. package/dist/skill/docs/stack/account-ui/features/sessions.md +20 -0
  82. package/dist/skill/docs/stack/account-ui/hooks.md +209 -0
  83. package/dist/skill/docs/stack/account-ui/index.md +147 -0
  84. package/dist/skill/docs/stack/account-ui/library-usage.md +257 -0
  85. package/dist/skill/docs/stack/account-ui/standalone.md +149 -0
  86. package/dist/skill/docs/stack/account-ui/with-quickback.md +160 -0
  87. package/dist/skill/docs/stack/account-ui/worker.md +362 -0
  88. package/dist/skill/docs/stack/auth/api-keys.md +15 -0
  89. package/dist/skill/docs/stack/auth/device-auth.md +14 -0
  90. package/dist/skill/docs/stack/auth/index.md +64 -0
  91. package/dist/skill/docs/stack/auth/jwt-optimization.md +245 -0
  92. package/dist/skill/docs/stack/auth/plugins/aws-ses.md +127 -0
  93. package/dist/skill/docs/stack/auth/plugins/combo-auth.md +74 -0
  94. package/dist/skill/docs/stack/auth/plugins/index.md +228 -0
  95. package/dist/skill/docs/stack/auth/plugins/upgrade-anonymous.md +155 -0
  96. package/dist/skill/docs/stack/auth/security.md +455 -0
  97. package/dist/skill/docs/stack/auth/using-auth.md +39 -0
  98. package/dist/skill/docs/stack/cms/actions.md +199 -0
  99. package/dist/skill/docs/stack/cms/components.md +479 -0
  100. package/dist/skill/docs/stack/cms/connecting.md +199 -0
  101. package/dist/skill/docs/stack/cms/dashboard.md +39 -0
  102. package/dist/skill/docs/stack/cms/index.md +158 -0
  103. package/dist/skill/docs/stack/cms/inline-editing.md +136 -0
  104. package/dist/skill/docs/stack/cms/pages.md +275 -0
  105. package/dist/skill/docs/stack/cms/record-layouts.md +151 -0
  106. package/dist/skill/docs/stack/cms/schema-format.md +437 -0
  107. package/dist/skill/docs/stack/cms/schema-registry.md +200 -0
  108. package/dist/skill/docs/stack/cms/security.md +203 -0
  109. package/dist/skill/docs/stack/cms/table-views.md +142 -0
  110. package/dist/skill/docs/stack/index.md +65 -0
  111. package/dist/skill/docs/stack/queues/handlers.md +317 -0
  112. package/dist/skill/docs/stack/queues/index.md +56 -0
  113. package/dist/skill/docs/stack/queues/using-queues.md +192 -0
  114. package/dist/skill/docs/stack/realtime/durable-objects.md +488 -0
  115. package/dist/skill/docs/stack/realtime/index.md +67 -0
  116. package/dist/skill/docs/stack/realtime/using-realtime.md +211 -0
  117. package/dist/skill/docs/stack/storage/index.md +17 -0
  118. package/dist/skill/docs/stack/storage/kv.md +204 -0
  119. package/dist/skill/docs/stack/storage/r2.md +232 -0
  120. package/dist/skill/docs/stack/storage/using-kv.md +70 -0
  121. package/dist/skill/docs/stack/storage/using-r2.md +55 -0
  122. package/dist/skill/docs/stack/vector/embeddings.md +554 -0
  123. package/dist/skill/docs/stack/vector/index.md +44 -0
  124. package/dist/skill/docs/stack/vector/using-embeddings.md +186 -0
  125. package/dist/skill/docs/stack/webhooks/inbound.md +186 -0
  126. package/dist/skill/docs/stack/webhooks/index.md +36 -0
  127. package/dist/skill/docs/stack/webhooks/outbound.md +281 -0
  128. package/package.json +1 -1
  129. package/src/skill/SKILL.md +142 -1051
  130. package/src/skill/agents/quickback-specialist/AGENT.md +36 -0
  131. package/src/skill/docs/changelog.md +1192 -0
  132. package/src/skill/docs/compiler/claude-code-skill.md +312 -0
  133. package/src/skill/docs/compiler/cloud-compiler/authentication.md +63 -0
  134. package/src/skill/docs/compiler/cloud-compiler/cli.md +307 -0
  135. package/src/skill/docs/compiler/cloud-compiler/endpoints.md +78 -0
  136. package/src/skill/docs/compiler/cloud-compiler/index.md +65 -0
  137. package/src/skill/docs/compiler/cloud-compiler/local-compiler.md +115 -0
  138. package/src/skill/docs/compiler/cloud-compiler/troubleshooting.md +76 -0
  139. package/src/skill/docs/compiler/config/agents.md +144 -0
  140. package/src/skill/docs/compiler/config/auth.md +109 -0
  141. package/src/skill/docs/compiler/config/bindings.md +176 -0
  142. package/src/skill/docs/compiler/config/domains.md +149 -0
  143. package/src/skill/docs/compiler/config/index.md +419 -0
  144. package/src/skill/docs/compiler/config/output.md +338 -0
  145. package/src/skill/docs/compiler/config/providers.md +248 -0
  146. package/src/skill/docs/compiler/config/security.md +255 -0
  147. package/src/skill/docs/compiler/config/single-tenant.md +128 -0
  148. package/src/skill/docs/compiler/config/variables.md +157 -0
  149. package/src/skill/docs/compiler/definitions/access.md +445 -0
  150. package/src/skill/docs/compiler/definitions/actions.md +884 -0
  151. package/src/skill/docs/compiler/definitions/concepts.md +52 -0
  152. package/src/skill/docs/compiler/definitions/feature.md +164 -0
  153. package/src/skill/docs/compiler/definitions/firewall.md +285 -0
  154. package/src/skill/docs/compiler/definitions/guards.md +241 -0
  155. package/src/skill/docs/compiler/definitions/index.md +219 -0
  156. package/src/skill/docs/compiler/definitions/masking.md +241 -0
  157. package/src/skill/docs/compiler/definitions/read.md +220 -0
  158. package/src/skill/docs/compiler/definitions/schema.md +697 -0
  159. package/src/skill/docs/compiler/definitions/validation.md +35 -0
  160. package/src/skill/docs/compiler/definitions/views.md +292 -0
  161. package/src/skill/docs/compiler/getting-started/claude-code.md +126 -0
  162. package/src/skill/docs/compiler/getting-started/full-example.md +431 -0
  163. package/src/skill/docs/compiler/getting-started/hand-crafted.md +178 -0
  164. package/src/skill/docs/compiler/getting-started/index.md +192 -0
  165. package/src/skill/docs/compiler/getting-started/patterns.md +225 -0
  166. package/src/skill/docs/compiler/getting-started/template-blog.md +280 -0
  167. package/src/skill/docs/compiler/getting-started/template-cloudflare.md +260 -0
  168. package/src/skill/docs/compiler/getting-started/template-empty.md +112 -0
  169. package/src/skill/docs/compiler/getting-started/templates.md +111 -0
  170. package/src/skill/docs/compiler/index.md +85 -0
  171. package/src/skill/docs/compiler/targets/hono-api/cloudflare.md +94 -0
  172. package/src/skill/docs/compiler/targets/hono-api/database/d1.md +246 -0
  173. package/src/skill/docs/compiler/targets/hono-api/database/index.md +16 -0
  174. package/src/skill/docs/compiler/targets/hono-api/database/neon.md +144 -0
  175. package/src/skill/docs/compiler/targets/hono-api/database/using-d1.md +39 -0
  176. package/src/skill/docs/compiler/targets/hono-api/index.md +37 -0
  177. package/src/skill/docs/compiler/targets/hono-api/using-the-api/actions-api.md +323 -0
  178. package/src/skill/docs/compiler/targets/hono-api/using-the-api/batch-operations.md +357 -0
  179. package/src/skill/docs/compiler/targets/hono-api/using-the-api/caching.md +105 -0
  180. package/src/skill/docs/compiler/targets/hono-api/using-the-api/crud.md +652 -0
  181. package/src/skill/docs/compiler/targets/hono-api/using-the-api/errors.md +224 -0
  182. package/src/skill/docs/compiler/targets/hono-api/using-the-api/index.md +37 -0
  183. package/src/skill/docs/compiler/targets/hono-api/using-the-api/openapi.md +203 -0
  184. package/src/skill/docs/compiler/targets/hono-api/using-the-api/query-params.md +199 -0
  185. package/src/skill/docs/compiler/targets/hono-api/using-the-api/views-api.md +161 -0
  186. package/src/skill/docs/compiler/targets/index.md +47 -0
  187. package/src/skill/docs/compiler/targets/supabase-rls/index.md +55 -0
  188. package/src/skill/docs/compiler/targets/supabase-rls/limitations.md +48 -0
  189. package/src/skill/docs/compiler/targets/supabase-rls/mappings.md +99 -0
  190. package/src/skill/docs/compiler/targets/supabase-rls/setup.md +88 -0
  191. package/src/skill/docs/compiler/troubleshooting.md +120 -0
  192. package/src/skill/docs/index.md +77 -0
  193. package/src/skill/docs/stack/account-ui/customization.md +378 -0
  194. package/src/skill/docs/stack/account-ui/environment-variables.md +325 -0
  195. package/src/skill/docs/stack/account-ui/features/admin.md +76 -0
  196. package/src/skill/docs/stack/account-ui/features/api-keys.md +22 -0
  197. package/src/skill/docs/stack/account-ui/features/avatars.md +37 -0
  198. package/src/skill/docs/stack/account-ui/features/cli-authorize.md +21 -0
  199. package/src/skill/docs/stack/account-ui/features/index.md +291 -0
  200. package/src/skill/docs/stack/account-ui/features/organizations.md +29 -0
  201. package/src/skill/docs/stack/account-ui/features/passkeys.md +31 -0
  202. package/src/skill/docs/stack/account-ui/features/passwordless.md +28 -0
  203. package/src/skill/docs/stack/account-ui/features/sessions.md +20 -0
  204. package/src/skill/docs/stack/account-ui/hooks.md +209 -0
  205. package/src/skill/docs/stack/account-ui/index.md +147 -0
  206. package/src/skill/docs/stack/account-ui/library-usage.md +257 -0
  207. package/src/skill/docs/stack/account-ui/standalone.md +149 -0
  208. package/src/skill/docs/stack/account-ui/with-quickback.md +160 -0
  209. package/src/skill/docs/stack/account-ui/worker.md +362 -0
  210. package/src/skill/docs/stack/auth/api-keys.md +15 -0
  211. package/src/skill/docs/stack/auth/device-auth.md +14 -0
  212. package/src/skill/docs/stack/auth/index.md +64 -0
  213. package/src/skill/docs/stack/auth/jwt-optimization.md +245 -0
  214. package/src/skill/docs/stack/auth/plugins/aws-ses.md +127 -0
  215. package/src/skill/docs/stack/auth/plugins/combo-auth.md +74 -0
  216. package/src/skill/docs/stack/auth/plugins/index.md +228 -0
  217. package/src/skill/docs/stack/auth/plugins/upgrade-anonymous.md +155 -0
  218. package/src/skill/docs/stack/auth/security.md +455 -0
  219. package/src/skill/docs/stack/auth/using-auth.md +39 -0
  220. package/src/skill/docs/stack/cms/actions.md +199 -0
  221. package/src/skill/docs/stack/cms/components.md +479 -0
  222. package/src/skill/docs/stack/cms/connecting.md +199 -0
  223. package/src/skill/docs/stack/cms/dashboard.md +39 -0
  224. package/src/skill/docs/stack/cms/index.md +158 -0
  225. package/src/skill/docs/stack/cms/inline-editing.md +136 -0
  226. package/src/skill/docs/stack/cms/pages.md +275 -0
  227. package/src/skill/docs/stack/cms/record-layouts.md +151 -0
  228. package/src/skill/docs/stack/cms/schema-format.md +437 -0
  229. package/src/skill/docs/stack/cms/schema-registry.md +200 -0
  230. package/src/skill/docs/stack/cms/security.md +203 -0
  231. package/src/skill/docs/stack/cms/table-views.md +142 -0
  232. package/src/skill/docs/stack/index.md +65 -0
  233. package/src/skill/docs/stack/queues/handlers.md +317 -0
  234. package/src/skill/docs/stack/queues/index.md +56 -0
  235. package/src/skill/docs/stack/queues/using-queues.md +192 -0
  236. package/src/skill/docs/stack/realtime/durable-objects.md +488 -0
  237. package/src/skill/docs/stack/realtime/index.md +67 -0
  238. package/src/skill/docs/stack/realtime/using-realtime.md +211 -0
  239. package/src/skill/docs/stack/storage/index.md +17 -0
  240. package/src/skill/docs/stack/storage/kv.md +204 -0
  241. package/src/skill/docs/stack/storage/r2.md +232 -0
  242. package/src/skill/docs/stack/storage/using-kv.md +70 -0
  243. package/src/skill/docs/stack/storage/using-r2.md +55 -0
  244. package/src/skill/docs/stack/vector/embeddings.md +554 -0
  245. package/src/skill/docs/stack/vector/index.md +44 -0
  246. package/src/skill/docs/stack/vector/using-embeddings.md +186 -0
  247. package/src/skill/docs/stack/webhooks/inbound.md +186 -0
  248. package/src/skill/docs/stack/webhooks/index.md +36 -0
  249. package/src/skill/docs/stack/webhooks/outbound.md +281 -0
@@ -0,0 +1,1192 @@
1
+ # Changelog
2
+
3
+ Release notes for the Quickback compiler, CLI, and platform.
4
+
5
+ ---
6
+
7
+ ## v0.10.20 — May 4, 2026
8
+
9
+ ### In-worker Durable Objects via `bindings.durableObjects[].from`
10
+
11
+ `bindings.durableObjects` previously only emitted the binding declaration — useful for cross-worker DOs (`scriptName: "other-worker"`), but not enough for app-owned classes that live in this worker's source. Authors had to hand-edit `src/index.ts` (to add `export { ItemStream } from './...'`) and `wrangler.toml` (to add the `[[migrations]]` block) on every compile.
12
+
13
+ Adding `from` flips the entry into in-worker mode and the compiler does both:
14
+
15
+ ```ts
16
+ durableObjects: [
17
+ {
18
+ name: "ITEM_STREAM",
19
+ className: "ItemStream",
20
+ from: "features/loops/lib/ItemStream", // module path under src/
21
+ },
22
+ ]
23
+ ```
24
+
25
+ Generates:
26
+ - `src/index.ts`: `export { ItemStream } from './features/loops/lib/ItemStream';` — wrangler resolves the binding by class export.
27
+ - `wrangler.toml`: a `[[migrations]]` block with `tag = "qb-do-ItemStream"` and `new_sqlite_classes = ["ItemStream"]`.
28
+ - `CloudflareBindings`: `ITEM_STREAM: DurableObjectNamespace` so `c.env.ITEM_STREAM.idFromName(...)` typechecks.
29
+
30
+ Where the class file lives: in-worker DO classes go under `quickback/lib/` or `quickback/features/<feature>/lib/` — both copy verbatim into the generated `src/` tree on every compile (the rest of `src/` is wiped). The `from` value is the resulting `src/`-relative path with no `./` prefix and no `.ts` suffix.
31
+
32
+ `from` and `scriptName` are mutually exclusive — the compiler rejects entries that set both. Cross-worker entries (`scriptName` set) skip the re-export and the migration block; the exporting worker owns its own migration table.
33
+
34
+ `migrationTag` (default `qb-do-${className}`) is stable across regenerations and **must never be removed or renamed once deployed** — wrangler tracks applied tags and will reject deploys that try to walk them back. `useSqlite` defaults to `true`; set to `false` for legacy KV-backed DOs.
35
+
36
+ See [Bindings → Durable Objects](/compiler/config/bindings#durableobjects) for the full reference.
37
+
38
+ ---
39
+
40
+ ## v0.10.19 — May 4, 2026
41
+
42
+ ### Fix: bundled-SPA auth survives `wrangler dev` on custom_domain projects
43
+
44
+ `wrangler dev` rewrites the configured `custom_domain` host in **every** response header value (Location, Content-Security-Policy, X-…) to the local hostname, with a case-sensitive substring matcher. That mangles the CSP `connect-src` for projects with `domain: "api.example.com"` + bundled CMS / Account SPAs:
45
+
46
+ ```
47
+ # Compiled (correct)
48
+ connect-src 'self' https://api.example.com …
49
+
50
+ # Served by wrangler dev (mangled)
51
+ connect-src 'self' https://localhost:8787 …
52
+ ```
53
+
54
+ Result: the bundled SPA's hardcoded `VITE_QUICKBACK_API_URL` fetches get blocked in dev because the CSP only allows localhost. Reported by Loop on the 0.10.18 thread; verified end-to-end with a minimal `wrangler@4.85.0 dev --local` repro.
55
+
56
+ The compiler now emits the SPA-baked-origin literal in `connect-src` with the host's first letter capitalised (`https://Api.example.com`). CSP host-source matching is ASCII case-insensitive per CSP3, so browsers accept it for connections to `https://api.example.com`; wrangler's case-sensitive matcher misses it. The case-shift is applied at compile time and only to URLs whose host matches the configured `custom_domain` — other origins (localhost, third-party hosts) are unchanged.
57
+
58
+ `TRUSTED_ORIGINS` keeps its lowercase prod entries: it's consumed by the CORS `isTrustedOrigin` check via `Array.includes()` against the browser-supplied Origin header (always lowercase). The CSP fix only needs to land on the SPA-baked literal — that's the entry the SPA's hardcoded fetch needs covered.
59
+
60
+ If wrangler ships a fix for the response-header rewrite, the case-shifted source remains a valid CSP entry that browsers match identically — no follow-up needed in user code.
61
+
62
+ **Action required:** none. Recompile (`quickback compile`) to pick up the fix.
63
+
64
+ ---
65
+
66
+ ## v0.10.18 — May 2, 2026
67
+
68
+ ### `experimentalRemote` — share deployed D1 with `wrangler dev`
69
+
70
+ Per-binding `experimental_remote = true` flag emitted into the generated `wrangler.toml`. Useful for "share prod auth in dev, keep feature writes sandboxed":
71
+
72
+ ```ts
73
+ providers: {
74
+ database: defineDatabase("cloudflare-d1", {
75
+ splitDatabases: true,
76
+ experimentalRemote: {
77
+ auth: true, // wrangler dev reads/writes deployed AUTH_DB
78
+ features: false, // (default) features stays local
79
+ audit: false,
80
+ webhooks: false,
81
+ files: false,
82
+ },
83
+ }),
84
+ }
85
+ ```
86
+
87
+ Keys are logical binding names — `auth` flips the flag on the `AUTH_DB` binding, `features` flips it on `DB` (or the legacy single-DB binding), `audit` / `webhooks` / `files` follow the same pattern. Off by default; only enable for databases you intend to share.
88
+
89
+ ### Google OAuth + signup ToS
90
+
91
+ The Account SPA now wires Google OAuth end-to-end when `auth.providers.auth.config.socialProviders.google.enabled: true`. The compiler bakes the right `VITE_ENABLE_GOOGLE_OAUTH` flag into the SPA's `.env` so the social-login button renders only when the provider is enabled — no more dead buttons.
92
+
93
+ Signup flow gains a Terms-of-Service checkbox gate (configurable via the Account SPA's branding config).
94
+
95
+ ### CLI compile auth gate + device-auth redirect fix
96
+
97
+ - `quickback compile` now requires authentication for cloud-compiler runs (closes the unauth public-compile path).
98
+ - The device-flow `/cli/authorize` page was sending `?returnTo=` to login, but `signup.tsx` and the `_authenticated` middleware only read `?redirect=` — so a user who clicked "Create one" from `/login` lost the return URL. Standardized on `?redirect=` everywhere.
99
+
100
+ ### Skill restructure (Claude Code skill)
101
+
102
+ The bundled Claude Code skill was reorganized for clarity:
103
+
104
+ - `SKILL.md` is now a thin orientation pointer, not a 600-line dump
105
+ - Reference docs split into `Compiler` and `Stack` sections
106
+ - Docs bundled as **files** the model navigates with `Read` / `Glob` rather than via `quickback docs <topic>` shell calls — same content, fewer tool calls per lookup
107
+ - Tightened against audit gaps surfaced by red-team review
108
+
109
+ Run `quickback claude install` to pick up the new skill layout.
110
+
111
+ ---
112
+
113
+ ## v0.10.17 — May 2, 2026
114
+
115
+ ### Security fix: CSP auto-config no longer widens `default-src`
116
+
117
+ When 0.10.15's auto-config was asked to add a value to a directive the user hadn't declared (e.g. `https://fonts.googleapis.com` → `style-src` when only `default-src` was set), it incorrectly pushed the value into `default-src` itself. Because CSP3 fall-back semantics make `default-src` the fallback for `script-src`, `img-src`, `media-src`, and others, this widened the attack surface to every directive that fell back to it — a `style-src`-only host became reachable from `script-src`.
118
+
119
+ 0.10.17 fixes the logic: missing target directives are now **scaffolded** with the user's `default-src` values as baseline, then extended with the auto-config addition. `default-src` stays clean. The new directive (e.g. `style-src`) covers exactly the styles the SPA needs and nothing else.
120
+
121
+ Before (0.10.16):
122
+ ```
123
+ default-src 'self' https://fonts.googleapis.com https://fonts.gstatic.com @trustedOrigins https://api.example.com
124
+ ```
125
+
126
+ After (0.10.17):
127
+ ```
128
+ default-src 'self'
129
+ style-src 'self' 'unsafe-inline' https://fonts.googleapis.com
130
+ font-src 'self' https://fonts.gstatic.com
131
+ connect-src 'self' @trustedOrigins https://api.example.com
132
+ ```
133
+
134
+ **Action required:** recompile (`quickback compile`) to regenerate the security middleware with the corrected scaffolding. Configs that already declared each `*-src` directive explicitly were unaffected by the bug — the regression only surfaced when users wrote `defaultSrc: ['@self']` and let auto-config fill in the rest.
135
+
136
+ The user-side workaround from 0.10.16 (declaring each directive with `['@self']` to force scaffold) is no longer needed in 0.10.17 — the compiler does the right thing automatically.
137
+
138
+ ---
139
+
140
+ ## v0.10.16 — May 2, 2026
141
+
142
+ ### CSP auto-config now covers SPA-baked-in API origins
143
+
144
+ When the bundled CMS or Account SPA is enabled, the compiler already inlines the API URL into the SPA bundle as a string literal at build time (`VITE_QUICKBACK_API_URL=https://${unifiedDomain}`). That hardcoded URL is what the SPA actually fetches — regardless of which origin is currently serving the page. CSP `connect-src` must allow it explicitly.
145
+
146
+ 0.10.16's auto-config picks up every domain the compiler already knows about — `config.domain`, the inferred `quickback.{baseDomain}`, `cms.domain`, `account.domain`, the admin domain — and adds `https://${each}` to `connectSrc` whenever a bundled SPA is enabled.
147
+
148
+ The motivating case: running the SPA on `localhost:5173` while it's still baked against `https://quickback.your-app.com`. Pre-0.10.16 the localhost CSP's `'self'` blocked the prod URL; users were patching it manually. Now it just works.
149
+
150
+ ```
151
+ [security] auto-added https://quickback.loop.kardoe.com to csp.connectSrc — account: true → bundled Account SPA → SPA bundle hardcodes https://quickback.loop.kardoe.com as VITE_QUICKBACK_API_URL / etc.
152
+ ```
153
+
154
+ `@trustedOrigins` (the CORS allowlist) is unchanged — it still gets added independently. The two cover different things: `@trustedOrigins` permits CORS-allowed sibling subdomains; the new SPA-baked addition permits the exact URL the SPA's compiled bundle hardcodes.
155
+
156
+ Combined with 0.10.15's bundled-SPA defaults, most projects can now write the minimal:
157
+
158
+ ```ts
159
+ security: {
160
+ csp: {
161
+ defaultSrc: ['@self'],
162
+ scriptSrc: ['@self'],
163
+ objectSrc: ['@none'],
164
+ upgradeInsecureRequests: true,
165
+ },
166
+ }
167
+ ```
168
+
169
+ …and the compiler fills in styleSrc font hosts, fontSrc gstatic, connectSrc trusted origins, and connectSrc SPA-baked URLs.
170
+
171
+ ---
172
+
173
+ ## v0.10.15 — May 2, 2026
174
+
175
+ ### CSP auto-config — bundled-SPA origins added automatically
176
+
177
+ When `security.csp` is set, the compiler now widens directives **additively** based on the project's enabled features. The four rules:
178
+
179
+ | Trigger | Auto-added | Directive |
180
+ |---|---|---|
181
+ | `cms: true` OR `account: true` | `'unsafe-inline'`, `https://fonts.googleapis.com` | `styleSrc` |
182
+ | `cms: true` OR `account: true` | `https://fonts.gstatic.com` | `fontSrc` |
183
+ | `csp` set (always) | `@trustedOrigins` | `connectSrc` |
184
+
185
+ Anything you already wrote stays — auto-config never removes or overrides. Every applied addition prints to stderr at compile so the magic is visible:
186
+
187
+ ```
188
+ [security] auto-added 'unsafe-inline' to csp.styleSrc — account: true → bundled Account SPA → inline style attributes from Tailwind / TanStack Router
189
+ [security] auto-added @trustedOrigins to csp.connectSrc — CORS-trusted origins must be reachable from XHR/fetch (matches cors() allowlist)
190
+ ```
191
+
192
+ The recipe in [the security docs](/compiler/config/security#example-paste-in-csp-for-a-quickback-spa-project) becomes ~5 lines shorter — most projects no longer need to list `fonts.googleapis.com` / `fonts.gstatic.com` / `@trustedOrigins` themselves. **Loop's CSP shrinks dramatically** after recompiling against this version.
193
+
194
+ **Opt-out:** `security: { cspAutoConfig: false, csp: { ... } }` for projects fronted by a CDN that injects its own CSP, or teams that want strict from-scratch control.
195
+
196
+ **Smart fallback:** if you set `defaultSrc` but omit the target directive (e.g. `defaultSrc: ['@self']` and nothing for `connectSrc`), the addition lands in `defaultSrc` rather than creating a sibling directive — CSP fall-back semantics mean a sibling would *narrow* your intent, so we preserve the broader fallback.
197
+
198
+ ### Troubleshooting table for CSP violations
199
+
200
+ The security docs page now includes a [Troubleshooting CSP violations](/compiler/config/security#troubleshooting-csp-violations) table mapping browser console errors back to the directive that needs widening. Useful when auto-config is disabled or the project has a non-bundled SPA hitting third-party origins.
201
+
202
+ ### Out of scope (deferred)
203
+
204
+ - **Per-request CSP nonces** (`@nonce` sentinel implementation) — Phase 2 / 0.10.16. Sentinel still errors at compile in 0.10.15.
205
+ - **`revocationCheck: 'kv'` for `auth.jwt`** — schema accepts it, runtime still errors at compile. Slipped from 0.10.15 to 0.10.16.
206
+ - **Public R2 host auto-add to `imgSrc`** — most R2 access today goes through the worker so the SPA fetches from `'@self'`. Will revisit once we have a clean way to discover public-bucket hosts at compile.
207
+
208
+ ---
209
+
210
+ ## v0.10.14 — May 1, 2026
211
+
212
+ ### `auth.jwt` — JWT bearer-token fast-path config
213
+
214
+ Quickback's bearer-token JWT (the one minted by the auth middleware and consumed by the fast-path on every subsequent request) is now configurable. The most-tuned knob is `expiresIn` — drop it to bound the post-revocation replay window without affecting browser SPAs, which auto-refresh via `set-auth-token` on every authed call:
215
+
216
+ ```ts
217
+ auth: {
218
+ jwt: {
219
+ expiresIn: 30, // 30s post-revocation replay window
220
+ issuer: 'my-api', // iss claim (verified on the way back in)
221
+ audience: 'partner-svc', // aud claim
222
+ secretEnv: 'CUSTOM_JWT_SECRET', // override BETTER_AUTH_SECRET if you need the JWT secret rotated independently
223
+ },
224
+ }
225
+ ```
226
+
227
+ `revocationCheck: 'kv'` (KV-denylist consult on every fast-path verify, ~5-15ms edge-cached, no D1 hit) is reserved in the schema today but **deferred to 0.10.15** — setting it errors at compile so the migration path is explicit. `'none'` (today's behaviour, 0 cost, replay bound by TTL) stays the default.
228
+
229
+ See [the docs page](/compiler/config/auth) for the full knob list and tuning recommendations.
230
+
231
+ ### MCP admin endpoints hidden from non-admin `tools/list`
232
+
233
+ Better Auth admin endpoints (`/admin/list-users`, `/admin/ban-user`, `/admin/impersonate-user`, etc. — 9 in total) now carry `x-access: { userRole: ['admin'] }` in the generated OpenAPI spec, which means the MCP server's existing access-filter automatically drops them from `tools/list` for callers without an admin token. Anonymous and member-role callers no longer see admin tooling enumerated through MCP; admin endpoints still exist on the HTTP surface (Better Auth gates them server-side regardless).
234
+
235
+ ### Declarative `security` config block
236
+
237
+ Every security response-header (`Content-Security-Policy`, `Cross-Origin-Opener-Policy`, `Cross-Origin-Embedder-Policy`, `Cross-Origin-Resource-Policy`, `X-Frame-Options`, `Strict-Transport-Security`, `Referrer-Policy`, `Permissions-Policy`) is now configurable from `quickback.config.ts`. Loop's `postcompile-patch.mjs` (which re-injected a fuller CSP and COOP after every `quickback compile`) can now be deleted in favour of:
238
+
239
+ ```ts
240
+ security: {
241
+ csp: {
242
+ defaultSrc: ['@self'],
243
+ scriptSrc: ['@self'],
244
+ styleSrc: ['@self', '@unsafe-inline'],
245
+ frameAncestors: ['@none'],
246
+ objectSrc: ['@none'],
247
+ upgradeInsecureRequests: true,
248
+ },
249
+ coop: 'same-origin',
250
+ }
251
+ ```
252
+
253
+ `@`-prefixed sentinels (`@self`, `@none`, `@unsafe-inline`, `@unsafe-eval`, `@trustedOrigins`, `@nonce`) save users from awkward `"'self'"` quoting and let `@trustedOrigins` resolve to the same allowlist `cors()` uses. Unknown sentinels throw at compile rather than silently stringify into the wire CSP.
254
+
255
+ The compiler runs lint rules over the resolved config — errors for `@nonce` (deferred to 0.10.15), `@unsafe-inline + @nonce` (silently broken), and sentinel-only directives that would resolve to nothing at runtime; warnings for `@unsafe-inline` in `script-src`, wildcard sources, missing `default-src`, HSTS preload-list misconfiguration, etc.
256
+
257
+ Defaults preserve 0.10.13 behaviour byte-for-byte — adding the block without setting any field is a no-op.
258
+
259
+ See [the docs page](/compiler/config/security) for the full reference.
260
+
261
+ ### HSTS no longer pins `localhost` to HTTPS
262
+
263
+ The generated middleware now skips `Strict-Transport-Security` when the request hostname is `localhost`, `127.0.0.1`, or `*.localhost`. Without this gate, `wrangler dev` would pin the developer's browser to HTTPS for `max-age` seconds — observable across every project on that machine since HSTS keys on hostname, not port. Affects every project running locally.
264
+
265
+ ### Out of scope (deferred)
266
+
267
+ - **Per-request CSP nonces** — Phase 2 / 0.10.15. Sentinel exists at config-validation level so users can author their final CSP today knowing it'll start working when nonces ship.
268
+ - **Asset-hash CSP** for inline `<style>` and `<script>` blocks emitted by the bundled SPAs — Phase 3.
269
+ - **Per-route CSP overrides** (e.g. one looser policy for `/admin`) — single global CSP for now.
270
+
271
+ ---
272
+
273
+ ## v0.10.13 — May 1, 2026
274
+
275
+ ### Clickjacking protection on every generated Worker
276
+
277
+ Every Worker now emits two clickjacking-defence headers on every
278
+ response:
279
+
280
+ - `Content-Security-Policy: frame-ancestors 'self' <TRUSTED_ORIGINS…>`
281
+ - `X-Frame-Options: SAMEORIGIN`
282
+
283
+ The CSP allowlist is sourced from the same `TRUSTED_ORIGINS` constant
284
+ that gates CORS, so users configure their domains in one place
285
+ (`auth.trustedOrigins` / `auth.trustedOriginDefaults` in
286
+ `quickback.config.ts`) and both CORS and frame-ancestors stay in
287
+ lockstep. `'self'` is always allowed so an app's own SPAs can frame
288
+ their own routes (e.g. an account login popover hosted on the same
289
+ origin).
290
+
291
+ Modern browsers obey `frame-ancestors` and ignore `X-Frame-Options`
292
+ when both are set; the legacy header is included for clients that
293
+ don't speak CSP3. The CSP intentionally only sets `frame-ancestors` —
294
+ adding `script-src` / `default-src` would need a much wider audit
295
+ across SPA assets, inline scripts, and third-party embeds, so that's
296
+ left as a follow-up.
297
+
298
+ Recompile (`quickback compile`) and redeploy to pick this up — no
299
+ config change needed unless you want to allow extra cross-origin
300
+ iframe embeds, in which case add them to `auth.trustedOrigins`.
301
+
302
+ ---
303
+
304
+ ## v0.10.12 — May 1, 2026
305
+
306
+ ### Bundled-docs sync for the MCP recon fix
307
+
308
+ Patch release that re-bundles the CLI's offline docs (consulted by the
309
+ Claude Code skill, Cursor rules, and other AI assistants) so they
310
+ reflect the corrected `tools/list` access-filter behavior and CORS
311
+ posture shipped in v0.10.11. The `compiler/config/agents.mdx` page
312
+ itself was already corrected on the docs site immediately after the
313
+ 0.10.11 release; this bump propagates that text into the bundle inside
314
+ `@quickback-dev/cli`.
315
+
316
+ No runtime or compiler behavior change — re-running `quickback compile`
317
+ against this version produces the same output as v0.10.11.
318
+
319
+ ---
320
+
321
+ ## v0.10.11 — May 1, 2026
322
+
323
+ ### MCP `tools/list` is now access-filtered + recon-tightened
324
+
325
+ The generated MCP-over-HTTP server (`src/routes/mcp.ts`) had three holes
326
+ that turned a standard pentest into trivial recon:
327
+
328
+ 1. `tools/list` returned the entire tool catalogue to anyone — including
329
+ admin-only endpoints — without checking auth or roles. Tool
330
+ descriptions also leaked sentences like `[UNSAFE] bypasses tenant
331
+ scoping and requires elevated access` verbatim.
332
+ 2. The endpoint set `Access-Control-Allow-Origin: *` so any origin could
333
+ pull the catalogue from a browser.
334
+ 3. Unauthenticated `GET /mcp` enumerated every tool name in its
335
+ discovery payload.
336
+
337
+ Fix:
338
+
339
+ - Each tool now carries sanitised access metadata (`_access` covering
340
+ `roles` / `userRole` / `or` / `and`, plus `_public` for `PUBLIC`
341
+ pseudo-role or empty `security`). `tools/list` filters against the
342
+ caller's `ctx` — unauth callers see only `_public` tools, authed
343
+ callers see only role-gated tools they pass. Record predicates and
344
+ function-form access (opaque at list time) are dropped.
345
+ - Wildcard CORS removed entirely. The parent app's `cors()` middleware
346
+ (origin allowlist via `TRUSTED_ORIGINS` + `BETTER_AUTH_URL`) now
347
+ applies uniformly to `/mcp`, same as every other route.
348
+ - `[UNSAFE] ... bypasses tenant scoping ...` flavour text is gone.
349
+ `annotations.destructiveHint` and `_unsafe` remain — those are the
350
+ spec-correct signals for clients to warn users.
351
+ - Unauthenticated `GET /mcp` no longer lists tool names. Inventory is
352
+ only available via the access-filtered `tools/list`.
353
+
354
+ This filter is recon-mitigation, not a security boundary: `tools/call`
355
+ still re-enters the Hono app and runs every middleware (auth, firewall,
356
+ access, guards, masking), so hiding a tool from list never weakens the
357
+ underlying gate.
358
+
359
+ Known follow-up: Better Auth admin endpoints (`ban-user`, `create-user`,
360
+ `impersonate-user`, etc.) don't yet emit `x-access` in the OpenAPI spec,
361
+ so any logged-in user still sees them in `tools/list` (the actual call
362
+ is still gated by the admin plugin). Tracked separately.
363
+
364
+ ---
365
+
366
+ ## v0.10.10 — April 29, 2026
367
+
368
+ ### Reject reserved keys inside `access.record` at compile time
369
+
370
+ `access.record` is a flat field map evaluated as implicit AND between
371
+ entries — keys must be column names. Putting `and: [...]` (or `or` /
372
+ `roles` / `userRole`) inside `record` was a real-world footgun: the
373
+ runtime treated the literal string `"and"` as a column lookup, the
374
+ predicate failed on every row, and the caller got a silent `403` /
375
+ empty list with nothing pointing at the misuse. The TypeScript type
376
+ couldn't catch this — `RecordConditions` is an open-ended index
377
+ signature, so any key parses.
378
+
379
+ The compiler now walks every access node attached to a resource (CRUD
380
+ ops, `read.access`, view access, masking `show` / `query`, action
381
+ access) and throws a clear migration error when `record` contains a
382
+ reserved key:
383
+
384
+ - `and` / `or` inside `record` → use the top-level `and` / `or`
385
+ sibling: `{ and: [{ record: { ... } }, { record: { ... } }] }`
386
+ - `roles` / `userRole` inside `record` → put them at the access node
387
+ alongside `record`: `{ roles: [...], record: { ... } }`
388
+
389
+ The error names the exact origin (`crud.update.access`,
390
+ `actions.focus.access.or[1]`, etc.) so the fix lands in the right place.
391
+
392
+ ---
393
+
394
+ ## v0.10.9 — April 29, 2026
395
+
396
+ ### Role hierarchy now expands in record-based action access
397
+
398
+ `auth.roleHierarchy: ['member', 'admin', 'owner']` plus
399
+ `access: { roles: ['member+'] }` on a record-based action used to
400
+ silently 403 valid callers. The standalone-action route generator
401
+ inlined the expanded role list as a JSON literal, but the
402
+ record-based generator read the access config back through the
403
+ runtime `actions['name'].access` import — the user's source, where
404
+ the unexpanded `'member+'` shorthand still lived. The runtime did
405
+ literal string matching against `ctx.roles`, so an `owner` calling
406
+ the action got `['member+'] !== 'owner'` and was rejected.
407
+
408
+ Fixed: record-based action routes now inline the expanded list the
409
+ same way standalone routes do. `input` and `execute` still flow
410
+ through the runtime import (closures aren't serializable); only the
411
+ access config is lifted to a JSON literal so the compile-time
412
+ expansion actually reaches the matcher.
413
+
414
+ A regression test (`role-hierarchy-action-routes.test.ts`) locks the
415
+ behavior in — it asserts that `member+` never reaches the route
416
+ output and that the access config is no longer read from
417
+ `actions[name].access` at runtime.
418
+
419
+ ---
420
+
421
+ ## v0.10.8 — April 29, 2026
422
+
423
+ ### Audit support on postgres targets, plus a generated-API quality pass
424
+
425
+ **Audit on PG.** Until this release, `audit_events` only existed on cloudflare-d1 — projects on Neon (or any postgres target) silently skipped audit logging on `unsafe:` and `PUBLIC`-role actions, and hard delete was hard-blocked. Postgres has no equivalent of D1's separate-database binding model, but it has native schemas — so the audit table now lives in a dedicated `audit` schema in the same database as features (`drizzle.pgSchema('audit')`). The `hasSecurityAudit` gate accepts D1 OR any PG dialect; the `auditDatabaseId` requirement only fires for D1 (which still uses the separate-binding model). The recruitment example wires `auditDatabaseId` so the recompile path stays green.
426
+
427
+ **`auditDatabaseId` is now a compile-time requirement** (D1 only). Previously, projects with unsafe/PUBLIC actions but no audit id silently produced a `database_id = "local-audit"` placeholder in production `wrangler.toml`; Cloudflare's worker upload step then rejected it with code 10021 *after* assets and migrations had already run. The compile-time error names the exact `wrangler d1 create <project>-audit` command and the `auditDatabaseId` config key where the returned id goes.
428
+
429
+ ### Five fixes from a Loop integration ticket pass
430
+
431
+ **Action input → OpenAPI / MCP.** `defineAction({ input: z.object({...}) })` schemas now flow into `requestBody` on the OpenAPI operation and `inputSchema.properties` / `_bodyFields` on the MCP tool list. Simple `z.object` shapes are extracted at compile time; for discriminated unions, refinements, recursive schemas, and bare-identifier references (`input: createPersonInput`), the compiler runs your action file through Zod 4's native `z.toJSONSchema()` during compilation — full-fidelity output with no static translator to maintain. Pre-fix, every action came out as a no-arg endpoint, which gutted typed SDK generation and made MCP useless for actions that take parameters.
432
+
433
+ **OpenAPI fidelity.** Three surgical fixes that strict validators (zod, openapi-typescript, openapi-fetch) had been complaining about:
434
+ - Response schemas now emit `required[]` for every non-nullable column, so generated SDKs treat them as guaranteed-present rather than optional.
435
+ - `text(_, { enum: [...] })` columns emit as closed `{ type: "string", enum: [...] }`, narrowing to literal unions.
436
+ - `id` only claims `format: "uuid"` when the project's `generateId` actually produces UUIDs. cuid2 / prefixed / nanoid / serial generators get plain `{ type: "string" }` — strict validators stop rejecting responses against their own spec.
437
+
438
+ **Mask auto-detector now checks the column exists.** The auto-mask predicate used to be unconditionally `show: { or: 'owner', roles: ['admin'] }` — including for tables with no owner column at all (no `userId` / `ownerId` and no `q.scope('owner')`). The generated mask function would reference a non-existent column and fail under TypeScript checks. The auto-detector now verifies the resolved owner column exists in the parsed schema before emitting the `or` clause; when it doesn't, the rule falls back to roles-only and the compiler emits a warning so the behavior is transparent.
439
+
440
+ **Error code consistency.** The generated CRUD layer was emitting raw codes (`'UNAUTHORIZED'`, `'NOT_NULL_VIOLATION'`, `'UNIQUE_VIOLATION'`, `'INSERT_FAILED'`, `'UPDATE_FAILED'`) that were never in the `QuickbackErrorCode` enum, so consumers couldn't switch exhaustively on `code`. New `database` layer + `DB_NOT_NULL_VIOLATION` / `DB_UNIQUE_VIOLATION` / `DB_INSERT_FAILED` / `DB_UPDATE_FAILED` / `NOT_FOUND` codes are now in the enum, the routes use `AuthErrors.missing()` / `DatabaseErrors.*()` helpers throughout, and the OpenAPI `Error` component emits `code` as a closed enum sourced from the canonical `QUICKBACK_ERROR_CODES` list. Generated SDKs can now `switch` on `code` without a default branch swallowing unknown values. See [API errors](/compiler/targets/hono-api/using-the-api/errors#database).
441
+
442
+ **Dropped dead `auditFields` preamble from action route generators.** The audit wrapper's `Proxy` already hard-stamps `createdAt` / `createdBy` / `modifiedAt` / `modifiedBy` on every INSERT and `modifiedAt` / `modifiedBy` on every UPDATE — the `auditFields` const the route preamble built was never read. Dropped from `standalone.ts` / `record-based.ts` and from the `ActionExecutorParams` JSDoc. Migrated 7 example handlers (drop `modifiedAt: auditFields!.modifiedAt` from `.set` payloads — the wrapper handles it). Note: `.onConflictDoUpdate({ set })` is *not* intercepted by the wrapper, so `upsertBatch`-style handlers keep an explicit `modifiedAt: now`.
443
+
444
+ ---
445
+
446
+ ## One file per action: greenfield action authoring
447
+
448
+ Action authoring collapses to a single shape. Each action is its own file under `<feature>/actions/<name>.ts` using `defineAction({...})`. The filename is the action name AND the URL segment.
449
+
450
+ ```typescript
451
+ // features/applications/actions/advance.ts
452
+ import { z } from "zod";
453
+ import { defineAction } from "../.quickback/define-action";
454
+ import { applications } from "../applications";
455
+
456
+ export default defineAction({
457
+ description: "Move an application forward in the pipeline",
458
+ input: z.object({ nextStatus: z.enum(["screening", "interview", "offer"]) }),
459
+ access: { roles: ["owner", "admin"] },
460
+ transition: {
461
+ field: "status",
462
+ via: "nextStatus",
463
+ fromTo: { applied: ["screening"], screening: ["interview"], interview: ["offer"] },
464
+ },
465
+ async execute({ db, record, input, auditFields, whereTransition }) { /* … */ },
466
+ });
467
+ ```
468
+
469
+ `defineAction` is imported from a generated per-feature helper at `<feature>/.quickback/define-action.ts` — types `record`, `input`, and audit fields without manual annotations. The directory says what `:id` mounts to; the imports say what the body reads or writes.
470
+
471
+ **Discovery rules:**
472
+ - `actions/<name>.ts` binds to the feature's primary table (the `<feature>.ts` file at the feature root).
473
+ - `actions/<table>/<name>.ts` binds to the sibling table file `<table>.ts` — for multi-table features.
474
+ - Setting `path:` makes the action standalone (custom URL, no record fetch, no firewall preload).
475
+ - Tableless features (no top-level `*.ts` files) require every action to be standalone.
476
+ - Action names are unique per `(bindTable, name)` pair — sibling-bound actions on different tables may share a verb (e.g. `actions/episodes/publish.ts` + `actions/shows/publish.ts` mount at `/episodes/:id/publish` and `/shows/:id/publish` and don't collide). Standalone actions are unique per `(method, path)`.
477
+ - Files under `<feature>/lib/` are copied verbatim for feature-local helpers; `quickback/lib/` is exposed via the `~/lib/*` alias for cross-feature shared code (with a one-way import rule enforced at compile time).
478
+
479
+ **Retired** (rejected at load time with migration guidance):
480
+
481
+ - `actions.ts` (bundled multi-action file)
482
+ - `_feature.ts` (shared preamble + tableless actions)
483
+ - `handlers/` directory + `handler:` string ref
484
+ - `defineActions(table, {…})` and `defineActions(null, {…})`
485
+ - `export default { actions: {…} }`
486
+ - Colocated `defineActions` inside table files
487
+ - `standalone: true` flag (presence of `path:` is the new signal)
488
+ - `*-actions.ts` / `*.actions.ts` filename patterns
489
+
490
+ The phantom-`unsafe` regex bug that flattened nested `unsafe: { … }` blocks into a fake top-level action is gone — the parser now reads action files as real TS modules with real imports, so type inference, jump-to-definition, and rename refactoring all work end-to-end.
491
+
492
+ The CLI loader rejects retired primitives at load time with batched migration errors. Existing projects need to be migrated by hand to the new shape before recompiling.
493
+
494
+ See the [Actions docs](/compiler/definitions/actions) for the full reference.
495
+
496
+ ---
497
+
498
+ ## Multi-table actions per feature
499
+
500
+ Features used to support exactly one `defineActions(table, …)` call via `actions.ts`, which forced unnatural feature splits whenever multiple tables in the same feature needed actions (a podcast feature with `episodes`, `shows`, `seasons`, `collections`, etc.). One feature directory can now own actions on multiple tables across three discovery modes:
501
+
502
+ - **Colocated** (canonical) — `<table>.ts` containing both `defineTable` and `defineActions(<table>, …)`. One file per entity. Default for new features.
503
+ - **`actions.ts`** (existing) — single primary-table actions file at feature root. Unchanged behaviour.
504
+ - **`actions/<table>.ts`** — per-table action files for teams that want strict schema/behavior separation or need to break an import cycle.
505
+
506
+ Plus the universal `_feature.ts` slot (at feature root) for **non-table-bound feature-level actions** (`export default { actions: { … } }` shape) and **shared Zod schemas** that get prepended once to the merged actions module so every sibling action sees them. Allowed in any of the three modes — orthogonal to table binding.
507
+
508
+ The decision flowchart: *one table with actions → colocate. Multiple tables with actions → colocate each. Hit a cycle or want strict separation → `actions/<table>.ts`. Want schema/actions split for a single-table feature → `actions.ts`. Non-table actions → always `_feature.ts`.*
509
+
510
+ Conflicts are batched and printed once before the compiler aborts — no "fix one, recompile, fix the next" loop. The CLI hard-errors when a feature mixes `actions.ts` with table-bound mode, when the same table has its `defineActions` declared in two places, when an `actions/<x>.ts` first-arg doesn't match the basename, or when `_feature.ts` contains `defineActions(table, …)`. Legacy `*-actions.ts` / `*.actions.ts` filenames in a feature dir trigger a soft warning naming the offending paths.
511
+
512
+ Within the legacy bundled `actions.ts` DSL, action names had to be unique within a feature — the runtime module merged every source into one keyspace, so colliding `publish` actions on `episodes` and `shows` would have silently overwritten each other. The retired `actions.ts` shape is no longer accepted, so this constraint is gone: the current one-file-per-action layout keys uniqueness per `(bindTable, name)` pair, and the codegen aggregator mangles the JS map key per bind-table while keeping the URL segment bare. Sibling-bound `actions/episodes/publish.ts` and `actions/shows/publish.ts` mount at `/episodes/:id/publish` and `/shows/:id/publish` and compile cleanly.
513
+
514
+ Inline `execute:` bodies must be arrow functions (`execute: async (ctx) => { … }`). `async function` and plain `function` shapes were silently misparsed by the route emitter — they now hard-error at parse time pointing at the canonical arrow form, with a suggestion to use `handler:` for callers who genuinely need a named function declaration.
515
+
516
+ `handlers/` walks recursively now — `handlers/<table>/<action>.ts` is the canonical layout. A new `lib/` directory under each feature gets copied verbatim into the output for feature-local helpers.
517
+
518
+ Migration: existing `actions.ts` projects compile bit-identically — the legacy single-table path is unchanged. Legacy `*-actions.ts` filenames produce a soft warning and silently aren't picked up; rename to `<table>.ts` (colocated), `actions/<table>.ts`, or single `actions.ts`.
519
+
520
+ ---
521
+
522
+ ## Firewall: named-scope shape restored, auto-detection synonyms widened
523
+
524
+ The named-scope firewall shape (`firewall: { organization: { column: 'tenant_id' } }`) is back as a co-equal user-facing input alongside the predicate array. DSL v2 step 8 had walled it off, but the internal architecture still kept named-scope around for the route + scoped-db generators — so re-accepting it at the input boundary is a thin coercion layer, not an architectural change.
525
+
526
+ ```typescript
527
+ // All three are now valid; all compile to the same predicate array internally.
528
+ firewall: { organization: { column: 'tenant_id' } } // named-scope (compact)
529
+ firewall: { owner: { column: 'account_user_id' } }
530
+ firewall: { exception: true }
531
+ firewall: [
532
+ { field: 'organizationId', equals: 'ctx.activeOrgId' },
533
+ { field: 'deletedAt', isNull: true },
534
+ ] // predicate array (explicit)
535
+ ```
536
+
537
+ Pick the form that reads better — named-scope for the common one-line case, predicate array when you need custom `in`-lists or non-scope predicates.
538
+
539
+ **Auto-detection synonyms expanded.** When `firewall:` is omitted entirely, the compiler scans the schema for an isolation column. The org-scope list now accepts `organizationId`, `organisationId`, `orgId`, `organization`, `organisation`, `org` (American + British). User-scope still accepts `userId` only.
540
+
541
+ **`ownerId` is now a targeted error signal.** When a table carries `ownerId` but no isolation column AND no explicit `firewall:`, the compiler raises a specific error: `\`ownerId\` is business-logic ownership, not access control — Quickback won't auto-derive a firewall from it. Either rename to \`userId\` if this column controls access, add a separate \`userId\` / \`organizationId\` column, or specify \`firewall:\` explicitly.` This replaces the generic "missing isolation column" error in the `ownerId`-only case and preserves the documented distinction between RLS-style access control (`userId`) and business-logic ownership (`ownerId`).
542
+
543
+ Migration: nothing breaks. Projects on the predicate-array shape compile bit-identically. Projects on the named-scope shape — including any test fixtures or example projects that were left on the legacy form — now compile cleanly again.
544
+
545
+ ---
546
+
547
+ ## v0.10.0 — April 26, 2026
548
+
549
+ ### `q.scope()` column DSL + unified `masking.query` gate
550
+
551
+ Two related DSL consolidations land. The `q.scope()` half is purely additive; the `masking.query` half rejects three legacy per-capability flags at compile time (migration is mechanical — see below).
552
+
553
+ **`q.scope(kind)` — single-declaration tenant scoping.** Replaces the three-place pattern (column declaration + firewall predicate + implicit ownership-guard) with one column. `q.scope('organization')` compiles to `text(...).notNull()` and tells the compiler:
554
+
555
+ 1. Auto-derive the firewall predicate (`{ field: 'organizationId', equals: 'ctx.activeOrgId' }`) so the explicit `firewall:` block can be omitted entirely.
556
+ 2. Add the column to `GUARDS_CONFIG.systemManaged` so client input is rejected at the guard layer.
557
+ 3. Auto-populate from `ctx` on create / upsert.
558
+
559
+ The systemManaged extension generalises beyond `q.scope()`: any firewall predicate whose `equals` references `ctx.*` adds its `field` to the systemManaged set. So a hand-rolled `firewall: [{ field: 'tenantId', equals: 'ctx.activeOrgId' }]` gets the same treatment.
560
+
561
+ ```typescript
562
+ columns: {
563
+ organizationId: q.scope('organization'), // → ctx.activeOrgId
564
+ ownerId: q.scope('owner'), // → ctx.userId
565
+ teamId: q.scope('team'), // → ctx.activeTeamId
566
+ }
567
+ ```
568
+
569
+ The auto-derived firewall also includes the soft-delete predicate (`{ field: 'deletedAt', isNull: true }`) when audit-field injection is on (the default). See [`q.scope()` in the schema docs](/compiler/definitions/schema#qscope--tenant-scope-columns).
570
+
571
+ **`masking[col].query.roles` — unified role gate for filter / sort / search.** The three legacy per-capability flags (`filterable`, `searchable`, `sortable`) are replaced by a single allowlist that says "these roles can query the column."
572
+
573
+ ```typescript
574
+ masking: {
575
+ email: {
576
+ type: 'email',
577
+ show: { roles: ['admin'] },
578
+ query: { roles: ['admin'] }, // optional — defaults to show.roles
579
+ },
580
+ }
581
+ ```
582
+
583
+ When omitted, `query` inherits from `show.roles` ("if you can see it, you can query it") which is the right shape for almost all PII. A view's own `query.{filterable,searchable,sortable}` allowlist is the opt-in for higher-privileged roles; the existing intersection validator gates it at compile time. See [Masking query gate](/compiler/definitions/masking#query-gate-filter--sort--search).
584
+
585
+ **Breaking:** Setting `masking[col].filterable / .searchable / .sortable` is rejected at compile time with a migration hint. Replace with `query.roles` (or just delete the flags — `query` defaults to `show.roles`).
586
+
587
+ ---
588
+
589
+ ## v0.9.0 — April 25, 2026
590
+
591
+ ### DSL v2: unified `read:` pipeline, transactional batches, ID-probe defense
592
+
593
+ Step 8 of the DSL v2 refactor lands. The headline shift is that the read
594
+ side of every resource now has its own block — `read:` — that owns the
595
+ collection-level `GET /` endpoint, single-record `GET /:id`, and named view
596
+ projections. The legacy `crud.list` and `crud.get` shapes are rejected at
597
+ compile time. See the new [Read pipeline](/compiler/definitions/read) page
598
+ for the full reference and migration table.
599
+
600
+ **Breaking changes** (compile-time errors with migration hints):
601
+
602
+ - `crud.list` → [`read.access`](/compiler/definitions/read) (plus `read.pageSize` / `read.maxPageSize`)
603
+ - `crud.get` → `read.access` (single-record GET inherits automatically; use record-level conditions on `read.access` for differentiated single-record gates)
604
+ - Top-level `views: {...}` → [`read.views: {...}`](/compiler/definitions/read#views-under-read-views)
605
+ - `crud.list.fields` / `crud.get.fields` → declare a named view under `read.views` and call `?view={name}` (or `/views/{name}`)
606
+
607
+ **Pre-record access ordering on `/:id`**: handlers now run a role-only
608
+ access check **before** the firewall query, so a caller without a matching
609
+ role gets 403 before the database is touched. This closes the 404-vs-403
610
+ ID-probe channel — an unauthorized caller can no longer distinguish "row
611
+ exists in another tenant" from "row doesn't exist." See
612
+ [Access evaluation order](/compiler/definitions/access#evaluation-order).
613
+
614
+ **Transactional batch operations**: batch endpoints now expose a
615
+ `failFast` option (replacing the old `atomic` naming) and a
616
+ `meta.transactional` response field. On tx-supporting providers
617
+ (postgres, supabase, neon, libsql, better-sqlite3, bun-sqlite), `failFast: true`
618
+ wraps the per-record loop in `db.transaction(...)` so any failure rolls
619
+ back the entire batch. On Cloudflare D1 (no `db.transaction`), `failFast: true`
620
+ still stops on the first error but prior writes stay committed; inspect
621
+ `meta.transactional` to know which guarantee you got. Embedding queue
622
+ messages and realtime broadcasts are emitted **after** the transaction
623
+ commits, so a rolled-back batch produces no orphan jobs. See
624
+ [Batch Operations: Transactional semantics](/compiler/targets/hono-api/using-the-api/batch-operations#transactional-semantics).
625
+
626
+ **`firewallErrorMode` lifted off the firewall block**: the field that
627
+ controls 403-vs-404 on firewall misses now lives at the resource top level
628
+ (sibling to `firewall:`), since the firewall config is now a predicate
629
+ array and this is a presentation-layer choice. Existing `firewall.errorMode`
630
+ values should be lifted to `firewallErrorMode` at the resource level.
631
+
632
+ **Read-only resources**: an empty `crud: {}` block (or omitting `crud:`
633
+ entirely) is valid for read-only resources. `read:` alone is enough to
634
+ expose `GET /` and `GET /:id`.
635
+
636
+ **Strict-mode top-level keys**: the strict allow-list now includes `dev` so
637
+ `defineConfig({ dev: { ... } })` is accepted at the top level.
638
+
639
+ ---
640
+
641
+ ## v0.8.7 — April 17, 2026
642
+
643
+ ### Security: Hono CVE cluster fix
644
+
645
+ Hono is bumped to `^4.12.14` across the monorepo, the compiler Docker image's pre-installed deps, and every generator path that emits Hono into compiled projects. Older ranges (`^4.0.0` / `^4.5.0` / `^4.6.0` / `^4.7.11`) covered the vulnerable window. Recompile to pick up the fix in your generated project's `package.json`.
646
+
647
+ ### Cloudflare Email Sending is now in public beta
648
+
649
+ Quickback already defaults to the Workers `send_email` binding for Cloudflare deploys, and Cloudflare Email Sending has now graduated to public beta — production-ready with zero-config, no API keys, no third-party accounts. No action needed; recompiling any existing project continues to wire the default Cloudflare transport. AWS SES remains a fully supported opt-in (`email.provider: 'aws-ses'`) for non-Cloudflare runtimes or existing SES setups. See [Email Configuration](/compiler/config#email-configuration).
650
+
651
+ ### Minor/patch dep sweep
652
+
653
+ Aligned the whole dep surface — monorepo, compiler Docker image, and generator emissions into compiled projects — so new compiles and existing recompiles converge on the same versions:
654
+
655
+ - `wrangler@^4.83.0`
656
+ - `drizzle-orm@^0.45.2`, `drizzle-kit@^0.31.10`
657
+ - `zod@^4.3.6`
658
+ - `@cloudflare/workers-types@^4.20260417.1` (also deduped — was accidentally declared in both `dependencies` and `devDependencies` in some paths)
659
+ - `@tanstack/react-query@^5.99.0` (Account app)
660
+
661
+ ---
662
+
663
+ ## v0.8.5 — April 15, 2026
664
+
665
+ ### Fix: Better Auth 1.5 and `@cloudflare/workers-types` Compatibility
666
+
667
+ Generated API code failed to typecheck after Better Auth bumped to 1.5 and `@cloudflare/workers-types` tightened `BufferSource` to `ArrayBufferView<ArrayBuffer>`. Four unrelated surfaces broke:
668
+
669
+ - **`databaseHooks.member.update.after` was removed** in Better Auth 1.5. The compiler now emits the member role-change broadcast hook as `organizationHooks.afterUpdateMemberRole` inside the `organization()` plugin call, which is the current supported shape.
670
+ - **`REALTIME_URL` and `ACCESS_TOKEN`** are always emitted as optional `CloudflareBindings` fields when the organization plugin is active, so the broadcast hook typechecks even when `realtimeMode` is `"inline"` (or realtime isn't configured at all).
671
+ - **`auth.api.listOrganizations` / `getFullOrganization` / `session.session.activeOrganizationId`** — third-party Better Auth plugins narrow the inferred `auth.api` type and hide organization-plugin endpoints. The generated middleware and `/admin/v1/organizations` route now cast through `any` for these calls.
672
+ - **`crypto.subtle.sign` / `verify`** no longer accept `Uint8Array<ArrayBufferLike>` directly. Generated `jwt.ts` casts encoded payloads to `BufferSource`.
673
+
674
+ No config changes required — recompile to pick up the fixes.
675
+
676
+ ### CMS Admin Gate Now Enforced Server-Side
677
+
678
+ `cms: { access: "admin" }` previously only hid the CMS link in Account UI and rendered an "Access Denied" screen inside the SPA — the static assets, `/api/v1/schema`, and `/api/v1/custom_view` CRUD were reachable by any authenticated user. A non-admin with an API token or cookie could bypass the UI and read schema metadata or saved CMS views directly.
679
+
680
+ This release adds server-side enforcement at every CMS-facing surface:
681
+
682
+ - **CMS SPA shell** — the Worker checks `ctx.userRole === "admin"` before serving `index.html`. Unauthenticated requests redirect to login; authenticated non-admins get `403 Admin access required`. Static bundles (JS/CSS) remain reachable so browser caches aren't invalidated.
683
+ - **`/api/v1/schema`** — returns `403` to non-admins.
684
+ - **`custom_view` CRUD** — now gated on the new `userRole: ["admin"]` primitive rather than org membership.
685
+ - **In-SPA gate** — unchanged; defense in depth behind the server-side gates.
686
+
687
+ Your resource CRUD endpoints are unaffected — they keep their per-resource `crud.access.roles`.
688
+
689
+ ### New `userRole` Access Primitive
690
+
691
+ Added `userRole?: string[]` to the declarative `Access` config, evaluated against `ctx.userRole` (the Better Auth admin-plugin `user.role` column). This is distinct from `roles`, which matches `ctx.roles` (org membership).
692
+
693
+ ```typescript
694
+ // Old: in multi-tenant this meant org-admin, not platform-admin
695
+ access: { roles: ['admin'] }
696
+
697
+ // New: explicitly require user.role === 'admin' regardless of org membership
698
+ access: { userRole: ['admin'] }
699
+
700
+ // "Org owner OR platform admin"
701
+ access: { or: [{ roles: ['owner'] }, { userRole: ['admin'] }] }
702
+
703
+ // Platform admins see SSNs across every org
704
+ masking: { ssn: { type: 'ssn', show: { userRole: ['admin'] } } }
705
+ ```
706
+
707
+ `userRole` works everywhere `Access` is accepted — CRUD, actions, views, masking, and inside `or`/`and` combinators. See [Access - userRole vs roles](/compiler/definitions/access#userrole-vs-roles).
708
+
709
+ ### Fix: `ReferenceError: customAlphabet is not defined` in generated POST handlers
710
+
711
+ Projects with `providers.database.config.generateId: "short"` (or `"nanoid"` / `"cuid"`) compiled routes that called the ID helper but never imported it. Every generated `src/features/**/*.routes.ts` had `customAlphabet('0123...', 6)()` in its POST body but no matching `import { customAlphabet } from 'nanoid';` at the top of the file. Every `POST /api/v1/<resource>` and batch-create returned `500` with `ReferenceError: customAlphabet is not defined` on the first write.
712
+
713
+ The compiler now emits the correct import alongside the ID expression for all three modes: `nanoid`, `customAlphabet`, and `createId` from `@paralleldrive/cuid2`.
714
+
715
+ No config changes required — recompile to pick up the fix.
716
+
717
+ ### Fix: Dangling `export const` in generated `actions.ts` breaks `tsc`
718
+
719
+ When a feature authored actions as `export const xActions = defineActions(...)` (instead of `export default defineActions(...)`), the compiler's preamble extractor leaked the assignment's left-hand side into the generated `src/features/<feature>/actions.ts`. The output contained a dangling `export const xActions =` with no right-hand side, and `tsc --noEmit` failed with `TS1109: Expression expected`. Runtime happened to work because the unused placeholder was never evaluated, but typecheck was red.
720
+
721
+ The preamble extractor now anchors its boundary to the start of the top-level statement containing `defineActions(...)`, covering `export default`, `export const X =`, `const X =`, and bare call forms. Local Zod helper declarations above the call continue to be preserved.
722
+
723
+ ### Fix: Files worker `database_id` reverted to `"local-files"` on every compile
724
+
725
+ Projects using the two-worker R2 architecture had their files worker's `wrangler.toml` (`apps/backend/cloudflare-workers/files/wrangler.toml`) rewritten with `database_id = "local-files"` on every `quickback compile`, even when `providers.database.config.filesDatabaseId` was set to a real D1 UUID. The main worker's binding was correct — only the files worker fell through. Remote deploys of the files worker bound to a non-existent D1, so file serving and access-control reads failed with a binding error.
726
+
727
+ The files-worker wrangler generator now reads `filesDatabaseId` (and `filesDatabaseName`) from `providers.database.config` as a fallback when they aren't set on `providers.fileStorage.config`, matching the precedence chain already used by the main worker. Local dev is unaffected — `wrangler dev --local` uses `.wrangler/state/` regardless of the configured ID.
728
+
729
+ No config changes required — recompile and redeploy the files worker.
730
+
731
+ ---
732
+
733
+ ## v0.8.6 — April 16, 2026
734
+
735
+ ### Fix: Audit columns silently dropped from tables with a same-line index callback
736
+
737
+ Tables authored with the composite-index shape Drizzle / prettier produces —
738
+
739
+ ```ts
740
+ export const episodeTags = sqliteTable("episode_tags", {
741
+ id: text("id").primaryKey(),
742
+ episodeId: text("episode_id").notNull(),
743
+ tagId: text("tag_id").notNull(),
744
+ }, (t) => [ // <-- "}, (t) =>" on one line
745
+ uniqueIndex("episode_tag_unique").on(t.episodeId, t.tagId),
746
+ ]);
747
+ ```
748
+
749
+ never received audit field injection. A regex in `injectAuditFields` required a literal `\n` between the columns-object `},` and the `(t) =>` index callback, so same-line closers were silently skipped and the function returned the source unchanged. drizzle-kit then diffed the audit-less schema against the previous snapshot and emitted `ALTER TABLE ... DROP COLUMN created_at/modified_at/deleted_at/created_by/modified_by/deleted_by` for every affected table. Any project that applied those migrations had production CRUD return `500` because the generated firewall helper still referenced `deletedAt`.
750
+
751
+ The regex is now whitespace-flexible and the identifier class accepts any valid JS identifier (`t`, `table`, `_t`, `tbl2`). A defensive guard throws at compile time if all three terminator patterns fail on a recognizable Drizzle table — no more silent drops.
752
+
753
+ **Recovery path:**
754
+
755
+ - Most projects: recompile. drizzle-kit will detect the audit columns are missing from the DB snapshot and emit an `ADD COLUMN` migration to restore them. Apply it.
756
+ - Projects that already hand-patched their schema and ran a manual `ADD COLUMN` migration (like the `podcast-app` workaround in commit `98d8758`): the next compile will regenerate a matching `ADD COLUMN` migration that will fail with "duplicate column name" against a DB that already has the columns. Mark the new migration as applied without running it (e.g. `INSERT INTO __drizzle_migrations` in the features DB) or hand-edit the generated SQL to a no-op, then continue normally.
757
+
758
+ ### Fix: `firewall.exception` generated `isNull(<table>.deletedAt)` against a missing column
759
+
760
+ Resources with `firewall: { exception: true }` always emitted `return isNull(<table>.deletedAt);` inside `buildFirewallConditions()`, regardless of whether the table actually had a `deletedAt` column. Projects that disabled audit injection globally (`compiler.features.auditFields: false`) or authored a schema without `deletedAt` ended up with Drizzle resolving `<table>.deletedAt` to `undefined` at query time — every `GET /api/v1/<resource>` returned `500`.
761
+
762
+ The three concerns are now fully independent:
763
+
764
+ - **`firewall.exception: true`** — only disables tenant scoping (org/user/team `WHERE` clauses). It does not gate audit fields or soft-delete.
765
+ - **Audit fields** — always injected unless globally opted out. Unchanged.
766
+ - **Soft-delete filter** — emitted only when the schema actually has `deletedAt` *or* the user explicitly set `firewall.softDelete`.
767
+
768
+ In the default configuration (audit injection on), behavior is unchanged: exception resources still filter `deletedAt IS NULL`. Only the broken case changes — exception resources on a schema without `deletedAt` now return `undefined` (no firewall), matching the column reality.
769
+
770
+ No config changes required — recompile to pick up the fix.
771
+
772
+ ---
773
+
774
+ ## v0.8.4 — April 14, 2026
775
+
776
+ ### New `generateId: "short"` Strategy
777
+
778
+ Added a compact ID option for tables where short, shareable codes matter more than collision resistance at scale:
779
+
780
+ ```typescript
781
+ providers: {
782
+ database: defineDatabase("cloudflare-d1", {
783
+ generateId: "short",
784
+ }),
785
+ }
786
+ ```
787
+
788
+ Generates 6-character alphanumeric IDs (e.g. `a3F9xK`) using nanoid's `customAlphabet` with the full 62-char alphabet (`0-9A-Za-z`). Requires the `nanoid` package in your project (same as the existing `"nanoid"` strategy).
789
+
790
+ **When to use:** room codes, invite links, share URLs, ephemeral records — anywhere the ID appears in a URL or needs to be human-typeable.
791
+
792
+ **When not to use:** high-volume tables. 62^6 ≈ 56.8B combinations means ~238K rows before a 50% collision probability (birthday bound). For large tables stick with `"uuid"`, `"cuid"`, or `"prefixed"`.
793
+
794
+ See [Providers - ID Generation Options](/compiler/config/providers#id-generation-options) for the full list of strategies.
795
+
796
+ ---
797
+
798
+ ## v0.8.3 — April 14, 2026
799
+
800
+ ### Fix: `wrangler.toml` Route Placement and Binding IDs
801
+
802
+ Two bugs in the generated `wrangler.toml` that blocked production deployment without manual edits:
803
+
804
+ **Routes were nested under `[dev]`.** The `routes = [...]` array was emitted after the `[dev]` section header, so TOML parsed it as `dev.routes` and wrangler ignored the custom domain (warning: `Unexpected fields found in dev field: "routes"`). Routes now emit as a top-level key.
805
+
806
+ **D1 and KV bindings used placeholder IDs.** Despite `databaseId`, `filesDatabaseId`, and `kvId` being set in the quickback config, the generated `wrangler.toml` wrote `"local-features"`, `"local-files"`, and `"local"` instead of the real UUIDs. The compiler now resolves IDs from multiple config sources:
807
+
808
+ | Binding | Config sources checked (in order) |
809
+ |---------|-----------------------------------|
810
+ | `AUTH_DB` | `database.config.authDatabaseId` |
811
+ | `DB` | `database.config.featuresDatabaseId`, `database.config.databaseId` |
812
+ | `FILES_DB` | `fileStorage.config.filesDatabaseId`, `database.config.filesDatabaseId` |
813
+ | `KV` | `database.config.kvNamespaceId`, `storage.config.namespaceId`, `auth.config.kvId` |
814
+
815
+ See [Providers - Database Options](/compiler/config/providers#database-options) for the full list of supported ID properties.
816
+
817
+ ### Fix: Account SPA Post-Login Redirect on Unified Domain
818
+
819
+ When the Account SPA was served at `/account/` on the unified quickback domain (e.g. `secure.example.com/account/`), post-login redirects dropped the basepath and sent users to `/dashboard` instead of `/account/dashboard`. Sign-out redirects had the same issue.
820
+
821
+ The SPA now shares a basepath module across the router and all raw `window.location.href` assignments, so login, signup, email OTP, welcome, and sign-out flows all stay under the correct path prefix regardless of whether the SPA is on the unified domain or its own dedicated auth subdomain.
822
+
823
+ No config changes required — recompile to pick up the fix.
824
+
825
+ ---
826
+
827
+ ## v0.8.2 — April 11, 2026
828
+
829
+ ### Catch-All `VITE_QUICKBACK_URL` Environment Variable
830
+
831
+ Instead of setting four separate URL env vars, you can now point at a single Quickback origin:
832
+
833
+ ```bash
834
+ # One variable — done.
835
+ VITE_QUICKBACK_URL=https://secure.example.com
836
+ ```
837
+
838
+ When set, it's used as a fallback for the individual URLs:
839
+
840
+ | Individual var (explicit) | Fallback when unset |
841
+ |---|---|
842
+ | `VITE_QUICKBACK_API_URL` | `${VITE_QUICKBACK_URL}` |
843
+ | `VITE_QUICKBACK_ACCOUNT_URL` | `${VITE_QUICKBACK_URL}/account` |
844
+ | `VITE_QUICKBACK_CMS_URL` | `${VITE_QUICKBACK_URL}/cms` |
845
+
846
+ `VITE_QUICKBACK_APP_URL` stays independent — it points at the tenant's own frontend, not the Quickback server.
847
+
848
+ **Non-breaking.** Individual vars still take precedence when set, so existing configurations work unchanged. The compiler now also emits `VITE_QUICKBACK_URL` into the generated SPA `.env` files, and library users can set `__QUICKBACK_URL__` on `globalThis` for the same effect.
849
+
850
+ See [Environment Variables](/stack/account-ui/environment-variables) for the full reference.
851
+
852
+ ---
853
+
854
+ ## v0.8.1 — April 9, 2026
855
+
856
+ ### Role Hierarchy with `+` Suffix
857
+
858
+ You can now define a role hierarchy in your config and use the `+` suffix in access rules to mean "this role and above":
859
+
860
+ ```typescript
861
+ // quickback.config.ts
862
+ auth: {
863
+ roleHierarchy: ['member', 'admin', 'owner'],
864
+ }
865
+
866
+ // In resource definitions
867
+ crud: {
868
+ list: { access: { roles: ["member+"] } }, // member, admin, owner
869
+ create: { access: { roles: ["admin+"] } }, // admin, owner
870
+ delete: { access: { roles: ["owner"] } }, // owner only
871
+ }
872
+ ```
873
+
874
+ Roles are expanded at compile time. No `+` = exact match. See [Access - Role Hierarchy](/compiler/definitions/access#role-hierarchy) for details.
875
+
876
+ ---
877
+
878
+ ## v0.8.0 — April 9, 2026
879
+
880
+ ### Breaking: VITE URL Environment Variables Renamed
881
+
882
+ All Quickback-generated URL environment variables are now namespaced under `VITE_QUICKBACK_*` to avoid collisions with other Vite projects.
883
+
884
+ | Old | New |
885
+ |-----|-----|
886
+ | `VITE_API_URL` | `VITE_QUICKBACK_API_URL` |
887
+ | `VITE_ACCOUNT_URL` | `VITE_QUICKBACK_ACCOUNT_URL` |
888
+ | `VITE_APP_URL` | `VITE_QUICKBACK_APP_URL` |
889
+ | `VITE_CMS_URL` | `VITE_QUICKBACK_CMS_URL` |
890
+
891
+ **Non-URL variables are unchanged:** `VITE_ENABLE_*` feature flags, branding vars (`VITE_APP_NAME`, etc.), and `VITE_STRIPE_PUBLISHABLE_KEY` stay as-is.
892
+
893
+ **Action required:**
894
+ - **Compiled projects** — re-run `quickback compile`. The compiler generates the new names automatically.
895
+ - **Standalone deploys** — update `.env`, `.env.production`, and `wrangler.toml` files manually.
896
+ - **Library users** — the `__QUICKBACK_API_URL__` / `__QUICKBACK_APP_URL__` globalThis names are unchanged, but if you pipe Vite env vars into them, update the var names.
897
+
898
+ See [Environment Variables](/stack/account-ui/environment-variables) for the full reference.
899
+
900
+ ### CMS Access Control
901
+
902
+ The `cms.access` config option now enforces access at the CMS level, not just link visibility in Account UI.
903
+
904
+ ```typescript
905
+ cms: { access: "admin" }
906
+ ```
907
+
908
+ When set to `"admin"`, non-admin users (`user.role !== "admin"`) see an "Access Denied" screen with a sign-out button instead of the CMS. When set to `"user"` (the default), any authenticated user can access the CMS.
909
+
910
+ See [CMS Connecting](/stack/cms/connecting) and [Compiler Config](/compiler/config) for details.
911
+
912
+ ### SPA Sub-Route Fix
913
+
914
+ Fixed a bug where hard-refreshing or directly navigating to SPA sub-routes (e.g., `/account/profile`, `/cms/tables/users`) returned a blank white screen. The Worker now correctly serves `index.html` for all SPA paths, allowing the client-side router to handle routing.
915
+
916
+ ---
917
+
918
+ ## v0.5.11 — February 24, 2026
919
+
920
+ ### Email OTP & Auth Fixes
921
+
922
+ - Fixed email-OTP magic links not working correctly
923
+ - Removed deprecated `/internal/validate` endpoint — use standard Better Auth session validation instead
924
+ - Auth is now required for all API routes when running locally (previously some routes were unprotected in dev)
925
+
926
+ ### Multiple Table Exports Fix
927
+
928
+ - Fixed a compiler error when a single file exports multiple Drizzle tables alongside a `defineTable()` default export
929
+ - The CLI now properly detects and reports this with a clear error message pointing to the fix
930
+
931
+ ### Headless Drizzle Rename Hints
932
+
933
+ - Added `compiler.migrations.renames` configuration for CI/CD environments where Drizzle's interactive rename prompts would block compilation
934
+ - Compile errors now include explicit rename key paths and fail fast on malformed rename config keys
935
+ - See [Configuration](/compiler/config) for details
936
+
937
+ ### Security Contract Report Artifacts
938
+
939
+ - Added generated security contract artifacts to compiler output:
940
+ - `reports/security-contracts.report.json`
941
+ - `reports/security-contracts.report.sig.json`
942
+ - Added config-driven signing controls:
943
+ - `compiler.securityContracts.report.signature.enabled`
944
+ - `compiler.securityContracts.report.signature.required`
945
+ - `compiler.securityContracts.report.signature.key` / `keyEnv` / `keyId`
946
+ - Missing required signing keys now fail loudly with explicit remediation guidance
947
+ - Added strict config validation for report/signature paths and signing options
948
+
949
+ ### Mandatory Unsafe Action Audit Trail
950
+
951
+ - Added structured unsafe action config (`unsafe: { reason, adminOnly, crossTenant, targetScope }`)
952
+ - Cross-tenant unsafe actions now require Better Auth authentication plus platform admin role (`ctx.userRole === "admin"`)
953
+ - Added mandatory audit logging for unsafe cross-tenant actions (success, denial, and error paths)
954
+ - Cloudflare output now includes optional `AUDIT_DB` wiring, `drizzle.audit.config.ts`, and `db:migrate:audit:*` scripts when unsafe actions are present
955
+ - Added compile-time raw SQL guard for actions and handlers (`allowRawSql: true` required per action)
956
+
957
+ ---
958
+
959
+ ## v0.5.10 — February 19, 2026
960
+
961
+ ### Compiler Page Parsing & CLI Output
962
+
963
+ - Improved compiler page parsing for `definePage()` definitions
964
+ - Better CLI output formatting during compilation
965
+ - Added `apiPath` to schema registry for CMS integration
966
+
967
+ ### Bug Fixes
968
+
969
+ - Fixed hyphenated action names not being properly quoted in generated code (e.g., `mark-complete` now generates valid JavaScript)
970
+ - API key authentication (`x-api-key` header) is now handled separately from session tokens (`Bearer` header)
971
+
972
+ ---
973
+
974
+ ## v0.5.9 — February 16, 2026
975
+
976
+ ### CMS Pages & CLI Page Support
977
+
978
+ - Added `definePage()` support for CMS-managed pages
979
+ - Auth middleware improvements for page routes
980
+ - CLI now supports page definitions alongside table and action definitions
981
+
982
+ ---
983
+
984
+ ## v0.5.8 — February 14, 2026
985
+
986
+ ### CMS App
987
+
988
+ - Introduced the Quickback CMS — a schema-driven admin panel that connects to your generated API
989
+ - CMS namespace added to actions for admin-specific operations
990
+ - Fixed `guard` → `access` naming inconsistency in CMS action definitions
991
+
992
+ ### Schema Registry & Firewall Improvements
993
+
994
+ - Added schema registry generator — the compiler now outputs a JSON schema registry used by the CMS
995
+ - Firewall error modes: choose between `reveal` (403 with details) and `hide` (opaque 404) for security-sensitive deployments
996
+
997
+ ### Bug Fixes
998
+
999
+ - Fixed anonymous user email format generation
1000
+ - Organization selector improvements in Account UI
1001
+ - Config validation now catches more errors at compile time
1002
+ - Better CRUD error handling with structured error responses
1003
+ - Fixed masking to use representative star counts instead of fixed formatting
1004
+
1005
+ ---
1006
+
1007
+ ## v0.5.7 — February 12, 2026
1008
+
1009
+ ### Scoped Database for Actions
1010
+
1011
+ Actions now receive a **security-scoped database** instead of a raw Drizzle instance. The compiler generates a proxy wrapper that automatically enforces org isolation, owner filtering, and soft-delete visibility — the same protections that CRUD routes have always had.
1012
+
1013
+ The scoped DB uses duck-typed column detection at runtime:
1014
+
1015
+ | Column Detected | SELECT / UPDATE / DELETE | INSERT |
1016
+ |---|---|---|
1017
+ | `organizationId` | Adds `WHERE organizationId = ?` | Auto-injects `organizationId` from context |
1018
+ | `ownerId` | Adds `WHERE ownerId = ?` | Auto-injects `ownerId` from context |
1019
+ | `deletedAt` | Adds `WHERE deletedAt IS NULL` | — |
1020
+
1021
+ This means **every action is secure by default** — no manual `WHERE` clauses needed.
1022
+
1023
+ ```typescript
1024
+ defineActions(todos, {
1025
+ complete: {
1026
+ type: "record",
1027
+ execute: async ({ db, ctx, record, input }) => {
1028
+ // db is scoped — only sees records in user's org, excludes soft-deleted
1029
+ const siblings = await db.select().from(todos);
1030
+ // ↑ automatically filtered to ctx.activeOrgId + deletedAt IS NULL
1031
+ },
1032
+ },
1033
+ });
1034
+ ```
1035
+
1036
+ #### Unsafe Mode
1037
+
1038
+ Actions that intentionally need to bypass security (admin reports, cross-org queries, migrations) can declare `unsafe: true` to receive a raw, unscoped database handle:
1039
+
1040
+ ```typescript
1041
+ defineActions(analytics, {
1042
+ globalReport: {
1043
+ unsafe: true,
1044
+ execute: async ({ db, rawDb, ctx, input }) => {
1045
+ // db → still scoped (safety net)
1046
+ // rawDb → bypasses all security filters
1047
+ const allOrgs = await rawDb.select().from(organizations);
1048
+ },
1049
+ },
1050
+ });
1051
+ ```
1052
+
1053
+ Without `unsafe: true`, `rawDb` is `undefined`.
1054
+
1055
+ **Related docs:** [Actions](/compiler/definitions/actions), [Actions API](/compiler/targets/hono-api/using-the-api/actions-api)
1056
+
1057
+ ---
1058
+
1059
+ ### Cascading Soft Delete
1060
+
1061
+ Soft-deleting a parent record now **automatically cascades** to child and junction tables within the same feature. The compiler detects foreign key references at build time and generates cascade UPDATE statements.
1062
+
1063
+ ```
1064
+ DELETE /api/v1/projects/:id
1065
+ ```
1066
+
1067
+ Generated behavior:
1068
+ ```typescript
1069
+ // 1. Soft delete the parent
1070
+ await db.update(projects)
1071
+ .set({ deletedAt: now, deletedBy: userId })
1072
+ .where(eq(projects.id, id));
1073
+
1074
+ // 2. Auto-cascade to children (compiler-generated)
1075
+ await db.update(projectMembers)
1076
+ .set({ deletedAt: now, deletedBy: userId })
1077
+ .where(eq(projectMembers.projectId, id));
1078
+
1079
+ await db.update(projectTasks)
1080
+ .set({ deletedAt: now, deletedBy: userId })
1081
+ .where(eq(projectTasks.projectId, id));
1082
+ ```
1083
+
1084
+ Rules:
1085
+ - Only applies to **soft delete** (the default). Hard delete relies on database-level `ON DELETE CASCADE`.
1086
+ - Only cascades within the **same feature** — cross-feature references are not affected.
1087
+ - Child tables must have `deletedAt` / `deletedBy` columns (auto-added by the compiler's audit fields).
1088
+
1089
+ **Related docs:** [Actions API — Cascading Soft Delete](/compiler/targets/hono-api/using-the-api/actions-api#cascading-soft-delete)
1090
+
1091
+ ---
1092
+
1093
+ ### Advanced Query Parameters
1094
+
1095
+ New query parameter capabilities for all list endpoints:
1096
+
1097
+ - **Field selection** — `?fields=id,name,status` returns only the columns you need
1098
+ - **Multi-sort** — `?sort=status:asc,createdAt:desc` sorts by multiple fields
1099
+ - **Total count** — `?count=true` returns total matching records in response headers (`X-Total-Count`)
1100
+ - **Full-text search** — `?search=keyword` searches across all text columns
1101
+
1102
+ ```bash
1103
+ # Get only names and statuses, sorted by status then date, with total count
1104
+ GET /api/v1/todos?fields=id,name,status&sort=status:asc,createdAt:desc&count=true
1105
+
1106
+ # Search across all text fields
1107
+ GET /api/v1/todos?search=urgent
1108
+ ```
1109
+
1110
+ **Related docs:** [Query Parameters](/compiler/targets/hono-api/using-the-api/query-params)
1111
+
1112
+ ---
1113
+
1114
+ ### Audit Field Improvements
1115
+
1116
+ - `deletedAt` and `deletedBy` fields are now **always injected** by the compiler for tables with soft delete enabled — no need to define them in your schema
1117
+ - All audit fields (`createdAt`, `createdBy`, `modifiedAt`, `modifiedBy`, `deletedAt`, `deletedBy`) are auto-managed
1118
+
1119
+ ---
1120
+
1121
+ ## v0.5.6 — February 8, 2026
1122
+
1123
+ ### Database Naming Conventions
1124
+
1125
+ - Default table and column naming changed to **snake_case** with `usePlurals: false`
1126
+ - Table names derived from generated Better Auth schema for consistency
1127
+ - Removed legacy single-database mode — split databases (auth + features) is now the standard
1128
+
1129
+ ### Auth Variable Shadowing Fix
1130
+
1131
+ - Fixed `member` variable in auth middleware that shadowed the Drizzle `member` table import
1132
+ - Renamed to `sessionMember` to avoid conflicts in generated routes
1133
+
1134
+ ---
1135
+
1136
+ ## v0.5.5 — February 5, 2026
1137
+
1138
+ ### Better Auth Plugins
1139
+
1140
+ - Published `@quickback-dev/better-auth-upgrade-anonymous` v1.1.0 — post-passkey email collection flow
1141
+ - Published `@quickback-dev/better-auth-combo-auth` — combined email + password + OTP authentication
1142
+ - Published `@quickback-dev/better-auth-aws-ses` — AWS SES email provider for Better Auth
1143
+
1144
+ ### OpenAPI Spec Generation
1145
+
1146
+ - Generated APIs now include a full OpenAPI specification at `/openapi.json`
1147
+ - Better Auth endpoints included in the spec
1148
+ - Runtime route: `GET /openapi.json`
1149
+
1150
+ ### Security Hardening
1151
+
1152
+ - Global error handler prevents leaking internal error details
1153
+ - Security headers middleware (CSP, HSTS, X-Frame-Options, X-Content-Type-Options)
1154
+ - `BETTER_AUTH_SECRET` properly passed to generated config
1155
+
1156
+ ---
1157
+
1158
+ ## v0.5.4 — January 30, 2026
1159
+
1160
+ ### Account UI
1161
+
1162
+ - Pre-built authentication UI deployed as Cloudflare Workers
1163
+ - Features: sessions, organizations, passkeys, passwordless, admin panel, API keys
1164
+ - Dual-mode: standalone (degit template) or embedded with Quickback projects
1165
+
1166
+ ### Webhook System
1167
+
1168
+ - Inbound webhook endpoints with signature verification
1169
+ - Outbound webhooks via Cloudflare Queues with automatic retries
1170
+ - Configurable per-feature webhook events
1171
+
1172
+ ### Realtime & Vector Search
1173
+
1174
+ - Durable Objects + WebSocket realtime subscriptions
1175
+ - Vector embeddings via Cloudflare Vectorize
1176
+ - KV and R2 storage integrations
1177
+
1178
+ ---
1179
+
1180
+ ## v0.5.0 — January 2026
1181
+
1182
+ ### Initial Release
1183
+
1184
+ - **Quickback Compiler** — TypeScript-first backend compiler
1185
+ - **Four Security Pillars** — Firewall, Access, Guards, Masking
1186
+ - **`defineTable()`** — Schema + security configuration in a single file
1187
+ - **Templates** — Cloudflare Workers, Bun standalone, B2B SaaS
1188
+ - **Cloud Compiler** — Remote compilation via `compiler.quickback.dev`
1189
+ - **CLI** — `quickback create`, `quickback compile`, `quickback init`
1190
+ - **Better Auth Integration** — Organizations, roles, sessions
1191
+ - **Drizzle ORM** — Schema-first with automatic migrations
1192
+ - **Cloudflare D1** — Split database support (auth + features)