@voltro/cli 0.12.0 → 0.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (85) hide show
  1. package/CHANGELOG.md +93 -0
  2. package/dist/{apiBuild-GefjNI5d.js → apiBuild-B6_ehbem.js} +3 -3
  3. package/dist/apiBuild-Bzpb383i.js +2 -0
  4. package/dist/bin.js +3 -3
  5. package/dist/{commands-BmNi1RgZ.js → commands-DYOuGlEC.js} +1668 -1371
  6. package/dist/dbCommand-ADD4mrTI.js +2 -0
  7. package/dist/{dbCommand-DNrkb58g.js → dbCommand-DIOJQwsq.js} +71 -57
  8. package/dist/{dev-d0LjACxE.js → dev-Fb9BmavX.js} +1483 -1414
  9. package/dist/dev-xdijqojc.js +3 -0
  10. package/dist/{seedRunner-DZmhoqNt.js → frameworkTableAssembly-CYlrafoK.js} +110 -331
  11. package/dist/frameworkTableAssembly-XvKO7wQt.js +2 -0
  12. package/dist/index.js +1 -1
  13. package/dist/{inspectMetrics-uEfIS1vp.js → inspectMetrics-DOiiII34.js} +302 -293
  14. package/dist/seedRunner-D6eu-u5U.js +229 -0
  15. package/dist/{serveCommand-B2-YV9TU.js → serveCommand-CqYxzBZR.js} +368 -367
  16. package/dist/serveEntry.js +3 -3
  17. package/dist/{start-DKcQd52a.js → start-CjG_0xhR.js} +1 -1
  18. package/dist/startEntry.js +2 -2
  19. package/package.json +17 -17
  20. package/templates/AGENTS.md +1 -1
  21. package/templates/agent-docs/_index.md +1 -1
  22. package/templates/agent-docs/authentication.md +36 -0
  23. package/templates/agent-docs/cli.md +78 -4
  24. package/templates/agent-docs/configuration.md +48 -0
  25. package/templates/agent-docs/database/migrations.md +32 -0
  26. package/templates/agent-docs/database/transactions.md +31 -0
  27. package/templates/agent-docs/testing.md +24 -0
  28. package/templates/agent-docs/whats-new.md +41 -137
  29. package/templates/apps/api-ai/package.json +7 -7
  30. package/templates/apps/api-auth/package.json +8 -8
  31. package/templates/apps/api-backend/package.json +7 -7
  32. package/templates/apps/api-backend-deactivation/package.json +7 -7
  33. package/templates/apps/api-backend-deactivation/tests/users.deactivate.test.ts +1 -1
  34. package/templates/apps/api-backend-mail/package.json +8 -8
  35. package/templates/apps/api-backend-mariadb/package.json +9 -9
  36. package/templates/apps/api-backend-storage/package.json +8 -8
  37. package/templates/apps/api-data-advanced/package.json +8 -8
  38. package/templates/apps/api-data-advanced/tests/queries.test.ts +6 -1
  39. package/templates/apps/api-durable/package.json +8 -8
  40. package/templates/apps/api-feature-flags/package.json +9 -9
  41. package/templates/apps/api-governance/app.config.ts +0 -1
  42. package/templates/apps/api-governance/package.json +8 -8
  43. package/templates/apps/api-kv/package.json +8 -8
  44. package/templates/apps/api-kv/tests/sync.test.ts +2 -2
  45. package/templates/apps/api-moderation/package.json +8 -8
  46. package/templates/apps/api-observability/package.json +8 -8
  47. package/templates/apps/api-ratelimit/package.json +8 -8
  48. package/templates/apps/api-rbac/README.md +53 -14
  49. package/templates/apps/api-rbac/app.config.ts +24 -26
  50. package/templates/apps/api-rbac/authz.ts +76 -0
  51. package/templates/apps/api-rbac/database/schema.ts +23 -6
  52. package/templates/apps/api-rbac/mutations/notes.create.mutation.server.ts +7 -5
  53. package/templates/apps/api-rbac/mutations/notes.create.mutation.ts +15 -8
  54. package/templates/apps/api-rbac/mutations/notes.delete.mutation.server.ts +54 -0
  55. package/templates/apps/api-rbac/mutations/notes.delete.mutation.ts +43 -0
  56. package/templates/apps/api-rbac/mutations/teams.rename.mutation.server.ts +19 -0
  57. package/templates/apps/api-rbac/mutations/teams.rename.mutation.ts +37 -0
  58. package/templates/apps/api-rbac/package.json +8 -8
  59. package/templates/apps/api-rbac/queries/notes.list.query.server.ts +12 -0
  60. package/templates/apps/api-rbac/queries/notes.list.query.ts +26 -0
  61. package/templates/apps/api-rbac/template.json +2 -2
  62. package/templates/apps/api-rbac/tests/authz.test.ts +233 -0
  63. package/templates/apps/api-rest/package.json +7 -7
  64. package/templates/apps/api-saas/package.json +11 -11
  65. package/templates/apps/api-search/package.json +8 -8
  66. package/templates/apps/api-versioning/package.json +8 -8
  67. package/templates/apps/api-webhooks/package.json +9 -8
  68. package/templates/apps/changelog/package.json +6 -6
  69. package/templates/apps/edge-functions/package.json +2 -2
  70. package/templates/apps/frontend-admin/package.json +8 -8
  71. package/templates/apps/frontend-app/package.json +8 -8
  72. package/templates/apps/frontend-blank/package.json +7 -7
  73. package/templates/apps/frontend-contact/package.json +7 -7
  74. package/templates/apps/frontend-dashboard/package.json +7 -7
  75. package/templates/apps/frontend-docs/package.json +7 -7
  76. package/templates/apps/frontend-i18n/package.json +6 -6
  77. package/templates/apps/frontend-landing/package.json +7 -7
  78. package/templates/apps/frontend-spa/package.json +7 -7
  79. package/templates/apps/frontend-ssr/package.json +7 -7
  80. package/templates/apps/frontend-ssr-api/package.json +8 -8
  81. package/templates/apps/frontend-static-blog/package.json +6 -6
  82. package/dist/apiBuild-s7swuEU5.js +0 -2
  83. package/dist/dbCommand-Bt6BCG7g.js +0 -2
  84. package/dist/dev-YHbHmeXt.js +0 -3
  85. package/templates/apps/api-rbac/tests/notes.create.test.ts +0 -80
@@ -1,4 +1,4 @@
1
- # What's new in 0.11.4
1
+ # What's new in 0.13.0
2
2
 
3
3
  Read this FIRST when a task touches an area you have not worked in recently.
4
4
  It is the cheapest way to notice that the framework grew the thing you were
@@ -7,171 +7,75 @@ workaround for something that shipped two versions ago.
7
7
 
8
8
  BREAKING entries name a codemod; run `voltro update` to apply it.
9
9
 
10
- ### Added
11
-
12
- - **@voltro/protocol** — **`ApiKeyRecord.metadata` — an app-defined binding carried onto the Subject.** `tenantId` is ONE level of key ownership. A product whose keys belong to a TEAM, a project or an environment needs a second, and the record had no slot for it — so the only safe way to authorize was a DB lookup on every check, on the auth hot path. Reported from an app whose `requireScope` could not see the team, so a key minted for team A authorized org-wide until they patched it with a per-check query.
13
-
14
- ```ts
15
- resolveKey: async (hash) => {
16
- const row = await findKey(hash)
17
- return row && { ...row, metadata: { keyType: row.keyType, teamId: row.teamId } }
18
- }
19
- // a guard then reads subject.metadata.teamId — no second query
20
- ```
10
+ ### ⚠ BREAKING
21
11
 
22
- Merged UNDER the framework's own claims: `provider` and `userId` are the strategy's attribution of the request and are applied last, so an app's bag cannot overwrite who the framework thinks made the call (tested). A record without `metadata` behaves exactly as before.
23
- - **@voltro/cli** — `voltro db generate [name]` now scaffolds a fresh, heavily-commented `migrations/<timestamp>_<name>.migration.ts` (the imperative path for data backfills / transforms the declarative differ can't express — for plain schema shape changes prefer `voltro db apply`). The name is slugified; `--name` overrides the positional, `--root` sets where `migrations/` lives. Replaces the old "not yet implemented" stub, and `db generate` is back in the command summary. `voltro db migrate --dry-run` is implemented too — it lists the pending migrations (querying the ledger for what's applied) without applying them, instead of erroring as unimplemented.
24
- - **@voltro/runtime** — `crud.list(table, { columns })` — SQL column projection, so a wide column a list view never shows is **never read**, not merely dropped at the wire boundary:
12
+ - **@voltro/protocol, @voltro/plugin-scim, @voltro/plugin-prometheus** SCIM was served UNAUTHENTICATED whenever its token was an empty string.
25
13
 
26
- ```ts
27
- export default crud.list('articles', { columns: ['id', 'title', 'createdAt'] })
28
- // the large `body` / json blob is never SELECTed, transferred, or decoded
29
- ```
14
+ `checkBearer(headers, expected)` returned `true` when `expected` was unset or empty, documented as "no token configured = open; the caller decided not to gate this surface". Its one production caller had decided the opposite: `scimPlugin` declares `token: string`, and `scimPlugin({ token: process.env.SCIM_TOKEN ?? '' })` — the shape anyone writes — turned the gate off silently. The result was SCIM 2.0 Users and Groups readable with no credentials: a full directory dump plus the provisioning surface that can deactivate accounts. Likeliest exactly where it hurts, too: an env var set in production and missing in a preview environment.
30
15
 
31
- This is the performance half of projection. The output schema already strips undeclared columns on encode (so nothing extra ever shipped either way) `columns` additionally saves the read, the DB→app transfer, and the decode.
16
+ `checkBearer` is now fail-closed by default, with the permissive behaviour available as an explicit `{ openWhenUnset: true }` a two-argument helper cannot know its caller's intent, so it must not assume the permissive one. `@voltro/plugin-prometheus` passes it (its token is documented as optional), and `scimPlugin` now throws at construction — i.e. at boot — rather than answering the first anonymous request.
17
+ - **@voltro/database, @voltro/cli** — `voltro db apply` and boot auto-migrate could report success while applying nothing, and then record a fingerprint that made every later boot short-circuit on "schema up to date".
32
18
 
33
- `.serverOnly()` columns are removed from the projection automatically: they are stripped from the response regardless, so SELECTing them is pure waste.
19
+ Reported from a live pod: `applied 31 op(s)` on every boot for two releases, with none of the 31 present in the database. Nothing was wrong with the transport, the lock or the transaction — the applier emitted statements that postgres accepted and that changed nothing. Two independent causes:
34
20
 
35
- Trap worth knowing: an eager `include` branch joins on a foreign key, so a projection that omits that FK column breaks the relation keep the FK in `columns` when you also pass `include`. Additive: a new optional `columns` on `CrudListOptions`; omitting it reads the full row exactly as before.
36
- - **@voltro/runtime** — `crud.list(table, options)` gains the read ergonomics a real list view needs, so a generated list isn't limited to "all rows" (the reason a rich hand-written list couldn't move to `crud.*`):
21
+ - A `ColumnSnapshot` carried no `vector` dimension / `array` element / `enum` name, so the applier's type renderers collapsed all three to `text`. A declared `vector(1536)` over a live `text` column planned an `alter-column-type` that emitted `ALTER COLUMN … TYPE text`. Valid, applied, no-op, re-planned forever. (Also meant an `add-column` for a vector, array, enum or PostGIS column created a plain `text` column.) - The default-clause renderers excluded ARRAYS, returning `null`, and the call site turned that into `SET DEFAULT NULL`. A declared `.default([])` on a `json()` column therefore never landed thirty columns were stuck this way in the reporting schema.
37
22
 
38
- ```ts
39
- export default crud.list('absenceRequests', {
40
- filter: (input) => ({ employeeId: input.employeeId, status: input.status }), // → WHERE
41
- paginate: true, // input.limit / input.offset (100 / 0)
42
- sort: [{ column: 'createdAt', direction: 'desc' }], // multi-column
43
- include: { employee: { with: { team: true } } }, // eager relations, nested filter/sort
44
- redact: ['internalNote'],
45
- })
46
- ```
23
+ Fixed: the snapshot carries the type parameters and the renderers delegate to `migrate.ts`'s canonical `sqlType`, so the applier and the CREATE-TABLE emitter cannot disagree; array defaults render (a real `text[]` literal on a native `array()` column, a jsonb literal otherwise); and a default the renderer cannot express now FAILS instead of degrading to `DEFAULT NULL`.
47
24
 
48
- - **`filter`** maps request input to a `WHERE` a column→value map; an `undefined` field is ignored (so an absent filter param is a no-op). Applied through the tenant-scoped `.where`. - **`paginate`** reads `input.limit` / `input.offset` (defaults 100 / 0). - **`sort`** is a multi-column `orderBy`, applied in order. - **`include`** is the SAME spec `.with(...)` takes, so nested relations and per-branch `where` / `orderBy` / `limit` (nested filtering + sort) all work. `getById` takes `include` too.
25
+ And the structural guard, which is the part that matters: **`applyPlan` re-plans against the live schema before it records a fingerprint, and refuses to record one if any operation remains.** DDL that changes nothing succeeds exactly as quietly as DDL that works, so the only evidence a plan applied is that the same planner has nothing left to do. `ApplyPlanCtx` gains a required `replan`; `AppliedMigration` gains `appliedOps` (what EXECUTED, not `plan.operations.length`), and the boot log quotes that.
26
+ - **@voltro/plugin-storage** — `storage.share`, `storage.revoke` and `storage.listGrants` performed no authorization at all.
49
27
 
50
- All optional and additive: `CrudListOptions extends CrudReadOptions`, so a bare `crud.list('t')` or `crud.list('t', { redact })` is unchanged. The descriptor's `input` schema declares the filter/pagination fields, and its `output` schema stays hand-written (deriving the projection from the output schema is a codegen concern a table value can't enter a browser-loaded descriptor).
51
- - **@voltro/runtime** — `crud.list`'s `paginate` now accepts **page-based** paging beside offset-based, and `crud.count` gives a page-based UI the total it needs:
28
+ Each took an object id straight off the wire and passed it to a service method that (correctly, for a trusted server-side API) checks nothing, with nothing in between. Any authenticated caller could grant themselves read or write on any object in the installation, revoke anyone else's grants, and enumerate who an object is shared with.
52
29
 
53
- ```ts
54
- // list: ?page=3&pageSize=20 (or ?limit=20&offset=40 — both work)
55
- export default crud.list('absenceRequests', { paginate: true, filter, sort })
56
- // total for "page 3 of 12"
57
- export default crud.count('absenceRequests', { filter })
58
- ```
30
+ All three now require that the caller owns the object, or carries `admin:full`. A missing object and an unowned object report the same 403 — a 404 would let an unauthorized caller probe which ids exist. `GrantStore` gains `getById`, which `revoke` needs to resolve a grant id back to its object.
59
31
 
60
- - **`page`** is **1-based** (what a UI shows) and pairs with **`pageSize`** (default 100); `offset` is computed as `(page - 1) * pageSize`. A `page` below 1 clamps to the first page rather than producing a negative OFFSET. - **`limit` / `offset`** still work unchanged. `page` wins when a caller sends both. - **`crud.count(table, { filter })`** is a real `COUNT(*)` aggregate over the same tenant-scoped, filtered set — it ignores paging fields on the input, so the total describes the whole result, not the current page. Pass it the SAME `filter` as the list (share the option object) so the count and the pages can't disagree about which rows they mean.
61
-
62
- Additive: paging style is detected from the request input, so an existing `paginate: true` list is unchanged.
63
- - **@voltro/cli** — **`voltro inspect schedules --failing`** — roll up each schedule's recent runs and report only the broken ones, exiting **1** when anything is failing.
64
-
65
- A schedule fires unattended, so a broken one is discovered by someone going to look — and the only thing to look at was the REGISTRATION (which cron exists, when it fires next), never whether it works. That is how three nightly jobs in a downstream app stayed dead for months after a port: each was registered, each fired on time, each threw.
32
+ ### Added
66
33
 
67
- The exit code is the point: it makes this usable as a post-deploy gate (`voltro inspect schedules --failing || exit 1`) rather than something a human has to remember. Needed no new endpoint `/schedules/runs` already returns the recorded firings; the roll-up is a client-side join, which keeps the cost on the diagnostic command instead of on every dashboard poll.
34
+ - **@voltro/runtime, @voltro/database** API keys carry app-owned `metadata` — the second ownership axis.
68
35
 
69
- A trailing success ends a streak (a recovered job is not reported) and `skipped`/`missed` runs are ignoredthose are coordination outcomes, not handler verdicts. Pairs with the schedule failure now logging at `error`.
70
- - **@voltro/runtime** — `ctx.store.links(junction, anchor).setRows(rows)` — a diff-based reconcile for a many-to-many junction that carries PER-ROW PAYLOAD (a membership `role`, a `capacity` value), the case `set(targetIds)` couldn't model. Each row is `{ [targetColumn]: id, …payload }`; the diff is on the (source, target) pair — an added row is inserted with its payload, a removed row deleted, and a SURVIVING row whose payload actually changed is UPDATED. A row whose payload is unchanged is left untouched, so a reactive consumer sees a change only where the payload differs — the drop+reinsert replacement for a data-carrying junction. Returns `{ added, removed, updated }`. Payload is compared by strict per-column equality (scalars). Additive: a new `setRows` method on `JunctionLinks`.
71
- - **@voltro/runtime, @voltro/cli** — **A query can now be projected to a public REST endpoint.** `publicApi` on a descriptor was only ever mounted for mutations and actions — a QUERY carrying it produced no route at all, silently. Both boot paths now mount queries too, so offering an API you don't consume from your own frontend is a one-line annotation:
36
+ `tenantId` and `onBehalfOf` are the two relationships the framework models. Plenty of apps have a third that actually authorizes the key: a team, a project, an environment. `ApiKeyRecord` in `@voltro/protocol` has carried a `metadata` slot all alongits doc comment even names `teamId` as the example — but the SERVICE had nowhere to store it and nowhere to return it. So an app with a team axis could authenticate through the built-in strategy and still not authorize, and `apiKeys: true` was unusable for it. Reported as the one thing that stopped an otherwise complete adoption; their alternatives were a second table joined on the hot auth path, or smuggling `team:<id>` into `scopes`, where `hasScope` would then see a scope that is not a scope.
72
37
 
73
- ```ts
74
- export default defineQuery({
75
- name: 'absenceRequests.list',
76
- input: Schema.Struct({ status: Schema.optional(Schema.String), limit: Schema.optional(Schema.Number) }),
77
- output: Schema.Array(AbsenceRequest),
78
- guards: [requireScope('absences:read')],
79
- publicApi: {}, // → GET /v1/absenceRequests/list?status=open&limit=20
80
- })
81
- ```
38
+ `IssueInput`, `ApiKeyRow` and `ResolvedApiKey` now carry it, stored as JSON on `_voltro_api_keys`, and it survives `rotate` — a rotated key is the same credential with a new secret, so dropping it would silently de-authorize every rotated key.
82
39
 
83
- A query derives **GET**, and its `input` schema binds to the **query string** (`publicApi.ts` wraps it as `{ query }` for GET) so filter and pagination parameters work as plain URL params. Eager relations work too: `include` is resolved server-side by the executor, so the transport makes no difference. This pairs with `crud.list`'s `filter` / `paginate` / `sort` / `include`, which is what makes a REST list endpoint a single declaration.
40
+ It is app data, never identity. The strategy merges it UNDER the framework's own claims: `provider` and the acting `userId` are written afterwards from `onBehalfOf` and always win, including when the answer is "none". A bag that could set `userId` would let whoever minted the key choose who the request is. Pinned end-to-end, not just at the protocol layer.
84
41
 
85
- The one-shot execution is `makeOneShotQueryRunner` (`@voltro/runtime`), built ON TOP of the existing `makeQueryDescriptorProducer` rather than beside it — so the declarative `guards:` gate, the per-request row filter and the tenant/soft-delete scoping are literally the same code the socket path runs. A second implementation would have been an authorization bypass on exactly the reads `publicApi` exposes; the tests pin that a guarded query rejects on the REST path with the executor never running and no read issued. Both handler shapes resolve: a descriptor-returning (reactive) query is finalized and executed to rows, a computed query yields its value. Wired identically in `voltro dev` and `voltro serve` (the dev/serve parity rule) from one shared deps object per path.
86
- - **@voltro/protocol, @voltro/runtime, @voltro/cli** — **`publicApi: { stream: 'sse' }` on a query now streams.** The field was declared but unimplemented — a query annotated with it silently served the first snapshot as JSON. It now mounts a Server-Sent-Events endpoint: the initial `snapshot`, then a `delta` per change, until the client disconnects.
42
+ `PublicApiKey` also gains `createdBy` and `onBehalfOf`, so `service.list` can answer the two questions an admin actually asks about a shared credential. Neither is a secret they are the accountability record, and omitting them hid them from the person responsible for the key.
43
+ - **@voltro/protocol, @voltro/cli** — A boot warning when two auth strategies claim the same bearer-token prefix.
87
44
 
88
- ```ts
89
- export default defineQuery({
90
- name: 'orders.live',
91
- input: Schema.Struct({ status: Schema.optional(Schema.String) }),
92
- output: Schema.Array(Order),
93
- guards: [requireScope('orders:read')],
94
- publicApi: { stream: 'sse' }, // → GET /v1/orders/live?status=open (text/event-stream)
95
- })
96
- ```
45
+ The chain is first-match-wins, so a duplicate claim is not a harmless redundancy: whichever strategy runs first decides the Subject. An app that already has its own `sk_` keys and then sets `apiKeys: true` gets the framework strategy appended on the same prefix — resolving without the app's own team binding — and *which strategy answered* decides whether authorization works. Reported by an app that had to pin a test asserting it never enables the flag.
97
46
 
98
- ```js
99
- const es = new EventSource('/v1/orders/live?status=open')
100
- es.addEventListener('snapshot', (e) => setRows(JSON.parse(e.data).data))
101
- es.addEventListener('delta', (e) => applyDelta(JSON.parse(e.data)))
102
- ```
47
+ `AuthStrategy` gains an optional `claimsBearerPrefix`, set by `apiKeyStrategy` from its `prefix` option. Making the claim declarative is what makes the collision detectable at all — the same "only what is declared can be checked" argument the scope rules run on. Checked in `buildResolveSubject`, which both `voltro dev` and `voltro serve` call, so the two boot paths cannot drift.
103
48
 
104
- Each event's `_tag` becomes the SSE `event:` name, so a client listens per kind rather than switch-ing on a payload field. Framing splits embedded newlines across `data:` lines (a raw `\n` would truncate the event), sends `retry: 5000`, and emits a keep-alive comment every 15s so proxies don't drop an idle stream (`cache-control: no-transform` + `x-accel-buffering: no` for the same reason).
49
+ A warning rather than a refusal: two strategies on one prefix can be deliberate (a migration window where old and new keys share a shape). What must not happen is that it goes unmentioned.
50
+ - **@voltro/protocol, @voltro/cli** — `auth.resolveScopes` — add scopes to an authenticated Subject from your own data, so ROLE-based authorization becomes declarable.
105
51
 
106
- Three things this deliberately does NOT do differently from the socket: authorization (the subscription runs through the same `makeQueryDescriptorProducer`, so the declarative `guards:`, the row filter and tenant scoping are the same code), leak handling (the client's disconnect runs the route's own unsubscribe through the response scope's finalizer, and a disconnect DURING setup tears the late-arriving subscription down), and error reporting (a guard denial arrives as one `error` EVENT by then the response headers are on the wire, so throwing is not available).
52
+ An app whose authorization is a database role (`requireCallerAdmin(ctx)` reading an `employees.role` column) is invisible to every static check the framework has: `voltro check`'s `rbac/unguarded-mutation` reports its writes as unguarded, and it is right to nothing about the decision is declared. But the declarative alternative was unusable for exactly those apps: their subjects come from an external IdP's JWTs and carry no scopes, so `requireScope('employee:admin')` would lock out every real user. One app measured 1566 findings it had no way to act on.
107
53
 
108
- New building blocks, useful beyond publicApi: `PluginHttpRouteResult.stream` lets ANY plugin HTTP route stream, with `sse()` / `sseFrame()` helpers in `@voltro/protocol/rest` for a hand-written `defineRestRoute`; `makeQuerySubscriber` (`@voltro/runtime`) is the shared dispatcher binding both boot paths use. Wired identically in `voltro dev` and `voltro serve`. A `stream: 'sse'` annotation on a mutation/action is ignored (nothing to subscribe to), and a query whose boot layer supplies no subscribe binding falls back to the snapshot response rather than mounting a route that never emits.
109
- - **@voltro/runtime, @voltro/cli** — Boot audit for the `.serverOnly()` marker (#22): `voltro dev` now warns, naming the query + column, when a wire-reachable query's `output` schema DECLARES a `.serverOnly()` column of its `source` table. The `crud.*` read helpers strip these automatically, but a hand-written output can only be caught here — this is what would have flagged the reported dead `apiKeys.getByKeyId` query that shipped a `keyHash`.
54
+ Lifting the role into `subject.scopes` makes the SAME authorization declarable, visible in the manifest and checkable in CI. Deliberately narrow: the hook returns SCOPES, never a Subject — it cannot change `id` or `tenantId` (identity belongs to the auth strategy), and the result is unioned with the strategy's own scopes, so it can grant but never revoke. It runs per matched request, so cache the lookup yourself; the framework does not, because only the app knows how fast a role change must take effect. Wired identically in `voltro dev` and `voltro serve`.
55
+ - **@voltro/cli** — `voltro doctor` reports packages resolved at more than one version.
110
56
 
111
- Backed by pure, unit-tested helpers exported from `@voltro/runtime`: `serverOnlyLeaks` (a query's output vs its source's serverOnly columns) and `schemaPropertyNames` (best-effort field introspection over the output Schema AST Struct / Array-of-Struct / NullOr / nested). Detection under-covers rather than false-positives: a shape it can't read yields no field names. The fix it points you at is to omit the column from the output schema (a runtime strip would fail the encode against a schema that still declares the field the reason this is an audit, not a strip).
112
- - **@voltro/database, @voltro/runtime** — `.serverOnly()` column marker + `serverOnlyColumns(table)` (#22) — the wire-EXPOSURE axis, declared explicitly at the schema and distinct from `.encrypted()` (storage at rest) and `.sensitive()` (export masking). A `.serverOnly()` column is read normally by server code but must never be serialized to a client:
57
+ A consumer reported type errors inside the GENERATED `rpcGroup.generated.ts` `Property '[TypeId]' is missing`, `typeof Never is not assignable to All`, an `Rpc<…, Stream<…>, …>` refused where `Any` was expectedand reasonably concluded the framework emits bad types, because the errors land in a file they cannot edit and did not write. That is the signature of two copies of `effect` in one install: Effect's types are nominal, so a Schema built by one copy is not the type the other expects.
113
58
 
114
- ```ts
115
- keyHash: text().serverOnly(), // an auth middleware verifies it; a client never sees it
116
- apiToken: text().encrypted().serverOnly(), // a column can carry both axes, or either
117
- ```
59
+ It deserves its own check because the RUNTIME usually stays green — two instances only diverge where identity matters — so an app boots, serves and passes its tests while `tsc` is red, which sends people looking at the compiler instead of the dependency tree. The report names the versions, the paths, and the errors it explains. Only identity-sensitive packages count (`effect`, `@effect/*`, `@voltro/*`, react/react-dom); a duplicated string utility is wasteful, not a bug class.
60
+ - **@voltro/cli** `voltro doctor` flags an executor that never names its own descriptor.
118
61
 
119
- The [`crud.*` read helpers](#) strip `.serverOnly()` columns from every returned row AUTOMATICALLY declare the exposure policy once at the schema and every crud read respects it, so you can't forget it on a handler (the single-source form of the per-call `redact` option, which still works for anything not worth a marker).
62
+ Descriptor/executor pairing is by FILENAME, which is rightand it means a `*.server.ts` can be a complete, correct executor with no reference at all to the contract it implements. Those are exactly the files where a hand-written input drifts from the wire.
120
63
 
121
- Why a NEW axis rather than reusing `.encrypted()`: encryption at rest says nothing about who may receive the plaintextdecrypting a private note *for its owner* is a valid case, so treating "encrypted" as "never to a client" would be wrong. Exposure is stated explicitly. Default stays exposed to both server and client; `.serverOnly()` opts a column out of the client.
64
+ Reported after a 426-executor migration to `ExecutorInput<typeof descriptor>`: three files were skipped by the app's own codemod for a reason no reviewer would guess they never imported their descriptor, so there was no `typeof` to point at. In the same codebase, six executors had written `boardPurpose: string` where their descriptor declared `Schema.Literal(...)`, discarding the contract at the executor boundary. Only imports of a SIBLING module clear the finding: an executor importing nothing but `@voltro/*` and `node:*` has still not named its contract.
65
+ - **@voltro/database** — `updateManyRow(store, table, patch, { where })` — the last untyped write is now typed against its table.
122
66
 
123
- Additive: a `serverOnly()` builder method + a `serverOnly?` flag on `ColumnDefinition` + the `serverOnlyColumns` helper. Enforcement beyond the `crud.*` patha runtime strip at the rpc wire boundary and a `serverOnly: true` whole-query primitive is a planned follow-on (see `plans/framework-serverOnly-exposure.md`).
67
+ `insertRow` and `upsertRow` already were; `ctx.store.updateMany(table, row, { where })` still took a string table name and an untyped row literal. Worth closing because the typed versions were measured: migrating 29 `store.upsert` call sites to `upsertRow` produced 15 `tsc` errors across 8 distinct defects that no test had caught including seven per-user mutations with no authentication check at all (they wrote `ctx.request.subject.id`, typed `string | null`, into a NOT NULL column, so an anonymous caller reached the database and got a raw statement failure instead of a typed refusal).
124
68
 
125
69
  ### Fixed
126
70
 
127
- - **@voltro/cli** — Machine output is now consistent across the CLI. `--json` works everywhere it should: the inspect-family commands (inspect/logs/traces/cluster/check) accept `--json` (and `--format=json`) as an alias for `--format json` — `voltro inspect app --json` silently produced pretty output before; and cloud/capabilities/doctor accept both spellings too. All `--json` payloads route through one `printJson` helper, and `bin.ts` now drains stdout before `process.exit`, so a large payload piped to a file / `| jq` is no longer truncated (only `voltro db --json` was safe before). A user-invocation mistake (no app.config here, a memory dialect where a real one is needed) now prints a clean one-line error instead of a stack trace (new `CliError`, rendered by bin.ts).
128
- - **@voltro/cli** — `voltro version` now prints the real installed version (was a hardcoded `v0.0.0 (scaffold)` placeholder); usage / unknown-command / version output say "voltro" instead of "framework". `voltro <command> --help` (and `-h`) now prints the command summary and returns 0 for EVERY command instead of, in several cases, running the command — `voltro env --help` used to run the env check and could exit 1. Commands with their own richer help (inspect/logs/doctor/secret) still show it. Honest command summaries: `db` now lists its declarative-workflow subcommands (plan/apply/plans/drift/squash/restore-snapshot/files/…) and drops the never-implemented `generate`; `serverless` lists `dev`/`serve` and the `node` default target; `workflows` lists `start`. `voltro cloud deploy`/`rollback`, which are not yet implemented, now fail (non-zero, stderr) instead of printing a message and returning success, and are marked "coming soon" in help.
129
- - **@voltro/cli** — Security: the inspect API's CORS now reflects the request `Origin` and allows credentials ONLY for loopback origins (localhost / 127.0.0.0/8 / ::1). Previously it echoed ANY origin with `access-control-allow-credentials: true`, so a website a developer visited could issue a credentialed cross-origin `fetch` and read the (default-open) inspect surface — DB rows, logs, schema, drift — and POST to fire schedules / start workflows. A non-loopback origin now gets no `access-control-allow-origin`, so the browser blocks the read; curl / same-origin / the local dashboard are unaffected. Also: the dashboard proxy (`/api/dashboard/proxy?target=`) now requires a loopback target (it forwards the caller's bearer, so an arbitrary target was an SSRF + bearer-harvest), and `~/.voltro/credentials.json` is written 0600 in a 0700 dir instead of world-readable.
130
- - **@voltro/cli** — `voltro serverless serve`/`dev` now exits non-zero when the server fails to bind or crashes at boot (it returned 0 = success, so a CI/deploy wrapper read a dead server as up). The production `voltro serve` shutdown chain gained a terminal `.catch` + a 10s force-exit safety net, so a rejected/hung drain step (plugin deactivate, pool close) no longer strands the process until the container's SIGKILL grace timer. `voltro e2e` cleanup now escalates SIGTERM→SIGKILL for a child that ignores SIGTERM (was lingering on :4000/:5190 and EADDRINUSE-ing the next run). `voltro migrate` now warns when it falls back to the default `localhost:5432` DB with no DB_URL/DB_HOST set.
131
- - **@voltro/cli** — CLI flag parsing is now shared (`src/cliArgs.ts`: `flagValue` / `takeFlag` / `hasFlag` / `positionals`) instead of each command hand-rolling its own `indexOf('--x'); args[i+1]`. Adopted across data, serve, cloud, db (14 sites), baseline, and secret — so every command accepts `--name value` AND `--name=value` uniformly. Group-command exit codes are standardized too: an unknown subcommand exits 2, a missing subcommand exits 1 (was a mix of 0/1/1-vs-1 including a dead `? 1 : 1` ternary in storage).
132
- - **@voltro/runtime** — **`crud.list` now caps the page size (default 1000).** The page size is CALLER-controlled — `input.limit` / `input.pageSize` — and nothing anywhere clamped it, so `?limit=1000000000` was a one-request read of the whole table. That was already unwelcome over the WebSocket; it became a genuine exposure the moment a query could be projected to a public REST endpoint (`publicApi`), where the caller is anyone who can reach the URL.
133
-
134
- - `limit` / `pageSize` above the cap are **clamped, not rejected** (a caller asking for too much gets the maximum page, not a 400). - `maxPageSize` raises it deliberately for an export-style endpoint. - A zero/negative `limit` clamps to 1 row, and a negative `offset` / `page < 1` clamps to 0 rather than producing a negative OFFSET (which dialects reject or treat oddly). Non-integers are floored.
135
-
136
- Found by auditing the paging code introduced in this same series — the cap was missing from the start, so this is a fix, not a behaviour change anyone relied on.
137
- - **@voltro/plugin-ai-flows** — **An AI-flow `MediaGenerator` can now require services.** Its type pinned the Effect requirement channel to `never`, so the common implementation — generate, then persist through `StorageService` — was untypeable while working perfectly at runtime. A type that forbids what the program does is a type lying about the program; the host was left carrying a documented cast.
138
-
139
- `MediaGenerator` and its `EngineDeps` siblings (`resolveAgent`, `onEvent`, `memoryPrefix`) now declare `R = unknown`, the same shape `@voltro/ai` uses for tool bodies (`execute?: (input) => Effect<O, never, unknown>`). The engine runs inside the host's runtime, which HAS those services, and states that fact once in a `callDep` bridge rather than at every call site — mirroring `callBody` in `@voltro/ai`.
140
-
141
- `apiSurface: compatible` — the change WIDENS the requirement channel on callbacks the app IMPLEMENTS. An existing implementation that requires nothing (`Effect<A, E, never>`) stays assignable to the widened type, so no downstream implementation breaks; the only consumer of the narrow form was the engine itself, which now bridges it. Verified by a full repo typecheck.
142
- - **@voltro/cli** — **Four discovered conventions were missing from the serve bundle — a prod-only boot crash waiting for an app to use them.** `voltro build` bundles the modules matching `API_ENTRY_PATTERN`; `voltro serve` resolves every app module from that bundle, and a convention the pattern misses falls back to loading `.ts` SOURCE, which a plain-node boot cannot do. `*.outbox.ts`, `*.connection.ts`, `*.email.tsx` and `*.migration.ts` were all absent — and all four are loaded at serve time (`serveCommand` filters outbox handlers explicitly, noting that without them the transactional outbox enqueues rows in production that nothing delivers). Fixed, and the lockstep is now a TEST (`apiEntryPatternLockstep.test.ts`) that asserts a representative filename for every convention matches — it found these four the moment it was written.
143
-
144
- **The file conventions are now single-sourced** (`fileConventions.ts`). They were declared in five modules — dev discovery, plugin codegen, framework-table assembly, migrate, the db command — and copies of a rule that IS the rule drift silently, because each copy is internally consistent. `WORKFLOW_PATTERN` had already drifted into two shapes: strict `\.workflow\.tsx$` in discovery, loose `\.workflow\.tsx?$` in table assembly. So a file named `orders.workflow.ts` got `_voltro_workflow_*` TABLES (the loose copies counted it) but was never registered as a workflow (the strict copy skipped it) — no error, no warning, just a workflow that did nothing.
145
-
146
- The two copies were answering DIFFERENT questions, and conflating them is what made the bug invisible, so both are now named: `WORKFLOW_DESCRIPTOR_PATTERN` (strict — the executor is paired by rewriting that exact suffix, so `.ts` could never work) and `WORKFLOW_PRESENCE_PATTERN` (loose on purpose — over-provisioning a table is harmless, missing one breaks a boot). `voltro dev` now WARNS on the gap between them, naming the file and the one-character fix, instead of skipping in silence.
147
- - **@voltro/database** — **A `.sensitive()` / `.safe()` marker no longer moves the schema fingerprint.** They emit no DDL and introspection never reads them back, yet they fed the hash — so adding a classification flipped the boot fast-path to "the declaration changed" and forced a full diff. A classification sweep over a few hundred tables therefore triggered a migration run, and any drift that had accumulated silently since the last real change surfaced THERE, triggered by an edit with nothing to do with it. Reported from a boot that then REFUSED and crash-looped on 31 pending ops, none of which came from the change that moved the hash.
148
-
149
- They join `idScheme` in `stripFingerprintHints`, which already existed for exactly this class. The rule, now written down where the next field gets added: **if introspection cannot read it back, it does not belong in the fingerprint** — the hash answers "does the database match the declaration?", not "did any character of the declaration change?".
150
-
151
- Tested including the control case (a real DDL change must still move the hash, or the test would pass against a hash that ignores everything).
152
- - **@voltro/i18n** — `createTypedMessages` (#16) now collects a REAL var nested inside a plural/select branch (#21). Previously `'{count, plural, one {# blocker in {discipline}} other {# blockers in {discipline}}}'` required only `count` — `discipline`, which lives inside the branches, was not extracted, so `t('key', { count })` compiled and then threw `The intl string context variable "discipline" was not provided` when it rendered. Now both `count` AND `discipline` are required at the call site.
153
-
154
- `ICUVars` was rewritten to SCAN every `{` and classify what follows it (an arg name / a bare placeholder / a structural branch to skip) rather than match a "body up to the matching `}`", which a nested `{var}` broke. It handles arbitrary nesting, and a branch's literal text (`# days`) is still never mistaken for a var.
155
-
156
- `apiSurface: compatible` — the `ICUVars<S>` signature is unchanged (only its body). The stricter extraction cannot break WORKING code: a call that omitted the nested var was already throwing at render (that is the bug this fixes); code that passed it — the documented workaround — keeps compiling.
157
- - **@voltro/protocol, @voltro/plugin-openapi** — **A streaming route is now visible on the descriptor, and OpenAPI documents it as one.** When `publicApi: { stream: 'sse' }` shipped, the streaming-ness lived inside the handler closure — so anything that INSPECTS a route without running it couldn't tell a stream from a buffered response. The OpenAPI generator therefore emitted `content: { 'application/json': <output schema> }` for an SSE endpoint: a spec that generates clients which try to parse the whole event stream as one JSON value.
158
-
159
- `RestRouteDescriptor` gains `streaming?: boolean`, `publicApiRoute` sets it for a `stream: 'sse'` query, and the generator emits `text/event-stream` (with no JSON response schema) for such a route.
160
-
161
- Worth stating as a rule, since it is the second time this shape has cost something: a fact that tooling must act on belongs on the DESCRIPTOR, not in the closure that implements it. A wrong spec is worse than a missing one — clients are generated from it.
162
- - **@voltro/runtime, @voltro/cli** — **A failing schedule handler is now an ERROR, not a warn.** A schedule fires unattended — there is no user watching a request fail — so the log line IS the discovery channel. It was `warn`, which `voltro logs --level error` does not show, and the only other surface is a dashboard nobody has open on staging.
163
-
164
- The root cause was structural rather than a bad choice: `SchedulerLogger` had no error channel at all (`info` / `warn` / optional `debug`), so the level was not expressible. It now has one — optional, so an embedder passing a two-method logger still compiles, falling back to `warn` — and BOTH boot paths (`voltro dev`, `voltro serve`) wire it, since a channel nothing supplies would have changed nothing.
165
-
166
- Reported from an app where three nightly jobs had been dead since a port — one of them an entire feature that never wrote a single row — each failing on EVERY firing, for months, at `warn`. The failure was already recorded in `_voltro_schedule_runs` (`status: 'failed'`) and published on the server-error bus; the log level was the one place that disagreed with both.
167
- - **@voltro/runtime** — **`ctx.workflows.start` now validates the payload against the workflow's schema, and says so when it doesn't match.** The signature is `(workflowName: string, payload: unknown)` — the name was not checked against the registry and the payload was not checked against anything — so a caller that drifted from the workflow's schema failed DEEP inside the engine, where the message reads like the workflow itself misbehaved.
168
-
169
- A mismatch now throws a `WorkflowPayloadError` carrying `workflowName`, `missingFields`, and the formatted parse error, and an unknown name lists the workflows that ARE registered (so a rename reads differently from a deletion). `run()` and `executionId()` validate too — `start` is not the only entry point.
71
+ - **@voltro/runtime** — A `cache:` declared on a query whose handler returns a COMPUTED value was silently ignored; it now says so.
170
72
 
171
- Validation is on the DECODED side (`Schema.validate`, not `decodeUnknown`): a `Schema.Date` payload accepts a `Date`. Using `decodeUnknown` here would have rejected valid calls the check meant to protect the caller breaking them.
73
+ The snapshot cache wraps the store read, and a computed query has none — its handler has already run by the time the binding is built. Caching one would mean wrapping the handler invocation, which is a different feature. Until that exists, the honest failure is a loud one: silently ignoring the config is how an author ends up believing a hot query is cached while every subscriber re-runs it. The data stays correct, so nothing else would ever tell them. Warned once per query name, not per subscribe.
74
+ - **@voltro/cli** — The minted `.env.local` is handed to the workspace's owner, and an unreadable env file explains itself.
172
75
 
173
- Reported from an app where a cron fired such a start on every tick: three nightly jobs dead since a port, one of them an entire feature that never wrote a row. The payload was the bug and nothing in the failure said so. Pairs with the schedule failure now logging at `error`.
76
+ A dev container running as root with the host workspace bind-mounted wrote `apps/api/.env.local` as `root:root 0600` INTO THE SHARED WORKSPACE. On the host, everything that loads env then died with EACCES vitest, `voltro doctor`, the editor — and the developer could not even read the file, while the next container boot recreated it. Container-with-bind-mount is the ordinary dev shape, not an edge case.
174
77
 
175
- ### Internal (no consumer-facing effect)
78
+ `0600` stays (the file holds a real signing key), because loosening it to `0644` would make that key readable by every account on the machine for the far more common single-user case. Ownership was the wrong variable, so that is the one corrected: the mint chowns the file to whoever owns the directory, which root can do — exactly the case that needs it — and reports loudly when it cannot. A plain EACCES while loading an env file now names the owning uid, the mode and the current uid, because that pair IS the diagnosis and none of it appears in node's message.
79
+ - **@voltro/cli** — Four tooling fixes, all from downstream reports:
176
80
 
177
- - **@voltro/cli** Test-only: cover the migrationRunner SQL apply/rollback path (the report's top coverage gap). `migrationRunnerApply.test.ts` runs real defineMigration steps against PostgresCREATE/DROP via the SqlClient, asserting the DDL ran, the `_voltro_migrations` ledger recorded it, re-run skips, and rollback reverts gated on a reachable Postgres (docker-compose `postgres-test` on :55432, or DB_URL) and skipped when down, per the dialect-parity convention. (The runner's ledger upsert uses `now()` + `ON CONFLICT`, so it is genuinely not sqlite-testable.)
81
+ - **`voltro check --offline` crashed on any app that declares a workflow.** It built workflow entries as `{ name }` behind an `as never` while `InspectWorkflowEntry` is keyed by `tag`, so the manifest's sort read `undefined` and threw — surfacing as "could not assemble the graph from source" rather than the type error underneath. The cast is what let the two shapes disagree. - **`voltro check --offline` reported plugin tables as `dangling-source`.** It collected only the app's own `*.entity.ts` tables, so a query reading `_voltro_storage_refs` was an `error` which sets the exit code, failing the CI gate the offline mode exists for. It now uses the same `assembleFrameworkTables` the migrator does. - **`voltro test` now derives `resolve.alias` from the app's tsconfig `paths`.** An app mapping `@/* → ./src/*` could not test any module importing through it (`Cannot find package '@/locales/en'`), and the workaround was a local `vitest.config.ts` restating what tsconfig already said. - **The `raw-fetch` doctor rule follows the import graph.** Keyed on filename conventions it caught 9 of 39 outbound calls on the reporting app; the other 30 were in `lib/*.ts` helpers only server code imports. A file reachable from a server-convention file and from nothing else is server code; one a page also imports is not, and stays unflagged.
@@ -11,16 +11,16 @@
11
11
  "dependencies": {
12
12
  "@effect/platform": "^0.96.1",
13
13
  "@effect/rpc": "^0.75.1",
14
- "@voltro/ai": "0.12.0",
15
- "@voltro/cli": "0.12.0",
16
- "@voltro/database": "0.12.0",
17
- "@voltro/env": "0.12.0",
18
- "@voltro/protocol": "0.12.0",
19
- "@voltro/runtime": "0.12.0",
14
+ "@voltro/ai": "0.13.0",
15
+ "@voltro/cli": "0.13.0",
16
+ "@voltro/database": "0.13.0",
17
+ "@voltro/env": "0.13.0",
18
+ "@voltro/protocol": "0.13.0",
19
+ "@voltro/runtime": "0.13.0",
20
20
  "effect": "^3.21.2"
21
21
  },
22
22
  "devDependencies": {
23
- "@voltro/testing": "0.12.0",
23
+ "@voltro/testing": "0.13.0",
24
24
  "typescript": "^5.7.0",
25
25
  "vitest": "^3.0.0"
26
26
  }
@@ -12,17 +12,17 @@
12
12
  "dependencies": {
13
13
  "@effect/platform": "^0.96.1",
14
14
  "@effect/rpc": "^0.75.1",
15
- "@voltro/cli": "0.12.0",
16
- "@voltro/database": "0.12.0",
17
- "@voltro/env": "0.12.0",
18
- "@voltro/plugin-auth": "0.12.0",
19
- "@voltro/protocol": "0.12.0",
20
- "@voltro/runtime": "0.12.0",
21
- "@voltro/sql-postgres": "0.12.0",
15
+ "@voltro/cli": "0.13.0",
16
+ "@voltro/database": "0.13.0",
17
+ "@voltro/env": "0.13.0",
18
+ "@voltro/plugin-auth": "0.13.0",
19
+ "@voltro/protocol": "0.13.0",
20
+ "@voltro/runtime": "0.13.0",
21
+ "@voltro/sql-postgres": "0.13.0",
22
22
  "effect": "^3.21.2"
23
23
  },
24
24
  "devDependencies": {
25
- "@voltro/testing": "0.12.0",
25
+ "@voltro/testing": "0.13.0",
26
26
  "typescript": "^5.7.0",
27
27
  "vitest": "^3.0.0"
28
28
  }
@@ -12,16 +12,16 @@
12
12
  "dependencies": {
13
13
  "@effect/platform": "^0.96.1",
14
14
  "@effect/rpc": "^0.75.1",
15
- "@voltro/cli": "0.12.0",
16
- "@voltro/database": "0.12.0",
17
- "@voltro/env": "0.12.0",
18
- "@voltro/plugin-multitenancy": "0.12.0",
19
- "@voltro/protocol": "0.12.0",
20
- "@voltro/runtime": "0.12.0",
15
+ "@voltro/cli": "0.13.0",
16
+ "@voltro/database": "0.13.0",
17
+ "@voltro/env": "0.13.0",
18
+ "@voltro/plugin-multitenancy": "0.13.0",
19
+ "@voltro/protocol": "0.13.0",
20
+ "@voltro/runtime": "0.13.0",
21
21
  "effect": "^3.21.2"
22
22
  },
23
23
  "devDependencies": {
24
- "@voltro/testing": "0.12.0",
24
+ "@voltro/testing": "0.13.0",
25
25
  "typescript": "^5.7.0",
26
26
  "vitest": "^3.0.0"
27
27
  }
@@ -12,16 +12,16 @@
12
12
  "dependencies": {
13
13
  "@effect/platform": "^0.96.1",
14
14
  "@effect/rpc": "^0.75.1",
15
- "@voltro/cli": "0.12.0",
16
- "@voltro/database": "0.12.0",
17
- "@voltro/env": "0.12.0",
18
- "@voltro/plugin-deactivation": "0.12.0",
19
- "@voltro/protocol": "0.12.0",
20
- "@voltro/runtime": "0.12.0",
15
+ "@voltro/cli": "0.13.0",
16
+ "@voltro/database": "0.13.0",
17
+ "@voltro/env": "0.13.0",
18
+ "@voltro/plugin-deactivation": "0.13.0",
19
+ "@voltro/protocol": "0.13.0",
20
+ "@voltro/runtime": "0.13.0",
21
21
  "effect": "^3.21.2"
22
22
  },
23
23
  "devDependencies": {
24
- "@voltro/testing": "0.12.0",
24
+ "@voltro/testing": "0.13.0",
25
25
  "typescript": "^5.7.0",
26
26
  "vitest": "^3.0.0"
27
27
  }
@@ -15,7 +15,7 @@ import { database } from '../database/schema' // registers users / actors / tena
15
15
  import createUser from '../mutations/users.create.mutation.server'
16
16
  import deactivateUser from '../mutations/users.deactivate.mutation.server'
17
17
 
18
- const subject = { type: 'user' as const, id: 'user_1', tenantId: null }
18
+ const subject = { type: 'user' as const, id: 'user_1', tenantId: 'acme' }
19
19
 
20
20
  describe('users.create', () => {
21
21
  it('inserts a user with an auto-injected id and no deactivation timestamp', async () => {
@@ -12,18 +12,18 @@
12
12
  "dependencies": {
13
13
  "@react-email/components": "^1.0.12",
14
14
  "@react-email/render": "^1.4.0",
15
- "@voltro/cli": "0.12.0",
16
- "@voltro/database": "0.12.0",
17
- "@voltro/env": "0.12.0",
18
- "@voltro/plugin-mail": "0.12.0",
19
- "@voltro/plugin-multitenancy": "0.12.0",
20
- "@voltro/protocol": "0.12.0",
21
- "@voltro/runtime": "0.12.0",
15
+ "@voltro/cli": "0.13.0",
16
+ "@voltro/database": "0.13.0",
17
+ "@voltro/env": "0.13.0",
18
+ "@voltro/plugin-mail": "0.13.0",
19
+ "@voltro/plugin-multitenancy": "0.13.0",
20
+ "@voltro/protocol": "0.13.0",
21
+ "@voltro/runtime": "0.13.0",
22
22
  "effect": "^3.21.2",
23
23
  "react": "^19.0.0"
24
24
  },
25
25
  "devDependencies": {
26
- "@voltro/testing": "0.12.0",
26
+ "@voltro/testing": "0.13.0",
27
27
  "typescript": "^5.7.0",
28
28
  "vitest": "^3.0.0"
29
29
  }
@@ -12,18 +12,18 @@
12
12
  "dependencies": {
13
13
  "@effect/platform": "^0.96.1",
14
14
  "@effect/rpc": "^0.75.1",
15
- "@voltro/cli": "0.12.0",
16
- "@voltro/database": "0.12.0",
17
- "@voltro/env": "0.12.0",
18
- "@voltro/plugin-multitenancy": "0.12.0",
19
- "@voltro/plugin-storage": "0.12.0",
20
- "@voltro/protocol": "0.12.0",
21
- "@voltro/runtime": "0.12.0",
22
- "@voltro/sql-mysql": "0.12.0",
15
+ "@voltro/cli": "0.13.0",
16
+ "@voltro/database": "0.13.0",
17
+ "@voltro/env": "0.13.0",
18
+ "@voltro/plugin-multitenancy": "0.13.0",
19
+ "@voltro/plugin-storage": "0.13.0",
20
+ "@voltro/protocol": "0.13.0",
21
+ "@voltro/runtime": "0.13.0",
22
+ "@voltro/sql-mysql": "0.13.0",
23
23
  "effect": "^3.21.2"
24
24
  },
25
25
  "devDependencies": {
26
- "@voltro/testing": "0.12.0",
26
+ "@voltro/testing": "0.13.0",
27
27
  "typescript": "^5.7.0",
28
28
  "vitest": "^3.0.0"
29
29
  }
@@ -10,17 +10,17 @@
10
10
  "test": "voltro test"
11
11
  },
12
12
  "dependencies": {
13
- "@voltro/cli": "0.12.0",
14
- "@voltro/database": "0.12.0",
15
- "@voltro/env": "0.12.0",
16
- "@voltro/plugin-multitenancy": "0.12.0",
17
- "@voltro/plugin-storage": "0.12.0",
18
- "@voltro/protocol": "0.12.0",
19
- "@voltro/runtime": "0.12.0",
13
+ "@voltro/cli": "0.13.0",
14
+ "@voltro/database": "0.13.0",
15
+ "@voltro/env": "0.13.0",
16
+ "@voltro/plugin-multitenancy": "0.13.0",
17
+ "@voltro/plugin-storage": "0.13.0",
18
+ "@voltro/protocol": "0.13.0",
19
+ "@voltro/runtime": "0.13.0",
20
20
  "effect": "^3.21.2"
21
21
  },
22
22
  "devDependencies": {
23
- "@voltro/testing": "0.12.0",
23
+ "@voltro/testing": "0.13.0",
24
24
  "typescript": "^5.7.0",
25
25
  "vitest": "^3.0.0"
26
26
  }
@@ -11,17 +11,17 @@
11
11
  "dependencies": {
12
12
  "@effect/platform": "^0.96.1",
13
13
  "@effect/rpc": "^0.75.1",
14
- "@voltro/cli": "0.12.0",
15
- "@voltro/database": "0.12.0",
16
- "@voltro/env": "0.12.0",
17
- "@voltro/plugin-governance": "0.12.0",
18
- "@voltro/plugin-multitenancy": "0.12.0",
19
- "@voltro/protocol": "0.12.0",
20
- "@voltro/runtime": "0.12.0",
14
+ "@voltro/cli": "0.13.0",
15
+ "@voltro/database": "0.13.0",
16
+ "@voltro/env": "0.13.0",
17
+ "@voltro/plugin-governance": "0.13.0",
18
+ "@voltro/plugin-multitenancy": "0.13.0",
19
+ "@voltro/protocol": "0.13.0",
20
+ "@voltro/runtime": "0.13.0",
21
21
  "effect": "^3.21.2"
22
22
  },
23
23
  "devDependencies": {
24
- "@voltro/testing": "0.12.0",
24
+ "@voltro/testing": "0.13.0",
25
25
  "typescript": "^5.7.0",
26
26
  "vitest": "^3.0.0"
27
27
  }
@@ -71,7 +71,12 @@ describe('authors.withBooks', () => {
71
71
  const rows = await ctx.store.query(authorsWithBooksExecute({}, ctx).descriptor)
72
72
 
73
73
  expect(rows).toHaveLength(1)
74
- const ada = rows[0] as { id: string; name: string; books: ReadonlyArray<{ title: string }> }
74
+ // Narrow BEFORE describing the shape: under `noUncheckedIndexedAccess`
75
+ // `rows[0]` is `Row | undefined`, and a cast that spans that gap is the one
76
+ // TypeScript refuses outright ("neither type sufficiently overlaps").
77
+ const first = rows[0]
78
+ if (first === undefined) throw new Error('expected one author row')
79
+ const ada = first as unknown as { id: string; name: string; books: ReadonlyArray<{ title: string }> }
75
80
  expect(ada.name).toBe('Ada')
76
81
  expect(ada.books.map((b) => b.title).sort()).toEqual(['Analytical Engine', 'Notes'])
77
82
  })
@@ -11,17 +11,17 @@
11
11
  "dependencies": {
12
12
  "@effect/platform": "^0.96.1",
13
13
  "@effect/rpc": "^0.75.1",
14
- "@voltro/cli": "0.12.0",
15
- "@voltro/database": "0.12.0",
16
- "@voltro/env": "0.12.0",
17
- "@voltro/plugin-multitenancy": "0.12.0",
18
- "@voltro/protocol": "0.12.0",
19
- "@voltro/runtime": "0.12.0",
20
- "@voltro/workflow": "0.12.0",
14
+ "@voltro/cli": "0.13.0",
15
+ "@voltro/database": "0.13.0",
16
+ "@voltro/env": "0.13.0",
17
+ "@voltro/plugin-multitenancy": "0.13.0",
18
+ "@voltro/protocol": "0.13.0",
19
+ "@voltro/runtime": "0.13.0",
20
+ "@voltro/workflow": "0.13.0",
21
21
  "effect": "^3.21.2"
22
22
  },
23
23
  "devDependencies": {
24
- "@voltro/testing": "0.12.0",
24
+ "@voltro/testing": "0.13.0",
25
25
  "typescript": "^5.7.0",
26
26
  "vitest": "^3.0.0"
27
27
  }