Files
CatoandClaude Opus 5.5 379215bca8 feat(review): unreviewed sweep leads expire after 30 days at read time (#113)
A lead nobody decides on within LEAD_EXPIRY_DAYS (30) is expired: kept in
research_sweep_candidates, never deleted or rewritten, but out of the review
queue and its freshness age. The review queue is judged on OPEN leads only —
late past 7 days (a slow reviewer, reported), stale past 31 (only a broken
expiry or queue can get there, so it still 503s).

- lib/lead-expiry.ts: the constant, the pure leadState rule and the SQL
  predicates it must agree with; method `lead-expiry` documents it
- /review, /data, /data/freshness count expired leads and link to the new
  /data/freshness/expired list
- desk and company pages label an expired lead "expired, never reviewed";
  the reader's leadMaxAgeDays window is unchanged; Ask says EXPIRED
- test/lead-expiry.test.ts: boundary, SQL/JS agreement, open-only queue and
  freshness, expired retrievable + no DELETE; each mutation-proven

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-25 23:02:57 -07:00
..