fix(review): velocity-aware exception in the unlinked-issue-match escalation for machine-cadence (miner) authors#4543
Conversation
…alation for machine-cadence (miner) authors The repeat-escalation path was calibrated for human abuse cadence: a confirmed repeat by the same author within 90 days, correlated across every repo in the install, straight-closes on the theory that a human is unlikely to repeat the exact same "forgot to link the issue" mistake twice in that window. A systematic bug in a miner's own PR-body template could recur within hours rather than months, converting one tooling bug into cross-repo closure of otherwise- correct, properly-targeted work. Adds a velocity exception gated on CONFIRMED official-miner identity, not on speed alone: a repeat within the last hour from a verified Gittensor miner holds again (with a distinct message) instead of closing, while an unverified account repeating just as fast still escalates to close exactly as before -- fast-and-unverified is the MORE suspicious case, not less, so leniency only applies where an independent identity check backs it. Fixes #4512
|
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 #4543 +/- ##
==========================================
- Coverage 94.04% 94.04% -0.01%
==========================================
Files 422 422
Lines 37600 37617 +17
Branches 13736 13740 +4
==========================================
+ Hits 35362 35376 +14
- Misses 1583 1586 +3
Partials 655 655
🚀 New features to boost your workflow:
|
|
Tip 🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩 ✅ Gittensory review result - approve/merge recommendedReview updated: 2026-07-10 00:46:50 UTC
✅ Suggested Action - Approve/Merge
Review summary Nits — 6 non-blocking
Linked issue satisfactionPartially addressed 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
resolveUnlinkedIssueMatchDisposition's repeat-escalation (a confirmed unlinked-issue match by the same author, correlated across every repo in the install within a 90-day window) straight-closes on a SECOND occurrence, calibrated for human abuse cadence — a genuine tooling bug in a miner's own PR-body template could recur within hours, converting one bug into a cross-repo close of otherwise-correct work.isConfirmedOfficialMinercached lookup, independent of processors.ts's version to avoid a circular import): a repeat within the last hour from a verified miner holds again (distinct message) instead of closing. An unverified account repeating just as fast still escalates to close exactly as before — deliberately NOT a blanket "fast repeats are fine" loophole, since a fast-and-unverified repeat is the more suspicious case, not less.mostRecentAuditEventForOtherTarget(timestamp-returning sibling of the existinghasRecentAuditEventForOtherTarget) since the velocity check needs to know how recently the prior match happened, not just whether one exists.Test plan
test/unit/unlinked-issue-guardrail.test.ts— 7 new tests: velocity exception holds within the window, still closes once the gap exceeds it, does NOT apply to an unconfirmed/not-found author, does NOT apply when the Gittensor API itself is unavailable (fail-safe), a third same-miner match hits the detection cache instead of re-fetching, and both cache-read/cache-write failure paths fail safeunlinked-issue-guardrail.tsnpx tsc --noEmitclean (one pre-existing, unrelated error inminer-opportunity-ranker.test.tsfrom upstream drift, not touched by this PR)Fixes #4512