Skip to content

fix(ranker): only flag default-goal-spec use when every ranked repo lacks one (#7226) - #7255

Merged
loopover-orb[bot] merged 1 commit into
JSONbored:mainfrom
xfodev:fix/ranker-default-goalspec-note-7226
Jul 19, 2026
Merged

fix(ranker): only flag default-goal-spec use when every ranked repo lacks one (#7226)#7255
loopover-orb[bot] merged 1 commit into
JSONbored:mainfrom
xfodev:fix/ranker-default-goalspec-note-7226

Conversation

@xfodev

@xfodev xfodev commented Jul 19, 2026

Copy link
Copy Markdown
Contributor

Summary

rankedUsesDefaultGoalSpec (opportunity-ranker.js) decided whether a ranked batch fell back to the
built-in default goal spec with ranked.some(repo lacks a supplied spec) — so it returned true the
moment any ranked repo lacked a per-tenant spec, even when other repos in the same batch genuinely
had one supplied and applied. discover-cli.js then printed the blanket note "ranked with the built-in
default goal spec (no per-tenant .loopover-miner.yml supplied)"
for the whole run, misreporting a
mixed batch as fully-default.

The note is only truthful when the entire batch fell back to the default, so this changes .some
to .every: usedDefaultGoalSpec is now true only when every ranked repo lacks a supplied spec. The
existing empty-batch guard (ranked.length === 0 → specRepos.length === 0) is unchanged, so .every's
vacuous-true case is never reached. All-default and all-supplied batches behave exactly as before; only
the mixed case is corrected.

Closes #7226

Scope

  • Conventional Commit title; focused (one module + one test); no site//CNAME/lovable; no new dependency.
  • Linked a currently open issue (Closes #7226).

Validation

  • git diff --check
  • npm run typecheck (root — clean)
  • npm run test:coverage on the changed module — 100% of the changed line + branches covered. New
    regression: a two-repo batch where only acme/widgets has a supplied spec (and acme/gadgets does not)
    now yields usedDefaultGoalSpec: false; it was true before the fix. Existing all-default (true) and
    all-supplied (false) cases still pass unchanged.
  • npm run build:miner (node --check passes).

If any required check was skipped, explain why:

  • Backend change confined to packages/loopover-miner/lib/** (one module + one test); CI runs the full suite.

Safety

  • No secrets, wallets, hotkeys, coldkeys, PATs, trust scores, or private data exposed.
  • Public GitHub text stays sanitized and low-noise.
  • No auth/CORS/session/API/OpenAPI/MCP surface change — a pure reporting-accuracy fix; the return type is unchanged.
  • No UI change — no UI Evidence needed.

@xfodev
xfodev requested a review from JSONbored as a code owner July 19, 2026 10:40
@superagent-security

Copy link
Copy Markdown
Contributor

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

@codecov

codecov Bot commented Jul 19, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.81%. Comparing base (92ccd34) to head (9cf52e3).
⚠️ Report is 5 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #7255   +/-   ##
=======================================
  Coverage   93.81%   93.81%           
=======================================
  Files         704      704           
  Lines       69491    69491           
  Branches    18912    18912           
=======================================
  Hits        65195    65195           
  Misses       3302     3302           
  Partials      994      994           
Flag Coverage Δ
shard-1 43.16% <100.00%> (-0.40%) ⬇️
shard-2 37.29% <100.00%> (+0.12%) ⬆️
shard-3 32.95% <100.00%> (-0.14%) ⬇️
shard-4 32.70% <100.00%> (-1.60%) ⬇️
shard-5 32.87% <0.00%> (+0.59%) ⬆️
shard-6 46.03% <0.00%> (+0.27%) ⬆️

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

Files with missing lines Coverage Δ
packages/loopover-miner/lib/opportunity-ranker.js 100.00% <100.00%> (ø)

@loopover-orb loopover-orb Bot added the gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier. label Jul 19, 2026
@loopover-orb

loopover-orb Bot commented Jul 19, 2026

Copy link
Copy Markdown
Contributor

Tip

✅ LoopOver review result - approve/merge recommended

Review updated: 2026-07-19 10:49:38 UTC

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

✅ Suggested Action - Approve/Merge

  • safe to merge

Review summary
This fixes a real logic bug: `.some()` flagged a batch as fully default-spec if any single repo lacked a supplied spec, even when other repos had one applied. Switching to `.every()` correctly requires the whole batch to lack a spec before reporting the blanket default-goal-spec note. The vacuous-true concern for `.every()` on an empty array is already guarded by the `ranked.length === 0` early return, and the added test exercises the exact mixed-batch regression scenario, with existing all-default/all-supplied tests still passing.

Nits — 2 non-blocking

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 #7226
Related work ✅ No active overlap found No same-issue or scoped active PR overlap found.
Change scope ❌ 8/20 High 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: 19 registered-repo PR(s), 9 merged, 0 issue(s).
Contributor context ✅ Confirmed Gittensor contributor xfodev; Gittensor profile; 19 PR(s), 0 issue(s).
Improvement ✅ Minor risk: clean · value: minor · LLM: minor
Linked issue satisfaction

Not yet addressed
The issue explicitly requires the summary to distinguish per-repo/count-based fallback (not a single boolean) and the CLI note to reflect partial vs. total fallback with which/how-many repos fell back, but the diff only flips `.some` to `.every`, keeping `usedDefaultGoalSpec` as one blanket boolean and leaving `discover-cli.js`'s note text/trigger completely unchanged.

Review context
  • Author: xfodev
  • Role context: outside_contributor
  • Public audience mode: oss maintainer
  • Lane context: Repository is configured for direct PR review.
  • Public profile languages: JavaScript, TypeScript
  • Official Gittensor activity: 19 PR(s), 0 issue(s).
  • PR-specific overlap: none found.
Contributor next steps
  • Start here: Add a concise scope and risk note.
  • Then work through the remaining 1 step in the Signals table above.
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 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LoopOver approves — the gate is satisfied and CI is green.

@loopover-orb
loopover-orb Bot merged commit a575ac2 into JSONbored:main Jul 19, 2026
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(ranker): don't report a blanket no-per-tenant-goal-spec note when only some ranked repos fell back to the default

1 participant