fix(miner): wire recordOwnSubmission's write side into the real attempt pipeline - #5678
Conversation
…pt pipeline governor-state.js's recordOwnSubmission/listRecentOwnSubmissions store existed with a real schema and tested store methods, but nothing ever called the write side -- meaning listRecentOwnSubmissions always returned empty in production, silently making resolveOwnRejectionHistory's own-rejection-history trigger a no-op despite passing its unit tests (which inject fake data). This records a real fingerprint (gittensory-engine's new fingerprintFromChangedFiles, over the loop's own real handoff-packet changed-files set) and real PR number on every real "submitted" outcome, so the next attempt on a repo has real history to check. See follow-up issues #5675, #5676, and #5677 for the reputationHistory/ selfPlagiarismCandidate chokepoint wiring and loop-cli.js's convergence-history dedup this unblocks.
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
loopover-ui | 1ee5f65 | Commit Preview URL Branch Preview URL |
Jul 14 2026, 01:15 AM |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #5678 +/- ##
=======================================
Coverage 95.04% 95.04%
=======================================
Files 577 577
Lines 45987 45998 +11
Branches 14708 14708
=======================================
+ Hits 43707 43720 +13
+ Misses 1527 1525 -2
Partials 753 753
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
|
Warning 🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨 ⏸️ LoopOver review result - manual review recommendedReview updated: 2026-07-14 01:44:23 UTC
⏸️ Suggested Action - Manual Review Review summary Nits — 5 non-blocking
Concerns raised — review before merging
📋 Copy for AI agents — paste into your coding agent
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.
|
…utation throttle (#5685) buildAttemptGovernorContext always left governor.reputationHistory undefined, so the chokepoint's self-reputation throttle (already built + tested in the engine) never saw a real track record and was silently skipped. Now that #5678 landed the recordOwnSubmission write path, wire the real data: - WRITE: on a resolved terminal PR outcome (loop-cli.js's disposition poll), update governor-state.js's reputation history -- decided always increments, unfavorable only on a closed-without-merge (rejection-state-machine.js's isRejectedPr, matching #5655's own-rejection classification). - READ: attempt-cli.js reads the per-repo loadReputationHistory and passes it into buildAttemptGovernorContext, which forwards it into the chokepoint context -- the same optional-parameter-with-honest-fallback pattern convergenceInput uses (#5654). Omitted stays an honest absence (the throttle stage is skipped), never a fabricated clean history. Out of scope: reputation-throttle.ts's calculator/thresholds are unchanged. Closes #5675
Summary
While researching what maintainer-only work would get AMS closer to a genuinely validated end-to-end release, I found that
governor-state.js'srecordOwnSubmission/listRecentOwnSubmissionsstore has a real schema and tested store methods, but nothing in the real pipeline ever called the write side. That meanslistRecentOwnSubmissionsalways returns empty in production, which silently makesresolveOwnRejectionHistory(#5655's own-rejection-history trigger, merged via #5657) a no-op — it passes its own unit tests because those inject fake submission data, but a real deployment never has any real history to check.attempt-cli.jsnow callsrecordOwnSubmissionon every real "submitted" outcome, with:fingerprint, computed by a newfingerprintFromChangedFileshelper (gittensory-engine'sself-plagiarism.ts) over the loop's own realhandoffPacket.changedFiles— sorted, deduped, comma-joined so it feedsfingerprintSimilarity's own token-set contract correctlyparsePrNumberFromExecResultresult the claim-conflict check already computes)recordOwnSubmissionfailure never fails an otherwise-successful attempt, mirroring the existingattempt_outcome_summarywrite's own non-fatal handling.This also unblocks two of the Governor's other documented-but-inactive defense layers (
reputationHistory,selfPlagiarismCandidate/selfPlagiarismRecentSubmissions— both explicitly gated as optional/skip-when-absent inchokepoint.ts, and both currently always-absent for the same underlying reason), and a related durability gap inloop-cli.js's own in-memory convergence tracking. I've filed those as separate, appropriately-scoped follow-ups rather than bundling them here:reputationHistoryinto the self-reputation throttleselfPlagiarismCandidate/selfPlagiarismRecentSubmissionsinto the chokepointloop-cli.jsinstead of an in-memory MapTest plan
packages/gittensory-enginenode:test suite (543/543 pass) — newfingerprintFromChangedFilescoverage: sort/dedupe/order-independence/empty-input/blank-entry/Jaccard-integrationtest/unit/self-plagiarism.test.ts)test/unit/miner-attempt-cli.test.ts(57/57 pass) — records with a real fingerprint+PR number, skips on no changed files, records with a null PR number when unrecoverable, never fails the attempt on arecordOwnSubmissionthrow, skips on a non-submitted outcome, and exercises the real (non-DI)recordOwnSubmissiondefault against an isolated tmp storenpm run test:cigreennpm run test:coverage(unsharded) — 100% branch coverage on every new/changed line, verified directly against lcov.info (including the?? recordOwnSubmissionfallback branch, which needed its own dedicated test)npm run typecheck,npm run build:miner,npm run test:miner-pack,npm audit --audit-level=moderateall clean