# Quantoga — Full Principal Engineering & QTGA Architecture Dossier

> Resilient real-time systems, Clojure/JVM rescue engineering, and private self-hosted infrastructure — 15+ years building software that stays fast and correct over unreliable networks.

Canonical URL: https://quantoga.com/
Availability: Open for diagnostic audits, Clojure/JVM rescues, turnkey real-time & private AI builds, and long-term architecture partnerships.

## Fixed-Scope Engagements & Deliverables

### Systems & Performance Audit (01 · DIAGNOSTIC · 1–2 Weeks · Fixed Scope · scope=`architecture`)
Full empirical teardown before you commit to a rewrite — find the true latency, concurrency, DB, or Linux bottlenecks fast.

Deliverables:
- OpenJDK JFR + async-profiler CPU & allocation flamegraphs
- PostgreSQL query, connection-pool & Linux networking audit
- Prioritized remediation roadmap with effort/impact estimates

### Clojure & Distributed Systems Rescue (02 · STABILIZATION · 2–6 Weeks · Fixed Milestone · scope=`clojure-rescue`)
Turn an overgrown, flaky Clojure/JVM/CLJS platform into fast, deterministic, observable code your team actually understands.

Deliverables:
- Eliminate race conditions, GC pauses & fragile sync glue
- Deterministic worker pipelines & clean automated test harness
- Pairing and architecture transfer so zero vendor lock-in remains

### On-Prem & Private LLM Deployment (03 · PRIVATE AI & INFRA · 2–4 Weeks · Fixed Scope · scope=`private-llm`)
Self-hosted inference and operational AI workflows on your own Linux hardware over WireGuard with zero external data exposure.

Deliverables:
- Hardened Linux/WireGuard inference host & declarative systemd deployment
- Internal API & MCP tool integration with schema validation, rate limits & audit logging
- Operational runbooks & live Prometheus/Grafana observability

## How We Work

- **STEP 01 · INITIAL CONTACT — Direct Email or Short Brief**: Send a short note via email or the form below describing your stack, failure modes, and timeline. You hear back directly from the principal engineer within one business day — followed by a short call if useful.
- **STEP 02 · WITHIN 48H — Written Fixed-Scope Proposal**: Clear fixed milestone price, concrete deliverables, exit criteria, and timeline — so you never pay for open-ended discovery drift.
- **STEP 03 · DELIVERY — Verified Execution & Handoff**: Measured before/after benchmarks, zero-warning CI checks, and pairing sessions with your engineers so your team owns the result.

## Production Case Studies

### Networked Multiplayer Kiosks & Live Fleet Operations Across Global Venues
_GLOBAL FLEET · ENTERTAINMENT & HOSPITALITY_
- **Metrics**: Deployment: Multi-Region | Topology: Kiosks → Regional | Foundation: Clojure + Linux
- **Constraint**: Venue hardware (touchscreens, large displays, cameras, payment terminals) operated behind flaky venue Wi-Fi across Europe, North America, the Middle East, Asia-Pacific, and Australia — causing desynced operator screens and brittle manual recovery.
- **Intervention**: Architected the real-time synced fleet admin platform managing organizations, regions, venues, and live device state, paired with Clojure/ClojureScript multiplayer games, booking/payment integrations, real-time reaction video replays, and ground-up Linux/WireGuard/Incus fleet operations.
- **Outcome**: Eliminated stale operational views across global venues, kept payments and gameplay resilient across intermittent links, and laid the production blueprint that evolved directly into QTGA's state-sync engine.
- **Stack**: Clojure, ClojureScript, Real-Time State Sync, WireGuard & Linux, PostgreSQL, Hardware & Video, Docker / LXC / Incus

### Continuous-Time Autonomous Trading & High-Resolution Simulation Platform
_QUANTITATIVE FINANCE · CONTINUOUS SYSTEMS (SINCE 2015)_
- **Metrics**: Horizon: Since 2015 | Markets: 4 Asset Classes | Execution: Clojure JVM
- **Constraint**: Discrete bar-by-bar backtesting diverged from live market behavior under real order-flow volatility, while large historical time-series simulations needed to share identical strategy math with autonomous live execution.
- **Intervention**: Designed and built a persistent immutable Clojure platform uniting continuous-time signal computation, multi-threaded backtesting, live forward plotting, advanced market-making/trend strategies, full order types (limit, post-only, reduce-only, triggers), and multi-exchange adapters.
- **Outcome**: Single authoritative mathematical model runs seamlessly across multi-threaded historical simulation and live autonomous execution across crypto, equities, commodities, and FX with live diagnostic visualization.
- **Stack**: Clojure, Continuous-Time Math, Multi-Threaded Backtesting, Autonomous Execution, Real-Time Plotting, Immutable Data

## Verified Benchmark Proof

- **Hardware**: 2019 AMD Ryzen 9 3900X (Zen 2)
- **Envelopes**: 2 vCPU / 4 GB cgroup (~$28/mo DigitalOcean s-2vcpu-4gb-amd · AWS c5a.large) & 8C/16T / 16 GB cgroup (~€60/mo dedicated · AWS c5a.4xlarge)
- **Runtime**: OpenJDK 25 (Compact Object Headers) · Netty epoll · Linux amd64
- **Runner**: `bb bench scale · bb bench`

- **qtga-transit · Live Fleet Radar App — 150,000 Vehicles × 1,000 Live Map Viewers — 65.2 ms / tick**: Moves 150,000 GPS vehicles (buses, trains, ferries, aircraft) across a world map at 10 updates/sec while filtering each of 1,000 operator screens to its own map bounds, zoom level, and role permissions. 8-core server: 65.2 ms per 100 ms tick (75.3% CPU, 4.78 GB RAM). Entry 2-vCPU / 4 GB VM (~$28/mo): 50,000 vehicles × 500 viewers in 91.0 ms (1.72 GB RAM).
- **qtga-control · Edge Policy Control Plane — 100,000-Device Policy Cascade & RBAC — 7.70 ms cascade**: Manages 100,000 edge kiosks across divisions and 10,000 sites with 200 role-scoped operators, resolving inherited display and operational settings with locks and site overrides. 8-core server: 7.70 ms (9.11 ms p99) to propagate a single site edit (skipping 99,999 unaffected device branches) and 3.17 ms steady-state fleet check (38.6% CPU, 4.27 GB RAM). 2-vCPU VM: 50,000 devices in 11.3 ms steady-state / 25.5 ms edit (1.40 GB RAM).
- **qtga-dungeon · 3D Multiplayer Action Game — 12,000 Active Physics & AI Entities @ 30 Hz — 16.9 ms / tick**: Steps 4 dungeon realms at 30 ticks/sec (33.3 ms budget) with 2D rigid-body collisions, line-of-sight fog-of-war raycasts, NPC pathfinding AI, and per-player field-of-view state streaming. 8-core server: 12,000 entities across 4 realms in 16.9 ms/tick (79.5% CPU, 974 MB RAM), or 4,000 in one realm in 11.5 ms. 2-vCPU VM: 4,000 entities in 27.8 ms/tick (638 MB RAM).
- **qtga-clj · Shared Ops Dashboard Stream — 20,000 Concurrent WebSockets @ 10 Hz — 195k frames/s**: External load generator holds up to 20,000 real TCP WebSockets open against a live operations dashboard updating regional metrics 10 times/sec, computing one shared binary diff per tick. 8-core server: 10,000 sockets (97,661 frames/s, 19.6 MB/s) at 7.3% CPU and 741 MB RAM (~32.1 KB/socket), scaling to 20,000 sockets (195,317 frames/s, 39.2 MB/s). 2-vCPU VM: 10,000 sockets at 54.5% CPU and 545 MB RAM (~23.4 KB/socket).
- **qtga-clj · Personalized Client Streams — 10,000–15,000 Unique Client Views @ 10 Hz — 145k diffs/s**: Personalization stress test where every connected WebSocket subscribes to its own distinct moving state slice at 10 updates/sec — zero shared broadcast coalescing between clients. 8-core server: 10,000 unique views (97,093 diffs/s) at 18.5% CPU and 1.43 GB RAM, scaling to 15,000 unique views (145,637 diffs/s). 2-vCPU VM: 7,500 unique views (72,821 diffs/s, 80.3% CPU, 802 MB RAM).
- **qtga-mesh · Multi-Node Server Cluster — Client Action Ack & 25-Node Cluster Sync — 0.67–2.36 ms**: Measures end-to-end TCP round-trip latency when clients submit validated actions and when 25 independent server nodes synchronize a shared 40-entity state tree bidirectionally. 0.67 ms client action-to-ack RTT (2.36 ms 10-peer fan-out), and 2.01 ms full-mesh RTT across 25 server peers (12,447 frames/s) over Netty native epoll.

## Architecture Pillars & Wire Pipeline

- **Pluggable Diffs & Subtree Caching (STATE-SYNC & CACHING)**: Servers update one canonical immutable tree directly. Lock-free Caffeine caches skip unchanged hierarchy branches and 2D spatial chunks in O(1), while changed paths coalesce once per subscriber group across binary CBOR tree diffs and RFC 6902 JSON Patch.
- **Vert.x 5 HTTP/3 WebTransport & WS (TRANSPORT & WIRE)**: Single-hop Netty event loop serving HTTP/2 static assets, HTTP/3 WebTransport (QUIC streams + datagrams) with automatic WebSocket fallback, and compact RFC 8949 CBOR or JSON.
- **Java 25 Virtual Threads (CONCURRENCY)**: Deterministic serialized workers and bounded multi-core fan-out preserve single-source state truth without lock contention or async callback sprawl.
- **OpenAPI 3.1, Webhooks & Failover (INTEROP & CLUSTERING)**: Shared schemas drive JSON coercion, OpenAPI 3.1 docs, CloudEvents 1.0, HMAC-SHA256 webhooks, optional MCP endpoints, and multi-node failover with durable shard handoffs.
- **SQLite WAL Ledger & Tiered Durability (PERSISTENCE & RECEIPTS)**: Embedded SQLite WAL records group-committed keyframes and structural tree diffs with per-mutation durability tiers (memory, WAL, fsync, replicated), ordered HTTP 201 commit receipts, audit blame, and instant rollback.
- **Fault Correlation & Flat Networking (DIAGNOSTICS & OPS)**: Prometheus metrics, structured journald logs linked to state-history frames for before/after crash replay, deduplicated alert outboxes, OpenJDK JFR profiling, local Unix-socket REPL diagnostics, and flat WireGuard.

### Wire State-Sync Pipeline
- **01 · Client Intent**: Client sends a compact change intent over binary CBOR WebSocket or HTTP/3 WebTransport (or standard JSON Patch for polyglot clients).
- **02 · Edge Socket Guards**: Connection caps, payload byte limits, edit bounds, and sliding rate limits reject abuse before touching worker queues.
- **03 · Serialized Virtual-Thread Worker**: Worker validates inputs against shared schemas, stamps authoritative server time, and commits an immutable state snapshot.
- **04 · Subtree Cache & Coalesced Diff**: Localized Caffeine caches skip unchanged branches, scoped slices, and 2D spatial chunks via O(1) pointer identity; subscribers sharing view paths, codec, and diff format share one diff and one serialization.
- **05 · Durable SQLite Journal & Receipt**: Changes append to an embedded SQLite WAL keyframe+diff ledger (group-committed at memory, WAL, fsync, or peer-replicated durability) before issuing ordered durability receipts.

### Architecture Decision Records
- **ADR 01 — Vert.x 5 (HTTP/3 WT + WS) Over Legacy Stacks**: One event loop serves HTTP/2 static assets (304/ETag + private no-cache behind CDN ingress), HTTP/3 WebTransport (QUIC streams + datagrams), and compressed WebSockets.
- **ADR 02 — RFC 8949 CBOR + Standard JSON Over Custom RPCs**: Compact binary CBOR handles high-frequency browser and peer sync without Base64 bloat, while standard JSON Patch, OpenAPI 3.1, and CloudEvents keep polyglot integration frictionless.
- **ADR 03 — OS WireGuard + Unix-Socket Diagnostics Over In-App Tunnels**: NAT traversal, routing, encryption, and WiFi↔5G roaming belong at the OS network layer, while live JVM diagnostics stay bound to local Unix domain sockets.
- **ADR 04 — Embedded SQLite Keyframe+Diff Ledger Over Blind Snapshots**: Bounded runtime state stays RAM-resident while SQLite WAL records group-committed keyframes and tree diffs, giving ordinary updates async throughput, critical mutations verifiable fsync/replicated receipts, and operators instant state-history replay.

### Core Engineering Invariants
- Single Vert.x 5 event loop (HTTP/2, HTTP/3 WebTransport & WebSockets) serving static assets with 304 ETag revalidation and zero proxy hops
- Lock-free Caffeine caching over immutable trees, spatial tile pyramids & 2D chunks — O(1) pointer identity skips diffing cold branches
- Embedded SQLite WAL keyframe+diff ledger with per-request durability tiers, HTTP 201 commit receipts & zero-downtime online backups
- Causal journald <-> state-history correlation linking runtime faults to exact state frames, paired with deduplicated incident alerts
- Flat OS-level WireGuard networking & local Unix-socket live diagnostics — zero custom in-app NAT relays or exposed debug TCP ports
- Java 25 Virtual Threads & bounded multi-core fan-out verified across WebSocket and HTTP/3 WebTransport (CBOR & JSON Patch) and multi-tab Chromium E2E tests

## Live Interactive Companion Demos

- **[Live 150k-Vehicle Geospatial Radar](https://qtga-transit.quantoga.com/)** (`qtga-transit`, GEOSPATIAL STREAMING): Viewport-culled MapLibre streaming across live global transit feeds (benchmarked up to 150,000 vehicles × 1,000 concurrent viewers in 65.2 ms) using a multi-zoom spatial tile pyramid, in-memory tile caching, and role-based filtering.
- **[Authoritative Sharded 3D Multiplayer](https://qtga-dungeon.quantoga.com/)** (`qtga-dungeon`, SHARDED 3D REAL-TIME): Deterministic multi-node 3D realm cluster with direct client handoff between shards, automatic failover, and per-player field-of-view streaming scaling to 4,000–12,000 live 30 Hz entities.
- **[Distributed Edge Policy Control Plane](https://qtga-control.quantoga.com/)** (`qtga-control`, POLICY & EDGE OPS): Hierarchical policy cascades with overrides, locks, expiry, and role-scoped access — backed by subtree-cached tree projections scaling past 100,000 edge nodes that survive offline partitions and resync automatically.
- **[Multi-Node Failover Testbed](https://qtga-mesh.quantoga.com/)** (`qtga-mesh`, SHARDED CLUSTERING): Sharded state across independent server nodes with automatic leader election, warm standbys, live node spawning, and seamless browser failover.
- **[Fleet Control Plane & Multi-Env Launcher](https://quantoga.com/)** (`qtga-console`, OPERATIONS PORTAL): Authenticated multi-environment launcher (prod, pre-prod, dev, test), live service discovery, benchmark regression tracking, and tunnel management.
- **[50k-Node State Inspector & Flight Recorder](https://quantoga.com/)** (`qtga-console`, LIVE DIAGNOSTICS): Real-time inspection of live server state trees, bandwidth churn, diff logs, and SQLite time-travel correlated directly to journald errors without pausing production workloads.

## Frequently Asked Questions

### Do I work directly with you or get handed off to junior contractors?
Always directly with me. Quantoga is an independent principal engineering practice — the person reviewing your architecture and profiling your JVM/Linux stack is the person writing the fixes.

### Do you only take short audits, or also longer builds and ongoing partnerships?
Both. Many teams start with a bounded 1–2 week Systems & Performance Audit, while others engage Quantoga across multi-month rescues, turnkey real-time or on-prem AI builds, ongoing principal retainers, or dedicated QTGA platform deployments — always scoped around clear outcomes rather than open-ended hourly seat-warming.

### Will our team be locked into Clojure or proprietary QTGA libraries?
Never. On audits and rescue engagements, we ship clean, idiomatic code directly inside your existing repositories with zero QTGA dependencies. QTGA-powered pilots and appliances run on standard Linux behind open wire contracts (JSON Patch, OpenAPI 3.1, CloudEvents, MCP) with optional source escrow — or filtered source handoff when explicitly contracted for internal team ownership.

### How do you handle NDAs, IP ownership, and timezone overlap?
100% client IP assignment upon payment for all bespoke code delivered inside your repositories; clear commercial licensing (with optional source escrow or contracted source-handoff tiers) for QTGA-powered pilots and sovereign appliances. Mutual NDA ready from day one, European (EET / CET / UK) and North American overlap, and available remotely or on-site across Europe.

## Direct Consulting Inquiry API

Submit structured consulting briefs programmatically via `POST https://quantoga.com/api/inquiry` (`Content-Type: application/json`):
- Required JSON fields: `name` (string), `email` (string), `message` (string, min 10 chars)
- Optional JSON fields: `company` (string), `scope` (`"architecture"` | `"clojure-rescue"` | `"private-llm"` | `"realtime-system"` | `"other"`)
- Response: `201 Created` with durable SQLite commit receipt header `X-QTGA-Commit` and JSON `{status: "ok", id: ...}`.
