tune_weights
Tune per-repo semantic weights from ranking event telemetry. Uses recency windows and minimum event gates to avoid overfitting, helping you calibrate search relevance.
Instructions
Online weight tuning. Reads ranking_events from ~/.doc-index/telemetry.db (requires JDOCMUNCH_PERF_TELEMETRY=1) and proposes a per-repo semantic_weight step. dry_run=true skips the disk write. min_events gates against early overfitting. Learns from a recency window of the ledger (default 90 days) so stale events can't anchor the weights. Learning compares confidence WITH vs WITHOUT the semantic channel, so a workload that only ever runs one mode produces no signal at all — use set_weight there instead of waiting.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| repo | No | Optional — single repo to tune. Omit to scan all repos with events. Required with set_weight. | |
| dry_run | No | ||
| min_events | No | ||
| set_weight | No | Persist this semantic_weight for repo directly, skipping the ledger. For when you have measured the right value for a corpus rather than waiting for the tuner to walk there. Does not require telemetry. Clamped to the allowed bounds, and the response reports whether clamping occurred. | |
| max_age_days | No | Only learn from ledger events newer than this many days. Keeps stale events from anchoring weights to an outdated query distribution. 0 = lifetime ledger. |