Files
PaperClipAI/server/scripts
DottaandClaude Fable 5.2 a4a0668a5c perf(attention): count the sidebar summary without the reads that only a card shows (#21159)
GET /attention/summary returns counts. To get them it ran the feed with a
flag that skipped card bodies, and still read every blocked task through the
full task list, every review two more times (one time with its description),
the blocker and the blocked work of each card, and the spend of every budget
policy.

The summary keeps the collection path of the feed, so a card is counted by
the rule that shows it. It no longer reads what only a card shows:

- blocked work: the rows of the task list, in list order, with only the
  columns blocker attention reads (issueService.listBlockerAttentionRoots),
  classified by the function the full list calls
- reviews: the review rows carry the card's task condition, so the summary
  does not read each review again
- tasks of cards: without project and workspace
- budget alerts: the open incidents (budgetService.openIncidents), not the
  spend of every policy
- a fingerprint only for a card that has a dismissal; no queue membership
  and no "transferred by" read

The review classification reads the 20 columns it uses, not the whole task.

The request makes the same writes as before (decision queue seeds, retention
states) through unchanged code. The feed, the task index and the task list
return what they returned before.

One summary request at 3,000 tasks: 133 -> 78 statements, 2,718 -> 842 KB
fetched, 604 -> 144 KB of SQL text, 100 -> 45 MB allocated.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-12 12:39:21 -06:00
..