feat(engine): add pickTopRankedOpportunities ranker helper#3326
feat(engine): add pickTopRankedOpportunities ranker helper#3326kiannidev wants to merge 1 commit into
Conversation
Expose a pure top-N wrapper over rankOpportunities so miners and tools can cap discovery output without reimplementing ordering or tie-breaks. Co-authored-by: Cursor <cursoragent@cursor.com>
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
|
|
Caution 🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥 🛑 Gittensory review result - reject/close recommendedReview updated: 2026-07-05 02:47:43 UTC
🛑 Suggested Action - Reject/Close
Review summary Blockers
Nits — 5 non-blocking
Why this is blocked
CI checks failing
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.
|
|
Gittensory is closing this pull request on the maintainer's behalf (CI is failing (validate, validate-code); AI reviewers agree on a likely critical defect: test/unit/opportunity-ranker.test.ts:5 still references OpportunityRankInput after the import on test/unit/opportunity-ranker.test.ts:2 dropped it, which breaks TypeScript validation; restore the type import, e.g. ```ts import { rankOpportunityScore, rankOpportunities, pickTopRankedOpportunities, type OpportunityRankInput, } from "../../packages/gittensory-engine/src/opportunity-ranker"; ```). This is an automated maintenance action — to pursue this change, please open a new pull request with the issues resolved. Closed PRs may be analyzed later to improve review accuracy, but they are not automatically reopened or re-reviewed. |
Summary
pickTopRankedOpportunities(candidates, limit)to@jsonbored/gittensory-engine: ranks with the existingrankOpportunitiesordering/tie-break rules, then returns the top N entries.limitis truncated to a non-negative integer.Why no linked issue
Small, self-contained engine helper — avoids every caller re-slicing
rankOpportunitiesand duplicating limit sanitization. Pure data path; no CLI or hosted review wiring.Conflict avoidance
Touches only
packages/gittensory-engine/src/opportunity-ranker.ts,packages/gittensory-engine/src/index.ts(ranker export block), and ranker tests. Does not overlap open PRs touching miner CLI (#3314), enrichment analyzers (#3322–#3324),src/queue/processors(#3255, #3288, #3315), signals (#3316), linear adapter (#3290), or docs/grafana.Codecov patch
Vitest exercises every new branch (top-N slice, empty input, zero/negative/non-finite limits, tie-break preservation, barrel export). Local
diff-coverreports 100% patch coverage on the ranker diff.Test plan
npm run build --workspace @jsonbored/gittensory-enginenpm run build:minernpx vitest run test/unit/opportunity-ranker.test.ts(52 tests)diff-cover coverage/lcov.info --compare-branch=main --fail-under=99→ 100%Made with Cursor