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

/asked counts in SQL: the pulls that close asks are read once, the asks never row by row #795

Merged opened this

Check · Review · Land · Live done — Landed and live in production.

Merged

Refs #758: its `/asked` item. The other items: plural headings and the merge-again return are in #790; looks are #791.

shipped production is serving it for issue #758 — its issue is already done deploy e61e234

opened this

Refs #758: its /asked item. The other items: plural headings and the merge-again return are in #790; looks are #791.

askedCounts used to read every ask, row by row, on every load of /asked. Now it reads the pulls that close asks once (pullsByAsk, the same join scan uses, so a count cannot disagree with the list) and hands them to one grouped SQL query as key sets. The cost follows the pulls, not the issues. The states are scan's, word for word: shipped, building (an open pull or the crew running), waiting, flagged (waiting and older than the stale window). The "a person's issue" filter is now one shared clause (ASK_WHERE).

Test: in asked.test.ts, over a fixture that holds every state, the SQL counts equal the counts of the full list kind by kind; no repositories gives zeros. Typecheck is clean. reserved-names, studio, shards, check-list, hollow and asked pass (265).

🤖 Generated with Claude Code

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs