Skip to content

feat(miner): consume ORB's live gate thresholds in self-review-context.js when available #6487

Description

@JSONbored

Context

#6209 decided the design (see its pinned decision comment). The ORB-side read endpoint (sibling issue) exposes live gate thresholds; this issue is the AMS-side consumer in packages/loopover-miner/lib/self-review-context.js that calls it.

Requirements

  • Before falling back to the existing static-.loopover.yml reconstruction, probe the target repo's ORB instance via the new endpoint (sibling issue). Reuse resolveGitHubToken's existing auth posture (packages/loopover-miner/lib/github-token-resolution.js) for this call rather than inventing new credential handling — this is additive to the same request flow AMS already makes against loopover's backend.
  • Purely additive, fallback-preserving: if the probe 403s (not allowlisted), times out, or the target repo has no live override, fall back to today's static-file reconstruction with zero behavior change. AMS's fully-standalone (ORB-absent) path must not change at all.
  • Short timeout on the probe (a few hundred ms) — this must never make discover/gate-prediction meaningfully slower for a repo where ORB isn't installed or doesn't respond.
  • When the live thresholds ARE available, prefer them over the static reconstruction for the confidence_floor/scope_cap_files/scope_cap_lines fields specifically — leave every other predicted-gate field sourced from the static file exactly as today.

Deliverables

  • The probe + fallback logic in self-review-context.js.
  • Unit tests: ORB endpoint returns live thresholds → used in the prediction; endpoint 403s/times out/repo has no override → falls back to static reconstruction unchanged; fully-standalone repo (no .loopover.yml at all, no ORB) → unaffected, matches today's behavior exactly.

Test Coverage Requirements

This touches packages/loopover-miner/** — confirm current coverage convention for this package (check its own package.json/CI config for whether Codecov's 99%+ patch gate applies here the same way as src/**, or whether it's measured separately) and match it; do not skip tests on the assumption coverage doesn't apply.

Expected Outcome

AMS's gate-prediction becomes more accurate against a repo where ORB is actually installed and live-tuned, with zero behavior change for every other case (ORB absent, endpoint unreachable, repo not allowlisted).

Links & Resources

Metadata

Metadata

Assignees

No one assigned

    Labels

    gittensor:featureGittensor-scored feature linked to a feature issue — scores a 0.25x multiplier.help wantedExtra attention is needed

    Projects

    Status
    Done
    Status
    Done

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions