Part of #106 — the policy half of the background-refresh system: who gets refreshed and how often.
Problem
Today refresh is lazy-on-lookup only. Entities nobody visits go stale (rank, followers, commit tail); org totals never refresh on the request path. We need a proactive, prioritized cadence that keeps the visible surface fresh while staying polite to GitHub's ~5,000 points/hr budget (shared token).
Proposal (to ratify / adjust)
Tiers, highest priority first:
- Hot — entities looked up in the last N days (from
lookups.searchedAt) + the top ~250 of each leaderboard. Refresh weekly.
- Long tail — everything else. Refresh monthly (stalest
lastFetched/builtAt first).
- Profile metadata (followers, rank inputs, bio) drifts faster than the monthly contribution curve — consider a more frequent, cheaper pass (one profile fetch/entity) independent of the full contribution re-fetch.
Budget: reserve a floor for live traffic (our scripts already use REMAINING_FLOOR = 500); split the remaining hourly budget across tiers, hot first.
Applies to users AND orgs — org contribution totals must join the cadence (they currently never refresh on the request path).
Acceptance criteria
Relationship to existing issues
Generalizes #6 (monthly refresh of cached users) into a tiered, org-aware policy; feeds #58 (retroactive reconcile) which is the "re-fetch immutable past months" special case; the runner is sub-issue B.
Part of #106 — the policy half of the background-refresh system: who gets refreshed and how often.
Problem
Today refresh is lazy-on-lookup only. Entities nobody visits go stale (rank, followers, commit tail); org totals never refresh on the request path. We need a proactive, prioritized cadence that keeps the visible surface fresh while staying polite to GitHub's ~5,000 points/hr budget (shared token).
Proposal (to ratify / adjust)
Tiers, highest priority first:
lookups.searchedAt) + the top ~250 of each leaderboard. Refresh weekly.lastFetched/builtAtfirst).Budget: reserve a floor for live traffic (our scripts already use
REMAINING_FLOOR = 500); split the remaining hourly budget across tiers, hot first.Applies to users AND orgs — org contribution totals must join the cadence (they currently never refresh on the request path).
Acceptance criteria
kind='user'andkind='org'backfill-contributions.ts/backfill-orgs.tshygiene)Relationship to existing issues
Generalizes #6 (monthly refresh of cached users) into a tiered, org-aware policy; feeds #58 (retroactive reconcile) which is the "re-fetch immutable past months" special case; the runner is sub-issue B.