Terminal map
Ten code-backed maps of Tort Terminal, drawn from the code on November 8, 2026.
The short version
- Meta spend reaches Neon hourly; Google and TikTok still ride Hevo and BigQuery twice a day.
- A case is born only by a signing; its status never changes, timestamps do the excluding.
- Prod migrations need two signatures in code; the release rule lives only in docs.
- Links between schemas are plain joins with no constraint, so a broken mapping moves money quietly.
System map
From you
Open the system map first; tell me which box you want drawn deeper.
Each map stops at the box; a deeper drawing opens the code paths inside the one you pick.
Default if you do not pick: the ad-to-campaign join every platform's spend passes through on the way to CPSC.
At a glance
- Maps10passed
- Source refs531verified
- API routes546at head
- Migrations758chain at 852
- Schemas14two dropped
- Two-key releasesDocs onlynot in code
The ten maps
| Map | What it shows |
|---|---|
| System map | Spend in, leads and cases through, CPSC out |
| Spend to CPSC | A dollar from ad platform to CPSC |
| Lead to case | A GHL lead to a signed case |
| Case status | Where a case's status can move |
| Diligence status | A diligence case, received to sent |
| Money schema | 28 tables, 485 columns, standard density |
| Migration gate | How a migration reaches prod |
| Release path | How a change reaches prod |
| Repository tree | What lives where in the repo |
| 2026 timeline | Releases, decisions and schema in 2026 |
Findings
- Case status never changes after birth, so the signed count rests on three timestamp columns a CI gate must police on every read.
- No workflow reads RELEASE-GO, so either agent can publish a release alone, while prod migrations refuse without two non-author signatures.
- Meta spend comes straight from Meta while Google and TikTok still pass through BigQuery, and TikTok has sent nothing since late December.
- GHL leads arrive by a 15-minute poll and signings come from a separate repo, so case freshness depends on two systems outside this one.
- The schema doc stops near migration 498 while the chain reaches 852, and the intelligence host is not in source; both are first fixes.
Details
The ten maps
- System map: Spend in, leads and cases through, CPSC out.
- Spend to CPSC: A dollar from ad platform to CPSC.
- Lead to case: A GHL lead to a signed case.
- Case status: Where a case's status can move.
- Diligence status: A diligence case, received to sent.
- Money schema: 28 tables, 485 columns, standard density.
- Migration gate: How a migration reaches prod.
- Release path: How a change reaches prod.
- Repository tree: What lives where in the repo.
- 2026 timeline: Releases, decisions and schema in 2026.
The findings in full
- ops.cases.status has one writer, the birth INSERT that sets active, and no code ever changes it; the signed count is really three timestamp columns (quarantined_at, operator_excluded_at, archived_at) that a CI gate must police on every read.
- RELEASE-GO appears only in CLAUDE.md and release-process.md, no workflow or script reads it, and both agent apps sit on the tag bypass list; either Jean or Brick can publish a release alone, while prod migrations refuse without two non-author signatures.
- Meta spend lands in Neon straight from Graph (hourly with a 3-day lookback, nightly with a 28-day restatement), but Google and TikTok still go Hevo to BigQuery to a twice-daily mirror, and the TikTok mirror header says it has been dry since 2025-12-30; every platform then funnels through one join, ops.campaign_ads.external_ad_id, into the hourly matview.
- GHL inbound is a 15-minute poll, not webhooks, and a signing reaches ops.cases only through zenith-events (a separate repo) and the document-events webhook; case freshness depends on two systems outside this repo.
- The schema overview doc stops near migration 498 while the live chain is at 852, and intelligence.tortterminal.com is not in source (the code's intel host is intel.tortterminal.com, marked future); the map shows what the code says, and those two gaps are the first fixes.
What the code corrects in the rig's memory
A migration file with no history on origin/main is refused outright (both agents count as authors), not "needs a human co-signer". A zero-signature operator path (db:migrate:prod:operator, a human types APPLY) exists, and the audit accepts the row as operator. release-process.md line 141 still says prod needs a human's approval while the section above it accepts Jean plus Brick alone.
Dry and divergent
The Targets surface reads ops.ad_spend_per_ad, and its own source comment records an $834,499 disagreement with the campaign_daily_spend matview. The formulas/cpsc.ts module built to force an aligned window has no production importer; the services divide inline and resolveRanges aligns the window.
Case Diligence side doors
The two KYC-phase moves the cron makes most often (kyc_queued to kyc_processing, and the no-session kyc_failed) are inline UPDATEs outside the state machine and never reach audit.events.
Schema caveats
Raw Hevo mirrors are trimmed to money and join columns (counts on the page). ops.campaigns and ghl.contacts predate app/migrations, so their columns come from the sandbox bootstrap and later ALTERs. 13 real foreign keys, 22 logical joins. Schemas: ops and ghl predate app/migrations; twelve more are created in migrations (ad_spend, audit, case_diligence, deel, kyc, lead_resolution, ledger, media_desk, public_intel, system, usage, zenith); nerve and migration were created and later dropped, so 14 are live.
How it was built
Archify 3.2.0 (Apache-2.0) with its update check off, read-only on the Terminal checkout (git status unchanged before and after), every box and step citing its file and lines at main 2afb20a, Chrome browser-check on every page; the desk look is a post-process (deskify) that leaves each Archify file and its receipts untouched.