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
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
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.jsthat calls it.Requirements
.loopover.ymlreconstruction, probe the target repo's ORB instance via the new endpoint (sibling issue). ReuseresolveGitHubToken'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.discover/gate-prediction meaningfully slower for a repo where ORB isn't installed or doesn't respond.confidence_floor/scope_cap_files/scope_cap_linesfields specifically — leave every other predicted-gate field sourced from the static file exactly as today.Deliverables
self-review-context.js..loopover.ymlat 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 ownpackage.json/CI config for whether Codecov's 99%+ patch gate applies here the same way assrc/**, 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
packages/loopover-miner/lib/self-review-context.js(today's static-file fallback, to be preserved)packages/loopover-miner/lib/github-token-resolution.js(resolveGitHubToken, the auth posture to reuse)