feat(miner): resolve rejectionSignaled's AI-usage-policy-ban trigger (#5132) - #5241
Conversation
|
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 |
gittensory-ui | 8237ede | Commit Preview URL Branch Preview URL |
Jul 12 2026, 11:27 AM |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #5241 +/- ##
=======================================
Coverage 94.34% 94.34%
=======================================
Files 473 473
Lines 39982 39982
Branches 14576 14576
=======================================
Hits 37722 37722
Misses 1585 1585
Partials 675 675
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
|
Warning 🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨 ⏸️ Gittensory review result - manual review recommendedReview updated: 2026-07-12 11:30:16 UTC
⏸️ Suggested Action - Manual Review
Review summary Blockers
Nits — 5 non-blocking
Concerns raised — review before merging
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 Gittensory, a quiet PR intelligence layer for OSS maintainers.
|
IterateLoopInput.rejectionSignaled has two documented triggers per iterate-policy.ts's own doc comment: an explicit AI-usage-policy ban on the target repo, or a prior submission from this miner closed/rejected on that exact repo. Adds resolveRejectionSignaled(repoFullName, options), which fetches AI-USAGE.md/CONTRIBUTING.md live from raw.githubusercontent.com (falling through to CONTRIBUTING.md only when AI-USAGE.md is absent/empty) and runs them through the engine's existing resolveAiPolicyVerdict -- the same check opportunity-fanout.js already runs during discovery, applied here at attempt time. The second trigger (a prior submission from this same miner was closed/ rejected on this exact repo) is deliberately not resolved here -- left as a documented follow-up. Fixes the new test's fetch stubs to satisfy SelfReviewContextFetch's response shape (json()/text(): Promise<string>, not Promise<string | null>).
cec9a43 to
9195b20
Compare
Advances #5132 IterateLoopInput.rejectionSignaled has two documented triggers: an explicit AI-usage-policy ban on the target repo, or a prior submission from this miner closed/rejected on that exact repo. This adds resolveRejectionSignaled, which fetches AI-USAGE.md/CONTRIBUTING.md live and runs them through the engine's existing resolveAiPolicyVerdict -- the same check opportunity-fanout.js already runs during discovery, applied here at attempt time. The second trigger (own prior-rejection history) needs governor-state's listRecentOwnSubmissions cross-checked against live PR outcomes via rejection-state-machine.js's resolveRejection -- a separately-scoped pipeline, left as a follow-up rather than fabricated as "no rejection history."
Advances #5132 Review feedback on this branch correctly flagged resolveRejectionSignaled as unwired: nothing called it yet. Wires it into attempt-cli.js's runAttempt, checked before acquiring a worktree slot so a repo that already bans AI contributions never consumes one. Adds the "blocked_rejection_signaled" outcome (exit code 5), logged to both the attempt log and event ledger like the existing blocked path.
Summary
Advances #5132
IterateLoopInput.rejectionSignaledhas two documented triggers periterate-policy.ts's own doc comment: an explicit AI-usage-policy ban on the target repo, or a prior submission from this miner closed/rejected on that exact repo. This addsresolveRejectionSignaled(repoFullName, options), which fetchesAI-USAGE.md/CONTRIBUTING.mdlive fromraw.githubusercontent.com(falling through toCONTRIBUTING.mdonly whenAI-USAGE.mdis absent/empty) and runs them through the engine's existingresolveAiPolicyVerdict-- the same checkopportunity-fanout.jsalready runs during discovery, applied here at attempt time.The second trigger (a prior submission from this same miner was closed/rejected on this exact repo) is deliberately not resolved here: it needs each of this miner's recorded own-submissions (
governor-state.js'slistRecentOwnSubmissions, #5134) cross-checked against their live PR outcome viarejection-state-machine.js'sresolveRejection-- a second, separately-scoped fetch-and-classify pipeline. Left as a documented follow-up rather than fabricated as "no rejection history."Test plan
npx vitest run test/unit/miner-rejection-signal.test.ts-- 8/8 passing (ban match, no ban, AI-USAGE.md-empty fallthrough to CONTRIBUTING.md, both-404 fail-open, network-error fail-open, malformed repoFullName, custom rawContentBaseUrl, default global fetch)node --check packages/gittensory-miner/lib/rejection-signal.jsnpm run --prefix packages/gittensory-miner build(addedrejection-signal.jsto the check list)npm run test:engine-parity