feat(miner-governor): self-plagiarism throttle across the miner's own repos - #4972
Conversation
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
|
Tip 🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩 ✅ Gittensory review result - approve/merge recommendedReview updated: 2026-07-11 06:32:41 UTC
✅ Suggested Action - Approve/Merge
Review summary Nits — 5 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 #4972 +/- ##
==========================================
+ Coverage 94.26% 94.27% +0.01%
==========================================
Files 448 449 +1
Lines 38900 38985 +85
Branches 14172 14211 +39
==========================================
+ Hits 36669 36754 +85
Misses 1574 1574
Partials 657 657
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
Closes #2345
Summary
Adds a pure
selfPlagiarismCheck()consulted beforeopen_pr, comparing a prospective PR's diff fingerprint against the miner's own recent submission history. Near-duplicates across repos are throttled using the same claim-time / earliest-wins election asisDuplicateClusterWinnerByClaim. Denials are recorded to the governor ledger with the flagged prior submission referenced.Changes
packages/gittensory-engine/src/governor/self-plagiarism.tsselfPlagiarismCheck,fingerprintSimilarity, ledger event builder, config resolverpackages/gittensory-engine/src/miner-goal-spec.tsselfPlagiarism.similarityThresholdfrom.gittensory-miner.yml(default 0.85)packages/gittensory-engine/src/index.tspackages/gittensory-miner/lib/governor-open-pr.jsevaluateOpenPrSelfPlagiarism— check + append-only ledger writepackages/gittensory-miner/docs/miner-goal-spec.mdselfPlagiarismfieldpackages/gittensory-miner/schema/miner-goal-spec.schema.jsonselfPlagiarism.gittensory-miner.yml.exampleselfPlagiarismblockself-plagiarism.test.ts,miner-governor-open-pr.test.ts, miner-goal-spec parser/doc updatesBehavior
allowedthrottled+ ledger row references matched priordenied(fail closed)denied(ambiguous election)allowed(mirrors duplicate-cluster winner election)Test plan
selfPlagiarismCheck— distinct PR passesselfPlagiarismCheck— near-duplicate across repos throttledselfPlagiarismCheck— missing/ambiguous fingerprint data fails closedselfPlagiarismCheck— earliest claimant wins among near-duplicatesbuildSelfPlagiarismGovernorLedgerEvent— references matched prior in payloadevaluateOpenPrSelfPlagiarism— persists throttled denial to governor ledgerparseMinerGoalSpec— parses and normalizesselfPlagiarism.similarityThresholdselfPlagiarismnpm run test:unit -- test/unit/self-plagiarism.test.ts test/unit/miner-governor-open-pr.test.ts test/unit/miner-goal-spec-doc.test.ts test/unit/miner-goal-spec-parser.test.tsnpm run test:ci(full gate before push)Notes
.gittensory-miner.yml→selfPlagiarism.similarityThreshold; built-in default is 0.85.near_duplicate_self_plagiarism).Test plan
npm run test:ci