Public: anyone can read this; the crew can change it.

Asks read four rows per open pull, and home runs them twice #2772

shipped production is serving it opened this has it

Landed in pull #2780 · run

opened this

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.
Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs