SQ-HotRoll — session-quiescence-gated progressive schema evolution with bijective inline complement lenses and DEC Mode 2026 TUI for Cloudflare D1, SQLite, and PostgreSQL 17.
Author: Augusto Cerrutti (augustocerruttisatto@gmail.com)
Target Runtimes: Cloudflare Workers & D1, Cloudflare Hyperdrive, bun:sqlite, PostgreSQL 17.11, Drizzle ORM, Kysely, Browser SPAs, Electron Multi-Window Apps, Mobile In-App WebViews, Kubernetes RollingUpdate Pods, and Firecracker MicroVMs.
JSR (published as @kanchingyg/hotroll):
bunx jsr add @kanchingyg/hotroll
npx jsr add @kanchingyg/hotroll
deno add jsr:@kanchingyg/hotrollNot published to npm yet — install from JSR or clone this repo.
SQ-HotRoll (sql-hotroll) decouples physical dual-table synchronization from logical client session promotion. It maintains bijectively synchronized _lc) and monotonic row-version guards (_row_ver), advancing each client session from
- Bijective Inline Complement Lenses & Monotonic Dual-Write Triggers (
src/core.ts,src/lenses.ts,src/d1-adapter.ts,src/postgres-adapter.ts):- Achieves
1.00row read per query (after phase-gated keyset backfill) and2.00rows written per mutation during the active migration window (reverting to1.00afterCOMMITTED_GC) on Cloudflare D1 with0lost updates and sub-millisecond single-flag rollback (0.017 mson D1,0.05 mson PostgreSQL 17.11). - Explicitly bounds single-pass lens applicability to bijective or complement-invertible row transforms; lossy aggregations (
GROUP BYrollups, cryptographic one-way hashes) and external side-effecting mutations require multi-stage expand-contract migrations.
- Achieves
- 3-Tier DDL AST Classifier & WAL-Paced Backfill (
src/ast-rewriter.ts,src/d1-adapter.ts,src/postgres-adapter.ts):- Routes additive/computed columns to Tier 0 SQLite
VIRTUALgenerated columns (0.446 mssetup,206.9xfaster than shadow copy,1.00xread/write), introspects virtual columns viaPRAGMA table_xinfo(hidden = 2), shrinks peak.sqlite-walsize by55.70x(14.23 MB -> 255.47 KB), and rewrites base table identifiers (FROM orders_v2 AS orders) to eliminate PostgreSQLSQLSTATE 0A000under Cloudflare Hyperdrive transaction pooling (/hyperdrive/concepts/connection-pooling/).
- Routes additive/computed columns to Tier 0 SQLite
- Universal Client Quiescence & Portable Multi-CDN Envelopes (
src/client-quiescence.ts,src/core.ts):- Eliminates cross-CDN and mixed-pod schema skew across Multi-CDN gateways (
75.00% -> 0.00%error rate), KubernetesRollingUpdatepod pools (50.00% -> 0.00%,1.754 msSIGTERMWALTRUNCATE), Firecracker sandboxes (100.00% -> 0.00%in158.88 us), Electron multi-window IPC barriers (33.40% -> 0.00%in<0.50 ms), and Mobile In-App WebViews (25.00% -> 0.00%in<100 ns).
- Eliminates cross-CDN and mixed-pod schema skew across Multi-CDN gateways (
- Zero-Trust Cryptographic Provenance, OpenSSH
10.0p2SSHSIGVerifier & Interactive TUI (src/core.ts,src/attestation.ts,src/hardware-auth.ts,src/tui.ts):- Computes RFC 8785 JCS canonical SQL AST and lens digests (
jcs-sha256/jcs-sha384in59.28 us), verifiesin-totov1.0 / SLSA v1.0 DSSE PAE M-of-NEd25519quorums (0.11 ms), and verifies asymmetricPASETO v4.public/Ed25519JWKSkidedge tokens (40.22 us, zero shared edge secrets). - Implements a pure-WebCrypto OpenSSH
PROTOCOL.sshsigparser (verifyOpenSshSkSignatureEnvelope()insrc/hardware-auth.ts) that closes two empirical verification flaws discovered in OpenSSH10.0p2ssh-keygen -Y verify(which rejectsverify-requiredinallowed_signersand ignores the 5-byte FIDO2flags+countertrailer inside 69-bytesk-ssh-ed25519@openssh.comsignature blobs, acceptingflags = 0x00or regressedcountervalues). - Provides a DEC Mode 2026 synchronized differential TUI (
hotroll watch/hotroll ci-gate) with[M]hardware authenticator support across FIDO2/CTAP2 YubiKey (sk-ssh-ed25519@openssh.com), ThinkPad/Linuxfprintd+ TPM 2.0 (/dev/tpmrm0), Windows Hello for Business TPM 2.0, macOS Touch ID Secure Enclave, and PIV/CAC smartcards (PKCS#11slot9c/SSH_AUTH_SOCK).
- Computes RFC 8785 JCS canonical SQL AST and lens digests (
# Run unit and integration test suite (23/23 tests passing, 261 expect() assertions across test/hotroll.test.ts and test/tui.test.ts)
bun test
# Run strict TypeScript type-checking across src/*.ts and test/*.test.ts (0 errors)
/workspace/wrangler-doctor-scratch/node_modules/.bin/tsc --noEmit
# Run formal verification (Z3 SMT 8/8 UNSAT + Spin 6.5.2 LTL)
python3 proofs/prove_hot_roll_safety.py && python3 proofs/verify_lenses_z3.py
# Compile publication PDF via Tectonic (12 pages, 0 Overfull/Underfull warnings)
cd paper && tectonic -X compile main.tex