Skip to content

calibration: per-repo knob overrides — storage scheme, resolution seam, and full settings wiring #8216

Description

@JSONbored

Problem

Epic #8211 track B. Knob overrides are global today (one system_flags key per knob). Repos with mature contributor populations should be able to carry individually-earned values — but the precedence chain must stay unambiguous and the wiring complete, or per-repo state becomes per-repo drift.

Requirements

⚠️ Required pattern. This is gate-authority plumbing: the full per-repo-setting checklist applies (every resolution site in the SAME PR — resolver, types, OpenAPI where surfaced, status endpoints), and the write path must enforce the same loosening-only bounds per scope that getKnobOverride enforces globally.

  • Storage: one system_flags key per (knob, repo) — {knobOverrideFlagKey}:repo:{owner/repo} — beside the existing global key. Migration-free (system_flags is schemaless rows).
  • Resolution seam, ONE function, precedence documented at the definition: explicit per-repo .loopover.yml setting > per-repo earned override > global earned override > shipped default. The gateCheckPolicy threading gains the repo dimension without the twins changing (they still consume one resolved number).
  • getKnobOverride grows a repo-aware variant with identical validation per scope; flag-off still zeroes everything instantly.
  • GET /v1/internal/calibration/knobs gains a per-repo overrides listing per knob (repo + value + applied-at), aggregates only.

Deliverables

  • Storage + resolution + policy threading with 100% branch on every touched src path
  • Knobs-endpoint per-repo section + tests
  • Docs: precedence table on the backtest-calibration page

Links & Resources

#8211 (epic), the corpus-slicing sub-issue (blocked-by), src/services/knob-loosening-run.ts, src/queue/gate-checks.ts

Boundaries

No evaluation changes here — this issue is consumption/storage only; the per-repo LOOP is its own follow-on. Explicit yml settings always win.

maintainer-only — gate-authority plumbing.

Metadata

Metadata

Assignees

Labels

maintainer-onlyOwner-only work — yields no Gittensor points.roadmapOn the Wave-2 agent-layer roadmap board (project 9)

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions