@voltro/cli 0.20.2 → 0.21.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.
- package/CHANGELOG.md +149 -0
- package/THIRD-PARTY-NOTICES.md +61 -61
- package/dist/{apiBuild-qZBEu59d.js → apiBuild-BHOtsQkp.js} +93 -80
- package/dist/apiBuild-K7M6Rt0U.js +2 -0
- package/dist/bin.js +41 -20
- package/dist/{commands-kYbfVoPO.js → commands-BZoimvvS.js} +2752 -2633
- package/dist/{dbCommand-BPp9R0Wc.js → dbCommand-CDBbZ-Ac.js} +27 -13
- package/dist/dbCommand-oADAj6ez.js +2 -0
- package/dist/dev-CZQ73Yoh.js +3 -0
- package/dist/{dev-OHLsAq4K.js → dev-DKb92NYX.js} +1537 -1527
- package/dist/index.js +1 -1
- package/dist/{inspectMetrics-DvPNXmGA.js → inspectMetrics-DMjWBQif.js} +576 -567
- package/dist/serveCommand-qHJCs0cX.js +1162 -0
- package/dist/serveEntry.js +2 -2
- package/dist/{start-CXQ7WL1W.js → start-B1x6Z60h.js} +389 -389
- package/dist/startEntry.js +2 -2
- package/package.json +27 -27
- package/templates/AGENTS.md +1 -1
- package/templates/agent-docs/_index.md +1 -1
- package/templates/agent-docs/cli.md +63 -0
- package/templates/agent-docs/database/migrations.md +33 -11
- package/templates/agent-docs/database/schema.md +7 -0
- package/templates/agent-docs/database/seedsdialects.md +3 -3
- package/templates/agent-docs/whats-new.md +136 -9
- package/templates/apps/api-ai/package.json +12 -12
- package/templates/apps/api-auth/package.json +13 -13
- package/templates/apps/api-backend/package.json +12 -12
- package/templates/apps/api-backend-deactivation/package.json +12 -12
- package/templates/apps/api-backend-mail/package.json +11 -11
- package/templates/apps/api-backend-mariadb/package.json +14 -14
- package/templates/apps/api-backend-storage/package.json +11 -11
- package/templates/apps/api-data-advanced/package.json +13 -13
- package/templates/apps/api-durable/package.json +13 -13
- package/templates/apps/api-feature-flags/package.json +14 -14
- package/templates/apps/api-governance/package.json +13 -13
- package/templates/apps/api-kv/package.json +13 -13
- package/templates/apps/api-moderation/package.json +13 -13
- package/templates/apps/api-observability/package.json +13 -13
- package/templates/apps/api-ratelimit/package.json +13 -13
- package/templates/apps/api-rbac/package.json +13 -13
- package/templates/apps/api-rest/package.json +12 -12
- package/templates/apps/api-saas/package.json +16 -16
- package/templates/apps/api-search/package.json +13 -13
- package/templates/apps/api-versioning/package.json +13 -13
- package/templates/apps/api-webhooks/package.json +14 -14
- package/templates/apps/changelog/package.json +8 -8
- package/templates/apps/edge-functions/package.json +5 -5
- package/templates/apps/frontend-admin/package.json +10 -10
- package/templates/apps/frontend-app/package.json +10 -10
- package/templates/apps/frontend-blank/package.json +9 -9
- package/templates/apps/frontend-contact/package.json +11 -11
- package/templates/apps/frontend-dashboard/package.json +9 -9
- package/templates/apps/frontend-docs/package.json +9 -9
- package/templates/apps/frontend-i18n/package.json +8 -8
- package/templates/apps/frontend-landing/package.json +9 -9
- package/templates/apps/frontend-spa/package.json +9 -9
- package/templates/apps/frontend-ssr/package.json +9 -9
- package/templates/apps/frontend-ssr-api/package.json +10 -10
- package/templates/apps/frontend-static-blog/package.json +8 -8
- package/dist/apiBuild-C9aHz4Yh.js +0 -2
- package/dist/dbCommand-DtUe-0dM.js +0 -2
- package/dist/dev-2AvdzDg2.js +0 -3
- package/dist/serveCommand-BKqTKWTX.js +0 -1136
- /package/templates/patches/{@effect__cluster@0.59.0.patch → @effect__cluster@0.60.0.patch} +0 -0
package/dist/startEntry.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t } from "./start-
|
|
1
|
+
import { X as e } from "./inspectMetrics-DMjWBQif.js";
|
|
2
|
+
import { t } from "./start-B1x6Z60h.js";
|
|
3
3
|
export { e as loadDotEnv, t as runStartCommand };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@voltro/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.21.0",
|
|
4
4
|
"description": "The `voltro` CLI — dev server, codegen, migrations, project scaffolding, agent-docs seeding, and production serve.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"voltro",
|
|
@@ -59,42 +59,42 @@
|
|
|
59
59
|
"node": ">=24.0.0"
|
|
60
60
|
},
|
|
61
61
|
"dependencies": {
|
|
62
|
-
"@effect/platform-node": "^0.
|
|
63
|
-
"@effect/sql": "^0.
|
|
64
|
-
"@effect/workflow": "^0.
|
|
65
|
-
"@voltro/ai": "0.
|
|
66
|
-
"@voltro/cache": "0.
|
|
67
|
-
"@voltro/data-transfer": "0.
|
|
68
|
-
"@voltro/database": "0.
|
|
69
|
-
"@voltro/env": "0.
|
|
70
|
-
"@voltro/kv": "0.
|
|
71
|
-
"@voltro/logger": "0.
|
|
72
|
-
"@voltro/plugin-auth": "0.
|
|
73
|
-
"@voltro/plugin-broadcast": "0.
|
|
74
|
-
"@voltro/plugin-mail": "0.
|
|
75
|
-
"@voltro/plugin-storage": "0.
|
|
76
|
-
"@voltro/plugin-webhooks": "0.
|
|
77
|
-
"@voltro/protocol": "0.
|
|
78
|
-
"@voltro/runtime": "0.
|
|
79
|
-
"@voltro/serverless": "0.
|
|
80
|
-
"@voltro/workflow": "0.
|
|
62
|
+
"@effect/platform-node": "^0.108.0",
|
|
63
|
+
"@effect/sql": "^0.52.0",
|
|
64
|
+
"@effect/workflow": "^0.19.0",
|
|
65
|
+
"@voltro/ai": "0.21.0",
|
|
66
|
+
"@voltro/cache": "0.21.0",
|
|
67
|
+
"@voltro/data-transfer": "0.21.0",
|
|
68
|
+
"@voltro/database": "0.21.0",
|
|
69
|
+
"@voltro/env": "0.21.0",
|
|
70
|
+
"@voltro/kv": "0.21.0",
|
|
71
|
+
"@voltro/logger": "0.21.0",
|
|
72
|
+
"@voltro/plugin-auth": "0.21.0",
|
|
73
|
+
"@voltro/plugin-broadcast": "0.21.0",
|
|
74
|
+
"@voltro/plugin-mail": "0.21.0",
|
|
75
|
+
"@voltro/plugin-storage": "0.21.0",
|
|
76
|
+
"@voltro/plugin-webhooks": "0.21.0",
|
|
77
|
+
"@voltro/protocol": "0.21.0",
|
|
78
|
+
"@voltro/runtime": "0.21.0",
|
|
79
|
+
"@voltro/serverless": "0.21.0",
|
|
80
|
+
"@voltro/workflow": "0.21.0",
|
|
81
81
|
"chokidar": "^5.0.0",
|
|
82
82
|
"ioredis": "^5.11.1",
|
|
83
83
|
"tinyglobby": "^0.2.17",
|
|
84
84
|
"ts-morph": "^28.0.0"
|
|
85
85
|
},
|
|
86
86
|
"optionalDependencies": {
|
|
87
|
-
"@tailwindcss/vite": "^4.3.
|
|
87
|
+
"@tailwindcss/vite": "^4.3.3",
|
|
88
88
|
"@vercel/nft": "^1.10.2",
|
|
89
|
-
"@vitejs/plugin-react": "^6.0.
|
|
89
|
+
"@vitejs/plugin-react": "^6.0.4",
|
|
90
90
|
"esbuild": "^0.28.0",
|
|
91
|
-
"tsx": "^4.23.
|
|
92
|
-
"vite": "^8.1.
|
|
91
|
+
"tsx": "^4.23.1",
|
|
92
|
+
"vite": "^8.1.5"
|
|
93
93
|
},
|
|
94
94
|
"peerDependencies": {
|
|
95
|
-
"@effect/platform": "^0.
|
|
96
|
-
"@effect/rpc": "^0.
|
|
97
|
-
"effect": "^3.
|
|
95
|
+
"@effect/platform": "^0.97.0",
|
|
96
|
+
"@effect/rpc": "^0.76.0",
|
|
97
|
+
"effect": "^3.22.0"
|
|
98
98
|
},
|
|
99
99
|
"publishConfig": {
|
|
100
100
|
"access": "public"
|
package/templates/AGENTS.md
CHANGED
|
@@ -595,7 +595,7 @@ each plugin's own README.
|
|
|
595
595
|
|
|
596
596
|
| Topic | Open | Summary |
|
|
597
597
|
|---|---|---|
|
|
598
|
-
| **What's new in 0.
|
|
598
|
+
| **What's new in 0.21.0** | `node_modules/@voltro/cli/templates/agent-docs/whats-new.md` | Everything that changed in this version. Read it before hand-rolling something the framework may now ship. |
|
|
599
599
|
| AI | `node_modules/@voltro/cli/templates/agent-docs/ai.md` | How Voltro treats AI — agents, tools, streaming, RAG — all primitives over the same WebSocket as the rest of the framework. |
|
|
600
600
|
| Authentication | `node_modules/@voltro/cli/templates/agent-docs/authentication.md` | How @voltro/plugin-auth wires password + session-cookie auth across api + web, plus the pluggable identity-strategy protocol. |
|
|
601
601
|
| Caching | `node_modules/@voltro/cli/templates/agent-docs/caching.md` | Voltro's caching layer (@voltro/cache) — an always-on memory default, swappable Redis-compatible backends, a low-level wrap primitive, and automatic query-result invalidation. |
|
|
@@ -9,7 +9,7 @@ each plugin's own README.
|
|
|
9
9
|
|
|
10
10
|
| Topic | Open | Summary |
|
|
11
11
|
|---|---|---|
|
|
12
|
-
| **What's new in 0.
|
|
12
|
+
| **What's new in 0.21.0** | `node_modules/@voltro/cli/templates/agent-docs/whats-new.md` | Everything that changed in this version. Read it before hand-rolling something the framework may now ship. |
|
|
13
13
|
| AI | `node_modules/@voltro/cli/templates/agent-docs/ai.md` | How Voltro treats AI — agents, tools, streaming, RAG — all primitives over the same WebSocket as the rest of the framework. |
|
|
14
14
|
| Authentication | `node_modules/@voltro/cli/templates/agent-docs/authentication.md` | How @voltro/plugin-auth wires password + session-cookie auth across api + web, plus the pluggable identity-strategy protocol. |
|
|
15
15
|
| Caching | `node_modules/@voltro/cli/templates/agent-docs/caching.md` | Voltro's caching layer (@voltro/cache) — an always-on memory default, swappable Redis-compatible backends, a low-level wrap primitive, and automatic query-result invalidation. |
|
|
@@ -544,6 +544,45 @@ compile. Already-compiled (warm) pages are never throttled, so a hot app stays
|
|
|
544
544
|
fully concurrent. Tune the cap with `VOLTRO_DEV_SSR_COMPILE_CONCURRENCY` (below) —
|
|
545
545
|
drop it on a low-memory box, raise it on a big machine.
|
|
546
546
|
|
|
547
|
+
### A failed server render fails the request
|
|
548
|
+
|
|
549
|
+
If the server render throws, `voltro dev` answers **500** with the error and its
|
|
550
|
+
stack, marks the response `x-voltro-rendered-by: ssr-dev-failed`, and logs it at
|
|
551
|
+
`error`. It does **not** fall back to a client-rendered shell.
|
|
552
|
+
|
|
553
|
+
That is deliberate, and it is the same outcome `voltro start` produces in
|
|
554
|
+
production. A fallback would hand you a page that renders in the browser and a
|
|
555
|
+
500 in production from the identical code — and because an empty `<div
|
|
556
|
+
id="root">` is what a client-only app looks like, the usual conclusion is "the
|
|
557
|
+
framework does not server-render", not "my page threw". The failure is loud so
|
|
558
|
+
the cause is the thing you see.
|
|
559
|
+
|
|
560
|
+
The practical consequence: anything that only misbehaves under
|
|
561
|
+
`renderToPipeableStream` — a component that suspends with no `<Suspense>`
|
|
562
|
+
boundary above it, a loader that throws, a hydration-unsafe value — surfaces in
|
|
563
|
+
`voltro dev` at the moment you hit the route.
|
|
564
|
+
|
|
565
|
+
**Suspending is fine here, and does not need a boundary you add.** A component
|
|
566
|
+
that suspends during a streamed server render — a lazily-loaded translation
|
|
567
|
+
catalog, a `React.lazy` component, `react-i18next` with `useSuspense: true` —
|
|
568
|
+
renders normally: `renderToPipeableStream` treats the root as an implicit
|
|
569
|
+
boundary, so a suspend delays the shell flush instead of failing. Measured, not
|
|
570
|
+
assumed; a regression test pins it.
|
|
571
|
+
|
|
572
|
+
Do **not** add a blanket `<Suspense>` at the root to "fix" a suspend. It makes
|
|
573
|
+
things worse in a way that is hard to see: React downgrades an errored boundary
|
|
574
|
+
to client rendering, so a page that THROWS starts answering 200 with
|
|
575
|
+
`<template data-msg="Switched to client rendering">` instead of failing. You lose
|
|
576
|
+
the hard failure above and gain nothing — the suspend already worked. Mount
|
|
577
|
+
boundaries where you want a *fallback* (`loading.tsx` per route, `<Await>` for
|
|
578
|
+
deferred loader values), not to make suspending legal.
|
|
579
|
+
|
|
580
|
+
Two places where a suspend genuinely is not supported, both by React rather than
|
|
581
|
+
by choice: `renderToString`, which backs the static prerender
|
|
582
|
+
(`renderMode: 'static'`), emits the fallback instead of waiting — so a suspending
|
|
583
|
+
component in a prerendered page needs its own boundary or a resolved value; and
|
|
584
|
+
the client render after hydration, which follows React's own rules.
|
|
585
|
+
|
|
547
586
|
|
|
548
587
|
Under `VOLTRO_LOG_LEVEL=debug` each cold compile logs its own duration, so a slow
|
|
549
588
|
first paint can be attributed to a specific module:
|
|
@@ -1470,6 +1509,30 @@ has never run is not "failing".
|
|
|
1470
1509
|
Pair it with `voltro logs --level error`: a failing handler now logs at **error**
|
|
1471
1510
|
level, so the two surfaces agree.
|
|
1472
1511
|
|
|
1512
|
+
## `voltro schedule run <name>` — fire one job, now
|
|
1513
|
+
|
|
1514
|
+
```sh
|
|
1515
|
+
voltro schedule run nightly-reconcile
|
|
1516
|
+
voltro schedule run nightly-reconcile --process billing --format json
|
|
1517
|
+
voltro schedule run nightly-reconcile --url https://api.example.com # a deployed app
|
|
1518
|
+
```
|
|
1519
|
+
|
|
1520
|
+
For the normal case: a nightly job that corrects business data, and you want to
|
|
1521
|
+
run it once and watch. It reports the run id, and `voltro inspect schedules`
|
|
1522
|
+
shows the outcome.
|
|
1523
|
+
|
|
1524
|
+
A run id of `null` is not a failure and is reported as its own outcome: the run
|
|
1525
|
+
was **coordinated away** — another replica holds the lock, or the previous run is
|
|
1526
|
+
still going and this schedule's `onOverlap` is `'skip'`. Printing "ok" there
|
|
1527
|
+
would claim work that never started.
|
|
1528
|
+
|
|
1529
|
+
`--trigger external` records the run as externally triggered instead of manual,
|
|
1530
|
+
for schedules that are normally fired by an outside scheduler.
|
|
1531
|
+
|
|
1532
|
+
This works against `voltro serve` as well as `voltro dev`. It did not before —
|
|
1533
|
+
production mounted no inspect surface at all, which also meant the post-deploy
|
|
1534
|
+
gate below could only ever be run against a dev server.
|
|
1535
|
+
|
|
1473
1536
|
## Targeting a deployed app
|
|
1474
1537
|
|
|
1475
1538
|
Every command in this family resolves its target from the local runtime registry — the apps running on *this* machine. Pass `--url` to point one at a **deployed** app instead:
|
|
@@ -89,7 +89,7 @@ voltro db plan --against <url> # diff vs a remote env's inspect endpoint (see
|
|
|
89
89
|
voltro db apply # execute (dev only — refuses on NODE_ENV=production)
|
|
90
90
|
voltro db apply --note '...' # apply with a freeform note recorded in history
|
|
91
91
|
voltro db plans [--limit 20] # history from _voltro_migration_plans, newest first
|
|
92
|
-
voltro db drift # live-vs-
|
|
92
|
+
voltro db drift # live-vs-baseline check — exit 0 match, 3 no baseline, 4 drift
|
|
93
93
|
voltro db squash --before <date> # consolidate history into one snapshot
|
|
94
94
|
voltro db restore-snapshot <id> # restore VOLTRO_SOFT_DROP=1 columns from a plan
|
|
95
95
|
|
|
@@ -2009,7 +2009,7 @@ Drift = the live database's schema doesn't match the fingerprint of the last app
|
|
|
2009
2009
|
|
|
2010
2010
|
Three trigger paths:
|
|
2011
2011
|
|
|
2012
|
-
1. **Manual** — `voltro db drift` runs the check on demand,
|
|
2012
|
+
1. **Manual** — `voltro db drift` runs the check on demand: exit 0 match, 3 no baseline, 4 drift
|
|
2013
2013
|
2. **On boot (dev)** — every `voltro dev` boot runs the planner, which detects drift implicitly (the plan will be non-empty)
|
|
2014
2014
|
3. **Periodic (cloud)** — the cloud dashboard polls each app's `/_voltro/inspect/migrations` endpoint; drift state is in the response
|
|
2015
2015
|
|
|
@@ -2018,16 +2018,39 @@ All three paths produce the same `DriftSnapshot` shape:
|
|
|
2018
2018
|
```ts
|
|
2019
2019
|
{
|
|
2020
2020
|
isDrifted: boolean,
|
|
2021
|
-
liveFingerprint: string, // current introspected
|
|
2022
|
-
lastAppliedFingerprint?: string, // newest
|
|
2021
|
+
liveFingerprint: string, // current introspected schema fingerprint
|
|
2022
|
+
lastAppliedFingerprint?: string, // the BASELINE the newest row recorded
|
|
2023
2023
|
lastAppliedAt?: string, // when it was applied
|
|
2024
2024
|
lastAppliedId?: string, // plan id
|
|
2025
2025
|
}
|
|
2026
2026
|
```
|
|
2027
2027
|
|
|
2028
|
-
`isDrifted: false` ↔ `liveFingerprint === lastAppliedFingerprint
|
|
2028
|
+
`isDrifted: false` ↔ `liveFingerprint === lastAppliedFingerprint`, **or** no baseline was recorded — nothing compared is not the same as nothing changed, and it is never reported as drift.
|
|
2029
2029
|
|
|
2030
|
-
|
|
2030
|
+
### What it compares, and what it does not
|
|
2031
|
+
|
|
2032
|
+
The baseline is `_voltro_migration_plans.liveFingerprint`: the fingerprint of the **live** schema as it was immediately after the last `voltro db apply`. Not `fingerprint`, which is the **declared** snapshot's hash — introspection cannot recover everything a declaration carries (generated expressions, `maxLength`, sensitivity markers), so a live hash and a declared hash never agree and comparing them reports drift on every clean database.
|
|
2033
|
+
|
|
2034
|
+
Both sides hash the **whole** live schema, framework tables included. A framework upgrade that adds a `_voltro_*` column therefore shows as drift until the next `db apply` records a new baseline — honest, since the live schema did change, and it self-heals on the apply the upgrade needs anyway.
|
|
2035
|
+
|
|
2036
|
+
### No baseline yet
|
|
2037
|
+
|
|
2038
|
+
A ledger row written before `liveFingerprint` existed has no baseline, and so does a database whose schema was already current when it upgraded. `voltro db drift` says so and **exits 3**:
|
|
2039
|
+
|
|
2040
|
+
```sh
|
|
2041
|
+
$ voltro db drift
|
|
2042
|
+
db drift: no drift baseline recorded yet — cannot compare
|
|
2043
|
+
```
|
|
2044
|
+
|
|
2045
|
+
Run `voltro db apply` once — a no-op apply backfills the baseline too. Until then use `voltro db plan`, which compares declared against live directly.
|
|
2046
|
+
|
|
2047
|
+
**Exit 3 is deliberately not 0.** "Did not compare" is not "clean", and a CI gate on the exit code has to be able to tell them apart — otherwise it passes vacuously on a stable schema, which is the failure drift detection exists to prevent.
|
|
2048
|
+
|
|
2049
|
+
| exit | meaning |
|
|
2050
|
+
|---|---|
|
|
2051
|
+
| 0 | compared, live matches the baseline |
|
|
2052
|
+
| 3 | no baseline — did NOT compare |
|
|
2053
|
+
| 4 | compared, live diverged |
|
|
2031
2054
|
|
|
2032
2055
|
## Common causes
|
|
2033
2056
|
|
|
@@ -2038,12 +2061,11 @@ Someone ran `ALTER TABLE ...` or `CREATE INDEX ...` via psql / DataGrip / Admine
|
|
|
2038
2061
|
```sh
|
|
2039
2062
|
$ voltro db drift
|
|
2040
2063
|
db drift: live schema DIVERGED from last applied state
|
|
2041
|
-
|
|
2042
|
-
live now:
|
|
2064
|
+
baseline: 8f507ba1e1aadad5 at 2026-06-15 14:32:00 (plan_mig_5k78)
|
|
2065
|
+
live now: a8f2c9d10b3f4e62
|
|
2043
2066
|
|
|
2044
|
-
|
|
2045
|
-
|
|
2046
|
-
- someone applied a plan but the row never made it into _voltro_migration_plans
|
|
2067
|
+
Something changed the live schema after the last apply. This command can see
|
|
2068
|
+
THAT it changed, not what or who — the fingerprints are hashes, not a diff.
|
|
2047
2069
|
|
|
2048
2070
|
To reconcile, run `voltro db plan` to see what your code expects vs the live DB.
|
|
2049
2071
|
```
|
|
@@ -73,6 +73,13 @@ Plain `text()` is **unbounded** — `TEXT` on Postgres/SQLite, `LONGTEXT` on MyS
|
|
|
73
73
|
|
|
74
74
|
Reach for **`.maxLength(n)`** when the column is a short identifier (a kind, slug, external id, resource discriminator) that participates in a `.unique([...])` or composite `.index([...])`: an unbounded column can only back a HASH long-unique constraint (MariaDB) or a prefix index, whereas a bounded `VARCHAR(n)` takes a plain BTREE key. It's cross-dialect (`VARCHAR(n)` on Postgres/MySQL/MariaDB, `NVARCHAR(n)` on MSSQL, `TEXT` on SQLite) — unlike `raw('varchar(20)')`, which hardcodes one dialect's DDL.
|
|
75
75
|
|
|
76
|
+
**Changing the bound on an EXISTING column is a real migration.** The differ compares `maxLength` on both sides, so `text()` → `text().maxLength(64)`, or 64 → 128, produces an operation:
|
|
77
|
+
|
|
78
|
+
- **widening** (a larger bound, or dropping the bound) is `safe` — no value can be lost;
|
|
79
|
+
- **narrowing** is `needs-backfill`: the `ALTER` fails at the database for any existing value longer than the new bound. The plan says so and gives you the query to run first.
|
|
80
|
+
|
|
81
|
+
Not compared on SQLite, which has no length-enforced type — a declared bound there is real, the live column is always `TEXT`, and comparing them would re-plan the same ALTER on every boot.
|
|
82
|
+
|
|
76
83
|
For **value** constraints (length ranges, regex, email, numeric min/max, cross-field invariants), use table-level `table().validate(Schema)` (see below) — that's the single validation surface, not a pile of per-column modifiers. There are no `.minLength()` / `.pattern()` column modifiers by design.
|
|
77
84
|
|
|
78
85
|
### `integer()`
|
|
@@ -996,7 +996,7 @@ If you write hand-rolled queries that read JSON columns through `unsafe()`, you'
|
|
|
996
996
|
> then applies it. Idempotent, and a no-op on every other dialect. Without it,
|
|
997
997
|
> workflow message/runner storage misbehaves on SQL Server.
|
|
998
998
|
|
|
999
|
-
`@effect/cluster`'s mssql branch uses `sp_getapplock` for shard claims and `MERGE … WHEN NOT MATCHED THEN INSERT … OUTPUT INSERTED` for runner upserts. Four bugs in `@effect/cluster@0.
|
|
999
|
+
`@effect/cluster`'s mssql branch uses `sp_getapplock` for shard claims and `MERGE … WHEN NOT MATCHED THEN INSERT … OUTPUT INSERTED` for runner upserts. Four bugs in `@effect/cluster@0.60.0` mssql code paths fail under the framework's workflow stack; the framework carries a `pnpm patch` (shipped in the CLI at `packages/cli/templates/patches/@effect__cluster@0.60.0.patch`, written into your project by `voltro add mssql`):
|
|
1000
1000
|
|
|
1001
1001
|
### Patch 1 — SqlRunnerStorage shard-lock MERGE alias
|
|
1002
1002
|
|
|
@@ -1024,7 +1024,7 @@ MSSQL forbids subqueries inside OUTPUT clauses (Msg 10705). The original `insert
|
|
|
1024
1024
|
|
|
1025
1025
|
The cluster's `deliver_at` column is BIGINT (storing millisecond epoch). Tedious binds JS `number` parameters as INT — which overflows for any post-2001 timestamp. The patch casts `deliver_at` to `BigInt` once at the top of `envelopeToRow` so all three message-kind switch arms emit `bigint | null`; other dialects accept bigint fine.
|
|
1026
1026
|
|
|
1027
|
-
All four patches are dialect-keyed (touch only the `mssql:` branch of `sql.onDialectOrElse`) so postgres / mysql / sqlite paths are bit-identical to upstream. The framework carries them and ships them to your project via `voltro add mssql` (see the note at the top of this section) —
|
|
1027
|
+
All four patches are dialect-keyed (touch only the `mssql:` branch of `sql.onDialectOrElse`) so postgres / mysql / sqlite paths are bit-identical to upstream. The framework carries them and ships them to your project via `voltro add mssql` (see the note at the top of this section) — the patch is how the fix reaches you. Upstream still carries these bugs on the current release — the framework re-verifies that on every bump (`git apply --check` against the new tarball) and re-keys the patch, because a `patchedDependencies` key is version-exact and a stale one fails the install.
|
|
1028
1028
|
|
|
1029
1029
|
## Read replicas — Always-On Availability Groups
|
|
1030
1030
|
|
|
@@ -1088,7 +1088,7 @@ For a full before-image or per-op fidelity, use **mariadb** (binlog CDC). For ze
|
|
|
1088
1088
|
- `voltro/packages/sql-mssql/src/replicationAdapter.ts` — `end_of_log_lsn` / `last_hardened_lsn` compare for RYW
|
|
1089
1089
|
- `voltro/packages/database/src/sqlCompiler.ts` — TOP / FETCH NEXT dispatch
|
|
1090
1090
|
- `voltro/packages/database/src/migrate.ts` — mssql DDL branch (line 72)
|
|
1091
|
-
- `packages/cli/templates/patches/@effect__cluster@0.
|
|
1091
|
+
- `packages/cli/templates/patches/@effect__cluster@0.60.0.patch` — the four upstream patches (shipped in the CLI; `voltro add mssql` writes it into your project)
|
|
1092
1092
|
|
|
1093
1093
|
|
|
1094
1094
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# What's new in 0.
|
|
1
|
+
# What's new in 0.21.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,20 +7,147 @@ 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
|
+
### ⚠ BREAKING
|
|
11
|
+
|
|
12
|
+
- **@voltro/database, @voltro/runtime, @voltro/workflow, @voltro/voltro** — `text().maxLength(n)` on an EXISTING column now actually applies. It planned zero operations and reported "schema is up to date" while the live column stayed `longtext` — the documented remedy for MariaDB's hash long-unique was a silent no-op, which is worse than no remedy because you stop looking.
|
|
13
|
+
|
|
14
|
+
**The differ was not comparing lengths wrongly — it could not see them.** `maxLength` was absent from the schema snapshot entirely: it lived on the column definition, was read only when rendering CREATE DDL, and never reached the comparison. A consumer pinned the mechanism with a contrast: a column bounded AT CREATION was `varchar(64)` (DDL path, fine); one bounded afterwards stayed `longtext` (diff path, blind).
|
|
15
|
+
|
|
16
|
+
It is now carried on both sides — declared from the definition, live from introspection — compared as its own dimension, and rendered by the applier from the declared snapshot (a bare `text` tag would emit DDL that applies successfully and changes nothing, the silent no-op the applier's convergence check exists to catch).
|
|
17
|
+
|
|
18
|
+
**Three guards against the real risk, which is not missing a change but re-emitting one forever:**
|
|
19
|
+
|
|
20
|
+
- Only the VARCHAR family contributes a live length. MariaDB reports `character_maximum_length = 4294967295` for `longtext` and 65535 for `text`; postgres reports NULL. Reading a type's theoretical maximum would make a declared `text()` differ from its own live column on every boot. - Only `text()` columns are compared. `id()` renders as `VARCHAR(64)` on mysql/mariadb while its declaration carries no length — measured on live MariaDB while building this, and it would have emitted an ALTER for every id column, forever. - Never on sqlite (no length-enforced type), and never when the caller omitted the dialect — an unknown dialect behaves exactly as before this field existed.
|
|
21
|
+
|
|
22
|
+
Proven by round-trip suites against live MariaDB and live Postgres: the same schema re-plans to NOTHING, a length change produces exactly one operation on the right column, applying it lands the new width, and re-planning after that is clean.
|
|
23
|
+
|
|
24
|
+
Classification follows the nullability precedent: **widening is `safe`** (no data can be lost), **narrowing is `needs-backfill`** and says so, with the count query to run first. Narrowing is deliberately not blocked — blocking it would leave the remedy just as unusable as the silence did.
|
|
25
|
+
|
|
26
|
+
**Also: `_voltro_api_keys.hashedKey` is now bounded at 64**, since the value is `sha256Hex(token)` and narrowing it can never fail. The other four unbounded unique columns in framework tables are deliberately left alone, each with the reason at the column: `_voltro_kv.key` is the caller's own key, `idempotencyKey` comes from a user-supplied function, and the two workflow `executionId`s have no shape the framework guarantees. A narrowing ALTER that fails on existing data during a framework upgrade is a worse outcome than the index-size concern it would fix — and the MariaDB hash long-unique is harmless on those tables anyway, since `_voltro_*` is filtered out of the binlog reader's include list.
|
|
27
|
+
|
|
28
|
+
**Migration** — `voltro update` prints it (`0.21.0/01_maxlength-now-migrates`, `manual`, and it fires only for projects that declare a bound). Your source does not change; every `.maxLength(n)` already written keeps compiling. What changes is that the next `voltro db apply` — or a `voltro dev` / `voltro serve` boot with auto-migrate — emits ALTERs it used to skip. Run `voltro db plan` first: it prints exactly which columns would be altered without touching anything, and an empty plan means this does not affect you. Widening is `safe` and can simply run; narrowing is `needs-backfill` and the plan carries the count query to run before it.
|
|
29
|
+
|
|
30
|
+
*Why this is `BREAKING` and not `Fixed`: the API is compatible — nothing is removed, renamed or narrowed, and the same call compiles. But an upgrade now performs DDL against YOUR tables that the previous version silently skipped, and on MariaDB `longtext → varchar(n)` is a full table rebuild that locks. The DB-changes-need-no-codemod exemption is written for `_voltro_*` tables riding the differ; this reaches user tables, so the operator deserves the warning at `voltro update` time rather than in a changelog section they may never open.*
|
|
31
|
+
|
|
32
|
+
### Added
|
|
33
|
+
|
|
34
|
+
- **@voltro/cli, @voltro/voltro** — **`voltro schedule run <name>`** fires one scheduled job on demand, against `voltro dev` or `voltro serve`.
|
|
35
|
+
|
|
36
|
+
Asked for by a consumer whose nightly jobs correct business data and whose workaround was: edit the cron expression to a minute out, wait for the reload, put it back. "Run it once now and watch" is a normal thing to want.
|
|
37
|
+
|
|
38
|
+
**Most of it already existed, and that is why it took a measurement to find the gap.** `SchedulerHandle.fireNow` has been there, and so has `POST /_voltro/inspect/schedules/:name/fire`. What was missing was the way in: no CLI verb, and — the part that mattered — **`voltro serve` mounted no inspect surface at all**. Every `/_voltro/inspect/*` route existed only under `voltro dev`, which is the one place a nightly data-correcting job is not running.
|
|
39
|
+
|
|
40
|
+
So production now mounts it. Two things make that safe rather than a new attack surface, and both were checked rather than assumed:
|
|
41
|
+
|
|
42
|
+
- `handleInspectRequest` is **closed by default**: with no `VOLTRO_INSPECT_TOKEN` every request is 401 carrying the remedy, the compare is constant-time, and the token is never minted outside dev. Opening it is an operator's deliberate act. - Only the handlers production can answer TRUTHFULLY are wired. Everything else stays absent and replies "not configured" — an empty array would claim the app has no procedures. `inspectSchedules` is deliberately still absent: dev computes `nextFiringAt` and the EFFECTIVE coordination from its own boot closure, and reporting a guessed coordination mode to a post-deploy gate is worse than reporting nothing.
|
|
43
|
+
|
|
44
|
+
The manifest's `rpc` / `workflows` entries come from a builder both boot paths now share (`inspectEntries.ts`). They are the same facts on both sides, and a second hand-written copy of the descriptor→entry mapping is the shape this repo keeps paying for.
|
|
45
|
+
|
|
46
|
+
**A run id of `null` is reported as its own outcome**, not as success: the run was coordinated away — another replica holds the lock, or `onOverlap: 'skip'` found the previous run still going. Printing "ok" would claim work that never started.
|
|
47
|
+
|
|
48
|
+
**Also fixed, and it affects every command in the inspect family.** `fetchJson` collapsed a non-2xx into the body's `error` field alone, discarding `message`. The surface answers `{ error: <category>, message: <what happened> }`, so firing an unknown schedule printed "fire failed" while the server had said `scheduler.fireNow: unknown schedule "…"`, and a closed surface printed "unauthorized" while the body named the missing env var. It now prefers `message`, then `reason`, then `error` — fixed in the shared fetch rather than per command.
|
|
49
|
+
|
|
50
|
+
Verified end to end against `voltro-starter/apps/v-api-durable`: the fire returns a run id and the job's own output appears in the server log; an unknown name reports the server's reason; `--format json` round-trips.
|
|
51
|
+
|
|
10
52
|
### Fixed
|
|
11
53
|
|
|
12
|
-
- **@voltro/database, @voltro/
|
|
54
|
+
- **@voltro/database, @voltro/sql-postgres, @voltro/sql-mysql, @voltro/sql-sqlite, @voltro/sql-mssql, @voltro/voltro** — <!-- apiSurface: compatible — reasoned, not rubber-stamped. `attributionFields()` gained an OPTIONAL parameter and `withCapturedAttribution` is new. Both are additive, and it was CHECKED rather than assumed, because this repo has already paid once for a narrowing that read as additive: a zero-arg call still compiles, the value is still assignable to the old `() => …` type, and it still passes as a callback typed with the old shape. All three probed under `--strict`. Nothing was removed. -->
|
|
55
|
+
|
|
56
|
+
Write attribution is now CARRIED down the write path instead of re-read from the ambient async-local scope, so a connection-pool handoff can no longer strand a write's `traceId` / `subjectId`.
|
|
57
|
+
|
|
58
|
+
`routeEvent` read the identity with `attributionFields()`, and it runs after `await runPromise(...)`. `AsyncLocalStorage` propagates through continuations the current context CREATES; one scheduled by ANOTHER context — exactly what a pool handoff does when an acquisition queues — resumes with that other context's store. So under contention the write landed with the identity absent. Absent is a LEGAL value there meaning "no request behind this write", so the result does not look like a defect: it looks like a schedule. In a compliance trail that asymmetry is the whole problem, and it is why this is closed structurally rather than left as unlikely.
|
|
59
|
+
|
|
60
|
+
The value is captured ONCE at each public store method, before any await (`withCapturedAttribution`), and threaded explicitly through every `execute*` and into `routeEvent` — in all four dialect stores, including the transactional view, which is the path every framework mutation takes. The ambient scope is kept as a FALLBACK: a site that has not been threaded behaves exactly as before rather than worse, which is what made the change verifiable site by site.
|
|
61
|
+
|
|
62
|
+
**On what is and is not proven.** A pool handoff cannot be reproduced deterministically from a test — the resume context is the driver's choice. Two attempts are worth recording because both produced misleading green: a load-based regression test passed in isolation and failed in the full gate twice (a coin flip that also blocked releases), and a "deterministic" replacement that left the scope before the write finished PASSED against the unthreaded store, because the store re-enters its own scope internally. It proved nothing while looking like proof, so it was deleted.
|
|
63
|
+
|
|
64
|
+
What is proven: the pure semantics (`writeAttributionCapture.test.ts` — explicit wins over the ambient scope, explicit wins over ANOTHER request's scope, "no request" stays "no request", keys omitted rather than `undefined`), and the threading itself (`attributionThreadingParity.test.ts` — every store accepts and uses the carried value, no store still calls a bare `attributionFields()`, every transactional view carries it). The guarantee is structural, and it is stated that way rather than dressed up as a reproduction.
|
|
65
|
+
|
|
66
|
+
Raised by a consumer who could NOT reproduce the loss across 2700 writes at 96-way concurrency with every core saturated, and who asked for the fix anyway on the right grounds: *"impossible beats unlikely when the failure is invisible."*
|
|
67
|
+
- **@voltro/database, @voltro/sql-postgres, @voltro/sql-mysql, @voltro/voltro** — <!-- apiSurface: compatible — `beginLocalWrite`, `endLocalWrite` and `resolveEchoAttribution` are new exports on `@voltro/database`; nothing was removed, renamed or narrowed. Checked rather than assumed, because this repo has already paid once for a narrowing that read as additive. -->
|
|
68
|
+
|
|
69
|
+
Under CDC, a plain `store.insert(...)` could deliver its change with `traceId` and `subjectId` ABSENT — not always, and more often the busier the process.
|
|
70
|
+
|
|
71
|
+
**The registration was racing the echo, and only winning on a margin.** The write path registers the request identity so the transport echo (a postgres NOTIFY, a mysql binlog row) can be re-united with it, and `pendingAttribution.ts` stated the ordering as a guarantee: the registration happens "BEFORE the transport can possibly echo it, because a NOTIFY fires at COMMIT". That is true INSIDE a transaction, where `routeEvent` runs before COMMIT. It is false for a plain write, whose statement commits ITSELF — the trigger fires while the write path is still awaiting the driver, and the registration lands afterwards. The echo has to make a round trip through the LISTEN/binlog connection, and that round trip was the only thing keeping the order right.
|
|
72
|
+
|
|
73
|
+
**Why it stayed hidden.** An unattributed event is a LEGAL event meaning "no request behind this write", so a lost identity is indistinguishable from a background job — there is no error, no warning, and nothing that looks wrong in a trace. It surfaced as one failing assertion in the full test suite, which is the only place this machine is loaded enough to flip the order, and it passed on every isolated re-run.
|
|
74
|
+
|
|
75
|
+
**Closed by construction, not by widening the margin.** A store now brackets each non-transactional write (`beginLocalWrite` / `endLocalWrite`) and delivers echoes through `resolveEchoAttribution`. An echo arriving while a write to that table is mid-registration is HELD until that write has had its chance, then answered. Held echoes keep arrival order — a subscriber seeing an update before the insert it updates would be worse off than one missing a `traceId` — and a write that never registers releases the table after a bound rather than parking its stream.
|
|
76
|
+
|
|
77
|
+
Three narrowings, each deliberate:
|
|
78
|
+
|
|
79
|
+
- **Only under `cdc`.** Nothing is injected in `inline` mode, so there is no echo to order against. - **Only non-transactional writes.** `transactional()` registers before COMMIT already; bracketing it would hold OTHER replicas' echoes for the length of the transaction to fix a race that path does not have. Asserted, so the narrowing is on the record rather than something a later reader "fixes". - **A remote write is still never attributed.** The barrier may delay an answer; it must never invent one. Nothing is registered locally for another replica's write, and that stays true while echoes are held.
|
|
80
|
+
|
|
81
|
+
**Both CDC stores had a hand-written copy of the claim-and-emit tail**, which is the shape of the previous three attribution defects in this package. The decision now lives in one function both call, and `echoBarrierParity.test.ts` fails if either store claims for itself, leaves a public write outside the bracket, or brackets the transactional path. The ordering itself is proven against the primitive (`pendingAttribution.test.ts`) — a live suite cannot force it, because the resume point is the driver's choice, and the four barrier tests were verified to go red against the pre-fix behaviour before being trusted.
|
|
82
|
+
|
|
83
|
+
Also fixed: `mysql`'s `updateMany` / `deleteMany` route their events after their transaction commits, so they carried the same race despite not going through the per-row write path. They are bracketed too.
|
|
84
|
+
- **@voltro/cli, @voltro/voltro** — `voltro build` could fail to build the **start bundle** with `Could not resolve "@voltro/cli/startEntry"`, degrading `voltro start` to the slower per-module boot. The serve bundle carried the identical latent failure.
|
|
85
|
+
|
|
86
|
+
Both bundles generate an entry importing a narrow CLI export and build it with `absWorkingDir: <app root>` — so esbuild resolved that bare specifier from the APP's `node_modules`. Under strict pnpm the app has `@voltro/cli` there only if it DECLARES it, and an app normally depends on `voltro` / `@voltro/web` and gets the CLI transitively. The CLI now resolves its own entry from `import.meta.url` and hands esbuild an absolute alias.
|
|
87
|
+
|
|
88
|
+
Same shape as the tsx bug (`tsxLoader.ts`): a package that is OUR dependency, resolved from the user's directory, invisible under strict pnpm. Same answer — the CLI knows where it lives, so it stops asking the app.
|
|
89
|
+
|
|
90
|
+
**The published export was not the problem.** It is present in the tarball — checked against the real 0.20.1 and 0.20.2 packages, `./startEntry` → `./dist/startEntry.js`, file included. Only resolution failed, which is why re-adding the export would have changed nothing.
|
|
91
|
+
|
|
92
|
+
This monorepo hoists everything, so the bare specifier resolves here and the build passes with or without the alias. The test therefore asserts the alias directly rather than inferring it from a green build — the hoisted layout is exactly what hid the strict-pnpm failure in the first place.
|
|
93
|
+
|
|
94
|
+
**Also pinned, after a wrong turn worth recording.** A consumer reported that the framework provides no Suspense boundary, so any suspend during SSR throws. The obvious repair — a root `<Suspense>` — was implemented, measured, and REVERTED:
|
|
95
|
+
|
|
96
|
+
- With a root boundary, a page that THROWS answered **200** with `<template data-msg="Switched to client rendering">`. React downgrades an errored boundary to client rendering, which silently undid the hard failure shipped moments earlier. - Without one, a suspending page renders fine anyway: `renderToPipeableStream` treats the root as an implicit boundary, so a suspend delays the shell flush rather than failing.
|
|
97
|
+
|
|
98
|
+
So the reported problem does not exist on the streaming path, and the obvious fix for it breaks something that does. Both halves are now fixtures with assertions side by side (`ssr-suspends` must render, `ssr-throws` must 500) — adding a root boundary flips the second, and that pair is what makes it visible instead of shipping it. Docs corrected in both languages, including the two places a suspend genuinely is unsupported (`renderToString` behind static prerender, and the client render), neither of which is the framework's choice.
|
|
99
|
+
- **@voltro/cli, @voltro/voltro** — <!-- apiSurface: compatible — `CliRuntime` keeps its exported signature and its behaviour (NodeContext + logger); only `runCli`'s internal composition changed. `loggerConfig` is module-private. -->
|
|
100
|
+
|
|
101
|
+
Every one-shot `voltro` command printed each log line TWICE. Measured on `voltro agents-md`: 76 lines for 38 events.
|
|
102
|
+
|
|
103
|
+
`runCli` installed two loggers. It provided `CliRuntime` (which contains a `LoggerLayer`) to the program, then provided a second `LoggerLayer` around the `matchCauseEffect` wrapping it — so the program ran inside both. Two `LoggerLayer`s in one fiber do not compose the way the name suggests: `LoggerLayer` is `Logger.replace(Logger.defaultLogger, …)`, which removes the DEFAULT logger and adds its own. The second one finds no default left to remove, the removal is a no-op, and the add still happens. Replace composes as replace only against the default — never against another replace.
|
|
104
|
+
|
|
105
|
+
The duplicates were distinguishable only because the outer layer was built without the command's `defaultScope`, so half the output carried `scope` and half did not. Had both been configured identically the output would have been byte-identical pairs, which is a good deal harder to notice than a stray field.
|
|
106
|
+
|
|
107
|
+
**The failure branch is the half that survives a partial fix**, and it did. Moving the second layer from around `matchCauseEffect` onto the error handler repairs the success path and leaves the failure path doubling, because that branch runs while the program's scope is still open and INHERITS its logger. Verified by measuring three shapes rather than reasoning about scopes: handler-provides → 2 lines, handler-inherits → 1, provide-once-outermost → 1.
|
|
108
|
+
|
|
109
|
+
The last is what shipped. The logger is a FiberRef, not a service the program requires, so it is provided ONCE at the outermost boundary and the program gets only `NodeContext`. That covers both branches by construction, rather than by the handler happening to still be inside a scope that has not closed yet. `CliRuntime` is unchanged and still used by `runCliMain`, which provides it once and never had the problem.
|
|
110
|
+
|
|
111
|
+
Guarded by `cliRuntime.test.ts`, which asserts the COUNT (any second provision doubles it regardless of what it logs) and that every line carries the command scope. It was checked against the reverted fix in both of its shapes before being trusted. Its capture spies on stdout AND stderr, deliberately: diagnostics route to stderr by level, and a stdout-only capture reported zero lines for the failure path — reading as "nothing was logged" when the truth was "logged on the other stream", which had the test accusing the fix it was written to protect.
|
|
112
|
+
- **@voltro/cli, @voltro/voltro** — Three corrections to the `db drift` baseline shipped in 0.20.2, all reported by the consumer who verified the fix — and all of them defects in that fix rather than in older code.
|
|
113
|
+
|
|
114
|
+
**1. The first `db drift` after upgrading CRASHED.** `liveFingerprint` is a new column and does not exist until a `db apply` adds it, so naming it in the ledger read died on `SqlError: Failed to execute statement` instead of reaching the "no baseline yet" branch written for exactly that moment. The documented sequence was `0 → apply → clean`; the real one was `crash → apply → clean`, with the crash landing in the first CI run after an upgrade. Proven by dropping and re-adding the column: absent → exit 1 and a driver error, present → exit 0 and the honest message. The read is now `SELECT *`, which cannot go stale against an older ledger.
|
|
115
|
+
|
|
116
|
+
**2. A no-op `db apply` established no baseline.** The baseline is written per applied plan row, so an already-current schema produced none — and "cannot compare" then persisted indefinitely rather than for one run, for any app whose schema was current when it upgraded. A no-op apply now backfills the latest row's `liveFingerprint` instead of inserting a history entry for a migration that did not happen.
|
|
117
|
+
|
|
118
|
+
**3. "No baseline" gets its own exit code: 3.** Previously it exited 0, so a CI gate could not distinguish "compared and matched" from "did not compare" — and on a stable schema the second could persist forever. The consumer named that as their reason for NOT adding a drift gate: it would pass vacuously, which is the failure this whole thread is about. Now `0` = matched, `3` = no baseline, `4` = diverged.
|
|
119
|
+
|
|
120
|
+
**And the SQL-error reporter added in the same release did not work on this path.** It walked `.cause`, and an `Effect` `FiberFailure` has none — its cause hides behind `Symbol(effect/Runtime/FiberFailure/Cause)`, with only `stack`, `message` and `name` as own keys. So the helper returned `undefined` and not even its "no statement attached" fallback fired. The consumer reproduced that against an empty database and checked field by field; all absent.
|
|
121
|
+
|
|
122
|
+
The reason the tests missed it is worth recording: every fixture was a hand-built object WITH a `.cause` — the shape assumed, not the shape the runtime produces. The suite now builds a real `FiberFailure` through `Effect.runPromise`, and the walk unwraps the symbol and flattens the `Cause` tree (`Fail`/`Die`/`Sequential`).
|
|
123
|
+
|
|
124
|
+
Their note on the irony is fair and is the reason this is one entry rather than two: defect 1 above IS the "next DB-shaped error in your CI" that the reporter existed to make readable, and it arrived as a bare wrapper plus a driver stack. With the statement printed it would have named the missing column immediately.
|
|
125
|
+
|
|
126
|
+
**A FOURTH copy of both defects was found in `voltro dev`'s migrations inspect endpoint, and it was the worst one.** It carried the same postgres-only `::text` casts, wrapped in `orElseSucceed(() => [])` — so on every non-postgres dialect the syntax error became an EMPTY history rather than a failure: the devtools migrations panel showed nothing, and with no history row the drift verdict came out `false`. A silent, permanent "no drift" on every mysql/mariadb/mssql/sqlite app. It also compared the declared hash against a live one, exactly like the CLI did.
|
|
127
|
+
|
|
128
|
+
Both are fixed there too, and `ledgerReadPortability.test.ts` now fails if any query touching `_voltro_migration_plans` grows a `::type` cast again. Three copies were fixed in one change and the fourth was missed in the same change, which is the argument for the test rather than another paragraph in a maintainer note.
|
|
129
|
+
- **@voltro/cli, @voltro/voltro** — `voltro dev` served a client-only shell — with a **200** — whenever a `renderMode: 'ssr'` page failed to render on the server. It now answers 500 with the cause, exactly as `voltro start` does.
|
|
130
|
+
|
|
131
|
+
**Reported as "voltro dev does not SSR". It does**, and has since before 0.20.0 — the middleware, its intent stated in a comment ("mirroring what `voltro start` does in production"), is an ancestor of every 0.20.x tag. What the reporter saw was the masking: their pages suspended during the server render (a lazily-loaded i18n catalog above any Suspense boundary), all 225 degraded to Vite's SPA shell, and an empty `<div id="root">` is indistinguishable from a framework that never server-renders. Their conclusion was the only one the evidence supported.
|
|
132
|
+
|
|
133
|
+
**The 200 is the part that mattered.** The same render is a hard 500 under `voltro start`, so those pages were down in production while dev reported success — the inverse of the usual "works in dev, breaks in prod", and worse, because nothing prompts you to look. Measured before the fix: `HTTP 200`, no `x-voltro-rendered-by` header at all, and the thrown error present in the dev log but nowhere in the response.
|
|
134
|
+
|
|
135
|
+
Three sites did this (both streaming `onShellError` handlers and the outer catch); all three now fail through one helper. The pattern was already in the file — the `isDeferralNotSupported` branch refuses rather than degrades and says why in the same words ("falling through would leave the developer with an unstyled page and a log line, which is exactly the silent degradation the hard error exists to prevent"). One of the removed fallbacks sat directly under a comment stating that falling through would mask the bug.
|
|
136
|
+
|
|
137
|
+
Dev puts the cause and stack in the response body; production keeps its bare `server error`, so a stack never reaches a public response. That is a difference in what the failure says, never in whether it fails.
|
|
138
|
+
|
|
139
|
+
**Also fixed, found while reproducing it: a page added while `voltro dev` runs was never server-rendered.** The middleware matched against a route table built once at boot, so a new page missed matching entirely and returned before its module was ever loaded — Vite's SPA shell, 200, and *no log line at all*, because the middleware never ran. The page tree the middleware reads is now refreshed by the same regeneration that rewrites the route table (`dirs` too, or a layout added after boot would be invisible to the spa-shell decision).
|
|
13
140
|
|
|
14
|
-
|
|
141
|
+
Both are covered by `webDevSsrLayoutLoader.test.ts` against a real dev server: `/ssr-throws` must answer 500 + `x-voltro-rendered-by: ssr-dev-failed` + the cause and must never contain the empty shell, and a page written while the server runs must be server-rendered without a restart. Each assertion was verified red against its own reverted fix — separately, because the first failure aborts the test and would have left the second unproven.
|
|
15
142
|
|
|
16
|
-
|
|
143
|
+
One thing this does NOT change: the framework still provides a Suspense boundary only for its own deferral (`<Await>`), not a blanket one at the root. Code that suspends outside it needs a boundary you mount yourself. That is now documented next to the failure behaviour, since a hard 500 is how you will meet it.
|
|
17
144
|
|
|
18
|
-
|
|
145
|
+
### Internal (no consumer-facing effect)
|
|
19
146
|
|
|
20
|
-
|
|
147
|
+
- **@voltro/cli** — Maintainer notes only — no shipped behaviour changes.
|
|
21
148
|
|
|
22
|
-
|
|
149
|
+
`mssqlClusterPatch.ts`'s header said the `@effect/cluster` patch covers "two mssql-only bugs" (it is four: the `deliver_at` INT-overflow, the MERGE…OUTPUT with correlated sub-SELECTs, `FOR UPDATE`, and `USING (SELECT * FROM (VALUES …))`) and implied that a version bump needs nothing but a re-key, because 0.59.0 → 0.60.0 happened to apply unchanged. On 0.60.2 the same patch fails on 3 of its 6 files — upstream refactored `SqlMessageStorage` and moved the context the hunks match on. A bump can require REGENERATING the patch.
|
|
23
150
|
|
|
24
|
-
|
|
151
|
+
The regeneration recipe now lives in `packages/sql-mssql/CLAUDE.md`, together with the two measurements that produced confidently wrong answers while working this out: reading an already-patched `node_modules/.pnpm/*patch_hash=*` copy and concluding upstream had fixed it, and un-patching one of the several installed copies and concluding the patch was not load-bearing. Both look like evidence.
|
|
25
152
|
|
|
26
|
-
|
|
153
|
+
Also recorded there: verify by BREAKING it. `git apply --check` proves the patch lands, not that it still fixes anything. Un-patched, the mssql cluster suite fails with `Incorrect syntax near ')'`; patched, 5/5 against the live fixture.
|
|
@@ -9,19 +9,19 @@
|
|
|
9
9
|
"typecheck": "tsc --noEmit"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"@effect/platform": "^0.
|
|
13
|
-
"@effect/rpc": "^0.
|
|
14
|
-
"@voltro/ai": "0.
|
|
15
|
-
"@voltro/cli": "0.
|
|
16
|
-
"@voltro/database": "0.
|
|
17
|
-
"@voltro/env": "0.
|
|
18
|
-
"@voltro/protocol": "0.
|
|
19
|
-
"@voltro/runtime": "0.
|
|
20
|
-
"effect": "^3.
|
|
12
|
+
"@effect/platform": "^0.97.0",
|
|
13
|
+
"@effect/rpc": "^0.76.0",
|
|
14
|
+
"@voltro/ai": "0.21.0",
|
|
15
|
+
"@voltro/cli": "0.21.0",
|
|
16
|
+
"@voltro/database": "0.21.0",
|
|
17
|
+
"@voltro/env": "0.21.0",
|
|
18
|
+
"@voltro/protocol": "0.21.0",
|
|
19
|
+
"@voltro/runtime": "0.21.0",
|
|
20
|
+
"effect": "^3.22.0"
|
|
21
21
|
},
|
|
22
22
|
"devDependencies": {
|
|
23
|
-
"@voltro/testing": "0.
|
|
24
|
-
"typescript": "^
|
|
25
|
-
"vitest": "^
|
|
23
|
+
"@voltro/testing": "0.21.0",
|
|
24
|
+
"typescript": "^6.0.3",
|
|
25
|
+
"vitest": "^4.1.10"
|
|
26
26
|
}
|
|
27
27
|
}
|
|
@@ -10,20 +10,20 @@
|
|
|
10
10
|
"typecheck": "tsc --noEmit"
|
|
11
11
|
},
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"@effect/platform": "^0.
|
|
14
|
-
"@effect/rpc": "^0.
|
|
15
|
-
"@voltro/cli": "0.
|
|
16
|
-
"@voltro/database": "0.
|
|
17
|
-
"@voltro/env": "0.
|
|
18
|
-
"@voltro/plugin-auth": "0.
|
|
19
|
-
"@voltro/protocol": "0.
|
|
20
|
-
"@voltro/runtime": "0.
|
|
21
|
-
"@voltro/sql-postgres": "0.
|
|
22
|
-
"effect": "^3.
|
|
13
|
+
"@effect/platform": "^0.97.0",
|
|
14
|
+
"@effect/rpc": "^0.76.0",
|
|
15
|
+
"@voltro/cli": "0.21.0",
|
|
16
|
+
"@voltro/database": "0.21.0",
|
|
17
|
+
"@voltro/env": "0.21.0",
|
|
18
|
+
"@voltro/plugin-auth": "0.21.0",
|
|
19
|
+
"@voltro/protocol": "0.21.0",
|
|
20
|
+
"@voltro/runtime": "0.21.0",
|
|
21
|
+
"@voltro/sql-postgres": "0.21.0",
|
|
22
|
+
"effect": "^3.22.0"
|
|
23
23
|
},
|
|
24
24
|
"devDependencies": {
|
|
25
|
-
"@voltro/testing": "0.
|
|
26
|
-
"typescript": "^
|
|
27
|
-
"vitest": "^
|
|
25
|
+
"@voltro/testing": "0.21.0",
|
|
26
|
+
"typescript": "^6.0.3",
|
|
27
|
+
"vitest": "^4.1.10"
|
|
28
28
|
}
|
|
29
29
|
}
|