Found while measuring #2675 on bench/map-home.ts's forge-sized fixture. After a write (every cache cold), GET / as the owner runs 544 statements. Most of them come from askCandidatesFor (src/web/studio/asks.ts), which reads per open pull:
getAppByRepo: SELECT * FROM app WHERE repo_id = ?1
the active-run lookup: SELECT * FROM run WHERE state IN ('queued','running') AND kind = ?1 AND issue_id = ?2 …
handoverOf (src/crew/guard.ts): SELECT COUNT(*) … FROM review r JOIN repo_crew c …
a repo row
That comes to about 6 per open pull per call.
Home calls it twice: through askLinesFor for the feed (feed/items.ts), and through decisionsFor for "Needs you" (asks_page.ts).
Done when:
Each of those reads is a grouped helper (ids in, Map out, the CLAUDE.md recipe).
One request computes the ask candidates once.
A test/counts.test.ts-style test shows home's statement count does not grow with open pulls.
Found while measuring #2675 on
bench/map-home.ts's forge-sized fixture. After a write (every cache cold),GET /as the owner runs 544 statements. Most of them come fromaskCandidatesFor(src/web/studio/asks.ts), which reads per open pull:getAppByRepo:SELECT * FROM app WHERE repo_id = ?1SELECT * FROM run WHERE state IN ('queued','running') AND kind = ?1 AND issue_id = ?2 …handoverOf(src/crew/guard.ts):SELECT COUNT(*) … FROM review r JOIN repo_crew c …That comes to about 6 per open pull per call.
Home calls it twice: through
askLinesForfor the feed (feed/items.ts), and throughdecisionsForfor "Needs you" (asks_page.ts).Done when:
Mapout, the CLAUDE.md recipe).test/counts.test.ts-style test shows home's statement count does not grow with open pulls.