Expand description
Maintenance sweeps for stale or weakly grounded skills.
The corpus has accumulated a long tail of conv-review-* skills that
never get accepted, never get served past the first injection, and
still pay full freight in the top-5 retrieval ranking. Two
complementary sweeps live here:
-
sweep_stale_skillsmultiplicatively decaysconfidence_scoreon skills that were installed long enough ago to have a track record, have NOT been served in the recent window, and have NEVER earned an accepted fix. Confidence is a multiplier in the recall ranker (context::retrieval::rules), so halving it ~halves the chunk’s fused score and naturally drops it out of the top 5 over two sweeps without deleting anything. -
quarantine_unguided_conv_reviewsflipsconv-review-*skills that have neitherfile_patternsnor atriggertostatus = 'pending'. These are the worst offenders: imported from a PR comment with no grounding so the embedding has to do all the work, and the embedding usually loses to a real rule. Pending status keeps the row (it can be promoted back by a human or an accept event) but removes it from active recall.
Hard constraints: no schema changes, no DELETEs, all writes wrapped in a single sqlx transaction so a partial sweep can’t half-decay the corpus.
Structs§
- Quarantine
Report - Outcome of
quarantine_unguided_conv_reviews.flipped_idsis the exact list of skill ids that moved fromactivetopending— useful for both audit logs and undo scripts. - Sweep
Opts - Tuning knobs for
sweep_stale_skills. Defaults: 14-day install/serve windows, x0.5 decay, 0.05 floor. - Sweep
Report - Outcome of one
sweep_stale_skillspass. Counts are best-effort snapshots taken during the same transaction as the writes (or the dry-run preview, ifdry_runwas set).
Functions§
- quarantine_
unguided_ conv_ reviews - Move
conv-review-*skills with neitherfile_patternsnor atriggertostatus='pending'. See module docs for the rationale. - sweep_
stale_ skills - Decay
confidence_scoreon truly-stale skills. See module docs.