Skip to content

feat(engine): add bestRankedOpportunity - #3368

Merged
JSONbored merged 1 commit into
JSONbored:mainfrom
kiannidev:feat/engine-best-ranked-opportunity
Jul 5, 2026
Merged

feat(engine): add bestRankedOpportunity#3368
JSONbored merged 1 commit into
JSONbored:mainfrom
kiannidev:feat/engine-best-ranked-opportunity

Conversation

@kiannidev

Copy link
Copy Markdown
Contributor

Summary

  • Add bestRankedOpportunity in @jsonbored/gittensory-engine — returns the highest-scoring generic ranked candidate or null when the list is empty.
  • Thin wrapper over rankOpportunities for miner discovery flows that only need a single pick.
  • Vitest coverage at 100% patch on the new helper.

Test plan

  • COVERAGE_NO_THRESHOLDS=1 npx vitest run test/unit/ranked-opportunity-best-pick.test.ts --coverage
  • npx diff-cover coverage/lcov.info --compare-branch=main --fail-under=99 → 100%
  • npm run build --workspace @jsonbored/gittensory-engine && npm run build:miner

Made with Cursor

Return the top-scoring generic ranked candidate in one call for miner discovery flows that only need a single pick.

Co-authored-by: Cursor <cursoragent@cursor.com>
@kiannidev
kiannidev requested a review from JSONbored as a code owner July 5, 2026 05:11
@superagent-security

Copy link
Copy Markdown
Contributor

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

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

loopover-orb Bot commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

Warning

🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨

⏸️ Gittensory review result - manual review recommended

Review updated: 2026-07-05 05:13:20 UTC

3 files · 1 AI reviewer · no blockers · readiness 55/100 · CI pending · blocked

⏸️ Suggested Action - Manual Review

Review summary
This adds a narrow `bestRankedOpportunity` helper that delegates scoring and tie behavior to the existing `rankOpportunities` implementation, then exposes it through the engine barrel. The tests cover the empty case, winner selection, tie preservation, and barrel export, so the visible change is coherent and low risk.

Nits — 3 non-blocking
  • nit: packages/gittensory-engine/src/ranked-opportunity-best-pick.ts:8 repeats the full projected return type instead of reusing the existing helper’s output type, which makes this wrapper easier to drift if `rankOpportunities` changes its shape.
  • packages/gittensory-engine/src/ranked-opportunity-best-pick.ts:8 could use `ReturnType<typeof rankOpportunities<T>>[number] | null` or a shared exported result type from `opportunity-ranker.ts` if one already exists, so this thin wrapper stays mechanically tied to the delegated function.
  • Readiness score is below the configured threshold — Use the readiness panel as advisory maintainer context; the score does not block this PR.
Signal Result Evidence
Code review ✅ No blockers 1 reviewer
Linked issue ⚠️ Missing No linked issue or no-issue rationale found.
Related work ⚠️ 1 scoped overlap Top overlaps are listed below; lower-confidence bulk is hidden.
Change scope ❌ 8/20 High review scope from cached public metadata (no linked issue context).
Validation posture ❌ 5/25 Preflight is holding this PR: the review lane is unavailable, so it is not ready for automated review.
Contributor workload ✅ 10/10 Author activity: 1334 registered-repo PR(s), 648 merged, 49 issue(s).
Contributor context ✅ Confirmed Gittensor contributor kiannidev; Gittensor profile; 1334 PR(s), 49 issue(s).
Gate result ✅ Passing No configured blocker found.
Review context
  • Author: kiannidev
  • Role context: outside_contributor
  • Public audience mode: oss maintainer
  • Lane context: Repository registration is not available in the local Gittensory cache.
  • Public profile languages: TypeScript, MDX, C++, HTML, Rust
  • Official Gittensor activity: 1334 PR(s), 49 issue(s).
  • Related work: Titles/paths share 8 meaningful terms. (issue #2276, issue #2287)
Contributor next steps
  • Explain no-issue PR.
  • Review top overlaps.
  • Add a concise scope and risk note.
  • Await review-lane availability.
  • Refresh registry data or choose a registered active repo.
  • Link the issue being solved, or explicitly explain why this is a no-issue PR.
  • Check active issues and PRs before submitting.
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.

🟩 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 Gittensory, a quiet PR intelligence layer for OSS maintainers.

  • Re-run Gittensory review

@codecov

codecov Bot commented Jul 5, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.89%. Comparing base (3fb2d1b) to head (4d9fb50).
⚠️ Report is 7 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3368   +/-   ##
=======================================
  Coverage   93.88%   93.89%           
=======================================
  Files         283      284    +1     
  Lines       30572    30574    +2     
  Branches    11137    11138    +1     
=======================================
+ Hits        28704    28706    +2     
  Misses       1211     1211           
  Partials      657      657           
Files with missing lines Coverage Δ
...tensory-engine/src/ranked-opportunity-best-pick.ts 100.00% <100.00%> (ø)
🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@JSONbored
JSONbored merged commit 39e9377 into JSONbored:main Jul 5, 2026
9 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

Development

Successfully merging this pull request may close these issues.

2 participants