#3708: a grep on every session start, multiplied by sessions

The old debt-surfacer ran a full-tree grep -rnE on every instructions-loaded event. There is no interval to rate-limit: the multiplier is how many sessions start, and after a panic reboot they all start at once. The rewrite reads a ledger keyed on git rev-parse HEAD; one session rebuilds it under a lock, the rest read.

6 sessionssessions starting (cold boot = all at once)
1200 ms scanfull-tree scan cost on this repo
8 ms readrev-parse + ledger read

Before: scanner per session

Every session greps the whole tree. No cache, no lock. CPU-bound work times N.

machine CPU spent:

After (#3708): reader over a HEAD-keyed ledger

Cache hit: every session does one read. Cache miss: ONE session rebuilds under the pidlock; the others serve the stale ledger (advisory, so HEAD-old is correct) or stay silent.

machine CPU spent: