TTCP Cleanup and Divergence
ttcp-saas · auto-tcp/ttcp-saas · 16–20 Oct 2026

Cleanup, deploy and the divergence detector

What changed in four days: the codebase cleanup from the code report, getting production back onto main, clearing out old branches, and the OSM-vs-imagery divergence detector with a new High Point test set.

16Oct

The cleanup workflow

The code report graded the repo B−: clean modules, one 17.6k-line server.py, private coupling, stale docs, no lint or CI. Two of its fixes were already on main (PRs #51–#54). The rest ran as reviewed, test-gated steps, each checked against an identity test: all 233 eval-corpus plans byte-identical to main.

40/40
planner-split steps landed, every one passing review first time
233
eval plans byte-identical after every step
3,039
tests passing, same as before (0 failed)
22 → 0
private srv._* calls from routers

server.py, lines of code

Before: main f26bc68. After: main ebfac1f. The plan generator moved into a planner/ package with an explicit per-request context; four thread-locals and a ContextVar are gone.
17Oct

Pull requests merged

  1. #56Re-land #55Shared plan-generator helpers that had merged into a branch after it shipped, so never reached main.merged
  2. #57ruff + GitHub Actions CILint (F, I, B), pytest with Postgres, frontend checks, image build. Docker job builds without data when the Supabase secret is absent.merged
  3. #58Legacy cleanupDead files removed after reference checks, stale docs and docstrings fixed.merged
  4. #59Planner splitserver.py 17,697 → 3,424 lines; public router interface; +20.5k / −17.6k lines across 40 reviewed commits.merged

Afterwards: 40 old ttcp-* worktrees removed (about 15 GB) and local branches cut from 94 to 4. Files found nowhere else were archived to reports/archive-2026-10-17/ first.

20Oct

Production back on main

Found: Cloud Run was running image ac9f417, the tip of an unpushed branch with the invite-link feature. The production database was already at migration 0014_account_links, which main did not have, so deploying main would have broken startup.
  1. #60Invite and password-reset links, ported to mainTwo public routes allow-listed (the single-use token is the credential); CI's Postgres tests caught one more expectation to fix.deployed
  2. #61CLAUDE.md paragraph breakDocs only.open

Production now runs main dd5cf06 (API revision ttcp-api-00004, web ttcp-web-00006). Health reports row-level security enforced; both existing invite links intact.

20Oct

Divergence detector: more answers, same accuracy bar

The detector measures how far the road in NC OneMap imagery sits from OSM's lane model, so a reviewer can tell a planner bug from bad map data. Its problem was coverage: it answered about 8 % of road sections. A cross-check between its two edge estimators vetoed too much. The new method (div-2) only vetoes when they disagree by more than 1 m.

Road sections answered, by truth set

div-1 (before)div-2 (now)
Share of 40 m sections with a confident answer. Raleigh sets use city survey polygons; Greensboro is 6 hand-labelled junction tiles; High Point is the new 40-window set below.

Accuracy of the answers (offset error, metres)

Truth setMethodSectionsMedianp90Worst< 0.5 m
Raleigh + Greensboro, alldiv-1290.160.280.43100 %
Raleigh + Greensboro, alldiv-2510.210.410.49100 %
High Point streetsdiv-1210.200.621.1181 %
High Point streetsdiv-2320.200.621.1181 %

Removing the veto entirely doubled coverage but put Greensboro answers 1.3 m wrong, so the 1 m veto stays.

Straightened view of Battleground Avenue: the magenta model band's left edge runs inside the median while the real carriageway lies to its right
A new catch. Battleground Ave, Greensboro, straightened. OSM's lane band (magenta) runs into the median; the real carriageway is 1.44 m to the right. div-1 missed this edge; div-2 answers it.
Straightened junction approach on Battleground Avenue with found edges on both curbs but confidence near zero
Why it said "unknown". On this approach the edges found (orange ticks) sit on the curbs, but confidence scores were 0.00–0.34, so nothing was reported.
20Oct

A High Point test set for the Triad

Greensboro publishes no pavement layer, and its 6 labelled tiles are all intersections. High Point publishes edge-of-pavement lines (CC0). From them: 40 random 160 m street windows, 25 arterial and 15 local, each inspected over the imagery before use. No frame shift (signed offset error +0.06 m).

Gordon Street at three times zoom with red edge-of-pavement lines on both pavement edges
Usually on the curb. Gordon St at 3×: the city's lines (red) sit on both pavement edges to about a pixel (0.12 m).
Erwinwood Drive: the yellow truth line runs below the concrete road edge into the grass
Stale lines dropped. Erwinwood Dr: a never-edited 1977–91 line (yellow) runs 0.6–1.2 m into the grass. Windows whose lines were never edited are now excluded.
Wrenn Farm Drive: one red line on the asphalt-gutter seam, the other outside the gutter
Mixed conventions. Wrenn Farm Dr: one side's line follows the asphalt/gutter seam, the other the curb face. That limits this set to judging errors above about 0.7 m.