feat(miner): extract contribution rules from AGENTS.md/CLAUDE.md as an agent_docs source - #8490
Conversation
…n agent_docs source (JSONbored#8316) The ContributionProfile schema (JSONbored#6795) defines an "agent_docs" ContributionSignalSource for repos that state contribution rules only in AI-agent docs, but the extractor (JSONbored#6796) only ever fetched labels + CONTRIBUTING.md, leaving that source permanently unused. Add fetchAgentDocs (mirroring fetchContributing exactly — probe AGENTS.md then CLAUDE.md at the repo root, first hit or null). Parameterize extractPrBody with an optional source/detail (defaults preserve the CONTRIBUTING.md path unchanged). In extractContributionProfile, agent docs are a strict fallback: CONTRIBUTING.md stays authoritative whenever it yields a non-absent prBody rule; only when it is absent entirely does the agent-doc candidate run through the same signpost-size + linked-issue logic, tagged provenance source "agent_docs". No ContributionProfile field added — the result still lands in the existing prBody slot. Closes JSONbored#8316
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
Codecov Report❌ Patch coverage is
❌ Your patch check has failed because the patch coverage (0.00%) is below the target coverage (99.00%). You can increase the patch coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## main #8490 +/- ##
===========================================
+ Coverage 60.60% 89.19% +28.59%
===========================================
Files 791 98 -693
Lines 79334 22804 -56530
Branches 23960 3905 -20055
===========================================
- Hits 48078 20341 -27737
+ Misses 27712 2285 -25427
+ Partials 3544 178 -3366
Flags with carried forward coverage won't be shown. Click here to find out more.
|
|
Caution 🛑 LoopOver review result - reject/close recommendedReview updated: 2026-07-24 15:43:47 UTC
Review summary Blockers
Nits — 5 non-blocking
Why this is blocked
📋 Copy for AI agents — paste into your coding agentCI checks failing
Decision drivers
Context & advisory signals — never blocks the verdict
Linked issue satisfactionAddressed Review context
Contributor next steps
Signal definitions
🧪 Chat with LoopOverAsk LoopOver 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://loopover.ai/docs/loopover-commands 🧪 Experimental — new and may change. 🟩 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.
|
|
LoopOver is closing this pull request on the maintainer's behalf (CI is failing (codecov/patch)). 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. |
Summary
The
ContributionProfileschema (#6795) defines an"agent_docs"ContributionSignalSource— for repos that state contribution rules only in AI-agent docs — but the extractor (#6796) only ever fetched labels +CONTRIBUTING.md, leaving that source permanently unused despite #6794's research flagging it as a real-world pattern.fetchAgentDocs— mirrorsfetchContributing's exact shape (same signature,getJson+decodeContentsprobe loop,string | nullreturn), probingAGENTS.mdthenCLAUDE.mdat the repo root only (no.github/variants — neither file follows that convention).extractPrBodyparameterized with an optionalsource/detail(defaulting to the currentcontributing_md/CONTRIBUTING.mdliterals) so existing callers are behavior-identical.CONTRIBUTING.mdstays authoritative whenever it yields a non-absentprBodyrule (zero regression for any repo with a realCONTRIBUTING.md, including the "no linked-issue rule" case). Only whenextractPrBody(contributing)isabsent(noCONTRIBUTING.mdat all) does the agent-doc candidate run through the sameCONTRIBUTING_SIGNPOST_MAX_BYTESfloor +LINKED_ISSUE_TERMSlogic, tagged provenancesource: "agent_docs".ContributionProfilefield added — the result still lands in the existingprBodyslot; only the provenance source differs.Tests
test/unit/contribution-profile-extract.test.ts(+5, 31 pass): (1) CONTRIBUTING.md present → agent docs never fetched, source stayscontributing_md; (2) no CONTRIBUTING.md, AGENTS.md large →agent_docs; (3) AGENTS.md missing but CLAUDE.md present →agent_docs(second probe path); (4) neither → staysabsent; (5) agent doc below the signpost floor → staysunknown. Covers both sides of theabsentgate, both probe paths, and the size-floor branch.Validation
packages/loopover-minerbuilds clean (tsc -p); contribution-profile-extract test file green (31); sibling suites green (no regressions).main; no base conflict.packages/loopover-miner/**is not Codecov-gated; still covered every new branch. No secret/wallet/hotkey/trust/reward terms.Closes #8316