@voltro/testing 0.39.1 → 0.41.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 +232 -0
- package/dist/index.d.ts +20 -0
- package/dist/index.js +178 -173
- package/package.json +8 -8
package/CHANGELOG.md
CHANGED
|
@@ -39,6 +39,238 @@ _Changes staged for the next release accumulate here (rolled up from
|
|
|
39
39
|
|
|
40
40
|
---
|
|
41
41
|
|
|
42
|
+
## [0.41.0] — 2026-08-17
|
|
43
|
+
|
|
44
|
+
### ⚠ BREAKING
|
|
45
|
+
|
|
46
|
+
- **@voltro/web, @voltro/cli** — `middleware.ts` exports `defineMiddleware(...)` (from `@voltro/web/middleware`) instead of a bare function, and each export carries its own `match`. Several middlewares per file are allowed; **at most one may match a given route**.
|
|
47
|
+
|
|
48
|
+
Migration: the codemod wraps the existing default export. That is behaviour-preserving — no `match` means every server-rendered route, which is what an unwrapped middleware did — and its note explains how to replace a hand-written path gate with a `match`.
|
|
49
|
+
|
|
50
|
+
**Why it was worth a break.** A hand-written `if (!req.pathname.startsWith('/app')) return` is invisible: nothing can tell you a middleware runs nowhere, or that two of them claim one route. `match` puts it where both the boot and `voltro doctor` can read it.
|
|
51
|
+
|
|
52
|
+
**The matcher speaks ROUTES, not URL patterns** — `under` / `routes` / `except`, validated against the app's own route patterns. A path matching no route refuses the boot instead of silently never firing. This is the deliberate difference from the `'/((?!api|_next/static|…).*)'` shape: our hook runs after route matching, so an app has never needed to know its own asset layout, and non-page requests are reachable only by asking (`assets: true`) — where, note, there is no render, so only `setCookies` takes effect.
|
|
53
|
+
|
|
54
|
+
An overlap refuses the boot and names both middlewares plus the route. Declaration order is not a semantic, "most specific wins" silently drops the broader hook, and merging needs a per-field rule nobody remembers — so two hooks writing one `authorization` header is a refusal, not a resolution.
|
|
55
|
+
|
|
56
|
+
**The web bundle budget moved UP, and the split is worth stating** because only one half is a cost the framework imposes:
|
|
57
|
+
|
|
58
|
+
| measured | before | after | | --- | --- | --- | | first load | 184 955 B | 185 309 B (**+354**) | | lazy route chunks | 3 502 B | 4 415 B (+913) |
|
|
59
|
+
|
|
60
|
+
The **+354 B of first load is the real price** — one `serverContext` chunk, 0.2 KB gz, which every app now carries whether or not it declares a middleware. That is the number to argue with, and it leaves 6.7 KB of headroom under the ceiling.
|
|
61
|
+
|
|
62
|
+
The +913 B is NOT a per-route regression: the fixture gained four routes (`exact`, `exact/[id]`, `mw`, `mw/skip`) to exercise the feature end to end, at 0.1–0.2 KB gz each, which accounts for the growth without remainder. Re-pinned with `--update` rather than by hand, so the `slackFloor` keeps ratcheting — a ceiling nobody lowers again silently permits re-inflating to the old number.
|
|
63
|
+
|
|
64
|
+
### Fixed
|
|
65
|
+
|
|
66
|
+
- **@voltro/data-transfer, @voltro/cli** — `voltro data export` could not export a table whose primary key is not named `id`, and one of its two failure modes reported success.
|
|
67
|
+
|
|
68
|
+
The keyset column was `columns.find(c => c.type === 'id')?.name ?? 'id'`, and `type: 'id'` is tagged only on a column that is BOTH the single-column primary key AND literally named `id` — identically in all four dialect introspectors. So any introspected table with another PK name was ordered by a column that does not exist. It now comes from the real primary key (the synthesised `<table>_pkey` index), with the declared `id()` column still winning where there is one.
|
|
69
|
+
|
|
70
|
+
**A composite or absent primary key is now REFUSED**, not silently ordered by the first column: keyset pagination on a non-unique order splits equal values across page boundaries, so rows are dropped or duplicated into a bundle that reports success. Bounded exports are recoverable; a quietly short backup is discovered at the restore.
|
|
71
|
+
|
|
72
|
+
**A requested table missing from the schema is refused too.** `scope: { kind: 'tables' }` used to drop unknown names, so a run that explicitly named a table wrote `"tables": []` and printed `export complete` with exit 0. `kind: 'all'` over an empty database is still a legal empty export — the asymmetry is deliberate: a named table is an expectation.
|
|
73
|
+
|
|
74
|
+
**Failure reasons survive.** `String(e?.message ?? e)` produced `"write table failed: "` with nothing after the colon — `??` falls back on null/undefined, and an Effect `TaggedError` carries an empty-string `message`. Every catch site in the exporter now reports tag, message or cause.
|
|
75
|
+
|
|
76
|
+
**New: `voltro data export --exclude a,b`** — everything except these, resolved against the live table list. It is the escape hatch the refusals above require; without it a single unkeyable table would block a whole-database export. An unknown name is refused for the same reason. Direct target only (the expansion needs the live table list), and it expands to an explicit `tables` scope, so the manifest records what was actually exported.
|
|
77
|
+
|
|
78
|
+
Reported with a reduced repro, a four-way variation over PK TYPES that ruled type out, and two disproved hypotheses. The affected tables include `@effect/cluster`'s own (`cluster_locks`, `cluster_migrations`), so no app running workflows could take a whole-database export.
|
|
79
|
+
- **@voltro/database, @voltro/runtime, @voltro/cli** — `.encrypted()` had three writers and two encodings. The store wrote `encrypt(JSON.stringify(v))`; `encryptField` — the documented raw-SQL escape hatch — and `voltro db encrypt-column` wrote `encrypt(v)`. All three produce the same `enc:v1:` envelope and nothing distinguished them, so a value written by one and read by another either threw with the wrong diagnosis or came back subtly wrong (`decryptField` handed back the JSON encoding verbatim, quotes and all, raising nothing).
|
|
80
|
+
|
|
81
|
+
There is one encoding for every WRITE now, and every READ resolves BOTH forms — so **no data has to be rewritten and nothing is blocked**. That second half is the point: the old form is already on staging and production disks, and a fix that needs the rows rewritten before the app works is an outage with a migration attached.
|
|
82
|
+
|
|
83
|
+
Reading two forms is deterministic, not a heuristic. After decrypting, a parse failure is the raw form; a parse to a STRING is the JSON form; a parse to a non-string depends on the column's declared type (a text column cannot hold a number, so `12345` is a raw string that parsed by accident). The one case nothing can separate — a raw secret whose literal text is `"abc"`, quotes included — is stated in the code rather than hidden.
|
|
84
|
+
|
|
85
|
+
**`voltro db encrypt-column` verified itself against the wrong decoder.** It wrote the raw form and checked it with `cipher.decrypt` — a decoder nothing reads these columns with — so it reported success over columns the app could not read. It round-trips through `decodeFieldValue` now, the same function the store calls. A self-check against a decoder the runtime does not use is not a weaker check; it is a second opinion from the same mistake.
|
|
86
|
+
|
|
87
|
+
The command also NORMALISES rows in the old encoding as it goes (reported separately from the ones it encrypts), so an operator does not write a script per column. It skips anything ambiguous and anything it cannot decrypt.
|
|
88
|
+
|
|
89
|
+
**The width pre-flight measured the wrong thing after the encoding changed.** It sized the ciphertext from the PLAINTEXT's byte length while the cipher is handed the JSON encoding — two characters more at minimum, and more for every escape. Measured on a real MariaDB: a 63-byte value in a `varchar(135)` passed the check and the UPDATE answered `ER_DATA_TOO_LONG`, which is the failure that check exists to prevent, mid-column with the rest already converted. It measures the encoded length now, and the refusal says "encodes to" rather than "is" so an operator measuring their own column finds the number it names.
|
|
90
|
+
|
|
91
|
+
**Two dialect defects, both found by running the command against real servers.** SQL Server reports `-1` for `NVARCHAR(MAX)` — its spelling of unbounded — and the pre-flight read it as a one-character column, so it refused the widest column the dialect has and printed `declared as -1` at the operator. And SQLITE has no `information_schema` at all: the shared catalog query died there with `Failed to prepare statement` and no statement attached, on a dialect the command claims to support. It uses `pragma_table_info` now, reporting no length because sqlite enforces none.
|
|
92
|
+
|
|
93
|
+
Measured end to end on postgres, mysql, mariadb, mssql and sqlite: a table holding plaintext, the old encoding and the current encoding side by side converts, every row decodes back to its original value, a re-run writes nothing, and a wrong key refuses with exit 1.
|
|
94
|
+
|
|
95
|
+
**Backups and restores were never affected and now say so.** `voltro data export` reads through the raw dialect store, so ciphertext travels verbatim in either encoding — pinned by a test, because a future change that wrapped that store would put plaintext credentials in a bundle.
|
|
96
|
+
- **@voltro/protocol, @voltro/cli** — Three findings from one consumer round, all of the same shape: something the framework knows and does not say.
|
|
97
|
+
|
|
98
|
+
**A decode failure on a GUARDED procedure now says the guard did not run.** The payload decodes before the handler, so a guard on a procedure with a malformed payload never gets the chance to refuse. A consumer auditing a guard called one with an incomplete payload, got a decode error instead of a `ScopeError`, and concluded the guard was not applied — the wrong conclusion in the dangerous direction. The title now carries `(guarded — the guard did NOT run: the payload failed to decode first, so this says nothing about access)`. It discloses nothing new: that a procedure is guarded is already visible to anyone who sends a VALID payload. An `openAccess:` declaration is not an enforced guard and gets no such sentence — `hasEnforcedGuard` is the one predicate, read by both the label and the wire error union, because two copies of that rule would disagree invisibly.
|
|
99
|
+
|
|
100
|
+
**`middleware.ts`'s `httpOnly` default is documented at the field, and warned about.** It defaults to `HttpOnly`, which is wrong for a session cookie a browser SDK reads back: Supabase's `createBrowserClient` reads `document.cookie`, so a forgotten `httpOnly: false` gives the browser a session it cannot see — the SSR render is perfect and the user is signed out at the first client-side call. The consumer only avoided shipping it because their probes already set the flag. `voltro dev` warns once per cookie when a session-shaped name is written with no `httpOnly` decision; an explicit decision either way silences it, because warning on a decision is how a diagnostic becomes noise.
|
|
101
|
+
|
|
102
|
+
**`voltro dev` restarts when `middleware.ts` changes.** It is loaded once per boot, that is documented, and a consumer read it and still lost an afternoon: they sabotaged the middleware, saw no change, and concluded it was not wired — in an environment where everything else hot-reloads. It now restarts through the same respawn a hard-restart field in `app.config.ts` uses, extracted so there is one copy of the `execArgv` inheritance and the signal forwarding.
|
|
103
|
+
- **@voltro/cli** — `middleware.ts` now produces ONE view of the request that every downstream reader takes. Previously only `buildLoaderQuery` saw the hook's result, while the loader context (`ctx.headers`), the SSR request snapshot (`useServerRequest()`) and the locale resolver kept reading the raw request — four readers, two answers, within eighty lines of one function.
|
|
104
|
+
|
|
105
|
+
The consequence was worse than an inconsistency: a hook that renews purely via `setCookies` — no `headers` at all, which is the normal shape for a cookie-session IdP and the reason the response half exists — moved nothing for the render that ran it. The rpc call still sent the old `Cookie` header, because a renewed cookie only reached the browser.
|
|
106
|
+
|
|
107
|
+
`setCookies` is applied to the cookie jar before the render, the `Cookie` header is rebuilt from that jar (an explicit `cookie` in the hook's own `headers` still wins), and `maxAge <= 0` deletes, so a hook that signs someone out renders them signed out. Both SSR boot paths shadow the raw headers out of scope after the hook runs, so a new reader added below is correct without knowing any of this.
|
|
108
|
+
- **@voltro/cli** — `voltro start` dropped `middleware.ts`'s `Set-Cookie` on **streamed** responses — which is the arm a plain `renderMode: 'ssr'` page takes, so it was the common case. The hook renewed the session server-side, the render used the fresh value, and the browser kept the consumed one. Against an IdP that rotates refresh tokens and detects reuse, that is worse than not renewing at all.
|
|
109
|
+
|
|
110
|
+
The cause is worth stating because it read as handled: a streamed response hands the socket to `stream(res)` and the caller never looks at the returned `headers`, so the `withCookies(...)` wrapper on that arm was dead code — sitting under a comment promising the cookies were written on every arm. The cookies now travel with the headers `streamSsrResponse` itself writes, and the dead wrapper is gone.
|
|
111
|
+
|
|
112
|
+
Found by booting real `voltro dev` and `voltro start` servers against a fixture and reading the response. Every unit test was green throughout, and the render's own HTML was correct — only the wire was wrong.
|
|
113
|
+
|
|
114
|
+
---
|
|
115
|
+
|
|
116
|
+
## [0.40.0] — 2026-08-16
|
|
117
|
+
|
|
118
|
+
### ⚠ BREAKING
|
|
119
|
+
|
|
120
|
+
- **@voltro/client, @voltro/web** — A subscription whose COLD START failed is its own state — `failed: true`, `loading: false` — so "it is loading" is a true statement again.
|
|
121
|
+
|
|
122
|
+
The old shape left `loading: true` for a subscription where nothing was in flight and nothing more was coming. The type's own comment predicted the consequence:
|
|
123
|
+
|
|
124
|
+
> A cold-start failure leaves `loading` TRUE … so a component that branches on > `loading` alone renders a skeleton forever. Check `error` to break out of it.
|
|
125
|
+
|
|
126
|
+
A consumer quoted that back with the right conclusion: **a comment that predicts the misbehaviour of its own field is an API resting on discipline.** `loading` means "something is coming" everywhere else; here it meant "something is coming OR never again", and the escape hatch was a second field that the natural shape of a wrapper — pass `{ data, loading }` through — silently drops. They had three such wrappers. The framework had six, in `useWorkflow.ts`, and the compiler named all six the moment the state existed.
|
|
127
|
+
|
|
128
|
+
`failed` is a positive discriminant, so the check reads as one:
|
|
129
|
+
|
|
130
|
+
```tsx
|
|
131
|
+
if (s.loading) return <Skeleton/>
|
|
132
|
+
if (s.failed) return <RetryPanel error={s.error}/>
|
|
133
|
+
return <Table rows={s.data}/>
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
**BREAKING**: `!loading` no longer proves `data` is present, so every call site that reads `data` after a bare `loading` check is a type error naming file and line. Nothing fails silently. The codemod is `manual` on purpose — a transform could add `|| s.failed` everywhere and would be wrong about half of them, since an infinite skeleton is precisely what this removes.
|
|
137
|
+
|
|
138
|
+
**Measured blast radius**, because the estimate was worse than the reality: 20 errors inside `@voltro/client` (mostly its own `useWorkflow` wrapper and the type-tests) and **zero** in `@voltro/web`, `devtools-ui`, the devtools app, the cloud app, and all 45 templates. Most consumers were already using a `fallback` or a wrapper, which is what made the original defect so quiet.
|
|
139
|
+
|
|
140
|
+
Unchanged: a failure AFTER the first snapshot still leaves good data on screen with `error` set — only the cold start is `failed`. A `fallback` subscription still has `data` always present, so `failed` reports there rather than gating. `idle` stays opt-in by overload; `failed` is not opt-in, because any subscription's cold start can fail. And the state is terminal for one TRANSPORT: a reconnect discards the error and re-subscribes.
|
|
141
|
+
- **@voltro/protocol, @voltro/runtime, @voltro/voltro** — A guard refusing a caller whose credential was REJECTED now answers `Unauthenticated`, not `ScopeError`.
|
|
142
|
+
|
|
143
|
+
Measured by a consumer: a user's tab outlived their IdP's token lifetime. The strategy logged it plainly —
|
|
144
|
+
|
|
145
|
+
```
|
|
146
|
+
WARN auth strategy "supabase" rejected request: supabase jwt expired
|
|
147
|
+
WARN mutation.tasks.update failed: missing required scope 'task:u:o'
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
— and the wire said the caller lacked a scope. Technically true (an anonymous caller holds none) and it sends everyone who reads it into the permissions system while the problem is an expired session. They did that round; the subject was their administrator, and the same call with a fresh token worked.
|
|
151
|
+
|
|
152
|
+
**The obvious fix would have broken more than it fixed**, which is why this shape and not that one. Failing hard when a strategy rejects would break every `openAccess` procedure for anyone holding a stale cookie — a public page that needs no session at all would start refusing. So the FACT travels instead: a rejected credential stamps `credentialRejected` on the anonymous subject it falls back to, and only a guard that actually refuses spends it. `openAccess` never reaches that point and is untouched.
|
|
153
|
+
|
|
154
|
+
Three details worth knowing if you touch it:
|
|
155
|
+
|
|
156
|
+
- **The stamp happens AFTER the app's `fallback`.** That callback builds its own anonymous subject and knows nothing about the rejection; stamping before it would be silently discarded — the shape of every "wired on one path" defect in this codebase. - **ONE conversion point** (`asRefusal`), at the exit rather than at each `return`. Every branch builds the `ScopeError` it always built; one place decides what it MEANS. - **`Unauthenticated` is merged into the wire union** for guarded procedures AND guarded events, beside `ScopeError`. Without that it would be a tagged error the descriptor cannot represent, and the server would collapse it to `InternalError` — the defect another consumer reported the same week.
|
|
157
|
+
|
|
158
|
+
A caller who presented NO credential still gets `ScopeError`. Collapsing both would send a genuinely under-privileged user to the login page.
|
|
159
|
+
|
|
160
|
+
**Why this is BREAKING although nothing was removed.** Three published results gained a union member:
|
|
161
|
+
|
|
162
|
+
```ts
|
|
163
|
+
checkGuards(…) // ScopeError | Unauthenticated | null (was ScopeError | null)
|
|
164
|
+
checkGuardsEffect(…) // Effect<ScopeError | Unauthenticated | null>
|
|
165
|
+
bindEvent(…) // Stream<…, ScopeError | Unauthenticated, …>
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
The test for breaking is not "did a symbol disappear", it is whether code that COMPILED can stop compiling — and a widened return does that wherever the old union is named (`const refusal: ScopeError | null = checkGuards(…)`), or narrowed exhaustively. It was filed as `Added` first; the golden diff is what showed otherwise, and the rule is worth more than the classification that felt right. `anonymousSubject`'s new second parameter is OPTIONAL and breaks nothing.
|
|
169
|
+
|
|
170
|
+
`voltro update` carries you across it — codemod `0.40.0/02_rejected-credential-widens-guard-results`, a written note. A transform would widen each annotation, which compiles and keeps the reported behaviour: the decision at each site is what an expired session should do that a missing permission should not.
|
|
171
|
+
|
|
172
|
+
### Added
|
|
173
|
+
|
|
174
|
+
- **@voltro/client, @voltro/web** — The client re-resolves `authHeaders` when the server says the credential was rejected — and `client.refreshAuth()` for an app that knows earlier.
|
|
175
|
+
|
|
176
|
+
`authHeaders` is resolved once per CONNECTION and attached per frame, so a tab open longer than the IdP's token lifetime keeps presenting a dead token until something reconnects. A consumer measured it: dragging a card on a board failed, their ADMINISTRATOR's token had simply expired while the page stood, and nothing in `@voltro/client` could force the re-resolve.
|
|
177
|
+
|
|
178
|
+
The trigger is the `Unauthenticated` error — which only became distinguishable from `ScopeError` in this same release. Before that the client could not have told "your session died" from "you lack a permission", and reconnecting on the second would have been wrong.
|
|
179
|
+
|
|
180
|
+
`refreshAuth()` is a SAME-SUBJECT rebuild, and the difference from `reconnect()` is one flag and a security boundary: `reconnect()` exists for a login / logout / tenant switch, where the next subject may be entitled to strictly LESS, so the cache must not be seeded from the old one. A token refresh is the same person with a fresh credential, so seeding is correct and the screen keeps its rows instead of blanking for the round trip. Getting that backwards is silent in both directions — seed on a subject change and you paint one user's rows into another's; refuse to seed on a refresh and every open screen blinks on every rotation.
|
|
181
|
+
|
|
182
|
+
The policy lives in ONE function (`wireAuthRefresh`) that every host wires, because "when do we reconnect on an auth error" is exactly the kind of decision this repo has watched drift when it was written twice. Two guards, answering different questions: a **rate** ceiling (one rebuild per window — a rejected mutation arrives alongside every rejected subscription on the page) and a **total** ceiling (stop after N refreshes with no successful call between, because at that point the credential is not stale, it is refused, and the answer is a sign-in screen rather than another socket).
|
|
183
|
+
- **@voltro/cli** — `middleware.ts` — a web app's one server-only hook, for renewing a credential before the SSR render uses it.
|
|
184
|
+
|
|
185
|
+
Reported: a consumer's SSR detail pages arrived empty on the first request of every day. Their cookie token had outlived the IdP's lifetime, the api resolved the caller to anonymous, and every `preload` on the page failed. They could not fix it in the app, and the reason is structural: `ctx.query` and every `preload` entry are bound from ONE cookie string **before any loader runs**, so a layout loader that renews the session cannot reach them — and a `type: 'web'` app has no auth middleware.
|
|
186
|
+
|
|
187
|
+
```ts
|
|
188
|
+
// middleware.ts — web app root, server-only
|
|
189
|
+
export default async (req) => {
|
|
190
|
+
const fresh = await refreshSession(req.cookies['sb-session'])
|
|
191
|
+
if (!fresh) return
|
|
192
|
+
return {
|
|
193
|
+
headers: { authorization: `Bearer ${fresh.accessToken}` },
|
|
194
|
+
setCookies: [{ name: 'sb-session', value: fresh.cookie, maxAge: 3600 }],
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
**Why not `app.config.ts`.** That file is imported into the CLIENT bundle, verbatim, the moment any api declares `authHeaders` — the thunk is a function, so it cannot be serialised. A hook that renews a session reaches for an IdP SDK by definition, so putting it there drags the server graph into the browser. The consumer proposed exactly that shape (`serverAuthHeaders` beside `authHeaders`) and it is the one place it cannot go.
|
|
200
|
+
|
|
201
|
+
**Why `setCookies` is not optional.** We asked whether writing cookies back was in scope, expecting the answer to be about a round trip. It was about correctness: Supabase ROTATES refresh tokens and detects reuse, so a hook that renews server-side and does not write the result back leaves the browser holding a consumed token. Without it the hook is not "slower but correct" — it can destroy the session.
|
|
202
|
+
|
|
203
|
+
**Deliberately not a general middleware.** It can replace credentials and set cookies. It cannot redirect, return a response, or rewrite a route — because authorization belongs on the API, which is the only thing that sees the data, and a web-side hook that can refuse a request becomes a second authorization layer beside the real one. A hook that cannot refuse also cannot be mistaken for a guard. For a login redirect, a loader already throws `RedirectError`.
|
|
204
|
+
|
|
205
|
+
Details worth knowing: only auth-shaped headers (`authorization`, `x-tenant`, `x-voltro-*`) are forwarded to the api, so a returned `host` or `content-length` cannot produce a failure that looks like anything but a header copy; cookies default to `HttpOnly` + `Path=/` + `SameSite=lax`; multiple cookies are written as separate header lines, never comma-joined (a cookie's `Expires` contains a comma); the file is loaded ONCE per boot; a failure to IMPORT is fatal rather than degrading to "no middleware", and a middleware that THROWS fails the request — the render must not proceed on the credential it was told to replace.
|
|
206
|
+
|
|
207
|
+
Wired on BOTH SSR boot paths (`voltro dev` and `voltro start`), with the cookies written on every response arm — streamed, buffered, redirect and 404. A partial application would renew a rotating token and drop it.
|
|
208
|
+
- **@voltro/testing** — `makeTestContext` supplies `ctx.events`, so an executor that publishes can be unit-tested at all.
|
|
209
|
+
|
|
210
|
+
`ctx.events` is a field PRODUCTION puts on every `AppContext`, and the test harness did not — so any handler containing `ctx.events.publish(...)` died on `Cannot read properties of undefined (reading 'publish')` the moment it ran under test.
|
|
211
|
+
|
|
212
|
+
**The shipped `api-durable` template demonstrates exactly that pattern** (publish inside the mutation's transaction, so it fires on COMMIT and not on rollback), and its own test passed anyway — because it called the executor with `await` instead of running it. An executor written in the Effect style RETURNS an Effect, and awaiting a non-thenable hands the object straight back, unrun. The assertion then failed on `row.status` being `undefined` and pointed at the assertion rather than at the call. Two defects propping each other up: the harness could not have run that handler, and the test never asked it to.
|
|
213
|
+
|
|
214
|
+
It is the REAL `makeEventPublisher` over a real `EventBus`, not a stub. A fake would re-implement the payload validation and the tenant stamping and would be wrong the first time either gains a case — the lesson `plugin-broadcast` paid for twice. `ctx.eventBus` is the read side:
|
|
215
|
+
|
|
216
|
+
```ts
|
|
217
|
+
const seen = ctx.eventBus.subscribe(orderPlaced, { orderId })
|
|
218
|
+
await invoke(placeOrder, executor, input, ctx)
|
|
219
|
+
expect(seen.received).toHaveLength(1)
|
|
220
|
+
```
|
|
221
|
+
|
|
222
|
+
One bus for the whole harness so a `withSubject` / `withTenant` re-scope still publishes where the test is listening; the PUBLISHER is per-subject, because the tenant it stamps is the caller's.
|
|
223
|
+
|
|
224
|
+
### Fixed
|
|
225
|
+
|
|
226
|
+
- **@voltro/cli** — `voltro agents-md --force` no longer exits 0 when it wrote nothing.
|
|
227
|
+
|
|
228
|
+
Reported: a consumer's `agent-docs/` is owned by the pod (root). They ran the command as `admin`, and it **overwrote nothing, said nothing, and exited 0**. They read the unchanged file as "the framework has not fixed this yet" — it had — and lost a full round to it.
|
|
229
|
+
|
|
230
|
+
The cause was three `orElseSucceed`s in the agent-docs copy. `makeDirectory`, `readDirectory` and every `copyFile` degraded to success, so a destination the process could not write produced an empty run that reported itself as done. An unreadable source directory came back as `[]` and did the same.
|
|
231
|
+
|
|
232
|
+
Failures are collected and reported now, and the command **exits 1** when the seed is incomplete:
|
|
233
|
+
|
|
234
|
+
```
|
|
235
|
+
agents-md: 12 file(s) could NOT be written — the seed is INCOMPLETE.
|
|
236
|
+
The commonest cause is ownership: a container wrote these as root and you are
|
|
237
|
+
running as someone else.
|
|
238
|
+
```
|
|
239
|
+
|
|
240
|
+
`--force` is an explicit instruction to overwrite, so silently not overwriting is the one outcome that must never be reported as done. `stat` is the single remaining silent degrade, deliberately: a source entry that vanished mid-walk is not a write failure and must not fail the run.
|
|
241
|
+
|
|
242
|
+
Pinned in both directions — a real unwritable directory yields failures, a clean copy yields none, and a source guard asserts that `stat` is the ONLY call on that path allowed to swallow. Red-verified by restoring the original `orElseSucceed`.
|
|
243
|
+
- **@voltro/cli** — Every server-side loader context is now checked by the compiler, and the static prerender stopped handing loaders a context missing `search` and `headers`.
|
|
244
|
+
|
|
245
|
+
`ctx.isServer` shipped with a source-reading guard, and that guard had the defect it exists to prevent: it matched context literals by shape (`loader({` / `ctx: {`) and therefore found ONE of the two in `build.ts`, missing the one built as a typed arrow return. Its tripwire — "at least 5 sites" — passed, because a floor cannot tell 5-of-8 from 5-of-5. The gap was found by a parallel report, not by the guard.
|
|
246
|
+
|
|
247
|
+
The invariant moved from "the literal mentions `isServer`" to "the literal is CHECKED BY THE COMPILER": every server loader context is now `satisfies SegmentLoaderContext`, whose `isServer` is required. A site that forgets it is a type error naming the file and line — strictly stronger than any regex over shapes, and verified by removing one.
|
|
248
|
+
|
|
249
|
+
**It caught a second defect immediately.** The static prerender built its page loader context with only `params`, `pathname`, `signal` — no `search`, no `headers`, no `query` — while `LoaderContext.search` is declared `string`. A static page's loader reading `ctx.search` got `undefined` where the type promised a value. The segment context twenty lines above it in the same file already passed `search: ''` with a comment explaining why.
|
|
250
|
+
|
|
251
|
+
Two smaller things worth knowing if you touch the guard: the closing brace is part of its pattern because the bare phrase also appears in the comment explaining the rule (the first version counted its own documentation), and the CLI's `SegmentLoaderContext` mirror keeping `isServer` non-optional is what the whole enforcement rests on — `isServer?:` would make every `satisfies` pass while a forgetful site reports itself as the browser.
|
|
252
|
+
- **@voltro/protocol, @voltro/cli** — A guard's `ScopeError` reaches the client as `ScopeError` on a mutation, not as `InternalError`.
|
|
253
|
+
|
|
254
|
+
Measured by a consumer over the wire, same session, same foreign team:
|
|
255
|
+
|
|
256
|
+
| kind | declared `error:` | denial arrived as | |---|---|---| | query `webhooks.list` | `AccessDeniedError` | `_tag: 'ScopeError'` ✓ | | mutation `…updateReferenceLabels` | `AccessDeniedError` | `InternalError` ✗ | | the same mutation, after adding `ScopeError` to its union | | `_tag: 'ScopeError'` ✓ |
|
|
257
|
+
|
|
258
|
+
Their client maps `ScopeError` to *forbidden* and `InternalError` to *something went wrong*, so a permissions refusal looked like a crash — on every relationship-guarded write in the app.
|
|
259
|
+
|
|
260
|
+
**Their observation was exact; the mechanism was not, and the difference is where the fix goes.** They diagnosed it as "the merge only happens on the streaming path". `withGuardError` is called by every lifter, so the wire union carries `ScopeError` on both. What differs is a SECOND reader: the server refuses to ship a tagged error the descriptor cannot represent, collapsing it to `InternalError` rather than emitting a raw defect tree — and it was handed `descriptor.error`, the RAW declaration, while the union it protects is the WIDENED one. It judged against a narrower set than it had advertised. A query never reaches that check (it is delivered through `wireErrorFromCause`, which preserves the tag), which is exactly why the split fell along query/mutation.
|
|
261
|
+
|
|
262
|
+
`wireErrorUnion(descriptor, kind)` is now the single owner of "what can this procedure put on the wire", used by the lifters AND by both bind sites.
|
|
263
|
+
|
|
264
|
+
**Two more error classes were collapsed the same way, and neither was reported:**
|
|
265
|
+
|
|
266
|
+
- **`BusinessRuleViolation`** — unconditional for mutations. `withRuleError`'s own comment says it MUST be in the union "or the violation crosses the wire as an untyped defect". It was in the union, and collapsed before it got there. - **The `requiresApproval` refusals** — `ApprovalRequired` / `ApprovalExpired` / `ApprovalUnavailable`, so "parked for approval" was indistinguishable from "the server broke".
|
|
267
|
+
|
|
268
|
+
`openAccess:` still merges nothing: a procedure advertising a denial it cannot produce is what makes an error union stop meaning anything.
|
|
269
|
+
|
|
270
|
+
If you worked around this by declaring `ScopeError` yourself, the declaration is now redundant rather than wrong — the union is the same either way, and you can delete it whenever you like.
|
|
271
|
+
|
|
272
|
+
---
|
|
273
|
+
|
|
42
274
|
## [0.39.1] — 2026-08-16
|
|
43
275
|
|
|
44
276
|
### Fixed
|
package/dist/index.d.ts
CHANGED
|
@@ -747,6 +747,26 @@ export declare interface TestContext extends AppContext {
|
|
|
747
747
|
* and the harness did not, so a mutation written the documented way —
|
|
748
748
|
* `useWebhooks(ctx).emit(...)` — threw in every unit test. */
|
|
749
749
|
readonly webhooks: MockWebhooks;
|
|
750
|
+
/**
|
|
751
|
+
* The event publisher, backed by a real in-process bus.
|
|
752
|
+
*
|
|
753
|
+
* `ctx.events` is a field PRODUCTION supplies on every `AppContext`, and this
|
|
754
|
+
* harness did not — so an executor containing `ctx.events.publish(...)` could
|
|
755
|
+
* not be unit-tested at all: it died on `Cannot read properties of undefined
|
|
756
|
+
* (reading 'publish')`. The shipped `api-durable` template demonstrates
|
|
757
|
+
* exactly that pattern (publish inside the mutation's transaction), so the
|
|
758
|
+
* example and the test helper contradicted each other, and the template's own
|
|
759
|
+
* test only passed because it awaited the Effect without running it.
|
|
760
|
+
*
|
|
761
|
+
* Real, not a stub: `makeEventPublisher` is the same constructor production
|
|
762
|
+
* uses, over a `testEventBus`. A fake would re-implement the validation and
|
|
763
|
+
* the tenant stamping, and would be wrong the first time either gains a case.
|
|
764
|
+
* `ctx.eventBus.received` is where a test reads what was published.
|
|
765
|
+
*/
|
|
766
|
+
readonly events: EventPublisher;
|
|
767
|
+
/** The bus behind `ctx.events` — subscribe to it to assert what a handler
|
|
768
|
+
* published. */
|
|
769
|
+
readonly eventBus: TestEventBus;
|
|
750
770
|
readonly llm: MockLLM;
|
|
751
771
|
readonly ai?: MockAi;
|
|
752
772
|
/** Re-scope to a different subject for one block (real subject swap, not
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { AUTO_FILLED_COLUMNS as e, allRegisteredTables as t, changeDelete as n, changeInsert as r, changeSoftDelete as i, changeUpdate as a, clearRelationsRegistry as o, missingRequiredColumns as s, registerRelations as c } from "@voltro/database";
|
|
2
2
|
import { Cause as l, Effect as u, Exit as d, Layer as f, Schema as p } from "effect";
|
|
3
|
-
import { SubjectService as m, anonymousSubject as h, checkGuardsEffect as g, composeAuthStrategies as _, composeRpcInterceptors as v, eventRoute as
|
|
4
|
-
import { EventBus as
|
|
3
|
+
import { SubjectService as m, anonymousSubject as h, checkGuardsEffect as g, composeAuthStrategies as _, composeRpcInterceptors as v, eventRoute as y, systemSubject as b, tenantScopedSubject as ee } from "@voltro/protocol";
|
|
4
|
+
import { EventBus as te, InMemoryDataStore as ne, NO_ROW_FILTER as x, applyRowFilterToDescriptor as re, clearSystemStoreHandle as ie, getRowFilter as S, getSystemStoreHandle as ae, makeAppAccess as oe, makeDataLoader as se, makeEffectStoreLayer as ce, makeEventPublisher as le, makeOutboxFacade as ue, makeSchemaRegistry as de, publishEvent as fe, resolveRowFilterScopeFor as pe, runProvidedEffect as C, runWithDeadlockRetry as me, setSystemStoreHandle as w, wrapStoreWithMixinBehaviour as T } from "@voltro/runtime";
|
|
5
5
|
import { installEnvSnapshot as he } from "@voltro/env";
|
|
6
6
|
import ge from "node:net";
|
|
7
7
|
import { describe as _e } from "vitest";
|
|
@@ -9,7 +9,7 @@ import { collectPublicApiRoutes as ve, dispatchSharedPath as ye, restRoutesToHtt
|
|
|
9
9
|
import { createLogger as xe } from "@voltro/logger";
|
|
10
10
|
import { CurrentWorkflowRunId as Se, inMemoryWorkflowEngineLayer as Ce, makeInMemoryRecorder as we } from "@voltro/workflow";
|
|
11
11
|
//#region src/fixtureRow.ts
|
|
12
|
-
var Te = new Set(e),
|
|
12
|
+
var Te = new Set(e), E = 0, D = () => ++E, Ee = (e, t) => {
|
|
13
13
|
if (t.oneOf && t.oneOf.length > 0) return t.oneOf[0];
|
|
14
14
|
if (t.enumValues && t.enumValues.length > 0) return t.enumValues[0];
|
|
15
15
|
let n = t.unique === !0;
|
|
@@ -17,17 +17,17 @@ var Te = new Set(e), T = 0, E = () => ++T, Ee = (e, t) => {
|
|
|
17
17
|
case "text":
|
|
18
18
|
case "reference":
|
|
19
19
|
case "id":
|
|
20
|
-
case "enum": return n ? `${e}-${++
|
|
20
|
+
case "enum": return n ? `${e}-${++E}` : e;
|
|
21
21
|
case "integer":
|
|
22
|
-
case "real": return n ? ++
|
|
22
|
+
case "real": return n ? ++E : 0;
|
|
23
23
|
case "decimal":
|
|
24
|
-
case "bigint": return n ? String(++
|
|
24
|
+
case "bigint": return n ? String(++E) : "0";
|
|
25
25
|
case "boolean": return !1;
|
|
26
26
|
case "timestamp":
|
|
27
27
|
case "date": return /* @__PURE__ */ new Date(0);
|
|
28
28
|
default: throw Error(`fixtureRow: column '${e}' is a required '${t.type}' with no default, and fixtureRow can't synthesize a safe placeholder for that type. Pass it explicitly: fixtureRow(table, { ${e}: … }).`);
|
|
29
29
|
}
|
|
30
|
-
},
|
|
30
|
+
}, O = (e, t = {}) => {
|
|
31
31
|
let n = {};
|
|
32
32
|
for (let r of s(e, t)) Te.has(r) || (n[r] = Ee(r, e.fields[r]));
|
|
33
33
|
return {
|
|
@@ -36,7 +36,7 @@ var Te = new Set(e), T = 0, E = () => ++T, Ee = (e, t) => {
|
|
|
36
36
|
};
|
|
37
37
|
}, De = (e) => {
|
|
38
38
|
let t = {};
|
|
39
|
-
for (let [n, r] of Object.entries(e)) t[n] = typeof r == "function" ? r(
|
|
39
|
+
for (let [n, r] of Object.entries(e)) t[n] = typeof r == "function" ? r(D()) : r;
|
|
40
40
|
return t;
|
|
41
41
|
}, Oe = (e) => {
|
|
42
42
|
for (let [t, n] of Object.entries(e.fields)) if (n.type === "id") return t;
|
|
@@ -49,29 +49,29 @@ var Te = new Set(e), T = 0, E = () => ++T, Ee = (e, t) => {
|
|
|
49
49
|
let s = n.references();
|
|
50
50
|
if (i.includes(s.tableName)) throw Error(`defineFactory: creating '${t.tableName}' requires '${s.tableName}' via '${o}', and that reference is cyclic (${[...i, s.tableName].join(" → ")}). Insert one side first and pass the id: create(store, { ${o}: existing.id }).`);
|
|
51
51
|
let c = r[o];
|
|
52
|
-
a[o] = (c === void 0 ? await
|
|
52
|
+
a[o] = (c === void 0 ? await k(e, s, {}, {}, [...i, s.tableName]) : await c.create(e, {}))[Oe(s)];
|
|
53
53
|
}
|
|
54
54
|
return a;
|
|
55
|
-
},
|
|
55
|
+
}, k = async (e, t, n, r, i) => {
|
|
56
56
|
let a = {
|
|
57
57
|
...await ke(e, t, n, r, i),
|
|
58
58
|
...n
|
|
59
59
|
};
|
|
60
|
-
return e.insert(t.tableName,
|
|
61
|
-
},
|
|
60
|
+
return e.insert(t.tableName, O(t, a));
|
|
61
|
+
}, A = (e, t) => typeof e == "function" ? e(t) : e ?? {}, Ae = (e, t = {}) => {
|
|
62
62
|
let n = t.traits ?? {}, r = t.associations ?? {}, i = (t) => {
|
|
63
63
|
let a = (e = {}) => ({
|
|
64
64
|
...De(t),
|
|
65
65
|
...e
|
|
66
|
-
}), o = (t = {}) =>
|
|
66
|
+
}), o = (t = {}) => O(e, a(t));
|
|
67
67
|
return {
|
|
68
68
|
table: e,
|
|
69
69
|
build: o,
|
|
70
|
-
buildList: (e, t) => Array.from({ length: e }, (e, n) => o(
|
|
71
|
-
create: (t, n = {}) =>
|
|
70
|
+
buildList: (e, t) => Array.from({ length: e }, (e, n) => o(A(t, n))),
|
|
71
|
+
create: (t, n = {}) => k(t, e, a(n), r, [e.tableName]),
|
|
72
72
|
createList: async (t, n, i) => {
|
|
73
73
|
let o = [];
|
|
74
|
-
for (let s = 0; s < n; s++) o.push(await
|
|
74
|
+
for (let s = 0; s < n; s++) o.push(await k(t, e, a(A(i, s)), r, [e.tableName]));
|
|
75
75
|
return o;
|
|
76
76
|
},
|
|
77
77
|
with: (...r) => {
|
|
@@ -93,19 +93,19 @@ var Te = new Set(e), T = 0, E = () => ++T, Ee = (e, t) => {
|
|
|
93
93
|
};
|
|
94
94
|
};
|
|
95
95
|
return i(t.defaults ?? {});
|
|
96
|
-
},
|
|
96
|
+
}, j = Symbol.for("voltro/testing/mockClock.installed"), M = () => globalThis, je = (e, t) => new Proxy(e, {
|
|
97
97
|
construct: (e, n, r) => Reflect.construct(e, n.length === 0 ? [t()] : n, r),
|
|
98
98
|
apply: () => new e(t()).toString(),
|
|
99
99
|
get: (e, n, r) => n === "now" ? () => t() : Reflect.get(e, n, r)
|
|
100
|
-
}),
|
|
100
|
+
}), N = (e) => {
|
|
101
101
|
if (typeof e == "number") return e;
|
|
102
102
|
let t = e instanceof Date ? e.getTime() : Date.parse(e);
|
|
103
103
|
if (Number.isNaN(t)) throw Error(`mockClock: cannot read an instant from '${String(e)}'`);
|
|
104
104
|
return t;
|
|
105
|
-
},
|
|
105
|
+
}, P = class {
|
|
106
106
|
currentMs;
|
|
107
107
|
constructor(e = "2026-01-01T00:00:00Z") {
|
|
108
|
-
this.currentMs =
|
|
108
|
+
this.currentMs = N(e);
|
|
109
109
|
}
|
|
110
110
|
now() {
|
|
111
111
|
return this.currentMs;
|
|
@@ -117,16 +117,16 @@ var Te = new Set(e), T = 0, E = () => ++T, Ee = (e, t) => {
|
|
|
117
117
|
this.currentMs += typeof e == "number" ? e : Fe(e);
|
|
118
118
|
}
|
|
119
119
|
set(e) {
|
|
120
|
-
this.currentMs =
|
|
120
|
+
this.currentMs = N(e);
|
|
121
121
|
}
|
|
122
122
|
get installed() {
|
|
123
|
-
return
|
|
123
|
+
return M()[j]?.clock === this;
|
|
124
124
|
}
|
|
125
125
|
install() {
|
|
126
|
-
let e =
|
|
126
|
+
let e = M(), t = e[j];
|
|
127
127
|
if (t !== void 0) throw Error("mockClock: global time is already faked" + (t.clock === this ? " by this same clock" : " by another MockClock") + ". Uninstall it before installing again — a nested install restores the outer fake on the way out, which leaves the realm frozen with nothing pointing at why. `withFrozenTime` always restores, including on a throw.");
|
|
128
128
|
let n = globalThis.Date;
|
|
129
|
-
return e[
|
|
129
|
+
return e[j] = {
|
|
130
130
|
realDate: n,
|
|
131
131
|
clock: this
|
|
132
132
|
}, globalThis.Date = je(n, () => this.currentMs), () => {
|
|
@@ -134,11 +134,11 @@ var Te = new Set(e), T = 0, E = () => ++T, Ee = (e, t) => {
|
|
|
134
134
|
};
|
|
135
135
|
}
|
|
136
136
|
uninstall() {
|
|
137
|
-
let e =
|
|
138
|
-
t !== void 0 && t.clock === this && (globalThis.Date = t.realDate, delete e[
|
|
137
|
+
let e = M(), t = e[j];
|
|
138
|
+
t !== void 0 && t.clock === this && (globalThis.Date = t.realDate, delete e[j]);
|
|
139
139
|
}
|
|
140
140
|
}, Me = (e) => typeof e == "object" && !!e && typeof e.then == "function", Ne = (e, t) => {
|
|
141
|
-
let n = e instanceof
|
|
141
|
+
let n = e instanceof P ? e : new P(e);
|
|
142
142
|
n.install();
|
|
143
143
|
let r = !1;
|
|
144
144
|
try {
|
|
@@ -150,7 +150,7 @@ var Te = new Set(e), T = 0, E = () => ++T, Ee = (e, t) => {
|
|
|
150
150
|
r || n.uninstall();
|
|
151
151
|
}
|
|
152
152
|
}, Pe = (e) => u.acquireRelease(u.sync(() => {
|
|
153
|
-
let t = e instanceof
|
|
153
|
+
let t = e instanceof P ? e : new P(e);
|
|
154
154
|
return t.install(), t;
|
|
155
155
|
}), (e) => u.sync(() => {
|
|
156
156
|
e.uninstall();
|
|
@@ -166,7 +166,7 @@ var Te = new Set(e), T = 0, E = () => ++T, Ee = (e, t) => {
|
|
|
166
166
|
case "d": return n * 864e5;
|
|
167
167
|
default: throw Error(`mockClock: unknown unit '${r}'`);
|
|
168
168
|
}
|
|
169
|
-
},
|
|
169
|
+
}, F = class {
|
|
170
170
|
emitted = [];
|
|
171
171
|
async emit(e, t) {
|
|
172
172
|
let n = typeof e == "string" ? e : e.id ?? e.event ?? "(unnamed event)";
|
|
@@ -185,7 +185,77 @@ var Te = new Set(e), T = 0, E = () => ++T, Ee = (e, t) => {
|
|
|
185
185
|
clear() {
|
|
186
186
|
this.emitted.length = 0;
|
|
187
187
|
}
|
|
188
|
-
},
|
|
188
|
+
}, I = (e = {}) => {
|
|
189
|
+
let t = e.tenantId ?? null, n = new te({
|
|
190
|
+
origin: e.origin ?? "test",
|
|
191
|
+
...e.ringSize === void 0 ? {} : { ringSize: e.ringSize }
|
|
192
|
+
});
|
|
193
|
+
return {
|
|
194
|
+
publish: async (e, r, i) => {
|
|
195
|
+
let a = await u.runPromise(u.either(fe({
|
|
196
|
+
bus: n,
|
|
197
|
+
tenantId: t
|
|
198
|
+
}, e, r, i)));
|
|
199
|
+
if (a._tag === "Left") {
|
|
200
|
+
let t = a.left;
|
|
201
|
+
throw Error(`testEventBus.publish(${e.name}) was rejected: ${t._tag}`, { cause: t });
|
|
202
|
+
}
|
|
203
|
+
return { n: a.right.n };
|
|
204
|
+
},
|
|
205
|
+
subscribe: (e, r, i) => {
|
|
206
|
+
let a = [], o = [];
|
|
207
|
+
return {
|
|
208
|
+
get received() {
|
|
209
|
+
return a.map((e) => e.payload);
|
|
210
|
+
},
|
|
211
|
+
get deliveries() {
|
|
212
|
+
return a;
|
|
213
|
+
},
|
|
214
|
+
get missed() {
|
|
215
|
+
return o;
|
|
216
|
+
},
|
|
217
|
+
get missedCount() {
|
|
218
|
+
return o.reduce((e, t) => e + t.count, 0);
|
|
219
|
+
},
|
|
220
|
+
stop: n.subscribe({
|
|
221
|
+
tenantId: i?.tenantId ?? t,
|
|
222
|
+
event: e.name,
|
|
223
|
+
key: r,
|
|
224
|
+
listener: (e) => {
|
|
225
|
+
if (e.kind === "gap") {
|
|
226
|
+
o.push({
|
|
227
|
+
count: e.missed,
|
|
228
|
+
reason: e.reason
|
|
229
|
+
});
|
|
230
|
+
return;
|
|
231
|
+
}
|
|
232
|
+
a.push({
|
|
233
|
+
payload: e.envelope.payload,
|
|
234
|
+
origin: e.envelope.origin,
|
|
235
|
+
n: e.envelope.n
|
|
236
|
+
});
|
|
237
|
+
},
|
|
238
|
+
...i?.resume === void 0 ? {} : { options: { resume: i.resume } }
|
|
239
|
+
})
|
|
240
|
+
};
|
|
241
|
+
},
|
|
242
|
+
skipSerials: (e, r, i, a) => {
|
|
243
|
+
let o = a?.tenantId ?? t, s = {
|
|
244
|
+
route: y(o, e.name, r),
|
|
245
|
+
event: e.name,
|
|
246
|
+
origin: "test-gap",
|
|
247
|
+
n: i + 1,
|
|
248
|
+
emittedAt: Date.now(),
|
|
249
|
+
payload: void 0
|
|
250
|
+
};
|
|
251
|
+
n.injectRemote(s);
|
|
252
|
+
},
|
|
253
|
+
bus: n,
|
|
254
|
+
reset: () => {
|
|
255
|
+
n.clear();
|
|
256
|
+
}
|
|
257
|
+
};
|
|
258
|
+
}, L = class {
|
|
189
259
|
queue;
|
|
190
260
|
calls = [];
|
|
191
261
|
constructor(e) {
|
|
@@ -200,27 +270,27 @@ var Te = new Set(e), T = 0, E = () => ++T, Ee = (e, t) => {
|
|
|
200
270
|
remaining() {
|
|
201
271
|
return this.queue.length;
|
|
202
272
|
}
|
|
203
|
-
}, Ie = (e) => e,
|
|
204
|
-
let n =
|
|
273
|
+
}, Ie = (e) => e, R = "00000000000000000000000000000000", z = /* @__PURE__ */ new WeakMap(), B = /* @__PURE__ */ new WeakMap(), V = /* @__PURE__ */ new WeakMap(), H = /* @__PURE__ */ new WeakMap(), U = /* @__PURE__ */ new WeakMap(), W = (e, t) => {
|
|
274
|
+
let n = H.get(e) ?? [], r = t === "mutation" ? "interceptMutation" : t === "query" ? "interceptQuery" : "interceptAction", i = [];
|
|
205
275
|
for (let e of n) {
|
|
206
276
|
let t = e[r];
|
|
207
277
|
typeof t == "function" && i.push(t);
|
|
208
278
|
}
|
|
209
279
|
return v(i);
|
|
210
|
-
},
|
|
211
|
-
let t = (
|
|
280
|
+
}, G = (e) => {
|
|
281
|
+
let t = (H.get(e) ?? []).map((e) => e.services).filter((e) => e !== void 0), n = U.get(e) ?? [], r = [...t, ...n];
|
|
212
282
|
if (r.length !== 0) return f.mergeAll(...r);
|
|
213
|
-
},
|
|
214
|
-
let t =
|
|
283
|
+
}, K = (e) => {
|
|
284
|
+
let t = B.get(e);
|
|
215
285
|
t !== void 0 && (t.length = 0);
|
|
216
|
-
},
|
|
217
|
-
let t =
|
|
286
|
+
}, q = async (e) => {
|
|
287
|
+
let t = B.get(e);
|
|
218
288
|
if (t === void 0 || t.length === 0) return;
|
|
219
289
|
let n = [...t];
|
|
220
290
|
t.length = 0;
|
|
221
291
|
for (let e of n) await e();
|
|
222
|
-
}, Le = (e) =>
|
|
223
|
-
let n =
|
|
292
|
+
}, Le = (e) => V.get(e) ?? [], J = async (e, t) => {
|
|
293
|
+
let n = z.get(e);
|
|
224
294
|
return n === void 0 ? e.store.transactional(async (n) => t({
|
|
225
295
|
...e,
|
|
226
296
|
store: n
|
|
@@ -293,28 +363,28 @@ var Te = new Set(e), T = 0, E = () => ++T, Ee = (e, t) => {
|
|
|
293
363
|
}
|
|
294
364
|
};
|
|
295
365
|
}, Be = async (e, t) => {
|
|
296
|
-
let n =
|
|
297
|
-
|
|
366
|
+
let n = ae();
|
|
367
|
+
w(e);
|
|
298
368
|
try {
|
|
299
369
|
return await t();
|
|
300
370
|
} finally {
|
|
301
|
-
n === void 0 ?
|
|
371
|
+
n === void 0 ? ie() : w(n);
|
|
302
372
|
}
|
|
303
|
-
},
|
|
304
|
-
|
|
373
|
+
}, Y = /* @__PURE__ */ new Set(), Ve = (e) => {
|
|
374
|
+
Y.has(e) || (Y.add(e), console.warn(e));
|
|
305
375
|
}, He = (e, t, n) => {
|
|
306
376
|
let r = Ue, i;
|
|
307
377
|
return () => {
|
|
308
|
-
let a = t ??
|
|
309
|
-
return t !== void 0 &&
|
|
378
|
+
let a = t ?? S();
|
|
379
|
+
return t !== void 0 && S() !== void 0 && t !== S() && Ve("[voltro:testing] this test passes `rowFilter:` while a DIFFERENT filter is registered via `setRowFilter`. The option wins, so this test does not exercise your app's registration. Drop `rowFilter:` to run the real process-global one."), (i === void 0 || a !== r) && (r = a, i = Be(n, () => C(pe(a, e, (e) => {
|
|
310
380
|
console.error("[voltro:testing] row filter failed to load — reads refused for this subject", e);
|
|
311
381
|
})))), i;
|
|
312
382
|
};
|
|
313
|
-
}, Ue = Symbol("unresolved"),
|
|
314
|
-
if (n === "query") return async (n) => e.query(
|
|
383
|
+
}, Ue = Symbol("unresolved"), We = (e, t) => new Proxy(e, { get: (e, n) => {
|
|
384
|
+
if (n === "query") return async (n) => e.query(re(await t(), n));
|
|
315
385
|
let r = Reflect.get(e, n, e);
|
|
316
386
|
return typeof r == "function" ? r.bind(e) : r;
|
|
317
|
-
} }),
|
|
387
|
+
} }), Ge = (e = {}) => {
|
|
318
388
|
if (he({
|
|
319
389
|
...process.env,
|
|
320
390
|
...e.env ?? {}
|
|
@@ -322,72 +392,77 @@ var Te = new Set(e), T = 0, E = () => ++T, Ee = (e, t) => {
|
|
|
322
392
|
o();
|
|
323
393
|
for (let t of e.relations) c(t);
|
|
324
394
|
}
|
|
325
|
-
let n = e.tables ?? t(), r = de(n), i = new
|
|
395
|
+
let n = e.tables ?? t(), r = de(n), i = new ne(e.store ?? {}), a = {
|
|
326
396
|
dataStore: i,
|
|
327
397
|
schemaRegistry: r
|
|
328
398
|
};
|
|
329
|
-
|
|
330
|
-
let s = new
|
|
399
|
+
w(a);
|
|
400
|
+
let s = new P(e.clockStart), l = new F(), u = I(), d = new L(e.llmResponses ?? []), f = Re(() => s.now()), p = ze(() => s.now()), m = (t, n = i, o) => {
|
|
331
401
|
let c = {
|
|
332
402
|
subject: t,
|
|
333
|
-
traceId:
|
|
334
|
-
},
|
|
403
|
+
traceId: R
|
|
404
|
+
}, h = le({
|
|
405
|
+
bus: u.bus,
|
|
406
|
+
tenantId: t.tenantId ?? null
|
|
407
|
+
}), g = o?.queued ?? [], _ = o?.nudges ?? [], v = se({ store: n }), y = He(t, e.rowFilter, a), b = {
|
|
335
408
|
clock: s,
|
|
336
409
|
webhooks: l,
|
|
337
|
-
|
|
410
|
+
events: h,
|
|
411
|
+
eventBus: u,
|
|
412
|
+
llm: d,
|
|
338
413
|
...e.ai === void 0 ? {} : { ai: e.ai },
|
|
339
414
|
request: c,
|
|
340
|
-
access:
|
|
341
|
-
cache:
|
|
342
|
-
kv:
|
|
343
|
-
store:
|
|
415
|
+
access: oe(t),
|
|
416
|
+
cache: f,
|
|
417
|
+
kv: p,
|
|
418
|
+
store: T(We(n, y), {
|
|
344
419
|
subject: t,
|
|
345
420
|
schemaRegistry: r,
|
|
346
|
-
rowFilter:
|
|
421
|
+
rowFilter: x
|
|
347
422
|
}),
|
|
348
|
-
storeForTenant: (e) =>
|
|
349
|
-
subject:
|
|
423
|
+
storeForTenant: (e) => T(We(n, y), {
|
|
424
|
+
subject: ee(t, e),
|
|
350
425
|
schemaRegistry: r,
|
|
351
|
-
rowFilter:
|
|
426
|
+
rowFilter: x
|
|
352
427
|
}),
|
|
353
428
|
outbox: ue({
|
|
354
429
|
store: n,
|
|
355
430
|
subject: t,
|
|
356
|
-
traceId:
|
|
431
|
+
traceId: R,
|
|
357
432
|
nudge: () => {
|
|
358
|
-
|
|
433
|
+
_.push(R);
|
|
359
434
|
},
|
|
360
435
|
afterCommit: (e) => {
|
|
361
|
-
|
|
436
|
+
g.push(e);
|
|
362
437
|
}
|
|
363
438
|
}),
|
|
364
|
-
load:
|
|
365
|
-
loadMany:
|
|
366
|
-
withSubject: (e, t) => Promise.resolve(t(
|
|
367
|
-
queued:
|
|
368
|
-
nudges:
|
|
439
|
+
load: v.load,
|
|
440
|
+
loadMany: v.loadMany,
|
|
441
|
+
withSubject: (e, t) => Promise.resolve(t(m(e, n, {
|
|
442
|
+
queued: g,
|
|
443
|
+
nudges: _
|
|
369
444
|
}))),
|
|
370
|
-
withTenant: (e, r) => Promise.resolve(r(
|
|
445
|
+
withTenant: (e, r) => Promise.resolve(r(m({
|
|
371
446
|
...t,
|
|
372
447
|
tenantId: e
|
|
373
448
|
}, n, {
|
|
374
|
-
queued:
|
|
375
|
-
nudges:
|
|
449
|
+
queued: g,
|
|
450
|
+
nudges: _
|
|
376
451
|
})))
|
|
377
452
|
};
|
|
378
|
-
return
|
|
379
|
-
queued:
|
|
380
|
-
nudges:
|
|
381
|
-
})))),
|
|
453
|
+
return B.set(b, g), V.set(b, _), H.set(b, e.plugins ?? []), U.set(b, e.layers ?? []), z.set(b, (e) => n.transactional((n) => e(m(t, n, {
|
|
454
|
+
queued: g,
|
|
455
|
+
nudges: _
|
|
456
|
+
})))), b;
|
|
382
457
|
};
|
|
383
|
-
return
|
|
384
|
-
},
|
|
385
|
-
let n =
|
|
386
|
-
return (n === void 0 ? e : u.provide(e, n)).pipe(u.provide(
|
|
387
|
-
},
|
|
458
|
+
return m(e.subject ?? h(null));
|
|
459
|
+
}, Ke = (e, t) => {
|
|
460
|
+
let n = G(t);
|
|
461
|
+
return (n === void 0 ? e : u.provide(e, n)).pipe(u.provide(ce(t.store)), u.provideService(m, t.request.subject));
|
|
462
|
+
}, qe = async (e, t, n, r) => {
|
|
388
463
|
let i = e.input, a = await p.decodeUnknownPromise(i)(n), o = e.kind, s = async (e) => {
|
|
389
464
|
let n = t(a, e);
|
|
390
|
-
return u.isEffect(n) ?
|
|
465
|
+
return u.isEffect(n) ? C(Ke(n, e)) : n;
|
|
391
466
|
}, c = async () => {
|
|
392
467
|
let t = e.guards;
|
|
393
468
|
if (t !== void 0 && t.length > 0) {
|
|
@@ -395,9 +470,9 @@ var Te = new Set(e), T = 0, E = () => ++T, Ee = (e, t) => {
|
|
|
395
470
|
if (e !== null) throw e;
|
|
396
471
|
}
|
|
397
472
|
if (o !== "mutation") return s(r);
|
|
398
|
-
let n = await me(async () => (
|
|
399
|
-
return await
|
|
400
|
-
}, f = o === "mutation" || o === "query" || o === "action" ? o : void 0, m = f === void 0 ? void 0 :
|
|
473
|
+
let n = await me(async () => (K(r), J(r, async (e) => s(e))), { delay: () => Promise.resolve() });
|
|
474
|
+
return await q(r), n;
|
|
475
|
+
}, f = o === "mutation" || o === "query" || o === "action" ? o : void 0, m = f === void 0 ? void 0 : W(r, f);
|
|
401
476
|
if (m === void 0 || f === void 0) return await c();
|
|
402
477
|
let h = m(u.tryPromise({
|
|
403
478
|
try: () => c(),
|
|
@@ -426,15 +501,15 @@ var Te = new Set(e), T = 0, E = () => ++T, Ee = (e, t) => {
|
|
|
426
501
|
i = !1;
|
|
427
502
|
}
|
|
428
503
|
_e.skipIf(!i)(i ? e : `${e} [SKIPPED: needs ${t}]`, r);
|
|
429
|
-
},
|
|
504
|
+
}, Je = async (e, t, n) => {
|
|
430
505
|
await Z(e, `${t.name} at ${t.host}:${t.port}`, () => X(t), n);
|
|
431
|
-
},
|
|
506
|
+
}, Ye = "test-tenant", Q = (e, t, n) => ({
|
|
432
507
|
type: e,
|
|
433
508
|
id: t,
|
|
434
509
|
tenantId: n.tenantId ?? "test-tenant",
|
|
435
510
|
scopes: n.scopes ?? [],
|
|
436
511
|
...n.metadata === void 0 ? {} : { metadata: n.metadata }
|
|
437
|
-
}),
|
|
512
|
+
}), Xe = (e, t = {}) => Q("user", e, t), Ze = (e, t = {}) => Q("apiKey", e, t), Qe = (e, t = {}) => Q("serviceAccount", e, t), $e = (e = null) => h(e), et = (e = "job:test", t) => t === void 0 ? b(e) : b(e, t), tt = (e) => {
|
|
438
513
|
let t = e.indexOf("?");
|
|
439
514
|
return t === -1 ? {
|
|
440
515
|
path: e,
|
|
@@ -443,17 +518,17 @@ var Te = new Set(e), T = 0, E = () => ++T, Ee = (e, t) => {
|
|
|
443
518
|
path: e.slice(0, t),
|
|
444
519
|
query: e.slice(t + 1)
|
|
445
520
|
};
|
|
446
|
-
},
|
|
521
|
+
}, nt = (e, t) => {
|
|
447
522
|
let n = e.split("/").filter((e) => e.length > 0), r = t.split("/").filter((e) => e.length > 0);
|
|
448
523
|
return n.length === r.length && n.every((e, t) => e.startsWith(":") || e === r[t]);
|
|
449
524
|
}, $ = (e) => {
|
|
450
525
|
let t = {};
|
|
451
526
|
for (let [n, r] of Object.entries(e)) t[n.toLowerCase()] = r;
|
|
452
527
|
return t;
|
|
453
|
-
},
|
|
528
|
+
}, rt = (e) => e === void 0 ? /* @__PURE__ */ new Uint8Array() : new TextEncoder().encode(JSON.stringify(e)), it = (e) => e === void 0 ? "" : typeof e == "string" ? e : new TextDecoder().decode(e), at = (e) => {
|
|
454
529
|
let { ctx: t } = e, n = ve((e.publicApi ?? []).map((e) => ({
|
|
455
530
|
descriptor: e.descriptor,
|
|
456
|
-
invoke: (n, r) => t.withSubject(r.subject, (t) =>
|
|
531
|
+
invoke: (n, r) => t.withSubject(r.subject, (t) => qe(e.descriptor, e.handler, n, t))
|
|
457
532
|
}))), r = [...e.restRoutes ?? [], ...n], i = _(e.strategies ?? [], {
|
|
458
533
|
...e.anonymousTenantRequired === void 0 ? {} : { anonymousTenantRequired: e.anonymousTenantRequired },
|
|
459
534
|
getStore: () => t.store
|
|
@@ -469,7 +544,7 @@ var Te = new Set(e), T = 0, E = () => ++T, Ee = (e, t) => {
|
|
|
469
544
|
pattern: r[t].path,
|
|
470
545
|
route: e
|
|
471
546
|
})), l = async (e, n, i = {}) => {
|
|
472
|
-
let { path: a, query: s } =
|
|
547
|
+
let { path: a, query: s } = tt(n), l = c.filter((e) => nt(e.pattern, a)).map((e) => e.route);
|
|
473
548
|
if (l.length === 0) return {
|
|
474
549
|
status: 404,
|
|
475
550
|
headers: {},
|
|
@@ -488,11 +563,11 @@ var Te = new Set(e), T = 0, E = () => ++T, Ee = (e, t) => {
|
|
|
488
563
|
...$(o),
|
|
489
564
|
...$(i.headers ?? {})
|
|
490
565
|
},
|
|
491
|
-
rawBody:
|
|
566
|
+
rawBody: rt(i.body),
|
|
492
567
|
store: t.store
|
|
493
568
|
}, d = await ye(l, u), f = $(d.headers ?? {});
|
|
494
569
|
d.contentType !== void 0 && (f["content-type"] = d.contentType);
|
|
495
|
-
let p =
|
|
570
|
+
let p = it(d.body), m = (d.contentType ?? "").includes("json");
|
|
496
571
|
return {
|
|
497
572
|
status: d.status,
|
|
498
573
|
headers: f,
|
|
@@ -526,77 +601,7 @@ var Te = new Set(e), T = 0, E = () => ++T, Ee = (e, t) => {
|
|
|
526
601
|
};
|
|
527
602
|
};
|
|
528
603
|
return a(void 0, {});
|
|
529
|
-
},
|
|
530
|
-
let t = e.tenantId ?? null, n = new ne({
|
|
531
|
-
origin: e.origin ?? "test",
|
|
532
|
-
...e.ringSize === void 0 ? {} : { ringSize: e.ringSize }
|
|
533
|
-
});
|
|
534
|
-
return {
|
|
535
|
-
publish: async (e, r, i) => {
|
|
536
|
-
let a = await u.runPromise(u.either(fe({
|
|
537
|
-
bus: n,
|
|
538
|
-
tenantId: t
|
|
539
|
-
}, e, r, i)));
|
|
540
|
-
if (a._tag === "Left") {
|
|
541
|
-
let t = a.left;
|
|
542
|
-
throw Error(`testEventBus.publish(${e.name}) was rejected: ${t._tag}`, { cause: t });
|
|
543
|
-
}
|
|
544
|
-
return { n: a.right.n };
|
|
545
|
-
},
|
|
546
|
-
subscribe: (e, r, i) => {
|
|
547
|
-
let a = [], o = [];
|
|
548
|
-
return {
|
|
549
|
-
get received() {
|
|
550
|
-
return a.map((e) => e.payload);
|
|
551
|
-
},
|
|
552
|
-
get deliveries() {
|
|
553
|
-
return a;
|
|
554
|
-
},
|
|
555
|
-
get missed() {
|
|
556
|
-
return o;
|
|
557
|
-
},
|
|
558
|
-
get missedCount() {
|
|
559
|
-
return o.reduce((e, t) => e + t.count, 0);
|
|
560
|
-
},
|
|
561
|
-
stop: n.subscribe({
|
|
562
|
-
tenantId: i?.tenantId ?? t,
|
|
563
|
-
event: e.name,
|
|
564
|
-
key: r,
|
|
565
|
-
listener: (e) => {
|
|
566
|
-
if (e.kind === "gap") {
|
|
567
|
-
o.push({
|
|
568
|
-
count: e.missed,
|
|
569
|
-
reason: e.reason
|
|
570
|
-
});
|
|
571
|
-
return;
|
|
572
|
-
}
|
|
573
|
-
a.push({
|
|
574
|
-
payload: e.envelope.payload,
|
|
575
|
-
origin: e.envelope.origin,
|
|
576
|
-
n: e.envelope.n
|
|
577
|
-
});
|
|
578
|
-
},
|
|
579
|
-
...i?.resume === void 0 ? {} : { options: { resume: i.resume } }
|
|
580
|
-
})
|
|
581
|
-
};
|
|
582
|
-
},
|
|
583
|
-
skipSerials: (e, r, i, a) => {
|
|
584
|
-
let o = a?.tenantId ?? t, s = {
|
|
585
|
-
route: ee(o, e.name, r),
|
|
586
|
-
event: e.name,
|
|
587
|
-
origin: "test-gap",
|
|
588
|
-
n: i + 1,
|
|
589
|
-
emittedAt: Date.now(),
|
|
590
|
-
payload: void 0
|
|
591
|
-
};
|
|
592
|
-
n.injectRemote(s);
|
|
593
|
-
},
|
|
594
|
-
bus: n,
|
|
595
|
-
reset: () => {
|
|
596
|
-
n.clear();
|
|
597
|
-
}
|
|
598
|
-
};
|
|
599
|
-
}, at = (e = {}) => {
|
|
604
|
+
}, ot = (e = {}) => {
|
|
600
605
|
let t = e.id ?? "test", n = e.store ?? new Proxy({}, { get: (e, t) => {
|
|
601
606
|
throw Error(`makeSubscribeContext: this subscriber reached ctx.store.${String(t)} and the test passed no store. Pass \`{ store: makeTestContext().store }\` so the subscriber and the code under test share one — an empty stand-in would let a read of the wrong table pass.`);
|
|
602
607
|
} });
|
|
@@ -606,7 +611,7 @@ var Te = new Set(e), T = 0, E = () => ++T, Ee = (e, t) => {
|
|
|
606
611
|
store: n,
|
|
607
612
|
...e.publish === void 0 ? {} : { publish: e.publish }
|
|
608
613
|
};
|
|
609
|
-
},
|
|
614
|
+
}, st = (e) => {
|
|
610
615
|
let t = /* @__PURE__ */ new Map();
|
|
611
616
|
for (let n of e) {
|
|
612
617
|
let e = t.get(n.stepName);
|
|
@@ -632,13 +637,13 @@ var Te = new Set(e), T = 0, E = () => ++T, Ee = (e, t) => {
|
|
|
632
637
|
});
|
|
633
638
|
}
|
|
634
639
|
return n.sort((e, t) => e._startedAt - t._startedAt), n.map(({ _startedAt: e, ...t }) => t);
|
|
635
|
-
},
|
|
640
|
+
}, ct = (e) => {
|
|
636
641
|
let t = e.workflows ?? [], n = /* @__PURE__ */ new Map(), r = 0;
|
|
637
642
|
return {
|
|
638
643
|
start: async (i, a) => {
|
|
639
644
|
let o = t.find((e) => e.workflow.name === i);
|
|
640
645
|
if (o === void 0) throw Error(`makeWorkflowRunner: no workflow named '${i}' — pass it in makeWorkflowRunner({ ctx, workflows: [{ workflow, execute }] }).`);
|
|
641
|
-
let s = `wfrun_test_${++r}`, c = we(), l = o.workflow.toLayer(o.execute).pipe(f.provideMerge(Ce)), d = /* @__PURE__ */ new Date(), p = o.workflow.execute(a).pipe(u.locally(Se, s), u.provide(c.layer), u.provide(l), u.either), m = await u.runPromise(p), h =
|
|
646
|
+
let s = `wfrun_test_${++r}`, c = we(), l = o.workflow.toLayer(o.execute).pipe(f.provideMerge(Ce)), d = /* @__PURE__ */ new Date(), p = o.workflow.execute(a).pipe(u.locally(Se, s), u.provide(c.layer), u.provide(l), u.either), m = await u.runPromise(p), h = st(c.readSteps()), g = /* @__PURE__ */ new Date(), _;
|
|
642
647
|
if (m._tag === "Right") _ = {
|
|
643
648
|
status: "succeeded",
|
|
644
649
|
output: m.right,
|
|
@@ -678,6 +683,6 @@ var Te = new Set(e), T = 0, E = () => ++T, Ee = (e, t) => {
|
|
|
678
683
|
},
|
|
679
684
|
inspect: async (e) => n.get(e) ?? null
|
|
680
685
|
};
|
|
681
|
-
},
|
|
686
|
+
}, lt = 1;
|
|
682
687
|
//#endregion
|
|
683
|
-
export {
|
|
688
|
+
export { P as MockClock, L as MockLLM, F as MockWebhooks, lt as TESTING_PRESET_VERSION, Ye as TEST_TENANT_ID, $e as anonymous, Ze as apiKey, n as changeDelete, r as changeInsert, i as changeSoftDelete, a as changeUpdate, Ae as defineFactory, Z as describeIfAvailable, Je as describeIfReachable, O as fixtureRow, Pe as frozenTime, qe as invoke, X as isTcpReachable, ot as makeSubscribeContext, at as makeTestApp, Ge as makeTestContext, ct as makeWorkflowRunner, Ie as mockStore, D as nextSequence, Le as outboxNudgesOf, K as resetAfterCommit, W as rpcInterceptorFor, q as runAfterCommit, J as runInStoreTransaction, Qe as serviceAccount, G as serviceLayerFor, et as system, I as testEventBus, Xe as user, Ne as withFrozenTime };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@voltro/testing",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.41.0",
|
|
4
4
|
"description": "Test utilities for Voltro apps — deterministic clock, subject and row factories, a handler-level invoke and a request-level app harness, queued LLM responses, scoped subject/tenant runners, and a cross-dialect parity harness.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"voltro",
|
|
@@ -43,15 +43,15 @@
|
|
|
43
43
|
"node": ">=24.0.0"
|
|
44
44
|
},
|
|
45
45
|
"dependencies": {
|
|
46
|
-
"@voltro/database": "0.
|
|
47
|
-
"@voltro/env": "0.
|
|
48
|
-
"@voltro/logger": "0.
|
|
49
|
-
"@voltro/protocol": "0.
|
|
50
|
-
"@voltro/runtime": "0.
|
|
51
|
-
"@voltro/workflow": "0.
|
|
46
|
+
"@voltro/database": "0.41.0",
|
|
47
|
+
"@voltro/env": "0.41.0",
|
|
48
|
+
"@voltro/logger": "0.41.0",
|
|
49
|
+
"@voltro/protocol": "0.41.0",
|
|
50
|
+
"@voltro/runtime": "0.41.0",
|
|
51
|
+
"@voltro/workflow": "0.41.0"
|
|
52
52
|
},
|
|
53
53
|
"peerDependencies": {
|
|
54
|
-
"@voltro/client": "0.
|
|
54
|
+
"@voltro/client": "0.41.0",
|
|
55
55
|
"effect": "^3.22.0",
|
|
56
56
|
"react": "^19.0.0",
|
|
57
57
|
"@effect/sql": "^0.52.0"
|