Skip to content

feat(miner): wire real self-plagiarism inputs into the Governor chokepoint - #5693

Closed
lourincedaging0-commits wants to merge 1 commit into
JSONbored:mainfrom
lourincedaging0-commits:feat-governor-self-plagiarism-v2
Closed

feat(miner): wire real self-plagiarism inputs into the Governor chokepoint#5693
lourincedaging0-commits wants to merge 1 commit into
JSONbored:mainfrom
lourincedaging0-commits:feat-governor-self-plagiarism-v2

Conversation

@lourincedaging0-commits

Copy link
Copy Markdown
Contributor

Resubmit of #5689 (closed on a test-only bug — the near-duplicate regression test seeded the recent submission at 2026, after the candidate's submittedAt (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 / selfPlagiarismRecentSubmissions were caller-supplied optional fields that attempt-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_pr chokepoint call — where the handoff packet is available — compute:

Both are spread into the chokepoint input. 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.

Validation

New regression tests in test/unit/miner-attempt-runner.test.ts, on the existing runMinerAttempt harness:

  • A near-duplicate — a prior own submission whose fingerprint matches the driver's changed-files fingerprint — is denied at the self_plagiarism stage (outcome: "governed", allowed: false).
  • A genuinely distinct submission is not throttled (outcome: "submitted").
  • The seed uses the same fingerprintFromChangedFiles helper as the production path, so candidate ≡ recent by construction; the existing happy-path (empty history → not throttled) is preserved.

…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-security

Copy link
Copy Markdown
Contributor

Superagent didn't find any vulnerabilities or security issues in this PR.

@codecov

codecov Bot commented Jul 14, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 86.51%. Comparing base (21d13b2) to head (4ced543).

Files with missing lines Patch % Lines
packages/gittensory-miner/lib/attempt-runner.js 0.00% 2 Missing ⚠️

❗ There is a different number of reports uploaded between BASE (21d13b2) and HEAD (4ced543). Click for more details.

HEAD has 1 upload less than BASE
Flag BASE (21d13b2) HEAD (4ced543)
shard-2 1 0
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     
Flag Coverage Δ
shard-1 44.04% <0.00%> (-0.02%) ⬇️
shard-2 ?
shard-3 32.25% <0.00%> (-0.18%) ⬇️
shard-4 31.31% <0.00%> (-1.75%) ⬇️
shard-5 32.55% <0.00%> (+0.78%) ⬆️
shard-6 44.79% <0.00%> (+0.37%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
packages/gittensory-miner/lib/attempt-runner.js 2.50% <0.00%> (-97.50%) ⬇️

... and 106 files with indirect coverage changes

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@loopover-orb loopover-orb Bot added gittensor:feature Gittensor-scored feature linked to a feature issue — scores a 0.25x multiplier. gittensor:priority Maintainer-selected Gittensor priority — scores a 1.5x multiplier. labels Jul 14, 2026
@loopover-orb

loopover-orb Bot commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Caution

🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥

🛑 LoopOver review result - reject/close recommended

Review updated: 2026-07-14 04:33:18 UTC

2 files · 1 AI reviewer · 1 blocker · readiness 100/100 · CI failing · blocked

🛑 Suggested Action - Reject/Close

  • AI review could not be completed: The dual-model AI review did not return a usable verdict for this change.

Review summary
This PR wires real selfPlagiarismCandidate/selfPlagiarismRecentSubmissions data into the Governor chokepoint at the open_pr call site in attempt-runner.js, computing the candidate fingerprint from the handoff packet's changed files (matching recordOwnSubmission's method) and pulling recent submission history from governorState.listRecentOwnSubmissions. The logic is sound: it correctly gates on both a truthy governorState and a non-empty fingerprint, defaulting to an honest skip rather than fabricating clean history, and the two new regression tests exercise both the near-duplicate-denied and genuinely-distinct-allowed paths through the real runMinerAttempt harness. The PR explicitly notes the prior #5689 failure was a test-seed-date bug (seeded after candidate submittedAt, so the tie-break picked the wrong 'plagiarist') and fixes only the test, leaving production code unchanged — that explanation is consistent with the diff shown.

Nits — 5 non-blocking
  • fingerprintFromChangedFiles(handoffPacket.changedFiles?.map(...) ?? []) in attempt-runner.js will produce some fingerprint for an empty array unless that helper itself returns falsy/empty on empty input — worth confirming (not visible in this diff) that an empty changedFiles list can't produce a truthy fingerprint that triggers a spurious self-plagiarism check.
  • The large header-comment rewrite in attempt-runner.js is mostly documentation churn; keep it if it earns its keep by staying accurate as Wire real selfPlagiarismCandidate/selfPlagiarismRecentSubmissions into the Governor chokepoint #5676/Wire real reputationHistory into the Governor's self-reputation throttle #5675 references age out, but there's a lot of prose to maintain here.
  • Consider a unit test directly on fingerprintFromChangedFiles with an empty changed-files array to lock in the 'no candidate fingerprint => skip' behavior at the source rather than only inferring it from the runner's ternary.
  • codecov/patch is failing at 0% for this diff — even though two new regression tests are added, verify they're actually attributed to the changed lines in attempt-runner.js (e.g. path mapping / coverage config) since the diff's own logic looks well covered.
  • AI review could not be completed — The gate is held for a human reviewer rather than passed automatically; it re-evaluates on the next update.

Why this is blocked

  • Linked issue overlaps another open PR — Review the related PRs before spending reviewer time on duplicate work.
📋 Copy for AI agents — paste into your coding agent
Fix the following blocker(s) from this PR review:

1. Linked issue overlaps another open PR — Review the related PRs before spending reviewer time on duplicate work.

CI checks failing

  • validate
  • codecov/patch — 0.00% of diff hit (target 99.00%)
  • validate-tests (2)
Signal Result Evidence
Code review ❌ 1 blocker 1 reviewer
Linked issue ✅ Linked #5676
Related work ✅ No active overlap found No same-issue or scoped active PR overlap found.
Change scope ✅ 20/20 Low review scope from cached public metadata (1 linked issue).
Validation posture ✅ 25/25 PR body includes validation/test evidence.
Contributor workload ✅ 10/10 Author activity: 0 registered-repo PR(s), 0 merged, 0 issue(s).
Contributor context ❌ No public Gittensor match lourincedaging0-commits; not a blocker.
Gate result ❌ Blocking Repo-configured hard blocker found.
Improvement ✅ Minor risk: clean · value: minor — Code changes are accompanied by test evidence. LLM value judgment: moderate — The change closes a concrete gap (self-plagiarism inputs never reaching the chokepoint) with a narrowly-scoped, well-tested fix at the correct layer (handoff time, not the early snapshot) and is tied to issue #5676.
Review context
  • Author: lourincedaging0-commits
  • Role context: outside_contributor
  • Public audience mode: oss maintainer
  • Lane context: Repository is configured for direct PR review.
  • Public profile languages: HTML
  • Contributor context: Public profile only; not a blocker.
  • PR-specific overlap: none found.
Contributor next steps
  • Keep the PR focused and include validation evidence before maintainer review.
Signal definitions
  • Related work = same linked issue, overlapping active PRs, or title/path similarity.
  • Change scope = cached public metadata such as size labels, draft state, and review-burden hints.
  • Validation posture = whether the PR provides enough public validation/test evidence for maintainer review.
  • Contributor workload = public contributor activity and cleanup pressure, not a repo-wide quality failure.
  • Contributor context = public GitHub/Gittensor identity context; non-Gittensor status is not a blocker.
[BETA] Chat with Gittensory

Ask 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.

  • @gittensory ask &lt;question&gt; answers contribution-quality Q&A with source citations and freshness.
  • @gittensory chat &lt;question&gt; answers in natural prose from cached decision-pack facts via local inference (maintainer/collaborator; read-only).
  • A plain-language @gittensory mention with a real question is routed to the closest matching read-only command automatically -- no exact syntax required.

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.

  • Re-run LoopOver review

@loopover-orb

loopover-orb Bot commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

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.

@loopover-orb loopover-orb Bot closed this Jul 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gittensor:feature Gittensor-scored feature linked to a feature issue — scores a 0.25x multiplier. gittensor:priority Maintainer-selected Gittensor priority — scores a 1.5x multiplier.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Wire real selfPlagiarismCandidate/selfPlagiarismRecentSubmissions into the Governor chokepoint

1 participant