fix(miner-governor): disambiguate self-plagiarism ties#5104
Conversation
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
gittensory-ui | 4b6e495 | Commit Preview URL Branch Preview URL |
Jul 12 2026, 08:35 AM |
|
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 #5104 +/- ##
=======================================
Coverage 94.34% 94.34%
=======================================
Files 473 473
Lines 39928 39949 +21
Branches 14557 14564 +7
=======================================
+ Hits 37670 37691 +21
Misses 1583 1583
Partials 675 675
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
|
Warning 🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨 ⏸️ Gittensory review result - manual review recommendedReview updated: 2026-07-12 08:40:17 UTC
⏸️ Suggested Action - Manual Review
Review summary Nits — 5 non-blocking
Concerns raised — review before merging
Review context
Contributor next steps
Signal definitions
[BETA] Chat with GittensoryAsk Gittensory a question about this PR directly in a comment — grounded only in the same cached, public-safe facts shown above, never a new claim.
Full command reference: https://gittensory.aethereal.dev/docs/gittensory-commands 🟩 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.
|
Replaces reuse of the same-repo duplicate-winner.ts helper (compares repo-scoped PR/issue numbers only) with a self-contained cross-repo election ordered by submittedAt, then repo-scoped number, then normalized repoFullName as a final deterministic tiebreaker -- PR/issue numbers collide across repos, so the old helper could produce multiple winners on a timestamp tie. Also drops resolveSelfPlagiarismWinner's redundant leading outright-winner check: its only call site (selfPlagiarismCheck) already performs that same check and only calls this helper when it returned false, so the check was unreachable.
e9ec9c7 to
4b6e495
Compare
Motivation
Description
submittedAt, then by repo-scoped PR/issue number, and finally by normalizedrepoFullNameas a deterministic tie-breaker, and fail-closed when tie-breaker data is ambiguous (packages/gittensory-engine/src/governor/self-plagiarism.ts).submissionNumber,repoTieBreaker,submissionPrecedesSibling,isSelfPlagiarismClusterWinner, andresolveSelfPlagiarismWinnerand wireselfPlagiarismCheckto use them instead of the same-repo helper.test/unit/self-plagiarism.test.ts).cf-typegen/typegen checks remain current (worker-configuration.d.ts).Testing
npx vitest run test/unit/self-plagiarism.test.tsand the unit suite for that file passed (all tests in that file succeeded).npm run typecheckwhich completed successfully with no TypeScript errors.npm run cf-typegen:checkandnpm run test --workspace @jsonbored/gittensory-engine, both of which completed successfully.npm run test:ci; the broader workspace run was exercised but the run was not completed end-to-end here due to unrelated failures in other test shards (queue-5reported failures) and the coverage job was terminated during debugging.npm audit --audit-level=moderatewas attempted and failed due to the registry audit endpoint returning403 Forbidden(environmental, not related to the change).Codex Task