Skip to content

feat(miner): consume ORB live gate thresholds in self-review-context - #6562

Closed
RealDiligent wants to merge 1 commit into
JSONbored:mainfrom
RealDiligent:feat/critical-issue-ams-live-gate-thresholds-6487
Closed

feat(miner): consume ORB live gate thresholds in self-review-context#6562
RealDiligent wants to merge 1 commit into
JSONbored:mainfrom
RealDiligent:feat/critical-issue-ams-live-gate-thresholds-6487

Conversation

@RealDiligent

Copy link
Copy Markdown
Contributor

Summary

  • Probe GET /v1/repos/:owner/:repo/live-gate-thresholds from fetchSelfReviewContext using the same loopover-mcp session posture as resolveGitHubToken.
  • On success, overlay confidence_floor (raise-only readinessMinScore) and scope_cap_* onto the static .loopover.yml reconstruction; leave every other gate field untouched.
  • On 403 / 404 / timeout / no session: zero behavior change (fully-standalone path unchanged). Probe timeout defaults to 400ms.

Closes #6487

Test plan

  • Unit: live 200 → thresholds applied
  • Unit: 403 / 404 / timeout → static fallback
  • Unit: loopoverAuth: null skips probe
  • Unit: raise-only confidence + prefer live scope caps
  • CI + codecov/patch ≥ 99%

Made with Cursor

Closes JSONbored#6487. Prefer live confidence_floor / scope caps over static
.loopover.yml reconstruction when the short ORB probe succeeds; fall
back unchanged on 403/404/timeout/no session.

Co-authored-by: Cursor <cursoragent@cursor.com>
@codecov

codecov Bot commented Jul 16, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 97.14286% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 93.60%. Comparing base (e066a90) to head (be25e0f).

Files with missing lines Patch % Lines
...ages/loopover-miner/lib/github-token-resolution.js 66.66% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #6562   +/-   ##
=======================================
  Coverage   93.60%   93.60%           
=======================================
  Files         675      675           
  Lines       67764    67797   +33     
  Branches    18627    18627           
=======================================
+ Hits        63431    63463   +32     
- Misses       3360     3361    +1     
  Partials      973      973           
Flag Coverage Δ
shard-1 43.88% <0.00%> (-0.17%) ⬇️
shard-2 36.92% <2.85%> (+0.12%) ⬆️
shard-3 32.31% <0.00%> (-0.11%) ⬇️
shard-4 34.62% <0.00%> (-0.29%) ⬇️
shard-5 31.51% <0.00%> (+0.39%) ⬆️
shard-6 45.86% <97.14%> (+0.24%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
packages/loopover-miner/lib/self-review-context.js 97.31% <100.00%> (+0.67%) ⬆️
...ages/loopover-miner/lib/github-token-resolution.js 97.91% <66.66%> (-2.09%) ⬇️

@loopover-orb loopover-orb Bot added the gittensor:feature Gittensor-scored feature linked to a feature issue — scores a 0.25x multiplier. label Jul 16, 2026
@loopover-orb

loopover-orb Bot commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Caution

🛑 LoopOver review result - fixes required

Review updated: 2026-07-16 13:59:24 UTC

5 files · 1 AI reviewer · no blockers · CI failing · unstable

🛑 Suggested Action - Fix Blockers

Review summary
This wires an optional ORB live-gate-thresholds probe into fetchSelfReviewContext, overlaying confidence_floor/scope_cap_* onto the static .loopover.yml reconstruction while leaving the fully-standalone (no loopoverAuth) path unchanged. The raise-only readinessMinScore logic and prefer-live scope caps in applyLiveGateThresholdsToManifest are correct and match the stated semantics, and the probe fails closed (any non-200, timeout, parse error, or missing session yields null and falls back to the static manifest) via the try/catch in probeLiveGateThresholds. The one gap is that every test exercises loopoverAuth explicitly (either null or a full {apiUrl, sessionToken} object) — the default auto-resolve-from-env path in normalizeOptions (options.loopoverAuth undefined → resolveLoopoverBackendSession(env)) is never exercised, which lines up with the codecov/patch shortfall.

Nits — 5 non-blocking
  • packages/loopover-miner/lib/self-review-context.js:66-77 (normalizeOptions): when an explicit `loopoverAuth` object is passed with a falsy/empty `sessionToken`, the code silently falls through to `resolveLoopoverBackendSession(env)` instead of treating it as 'no auth' — worth a comment or an explicit branch so a caller who intended to suppress the probe isn't surprised it still fires from an ambient session.
  • No test exercises the default (options.loopoverAuth === undefined) auto-resolve-from-env branch in normalizeOptions — this is the likely source of the codecov/patch 97.14%→99% shortfall.
  • packages/loopover-miner/lib/self-review-context.js: applyLiveGateThresholdsToManifest's confidence_floor branch is untested for the case where `gate.readinessMinScore` is not already a number (e.g. a manifest with no readiness block) — the raise-only guard silently no-ops there.
  • External brief flags `parseLiveGateThresholdFields` at ~complexity 11 (threshold 10) and the file at ~438 lines (threshold 400); both are marginal and not worth blocking on but consider whether the nested ternary in normalizeOptions (depth 5) could be flattened into a small helper for readability.
  • Add a unit test that omits `loopoverAuth` entirely and stubs `resolveLoopoverBackendSession` (or sets a fake config on disk) to cover the default env-resolution path end-to-end, closing the coverage gap CI flagged.

CI checks failing

  • codecov/patch — 97.14% of diff hit (target 99.00%)

Decision drivers

  • ✅ Code review — No blockers (1 reviewer)
  • ✅ Gate result — Passing (No configured blocker found.)
Context & advisory signals — never blocks the verdict
Signal Result Evidence
Linked issue ✅ Linked #6487
Related work ✅ No active overlap found No same-issue or scoped active PR overlap found.
Change scope ✅ 20/20 Low review scope from cached public metadata (1 linked issue).
Validation posture ✅ 25/25 PR body includes validation/test evidence.
Contributor workload ✅ 10/10 Author activity: 342 registered-repo PR(s), 166 merged, 31 issue(s).
Contributor context ✅ Confirmed Gittensor contributor RealDiligent; Gittensor profile; 342 PR(s), 31 issue(s).
Improvement ✅ Minor risk: clean · value: minor · LLM: moderate
Linked issue satisfaction

Addressed
The diff adds a short-timeout probe to ORB's live-gate-thresholds endpoint reusing the loopover-mcp session posture from github-token-resolution.js, overlays only confidence_floor/scope_cap_files/scope_cap_lines (raise-only for the floor) onto the static manifest while leaving other gate fields untouched, and falls back cleanly on 403/404/timeout/no-session with tests covering all required scenari

Review context
  • Author: RealDiligent
  • Role context: outside_contributor
  • Public audience mode: oss maintainer
  • Lane context: Repository is configured for direct PR review.
  • Public profile languages: Python, JavaScript, Ruby, Svelte, TypeScript, Markdown, MDX
  • Official Gittensor activity: 342 PR(s), 31 issue(s).
  • PR-specific overlap: none found.
Contributor next steps
  • Keep the PR focused and include validation evidence before maintainer review.
Signal definitions
  • Related work = same linked issue, overlapping active PRs, or title/path similarity.
  • Change scope = cached public metadata such as size labels, draft state, and review-burden hints.
  • Validation posture = whether the PR provides enough public validation/test evidence for maintainer review.
  • Contributor workload = public contributor activity and cleanup pressure, not a repo-wide quality failure.
  • Contributor context = public GitHub/Gittensor identity context; non-Gittensor status is not a blocker.
🧪 Chat with LoopOver

Ask LoopOver a question about this PR directly in a comment — grounded only in the same cached, public-safe facts shown above, never a new claim.

  • @loopover ask &lt;question&gt; answers contribution-quality Q&A with source citations and freshness.
  • @loopover chat &lt;question&gt; answers in natural prose from cached decision-pack facts via local inference (maintainer/collaborator; read-only).
  • A plain-language @loopover mention with a real question is routed to the closest matching read-only command automatically — no exact syntax required.

Full command reference: https://loopover.ai/docs/loopover-commands

🧪 Experimental — new and may change.

🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed


💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →.

Checked by LoopOver, a quiet PR intelligence layer for OSS maintainers.

  • Re-run LoopOver review

@loopover-orb

loopover-orb Bot commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

LoopOver is closing this pull request on the maintainer's behalf (CI is failing (codecov/patch)). This is an automated maintenance action — to pursue this change, please open a new pull request with the issues resolved. Closed PRs may be analyzed later to improve review accuracy, but they are not automatically reopened or re-reviewed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gittensor:feature Gittensor-scored feature linked to a feature issue — scores a 0.25x multiplier.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

1 participant