Orientation
System teardown
A clickable map of the whole system, plus the codebase in numbers.
The system on one page
Click any box to open the chapter that covers it. The dashed outline is the hardware trust boundary: prompts exist only inside it and at the provider. Everything below the boundary sees metadata.
prompt bytesmetadata only (internal token)control and data flowattested trust boundary
Teardown: what each layer is made of
| Layer | Built with | Lives in | Owned state | Blast radius if wrong |
|---|---|---|---|---|
| Attested gateway | Go, Confidential Space / Nitro / SEV-SNP | quill-cloud-proxy | None persistent; BYOK key cache in memory | Privacy claim. A digest mismatch is caught by trust-drift. |
| Gateway callbacks | FastAPI, routes/internal/gateway.py (6k lines) | quill-router | Authorizations, reservations | Money: double charge or free usage |
| Credit ledger | Spanner typed tables, settle outbox, reaper | quill-router | tr_credit_balance, tr_key_limit, tr_reservation | Money; covered by the proof oracle and TLA+ |
| Routing & catalog | Import-time catalog, 92 provider JSON files | quill-router | Prices, privacy flags | Mispricing, or a privacy floor routed to a non-qualifying provider |
| Storage layer | Store protocol (210 methods), 3 production backends | quill-router | Everything durable | Spanner CPU incidents; cross-cloud drift |
| Analytics | Spanner outbox → ClickHouse (3 replicas) | quill-router/clickhouse | Usage events, rollups | Status page, leaderboard, reports (not money) |
| Delivery | GitHub Actions, rollout.sh, Terraform | .github/, scripts/deploy/, infra/ | Config-as-code ENV_VARS | Every merge to main can ship |
The codebase in numbers
3,213commits since 2026-05-03
1,711merged PRs
194klines of Python source
343klines of Python tests
28GitHub workflows
25incident write-ups
Commits per month, by author
Oct* covers Oct 1–19. Bots are the hourly pricing bot and Dependabot.
Joseph PerlaJasmine LeeBots
Table view
| Month | Joseph Perla | Jasmine Lee | Bots |
|---|---|---|---|
| May | 206 | 0 | 195 |
| Jun | 378 | 0 | 46 |
| Jul | 348 | 0 | 47 |
| Aug | 651 | 0 | 182 |
| Sep | 449 | 42 | 64 |
| Oct* | 417 | 166 | 22 |
Python lines by top-level directory
Tests outweigh source by 1.77 to 1.
Largest source modules
Lines of code in src/trusted_router. The four largest are also the most-changed files.
Human-edited hotspots, last 90 days
Expect merge conflicts in these files.
| File | Changes |
|---|---|
src/trusted_router/routes/internal/gateway.py | 141 |
src/trusted_router/dashboard.py | 141 |
src/trusted_router/storage_gcp.py | 140 |
src/trusted_router/config.py | 134 |
scripts/deploy/rollout.sh | 119 |
src/trusted_router/static/og/providers/manifest.json | 112 |
src/trusted_router/storage_postgres.py | 105 |
src/trusted_router/routes/public.py | 102 |
src/trusted_router/catalog_data.py | 100 |
src/trusted_router/storage.py | 96 |