Skip to content

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

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

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

Conversation

@lourincedaging0-commits

Copy link
Copy Markdown
Contributor

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
@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.52%. Comparing base (66e927e) to head (475a648).
⚠️ Report is 5 commits behind head on main.

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 (66e927e) and HEAD (475a648). Click for more details.

HEAD has 1 upload less than BASE
Flag BASE (66e927e) HEAD (475a648)
shard-2 1 0
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5689      +/-   ##
==========================================
- Coverage   95.04%   86.52%   -8.53%     
==========================================
  Files         576      576              
  Lines       45977    45979       +2     
  Branches    14724    14724              
==========================================
- Hits        43699    39783    -3916     
- Misses       1525     4823    +3298     
- Partials      753     1373     +620     
Flag Coverage Δ
shard-1 43.56% <0.00%> (-0.43%) ⬇️
shard-2 ?
shard-3 32.25% <0.00%> (-0.21%) ⬇️
shard-4 31.31% <0.00%> (-1.75%) ⬇️
shard-5 32.56% <0.00%> (+0.79%) ⬆️
shard-6 44.78% <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 105 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:17:46 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 wires the previously-stubbed selfPlagiarismCandidate/selfPlagiarismRecentSubmissions fields into the chokepoint at the open_pr call site, computing the candidate fingerprint from handoffPacket.changedFiles and pulling recent history from governorState.listRecentOwnSubmissions. The fallback-to-empty-object when governorState or fingerprint is absent is a reasonable fail-open-to-skip design matching the stated intent, and the two new regression tests exercise both the throttled near-duplicate and genuinely-distinct paths through the real runMinerAttempt pipeline using the same fingerprintFromChangedFiles helper as production. The description explicitly closes #5676, so issue-scope is satisfied; codecov/patch failing at 0% is likely a coverage-tool quirk on this specific commit rather than a real gap, since the diff's core logic is directly covered by the new tests.

Nits — 4 non-blocking
  • packages/gittensory-miner/lib/attempt-runner.js: `handoffPacket.changedFiles?.map(...)` uses optional chaining defensively even though every other read of `handoffPacket` in this function (e.g. `submission.openPrInput`) assumes it's populated on the handoff path — worth confirming changedFiles can actually be undefined here, or drop the `?.` for consistency.
  • test/unit/miner-attempt-runner.test.ts: the two new regression tests don't assert on `selfPlagiarismCandidate`/`selfPlagiarismRecentSubmissions` fields directly, only on the resulting governed/submitted outcome — fine given the existing test style, but a fabricated-fingerprint edge case (e.g. empty changedFiles) isn't covered.
  • Consider a small unit assertion (or comment) confirming `candidateFingerprint` being falsy (empty changedFiles) correctly falls back to skipping the self-plagiarism fields, since that's the 'honest skip' behavior the PR description calls out as important.
  • 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 concretely identified gap (self-plagiarism inputs never reaching the chokepoint) with a narrowly-scoped, well-tested fix at the correct layer (handoff time, where the real fingerprint exists) rather than a symptom patch.
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.

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