fix(miner): narrow generateReplayScoringKey's rejection type - #3294
Conversation
generateReplayScoringKey never lints or scrubs frozen context, so it can only ever reject on selection -- reusing ReplayTaskRejected advertised an unscrubbable_forward_reference branch this function can never produce. Adds a regression test pinning the documented eligibility asymmetry against generateReplayTask for the same candidate.
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
gittensory-ui | f4dd645 | Commit Preview URL Branch Preview URL |
Jul 05 2026, 01:08 AM |
|
Tip 🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩 ✅ Gittensory review result - approve/merge recommendedReview updated: 2026-07-05 01:11:19 UTC
✅ Suggested Action - Approve/Merge
Review summary Nits — 3 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 #3294 +/- ##
=======================================
Coverage 94.14% 94.14%
=======================================
Files 276 276
Lines 30246 30246
Branches 11021 11021
=======================================
Hits 28474 28474
Misses 1127 1127
Partials 645 645 🚀 New features to boost your workflow:
|
Summary
Follow-up to #3235's review nits.
generateReplayScoringKeynever lints or scrubs frozen context text, so it can only ever reject withrejected: "selection". Its return type previously reusedReplayTaskRejected, which also advertises anunscrubbable_forward_referencebranch that this function can never actually produce -- misleading callers into thinking they need to handle a case that doesn't exist. This narrows the type to a newReplayScoringKeyRejectedand adds a regression test pinning the documented eligibility asymmetry: a candidate whose frozen contextgenerateReplayTaskrejects as unscrubbable still yields a valid scoring key fromgenerateReplayScoringKey.Addresses the remaining 2 code-level nits from #3235's review; the other 2 were prose/comment-placement suggestions judged as non-actionable.
Scope
packages/gittensory-miner/lib/replay-task-generation.d.ts-- newReplayScoringKeyRejectedtype, narrowedgenerateReplayScoringKeysignaturetest/unit/miner-replay-task-generation.test.ts-- regression test for the eligibility asymmetry.js) change needed -- the implementation already only ever produces the narrower shapeValidation
npm run typechecknpx vitest run test/unit/miner-replay-task-generation.test.ts(20 passed)npm run test:ci(full local gate, green)mainSafety