feat(miner-hands): resolve the own-rejection-history trigger of rejectionSignaled - #5657
Conversation
…tionSignaled Close the second, long-documented trigger of rejectionSignaled (JSONbored#5655): whether a prior submission from this same miner on this exact repo was already closed/rejected. resolveRejectionSignaled previously resolved only the first trigger (a live AI-usage-policy ban) and this file's own header documented the second as a deliberate gap. Add resolveOwnRejectionHistory(repoFullName, options): reads this miner's own recorded submissions on the repo (governor-state.js's listRecentOwnSubmissions, JSONbored#5134), fetches each one's live GitHub PR state, and runs it through rejection-state-machine.js's resolveRejection (JSONbored#4278) -- true if ANY was closed without merge. Consumes both upstream modules without modifying either. - Bounded: only the most recent maxRejectionHistoryChecks (default 10) submissions with a real PR number are fetched -- no unbounded fan-out. - Fail-open: a wholesale failure to read submissions resolves to false (never fabricated as a rejection); any single PR fetch/parse failure is skipped so it never blocks the others. - resolveRejectionSignaled now returns true if EITHER trigger fires, so rejectionSignaled finally matches iterate-policy.ts's doc comment. Covered by test/unit/miner-rejection-signal.test.ts: real-rejection detected, no-prior-submissions (no fetch), bounded fetch count, fail-open (individual + wholesale), and combined-trigger (either alone suffices). Closes JSONbored#5655
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
|
Tip 🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩 ✅ LoopOver review result - approve/merge recommendedReview updated: 2026-07-13 21:36:33 UTC
✅ Suggested Action - Approve/Merge
Review summary Nits — 5 non-blocking
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.
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #5657 +/- ##
=======================================
Coverage 95.03% 95.03%
=======================================
Files 577 577
Lines 45920 45946 +26
Branches 14695 14695
=======================================
+ Hits 43639 43666 +27
+ Misses 1528 1527 -1
Partials 753 753
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
What & why
Closes #5655.
iterate-policy.ts's doc comment has always definedrejectionSignaledas true when the repo has signaled it doesn't want automated contributions — either an explicit AI-usage-policy ban or a prior submission from this same miner that was closed/rejected on this exact repo.resolveRejectionSignaledonly resolved the first trigger; its own header documented the second as a deliberate gap. This wires the two already-shipped modules that close it.resolveOwnRejectionHistory(repoFullName, options)(new): reads this miner's own recorded submissions on the target repo (listRecentOwnSubmissions, #5134), fetches each one's liveGET /pulls/{n}state, and runs it throughresolveRejection(#4278) — returningtrueif any was closed without merge. It consumes both upstream modules without modifying either (out of scope per the issue).maxRejectionHistoryChecks(default 10) submissions with a real PR number are fetched, so a long history on one repo never triggers an unbounded API fan-out.false(never fabricated as a rejection, per the issue); any single PR fetch/parse failure is skipped so it never blocks the others.resolveRejectionSignalednow returnstrueif either trigger fires (the policy-doc ban short-circuits), and its header/comment are updated to reflect the closed gap.Acceptance criteria
rejectionSignalednow reflects both documented triggersrejection-state-machine.jsorgovernor-state.js's own logicTests
test/unit/miner-rejection-signal.test.ts(all pass; 100% of the changed lines/branches covered): real-rejection-detected, no-prior-submissions (no fetch), bounded-fetch-count, fail-open (individual PR failure + wholesale), a merged/non-2xx PR is not a rejection, auth-header wiring, and the combined-trigger cases (policy ban with clean history, and clean policy with a real rejection, each resolvetrue).tsc --noEmitand the existing suite stay green.