Skip to content

fix(engine): align computeMinerGoalLaneFit's no-preference score with computeLaneFit - #9006

Merged
loopover-orb[bot] merged 1 commit into
JSONbored:mainfrom
nghetien:fix/issue-8870-a2-fix-engine
Jul 26, 2026
Merged

fix(engine): align computeMinerGoalLaneFit's no-preference score with computeLaneFit#9006
loopover-orb[bot] merged 1 commit into
JSONbored:mainfrom
nghetien:fix/issue-8870-a2-fix-engine

Conversation

@nghetien

Copy link
Copy Markdown
Contributor

Closes #8870

computeMinerGoalLaneFit and computeLaneFit disagreed on what "no preference configured" should score: computeLaneFit's rule 2 returns the neutral 0.5 when neither wantedPaths nor preferredLabels is set, but computeMinerGoalLaneFit's label-only equivalent returned 1 for an unconfigured preferredLabels — a silent 2x divergence that skewed issue-ranking for autonomous targeting toward repos with no configured label preference at all.

Aligned computeMinerGoalLaneFit's no-preference branch to return 0.5 and added a doc comment cross-referencing computeLaneFit's rule so the two scorers stay in sync going forward. Updated the direct unit-test assertions in both packages/loopover-engine/test/miner-goal-lane-fit.test.ts and test/unit/miner-goal-lane-fit.test.ts to expect 0.5.

This neutral-score change flows into buildMetadataRankInput's composite rankScore, so two existing threshold-based tests (test/unit/metadata-min-score.test.ts, test/unit/metadata-top-min-score.test.ts) that relied on unconfigured-label candidates scoring a full 1 needed their fixed thresholds recalibrated from 0.1 to 0.05 — the filtered/ordered issue-number expectations are unchanged, only the threshold value that was tuned against the old (incorrect) neutral score.

No UI files touched — this is a pure src//test/ scoring-logic change with no visible output, so no screenshot evidence applies.

Validation

  • npx turbo run build --filter=@loopover/engine && npx turbo run build --filter=@loopover/mcp && npx turbo run build:tsc build:verify --filter=@loopover/miner — green
  • npx vitest run --changed=upstream/main --passWithNoTests — 110 files / 1754 tests passed
  • npm test — 1177 files / 22009 tests passed (one pre-existing, unrelated environmental failure in check-ui-kit-package.test.ts, resolved by running npm run build --workspace @loopover/ui-kit first)

Residuals

None — the issue's full scope (align the value, update tests, keep coverage on the changed branch) is covered in this PR.

… computeLaneFit

computeMinerGoalLaneFit returned 1 for the "no preferredLabels configured"
case while computeLaneFit's equivalent "no preference configured" rule
returns the neutral 0.5, an unexplained 2x scoring divergence between the
two lane-fit scorers. Align the label-only scorer to the same 0.5 neutral
default and update its rank-score-dependent test fixtures accordingly.
@nghetien
nghetien requested a review from JSONbored as a code owner July 26, 2026 15:47
@superagent-security

Copy link
Copy Markdown
Contributor

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

@codecov

codecov Bot commented Jul 26, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.87%. Comparing base (f32e140) to head (f036478).
⚠️ Report is 10 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #9006      +/-   ##
==========================================
+ Coverage   90.56%   93.87%   +3.31%     
==========================================
  Files          96      807     +711     
  Lines       22490    80465   +57975     
  Branches     3884    24397   +20513     
==========================================
+ Hits        20367    75537   +55170     
- Misses       1945     3560    +1615     
- Partials      178     1368    +1190     
Flag Coverage Δ
backend 95.16% <100.00%> (?)

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

Files with missing lines Coverage Δ
...ackages/loopover-engine/src/miner-goal-lane-fit.ts 90.90% <100.00%> (ø)

... and 710 files with indirect coverage changes

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

loopover-orb Bot commented Jul 26, 2026

Copy link
Copy Markdown
Contributor

Tip

✅ LoopOver review result - approve/merge recommended

Review updated: 2026-07-26 16:05:57 UTC

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

✅ Suggested Action - Approve/Merge

  • safe to merge

Review summary
The AI review returned non-blocking notes for this change but did not include a separate narrative summary. Review the nits below before deciding this PR.

Nits — 1 non-blocking
  • packages/loopover-engine/src/miner-goal-lane-fit.ts:43 — the neutral 0.5 is a duplicated magic number relative to computeLaneFit's own 0.5; a shared exported constant would make the cross-reference enforceable rather than just documented.

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 #8870
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: 4 registered-repo PR(s), 1 merged, 0 issue(s).
Contributor context ✅ Confirmed Gittensor contributor nghetien; Gittensor profile; 4 PR(s), 0 issue(s).
Improvement ✅ Minor risk: clean · value: minor
Linked issue satisfaction

Addressed
The PR changes computeMinerGoalLaneFit's no-preference branch to return 0.5, adds a cross-referenced doc comment to computeLaneFit's rule, and updates the assertions in test/miner-goal-lane-fit.test.ts:12 (and the unit test variant) to expect 0.5, matching the issue's requested alignment.

Review context
  • Author: nghetien
  • Role context: outside_contributor
  • Public audience mode: oss maintainer
  • Lane context: Repository is configured for direct PR review.
  • Public profile languages: Dart, JavaScript, Python, CSS, C#, C++, TypeScript
  • Official Gittensor activity: 4 PR(s), 0 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 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.

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(engine): computeMinerGoalLaneFit and computeLaneFit disagree on the "no preference configured" neutral score

1 participant