Drop lock_lines and retire its writer (dead table, dead writer)

lock_lines was built in Session 64 for a staleness audit - join lock-time
per-book lines to closing_captures and ask whether our locked line was
stale-high vs consensus. That audit was never written. ruler-comparison.sql
records why: only 43 settled rows ever joined it with >=2 two-sided books.

Measured before removal: 367,595 rows, 104 MB, zero readers in src/, scripts/
or web/src/ - the only from('lock_lines') was an upsert, every other mention a
comment. Zero dependents: no FK, no view, no trigger. The newest pg_dump held
all 367,595 rows, pg_restore-verified before the drop.

The write is off too, because a dead table that keeps refilling is only half
solved: it was accruing 36,440 rows/day, 10.3 MB/day, 23% of all database
growth, for a question nobody was asking. buildLockRows is kept and still
tested - the logic was never what was wrong, and re-arming is one flag plus
re-creating the table.

DB 510 MB -> 406 MB: 81% of the 500 MB cap, +94 MB headroom, under it for the
first time in months.

Moat and grade untouched.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Kev
2026-08-12 01:18:10 -04:00
parent fb0010222d
commit 0657b71d18
5 changed files with 179 additions and 2 deletions
+19
View File
@@ -3,6 +3,25 @@
## Last Updated
2026-08-12
## Reclaim 2 (2026-08-12) — lock_lines dropped, writer retired ✅
4,803 tests / 374 suites, web build exit 0, app healthy. **Moat untouched
(`ledger_entries`, `model_snapshots`); grade path untouched.**
- **DROPPED `lock_lines`**: 367,595 rows / 104 MB, zero readers anywhere, zero
dependents (no FK/view/trigger). Dump held all 367,595 rows, verified first.
- **RETIRED the writer** (`LOCK_LINE_CAPTURE=1` to re-arm; also needs the table
re-created). Was 36,440 rows/day — 23% of all DB growth.
- **DB 510 MB → 406 MB — 81% of cap, +94 MB headroom.** Under the free-tier cap
for the first time in months. Growth ~45 → ~35 MB/day.
- 10 new tests; `buildLockRows` kept and still covered.
### STILL OPEN — the survey's conclusion stands
B1 (`2271f46`) and B2 (`fb00102`) are pushed but **NOT deployed** — prod is on
`f61ec6b`. Until B2 lands, `missed_window` resumes at ~66 MB/day tonight and
eats the 94 MB headroom in ~36 hours. **Deploy is the next action.**
Even with B2 live, the hot floor (~372 MB, +33 MB/day) crosses 500 MB in ~4-5
days. Reclaim 2 bought ~3 days, not a solution. Pro remains the arithmetic
answer; the Roundtable decides.
## Fix B2 (2026-08-12) — halt the closing_captures bleed at source ✅
4,793 tests / 373 suites, web build exit 0. **No rows deleted. Grade untouched.
Readers untouched. No R2 involved.**