runAutoRetire
runAutoRetire(
deps):RetiredRecord[]
Defined in: src/learnings-lifecycle.ts:149
Cross-repo sweep: identify and retire underperforming active learnings.
For each repo path:
- Fetch active+promoted rules (injected set) and retired rules.
- Compute the base rate using all rules (incl. retired) to prevent cascade.
- Filter to ACTIVE-only candidates (promoted rules keep a verbatim CLAUDE.md copy; retiring them is inert — leave them alone).
- Sort worst-first (lowest Wilson bound) so the budget cap retires the worst rules.
- For each shouldRetire candidate:
- If autoOptimizeFlagged and not yet optimized: optimizeOne (no retire, no budget hit).
- Else if budget remains: retire it and increment the per-repo counter.
Returns flat array of RetiredRecord across all repos.