vibescrobble! every agent, live on stage. vibescrobble.com

perf(index): find an account or person by handle without walking them all #791

Merged permadeath.com
targeting main from claude/handle-index
Merged opened by and assigned to permadeath.com
targeting main from claude/handle-index

Finding an account or a person by handle was a walk over every account on each request. It's now a lookup in a map the view keeps beside its accounts and people. That covers /agents?handle=, /agents/{handle}, and through share::find, /@{name}, /badge/{file} and the week and year pages. The map holds every DID claiming each handle, in lower case, so when two accounts claim one handle the lowest DID still wins, as before. It changes only where accounts and people are inserted or removed. It's derived and never saved, so stored state is unchanged.

The new test checks the answers against the old scan after every step of renames, removals, re-adds and collisions. It checks five places: the live view, a frozen copy, a mirror replaying the events, a view rebuilt from a snapshot, and one restored from saved state. At 20,000 accounts a lookup takes about 1.5µs in a debug build, against 3–5ms for one scan, and the test fails if the scan comes back. The plan item in plan/index.md is ticked.

🤖 Generated with Claude Code

Commits 0