Skip to content

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

Merged
JSONbored merged 2 commits into
JSONbored:mainfrom
RealDiligent:feat/critical-issue-ams-live-gate-thresholds-6487-v2
Jul 16, 2026
Merged

feat(miner): consume ORB live gate thresholds in self-review-context#6565
JSONbored merged 2 commits into
JSONbored:mainfrom
RealDiligent:feat/critical-issue-ams-live-gate-thresholds-6487-v2

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.
  • Coverage fix vs closed feat(miner): consume ORB live gate thresholds in self-review-context #6562: unit-test resolveLoopoverBackendSession null-session path (the single codecov/patch miss).

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
  • Unit: resolveLoopoverBackendSession returns null without a session token
  • CI + codecov/patch ≥ 99%

@superagent-security

Copy link
Copy Markdown
Contributor

Superagent didn't find any vulnerabilities or security issues in this PR.

@codecov

codecov Bot commented Jul 16, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.60%. Comparing base (93f3467) to head (e5c0d3e).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #6565   +/-   ##
=======================================
  Coverage   93.60%   93.60%           
=======================================
  Files         675      675           
  Lines       67764    67797   +33     
  Branches    18627    18627           
=======================================
+ Hits        63431    63464   +33     
  Misses       3360     3360           
  Partials      973      973           
Flag Coverage Δ
shard-1 43.88% <0.00%> (-0.17%) ⬇️
shard-2 36.92% <2.85%> (+0.12%) ⬆️
shard-3 32.32% <8.57%> (-0.11%) ⬇️
shard-4 34.62% <0.00%> (-0.28%) ⬇️
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 Δ
...ages/loopover-miner/lib/github-token-resolution.js 100.00% <100.00%> (ø)
packages/loopover-miner/lib/self-review-context.js 97.31% <100.00%> (+0.67%) ⬆️

RealDiligent and others added 2 commits July 16, 2026 22:06
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>
Co-authored-by: Cursor <cursoragent@cursor.com>
@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

Tip

✅ LoopOver review result - approve/merge recommended

Review updated: 2026-07-16 14:34:04 UTC

6 files · 1 AI reviewer · no blockers · readiness 100/100 · CI green · clean

✅ Suggested Action - Approve/Merge

  • safe to merge

Review summary
This diff adds an optional ORB live-gate-thresholds probe to the miner's self-review context builder, overlaying confidence_floor (raise-only readinessMinScore) and scope_cap_files/lines onto the static .loopover.yml reconstruction, with explicit fail-closed handling on 403/404/timeout/no-session. The implementation is correct: the probe is added as a fifth parallel Promise.all entry with its own short timeout, applyLiveGateThresholdsToManifest only mutates the gate object copy, and the raise-only floor logic is tested for both directions. Tests cover the 200/403/404/timeout/null-auth/timeout-budget paths thoroughly and the standalone path is verified byte-identical via an explicit assertion that live-gate-thresholds is never called.

Nits — 5 non-blocking
  • packages/loopover-miner/lib/self-review-context.js:71 hardcodes the https:​//api.loopover.ai fallback inline inside normalizeOptions rather than reusing a shared DEFAULT constant already declared in github-token-resolution.js (DEFAULT_API_URL) — worth exporting/reusing that constant to avoid the two files drifting if the default ever changes.
  • packages/loopover-miner/lib/self-review-context.js:97 parseLiveGateThresholdFields has three independent numeric-range validations inline; a small per-field helper would reduce the branch count and make future field additions (per feat(review): read-only endpoint exposing ORB's live self-tuned gate thresholds #6486) less repetitive.
  • The external brief flags packages/loopover-miner/lib/self-review-context.js as now ~438 lines (over the 400-line convention) — consider whether the live-gate-threshold probe/parse/apply functions belong in a sibling module now that this file does two distinct jobs (GitHub context reconstruction + ORB overlay).
  • Consider extracting parseLiveGateThresholdFields, applyLiveGateThresholdsToManifest, and probeLiveGateThresholds into a new lib/live-gate-thresholds.js to keep self-review-context.js focused and under the file-size convention.
  • packages/loopover-miner/lib/self-review-context.js:71 — export DEFAULT_API_URL from github-token-resolution.js and reuse it here instead of restating the literal.

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 #6562, #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 (2 linked issues).
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
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: not available
  • 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 added the manual-review Gittensor contributor context label Jul 16, 2026
@JSONbored
JSONbored merged commit 1cb09e4 into JSONbored:main Jul 16, 2026
16 checks passed
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. manual-review Gittensor contributor context

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

2 participants