feat(miner): wire real self-plagiarism inputs into the Governor chokepoint - #5693
Conversation
…point The chokepoint's self-plagiarism throttle (built + tested in the engine) never saw real data: selfPlagiarismCandidate/selfPlagiarismRecentSubmissions were caller-supplied optional fields that attempt-cli.js's early governor snapshot always left unset -- and it CAN'T set them, because the prospective submission's real changed-files fingerprint only exists once the loop reaches handoff. Compute them at the open_pr chokepoint call inside attempt-runner.js instead (late augmentation): the candidate fingerprint via fingerprintFromChangedFiles over the handoff packet's changed files (the same way JSONbored#5678's recordOwnSubmission does), plus the miner's real recent-submission history from governor-state.js's listRecentOwnSubmissions. Without a governorState to read from, or an empty fingerprint, the fields stay absent -- an honest skip of that stage, never a fabricated clean history. Out of scope: self-plagiarism.ts's similarity threshold / election logic is unchanged. Closes JSONbored#5676
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #5693 +/- ##
==========================================
- Coverage 95.02% 86.51% -8.51%
==========================================
Files 577 577
Lines 45978 45980 +2
Branches 14724 14724
==========================================
- Hits 43689 39780 -3909
- Misses 1530 4824 +3294
- Partials 759 1376 +617
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
|
Caution 🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥 🛑 LoopOver review result - reject/close recommendedReview updated: 2026-07-14 04:33:18 UTC
🛑 Suggested Action - Reject/Close
Review summary Nits — 5 non-blocking
Why this is blocked
📋 Copy for AI agents — paste into your coding agentCI checks failing
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 LoopOver, a quiet PR intelligence layer for OSS maintainers.
|
|
Gittensory is closing this pull request on the maintainer's behalf (CI is failing (validate, codecov/patch, validate-tests (2)); Linked issue overlaps another open PR; duplicate of another open PR). 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. |
Resubmit of #5689 (closed on a test-only bug — the near-duplicate regression test seeded the recent submission at
2026, after the candidate'ssubmittedAt(new Date(nowMs=10_000)→ 1970), so per self-plagiarism.ts's "later submission is the plagiarist" tie-break the candidate read as the original and wasn't throttled. Seed is now earlier than the candidate; production code unchanged.)Closes #5676.
Problem
The chokepoint's self-plagiarism throttle — built + tested in
gittensory-engine— never saw real data.selfPlagiarismCandidate/selfPlagiarismRecentSubmissionswere caller-supplied optional fields thatattempt-cli.js's single early governor snapshot always left unset — and it can't set them, because the prospective submission's real changed-files fingerprint only exists once the loop reaches handoff, well after that snapshot.Change (late augmentation in
attempt-runner.js)At the
open_prchokepoint call — where the handoff packet is available — compute:selfPlagiarismCandidate:fingerprintFromChangedFilesover the handoff packet's changed files, the same way fix(miner): wire recordOwnSubmission's write side into the real attempt pipeline #5678'srecordOwnSubmissioncomputes it (so the check and the recorded submission agree).selfPlagiarismRecentSubmissions: the miner's realgovernor-state.jslistRecentOwnSubmissions({ repoFullName }).Both are spread into the chokepoint input. Without a
governorStateto read from, or an empty fingerprint, the fields stay absent — an honest skip of that stage, never a fabricated clean history.Out of scope:
self-plagiarism.ts's similarity threshold / election logic is unchanged.Validation
New regression tests in
test/unit/miner-attempt-runner.test.ts, on the existingrunMinerAttemptharness:self_plagiarismstage (outcome: "governed",allowed: false).outcome: "submitted").fingerprintFromChangedFileshelper as the production path, so candidate ≡ recent by construction; the existing happy-path (empty history → not throttled) is preserved.