feat(miner-foundation): extract reward-risk scoring into gittensory-engine (#2281) - #3933
Conversation
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
…ngine (JSONbored#2281) Move the reward/risk reasoning signals into packages/gittensory-engine/src/reward-risk.ts so the gittensory-miner can rank candidate work locally with the same logic the maintainer-side gate computes. Closes JSONbored#2281.
870a4ce to
e468fb1
Compare
|
Caution 🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥 🛑 Gittensory review result - fixes requiredReview updated: 2026-07-07 07:17:51 UTC
🛑 Suggested Action - Fix Blockers
Review summary Nits — 2 non-blocking
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.
|
Codecov Report❌ Patch coverage is
❌ Your patch check has failed because the patch coverage (97.26%) is below the target coverage (99.00%). You can increase the patch coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## main #3933 +/- ##
=======================================
Coverage 93.66% 93.66%
=======================================
Files 372 373 +1
Lines 34859 34864 +5
Branches 12746 12746
=======================================
+ Hits 32652 32657 +5
Misses 1588 1588
Partials 619 619
🚀 New features to boost your workflow:
|
|
Gittensory is closing this pull request on the maintainer's behalf (CI is failing (codecov/patch)). 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
Extracts the deterministic reward/risk reasoning signals out of
src/signals/reward-risk.tsintopackages/gittensory-engine/src/reward-risk.ts, so the gittensory-miner can rank candidate work locally with the same logic the maintainer-side gate computes. MovesbuildRepoRewardRisk,buildContributorRewardRiskStrategy,buildMaintainerNoiseReport,buildPullRequestReviewability,rewardRiskFreshnessInternals, and every public type, and re-exports them from the engine barrel.src/signals/reward-risk.tsbecomes a shim that imports the engine implementation via its relative source path (../../packages/gittensory-engine/src/reward-risk.js) — matching the merged #2276/#2278/#2282 style, not the published@jsonbored/gittensory-enginespecifier — so no tsconfig path, vitest alias, or root dependency is introduced.Closes #2281.
Why a wrapping shim instead of a pure re-export
Unlike the earlier self-contained extractions, reward-risk sits on top of the maintainer signal stack in
src/signals/engine.ts(buildRoleContext,buildLaneAdvice,buildCollisionReport,buildQueueHealth,buildRepoFitRecommendation,buildContributorIntakeHealth,buildPullRequestReviewIntelligence) plusisFailingCheckSummaryfromsrc/signals/local-branch.ts. Those builders are not extracted yet and are far too large to port under the size cap, and the engine package must never import fromsrc/. So the engine module takes them as an injectedRewardRiskEngineDeps, and the shim binds the realsrcbuilders and threads them in — every existing importer keeps calling the four builders with their original signatures. Once those builders gain engine homes, a follow-up can drop the injection and collapse the shim back to a plain re-export.The injected builders bind with no casts: their argument records are wider than (assignable to) the engine's mirror types, and their richer return types are covariantly assignable to the narrowed views the module actually reads. The engine-side types live in
packages/gittensory-engine/src/types/reward-risk-types.ts(hand-kept mirrors, same pattern aspredicted-gate-types.ts); the record mirrors are full verbatim copies because the reward-risk tests build those records as inline object literals. The real runtime objects pass straight through the injected builders, so behavior is identical to the pre-extraction file.Size note
+1435 / -906 across 4 files, but ~906 of the insertions are the verbatim relocation of the existing module (offset by the deletions in
src/); the genuinely new code is the ~360-line type mirror plus the DI plumbing and the shim. The file count (4) is well under the 10-file guidance.Test plan
npm run typecheck(exit 0) — and again withpackages/gittensory-engine/dist/moved aside (resolves via source, not a stale build)npx vitest runreward-risk-freshness / reward-risk-reports / maintainer-noise / signals-v2 / signals-coverage (127 tests, unmodified)npm run test:coverage(full suite green; shim 100%, engine module 99.45% line)npm run ui:typecheck,npm run ui:lint(0 errors),npm run ui:test(71)npm run rees:test(1186)git diff --checkclean