feat(engine): add rankOpportunitiesAtOrAboveScore helper#3334
Conversation
Filter ranked discovery candidates by a minimum score threshold with finite-only input validation and stable rankOpportunities ordering. Co-authored-by: Cursor <cursoragent@cursor.com>
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
|
Warning 🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨 ⏸️ Gittensory review result - manual review recommendedReview updated: 2026-07-05 03:50:16 UTC
⏸️ Suggested Action - Manual Review Review summary Nits — 5 non-blocking
Review context
Contributor next steps
Signal definitions
🟩 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.
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3334 +/- ##
=======================================
Coverage 93.87% 93.88%
=======================================
Files 277 278 +1
Lines 30522 30526 +4
Branches 11114 11116 +2
=======================================
+ Hits 28654 28658 +4
Misses 1211 1211
Partials 657 657
🚀 New features to boost your workflow:
|
Summary
rankOpportunitiesAtOrAboveScore(candidates, minScore)to@jsonbored/gittensory-engine: ranks withrankOpportunities, then keeps only entries whoserankScoremeets the threshold.[0, 1]before filtering.ranked-opportunity-min-score.tsand exported from the package barrel.Why no linked issue
Complements the merged ranker helpers (
pickTopRankedOpportunities, pendingpickTopMetadataOpportunities) — miners/tools can drop low-score discovery noise without reimplementing rank ordering or threshold sanitization.Conflict avoidance
Touches only
packages/gittensory-engine/src/ranked-opportunity-min-score.ts(new file),packages/gittensory-engine/src/index.ts(one export line after the ranker block), andtest/unit/opportunity-ranker.test.ts. Does not overlap open PRs (#3331 metadata-top-pick, #3314 miner CLI, #3322/#3332/#3333 enrichment, #3315/#3255 queue, #3316 signals, #3304 review holds, grafana/docs).Codecov patch
Vitest covers every branch (threshold filter, zero/one/clamped thresholds, non-finite input, empty candidates, barrel export). Local
diff-coverreports 100% patch coverage onranked-opportunity-min-score.ts.Test plan
npm run build --workspace @jsonbored/gittensory-enginenpm run build:minernpx vitest run test/unit/opportunity-ranker.test.ts(58 tests)diff-cover coverage/lcov.info --compare-branch=main --fail-under=99→ 100%