feat(miner-foundation): extract scoring preview/model into gittensory-engine (#2282)#3849
Conversation
…-engine
Ports the deterministic parts of src/scoring/{preview,model,pending-pr-scenarios}.ts
into packages/gittensory-engine/src/scoring/, giving the miner the same
score-preview machinery the gittensory_preview_local_pr_score MCP tool already
calls server-side, so a miner can preview its own PR score fully locally (JSONbored#2282).
The D1/GitHub-fetching halves of model.ts and pending-pr-scenarios.ts stay in
src/, which now imports its pure constants/classifiers back from the engine;
those functions have no use to a local miner (no D1/App-token access) and
depend on Cloudflare-specific bindings the engine package's isolated tsconfig
cannot resolve. src/scoring/preview.ts is now a full re-export shim since the
whole file was already side-effect-free. Every existing scoring test suite
passes unmodified against the new shims.
…ored#2282) Add barrel, branch-eligibility, wildcard, draft, and timestamp edge-case tests so the scoring engine extraction meets the 99% patch coverage gate. Co-authored-by: Cursor <cursoragent@cursor.com>
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3849 +/- ##
==========================================
+ Coverage 93.47% 93.49% +0.02%
==========================================
Files 332 334 +2
Lines 33110 33125 +15
Branches 12116 12121 +5
==========================================
+ Hits 30948 30971 +23
+ Misses 1530 1528 -2
+ Partials 632 626 -6
🚀 New features to boost your workflow:
|
|
Warning 🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨 ⏸️ Gittensory review result - manual review recommendedReview updated: 2026-07-06 16:45:06 UTC
⏸️ Suggested Action - Manual Review
Review summary Nits — 6 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.
|
Summary
src/scoring/preview.ts,model.ts, andpending-pr-scenarios.tsintopackages/gittensory-engine/src/scoring/with thinsrc/scoring/*re-export shims so existing imports and tests stay unchanged.scoringPreview,scoringModel,scoringPendingPrScenarios) and adds./scoring/*package subpath exports for the miner.**/label globs, branch-eligibility failure branches, draft PR detection, and missing review/check map paths so patch coverage meets the 99% codecov gate.Fixes #2282
Test plan
npm run typechecknpm run test:coverage(project thresholds pass; engine scoring modules at 100% line/branch coverage)validate-code+codecov/patchMade with Cursor