@voltro/client 0.66.0 → 0.67.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 CHANGED
@@ -39,6 +39,58 @@ _Changes staged for the next release accumulate here (rolled up from
39
39
 
40
40
  ---
41
41
 
42
+ ## [0.67.0] — 2026-09-07
43
+
44
+ ### ⚠ BREAKING
45
+
46
+ - **@voltro/client, @voltro/protocol, @voltro/runtime, @voltro/cli, @voltro/web** — Confirmed optimistic writes now reconcile against a token-bound post-ACK primary snapshot, never an unrelated delta, changed row or timeout. Matching snapshots retire only covered previews; server normalisation and later writers remain authoritative. Same-tick acknowledgements coalesce, and affected cache entries preserve primary consistency across same-subject reconnects. Migration: deploy matching client/server framework versions together and account for an additional subscription read per affected acknowledgement group; affected entries use primary snapshots instead of replica reads/delta-resume for their cache lifetime. Native hooks need no source rewrite. Direct callers of the public `supersedesConfirmedPatches(event, baseBefore, baseAfter)` helper must migrate to `(event, reconciliationToken)` using the token of the post-ACK read, or use the native `SubscriptionCache`; row comparison cannot be mechanically rewritten into causal proof.
47
+
48
+ **`voltro update` carries you across this** — codemod `0.67.0/01_subscription-reconciliation`. If you pin versions by hand and never run it, print the notes without changing anything: `voltro update --codemods-only --from <your current version> --dry-run` (this one ships in 0.67.0).
49
+ - **@voltro/cli** — `voltro support sentry <eventId>` is removed. It wrapped `sentry-cli sourcemaps explain`, which sentry-cli 3 dropped in favour of Sentry's in-product source-map debugger; `@voltro/cli` now depends on `@sentry/cli` 3, whose `execute(args, live)` takes a boolean. Migration: delete the invocation from scripts, CI jobs and runbooks and read the event's source-map resolution in Sentry itself. `voltro support collect` is unchanged.
50
+
51
+ **`voltro update` carries you across this** — codemod `0.67.0/03_support-sentry-removed`. If you pin versions by hand and never run it, print the notes without changing anything: `voltro update --codemods-only --from <your current version> --dry-run` (this one ships in 0.67.0).
52
+ - **@voltro/cli, @voltro/workflow, @voltro/testing** — `voltro test` runs on vitest 5, and `@voltro/workflow` names `vitest ^5.0.0` as its peer. Migration: set `vitest` and `@vitest/coverage-v8` to `^5.0.0` together in every app that declares them (the coverage provider peer-pins the exact vitest version), install, and run the suite once — vitest 5 clears mocks before each test by default, fails a test whose async assertion was not awaited, and no longer looks a config file up in ancestor directories. Scaffolded templates ship on 5.
53
+
54
+ **`voltro update` carries you across this** — codemod `0.67.0/02_vitest-5`. If you pin versions by hand and never run it, print the notes without changing anything: `voltro update --codemods-only --from <your current version> --dry-run` (this one ships in 0.67.0).
55
+
56
+ ### Added
57
+
58
+ - **@voltro/ui-shadcn, @voltro/cli, @voltro/devtools, @voltro/devtools-ui** — Add the opt-in Signal brand stylesheet, accessible `SignalHeader` and pausable `SignalField` with reduced-motion and visibility handling. Development and production builds resolve the stylesheet from the same UI-kit installation; the in-browser devtools use the matching plum/violet palette and declare the Tailwind dependency required to compile their source stylesheet locally.
59
+
60
+ Code blocks use matching light/dark surfaces, code comparisons retain readable contrast, and the shared routes view uses a direct heading.
61
+
62
+ `DocsLayout` supports custom header and introduction slots and an optional desktop sidebar. Its mobile drawer uses native modal focus and Escape behavior; search contains keyboard focus and restores the opener when dismissed.
63
+
64
+ `VoltroWordmark` owns product badges and an operator warning tone. `SignalHeader` shares responsive brand geometry and an optional sticky reading surface; `AppShell` accepts a custom header slot. All first-party product headers and footers use this composition, including the compact local Devtools identity.
65
+
66
+ Shared `SignalPreferences`, `SignalSearch` and `SignalHeaderAction` align header controls across public and operating apps. Signal fields support both themes; `ProfileMenu` accepts a custom trigger and preserves an explicit System choice.
67
+
68
+ ### Changed
69
+
70
+ - **@voltro/cli, @voltro/runtime, @voltro/database, @voltro/protocol, @voltro/voltro, @voltro/sql-mssql, @voltro/sql-turso, @voltro/workflow, @voltro/plugin-sso-saml, @voltro/plugin-sentry** — Dependency refresh: Effect 3.22.1 with the matching `@effect/*` patch releases (`@effect/cluster` 0.60.2, `@effect/sql-mssql` 0.54.0, `@effect/platform` 0.97.1, `@effect/rpc` 0.76.2, `@effect/sql` 0.52.1, `@effect/workflow` 0.19.1), `@libsql/client` 0.18.0 — and `@effect/sql-mssql` 0.54.0 flipped its TLS default to encrypt-and-verify, so the mssql dialect now passes `encrypt: false` explicitly for an unset connection to keep the documented modes (unset → plaintext, `sslmode=require` → encrypt without verification) — `@sentry/cli` 3, `xml-encryption` 6, vite 8.2.2, and the tracked minor/patch lines. The mssql patch for `@effect/cluster` — the four SQL fixes plus the shard-release backoff — was regenerated against 0.60.2 (upstream refactored `SqlMessageStorage`, so the 0.60.0 hunks no longer applied) and ships as `patches/@effect__cluster@0.60.2.patch`; `voltro add mssql` writes the new key. Projects scaffolded by the CLI record the pnpm that ran it, which is 12.x on the framework's own toolchain; pnpm 11+ replaced `onlyBuiltDependencies` with `allowBuilds`, and the framework's workspaces declare it.
71
+
72
+ ### Fixed
73
+
74
+ - **@voltro/cli, @voltro/runtime, @voltro/database, @voltro/voltro** — The tunable readers that take `env = process.env` (`resolveEagerFallbackWarnIntervalMs`, `resolveWorkflowRecordingMode`, `readPollCeilingMs`, and the `SchedulingEnv` / `ReactiveEnv` / `InspectRingsEnv` shapes) accept a bare `NodeJS.ProcessEnv` again. They were typed as all-optional literals, which TypeScript's weak-type check rejects for `Dict<string>` the moment nothing in the compilation augments `ProcessEnv` — an app that compiles framework source with only `@types/node` (a mobile app, which declares no env) failed `tsc` on `dbMetrics.ts`. The parameters now carry an index signature.
75
+ - **@voltro/client, @voltro/web** — The subscription recovery watchdog knows when it was throttled. A browser delays timers in a hidden tab, so the stall timer could fire long after it was due, report the interval it was armed with as the interval waited, warn, and invalidate entries whose deliveries were queued behind the same throttling. It now compares its due time with its fire time: late beyond a tolerance, or firing in a hidden tab, it records one `subscription.recovery-timer-late` per attempt (with `timerLateMs` and `hidden`) and re-arms; the first on-time fire in a visible tab decides. `subscription.recovery-stuck` carries the time actually waited and the number of deferrals.
76
+
77
+ The client runtime yields to the event loop through a `MessageChannel` in the browser instead of `setTimeout`, so tasks queued behind Effect's periodic yield are not held to the hidden-tab timer grid. `runtime.resolved` records the channel in use as `scheduler`.
78
+
79
+ `socket.frames` marks frame-arrival bursts on the raw socket — the first frame after open and each frame that follows a gap of five seconds or more, at most eight per socket — so an export separates a late arrival from late processing.
80
+
81
+ `apiSurface: compatible` — the golden churn in `@voltro/client` and `@voltro/web` is two members added to the `ClientDiagnosticKind` union (`socket.frames`, `subscription.recovery-timer-late`); every existing member is unchanged, the framework is the only producer, and a reader that does not know the new kinds sees two more events it can ignore. Only a switch exhaustive over the vocabulary needs two arms.
82
+ - **@voltro/cli** — Web middleware is precompiled into the server production output and rooted by runtime pruning, preserving its behavior in source-free Docker deployments. Missing transitive imports now fail loudly instead of silently disabling a present middleware; rebuilding after removal clears the previous policy. Runtime tracing also preserves transitive dependencies when a deploy directory is reached through a symlink. Native bundle imports now propagate missing-library and initialization errors instead of returning a circular shim's empty exports. Rebuild and deploy the complete `.framework` output; no application API changes are required.
83
+
84
+ ---
85
+
86
+ ## [0.66.1] — 2026-09-06
87
+
88
+ ### Fixed
89
+
90
+ - **@voltro/cli** — API serve and web start bundles preserve esbuild's caught-import handling: a missing `require()` inside `try/catch` or a caught dynamic import can use its source fallback without a package.json optional-dependency declaration. This fixes the 0.66.0 minified MySQL/MariaDB serve-build regression at mysql2's optional `cardinal` debug highlighter; no direct `cardinal` dependency is needed after upgrading and rebuilding the API. Unhandled missing dependencies and broken installed exports still fail the build. Regression tests execute minified fallback code and build/import production serve bundles for every registered SQL-driver package, plus MariaDB, without requiring database services.
91
+
92
+ ---
93
+
42
94
  ## [0.66.0] — 2026-09-06
43
95
 
44
96
  ### ⚠ BREAKING
package/README.md CHANGED
@@ -20,6 +20,12 @@ Installation, guides, the full API reference, and examples all live in the
20
20
  **[Voltro documentation](https://docs.voltro.dev/docs/intro/getting-started)** — the single source of truth. This README is
21
21
  deliberately short so there is nothing here to drift out of date.
22
22
 
23
+ ## Subscription consistency
24
+
25
+ Confirmed optimistic writes use a post-acknowledgement primary snapshot, not
26
+ an arbitrary delta or timeout. Upgrade client and server together; see the
27
+ [reconciliation wire contract](https://docs.voltro.dev/docs/data/wire-protocol).
28
+
23
29
  ## License
24
30
 
25
31
  Proprietary. © 2026 Voltro UG. Your use is governed by the
@@ -9,7 +9,7 @@ Generated from the resolved runtime dependency closure (12 packages).
9
9
 
10
10
  ---
11
11
 
12
- ## @effect/sql@0.52.0
12
+ ## @effect/sql@0.52.1
13
13
 
14
14
  License: MIT
15
15
 
@@ -177,7 +177,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
177
177
  SOFTWARE.
178
178
  ```
179
179
 
180
- ## jose@6.2.8
180
+ ## jose@6.2.10
181
181
 
182
182
  License: MIT
183
183
 
package/dist/index.d.ts CHANGED
@@ -163,6 +163,8 @@ export declare interface Analytics<E extends ReadonlyArray<EventDescriptor<strin
163
163
  readonly catalog: EventCatalog;
164
164
  }
165
165
 
166
+ /** Erased per-api runtime boundary. Headless cache code must not import the
167
+ * React context (and its browser globals) merely to name this Effect type. */
166
168
  export declare type AnyRuntime = ManagedRuntime.ManagedRuntime<never, never>;
167
169
 
168
170
  export declare interface ApiHandle {
@@ -404,11 +406,13 @@ declare interface CacheEntry {
404
406
  * prior subscribe still work (stub entries get tag too). */
405
407
  readonly tag: string | undefined;
406
408
  state: EntryState<unknown>;
407
- /** How many server events have MOVED this entry's base (every delta; a
408
- * snapshot only when it changed the rows). Lives on the entry, not the
409
- * state, so a re-issue that resets the state cannot make a preview look
410
- * older or younger than it is. */
411
- baseMoves: number;
409
+ /** Retired stream callbacks must not mutate the replacement generation. */
410
+ generation: number;
411
+ /** Coalesce same-tick mutation ACKs into one causal read per entry. */
412
+ reconciliationScheduled: boolean;
413
+ /** Once this entry has read its own write, reconnects must not downgrade to
414
+ * a lagging replica. Same-subject replacements carry this bit with rows. */
415
+ primaryReads: boolean;
412
416
  /** Subscriber re-render callbacks. */
413
417
  subscribers: Set<() => void>;
414
418
  /** Fiber running the underlying stream. */
@@ -627,7 +631,7 @@ export declare interface ClientDiagnosticEvent {
627
631
  readonly fields: Readonly<Record<string, ClientDiagnosticValue>>;
628
632
  }
629
633
 
630
- export declare type ClientDiagnosticKind = 'runtime.build-started' | 'runtime.resolved' | 'runtime.failed' | 'runtime.capabilities' | 'runtime.swapped' | 'runtime.disposed' | 'socket.created' | 'socket.raw-open' | 'socket.close' | 'socket.error' | 'socket.connect-timeout' | 'socket.retry-scheduled' | 'protocol.ready' | 'subscription.transport-failed' | 'subscription.reissue-started' | 'subscription.reissue-skipped' | 'subscription.first-delivery' | 'subscription.recovery-stuck' | 'subscription.health-cleared' | 'event.gap' | 'connection.status' | 'recovery.state' | 'fault.transport-cut';
634
+ export declare type ClientDiagnosticKind = 'runtime.build-started' | 'runtime.resolved' | 'runtime.failed' | 'runtime.capabilities' | 'runtime.swapped' | 'runtime.disposed' | 'socket.created' | 'socket.raw-open' | 'socket.close' | 'socket.error' | 'socket.connect-timeout' | 'socket.retry-scheduled' | 'socket.frames' | 'protocol.ready' | 'subscription.transport-failed' | 'subscription.reissue-started' | 'subscription.reissue-skipped' | 'subscription.first-delivery' | 'subscription.recovery-stuck' | 'subscription.recovery-timer-late' | 'subscription.health-cleared' | 'event.gap' | 'connection.status' | 'recovery.state' | 'fault.transport-cut';
631
635
 
632
636
  export declare interface ClientDiagnosticsSnapshot {
633
637
  readonly version: 1;
@@ -1761,16 +1765,8 @@ declare interface OptimisticPatch<T = unknown> {
1761
1765
  readonly id: string;
1762
1766
  readonly mutationId: string;
1763
1767
  readonly reducer: (current: T) => T;
1764
- /** The entry's `baseMoves` when this preview went on. A server event that
1765
- * moved the base AFTER this point is the write's echo as far as the client
1766
- * can tell — see `confirmByMutation` for why that has to be decided at
1767
- * confirmation time and not only afterwards. */
1768
- readonly baseMovesAtApply: number;
1769
- /** Set once the mutation SUCCEEDED. A confirmed patch stays applied (so the
1770
- * optimistic preview never blinks out) until a server snapshot/delta updates
1771
- * `base` to reflect the committed write — only THEN is it dropped. Without
1772
- * this, dropping the patch on mutation-resolve reveals a still-stale base
1773
- * before the (CDC-latent) delta arrives → the on→off→on toggle flash. */
1768
+ /** A successful write stays previewed until a matching post-ACK primary
1769
+ * snapshot supersedes it. A different write's delta proves nothing. */
1774
1770
  confirmed?: boolean;
1775
1771
  }
1776
1772
 
@@ -3398,8 +3394,7 @@ export declare class SubscriptionCache {
3398
3394
  /**
3399
3395
  * Mark a SUCCEEDED mutation's optimistic patches as confirmed. Unlike
3400
3396
  * `revertByMutation` (used on failure), this does NOT drop them — they stay
3401
- * visible until the next server snapshot/delta updates `base` (which then
3402
- * reflects the committed write and drops them, see the stream apply loop).
3397
+ * visible until a matching post-ACK primary snapshot replaces `base`.
3403
3398
  * This removes the on→off→on flash where dropping the patch on mutation
3404
3399
  * resolve briefly exposes a stale base before the server delta lands.
3405
3400
  */
@@ -3491,6 +3486,27 @@ export declare class SubscriptionCache {
3491
3486
  */
3492
3487
  refreshAll(runtime: AnyRuntime): void;
3493
3488
  /* Excluded from this release type: resumeTransportFailures */
3489
+ /**
3490
+ * The stall watchdog for one re-issued entry: `recoveryStuckMs` after the
3491
+ * re-issue with neither snapshot nor delta, the entry is reported stuck and
3492
+ * its subscribers are notified.
3493
+ *
3494
+ * That is a finding only if the watchdog itself ran on time. A browser
3495
+ * throttles timers in a hidden tab — to a one-second grid, then a one-minute
3496
+ * grid — so a timer there fires whenever the tab next wakes, and it used to
3497
+ * report the interval it was ARMED with as the interval waited. A delivery
3498
+ * queued behind the same throttling then arrived a moment after the warning
3499
+ * and the invalidation, under the same attempt: the watchdog had measured
3500
+ * its own delay and called it a stall.
3501
+ *
3502
+ * So the watchdog compares its due time with its fire time. Late beyond the
3503
+ * tolerance, or firing in a hidden tab, it does not judge: it records ONE
3504
+ * `recovery-timer-late` for the attempt (with how late, and whether hidden)
3505
+ * and re-arms. The first on-time fire in a visible tab decides — which gives
3506
+ * a delivery `recoveryStuckMs` of unthrottled time once the tab is looked at
3507
+ * again, and reports a real stall within that.
3508
+ */
3509
+ private armRecoveryWatchdog;
3494
3510
  /**
3495
3511
  * Re-issue ONE entry's subscription: interrupt the fiber, reset the base,
3496
3512
  * re-fork through the saved `fetch`.
@@ -3813,34 +3829,12 @@ export declare interface SubscriptionStateWithFallback<T> extends SubscriptionMe
3813
3829
  }
3814
3830
 
3815
3831
  /**
3816
- * May this server event retire the CONFIRMED optimistic patches on an entry?
3817
- *
3818
- * **A rollback happens if and only if the write FAILED.** Nothing else — no
3819
- * timer, no elapsed window, no "probably fine by now" — may take an optimistic
3820
- * preview away from a write the server acknowledged. This function is the other
3821
- * half of that rule: it decides when a patch is *superseded* rather than rolled
3822
- * back, and superseding is only honest when the authoritative state has actually
3823
- * arrived and actually says something.
3824
- *
3825
- * Three answers, each of which was a way to lose a committed write:
3826
- *
3827
- * - **delta → YES.** A delta IS the echo of committed writes. This is the
3828
- * seamless hand-off: base gains the real row and the placeholder goes in the
3829
- * same update, so there is no flash and no optimistic+real duplicate.
3830
- * - **error → NO.** An error does not advance `base`; it sets `baseError` and
3831
- * leaves the rows where they were. Dropping here would discard the preview
3832
- * in favour of a base the client knows does not reflect the write.
3833
- * - **snapshot → only if it MOVED the base.** A resync after a missing echo
3834
- * re-asks the server, and if the answer comes back byte-identical then the
3835
- * write is still not reflected in it. Retiring the patch on that would be
3836
- * the reported bug reached by a longer route: the user watches their saved
3837
- * change disappear, and the client did it while holding evidence that the
3838
- * server's answer had not changed.
3839
- *
3840
- * The comparison only runs when confirmed patches exist, which is rare and
3841
- * short-lived, so the stringify is not on any hot path.
3832
+ * The matching token proves this snapshot was read after the covered ACKs.
3833
+ * Contents need not equal the preview: server normalisation, no-op writes and
3834
+ * later remote writes are legitimate. Conversely, a changed value or a higher
3835
+ * revision on an ordinary stream does not prove it contains OUR write.
3842
3836
  */
3843
- export declare const supersedesConfirmedPatches: (event: SubscriptionEvent<unknown>, baseBefore: unknown, baseAfter: unknown) => boolean;
3837
+ export declare const supersedesConfirmedPatches: (event: SubscriptionEvent<unknown>, reconciliationToken: string | undefined) => boolean;
3844
3838
 
3845
3839
  export declare interface SupervisorHandle {
3846
3840
  readonly dispose: () => void;