treat transferred issues as closed in discovery scoring#415
treat transferred issues as closed in discovery scoring#415nudiltoys-cmyk wants to merge 8 commits intoentrius:testfrom
Conversation
fixes the anti-gaming gap where transferred issues counted as solved in the pr-linked path and were not flagged during repo scan. adds stateReason to the closingIssuesReferences graphql selection, populates is_transferred in both construction paths, and routes transferred issues to closed_count in _collect_issues_from_prs and _merge_scan_issues
ReviewWhat works
IssuesNOT_PLANNED gap — GitHub
Boolean field limits future extensibility — Minor: no test for NOT_PLANNED — Even if NOT_PLANNED handling is deferred, a test documenting current behavior for VerdictThe PR properly solves what it claims (transferred issues). The NOT_PLANNED gap is a real scoring loophole that should be addressed — either in this PR or as a fast-follow. Storing |
replaces is_transferred: bool with state_reason: Optional[str] on Issue and keeps is_transferred as a convenience property. gates solved classification in _collect_issues_from_prs and _merge_scan_issues on state_reason == 'COMPLETED', so NOT_PLANNED and TRANSFERRED both route to closed_count. None is effectively unreachable inside the 35-day lookback since github auto-populates stateReason on close, but the strict gate is the safer default if that ever changes tests cover COMPLETED, TRANSFERRED, NOT_PLANNED, and None in both the pr-linked path and the scan path, plus the REST uppercase normalization
|
thanks for the review pushed a follow-up commit covering all four points:
12/12 tests in the touched files pass, ruff clean. ready for another look |
|
pushed three style-only commits to clear the lint failure -just |
closes #404
closes #405
summary
transferred issues were being counted as solved in discovery scoring, so a miner could file an issue, have it transferred, and still collect emissions
repo_scan never populated is_transferred even though the rest response carries state_reason, and the pr-linked path never had the data because the graphql query didn't select stateReason
this adds stateReason to the closingIssuesReferences selection, sets is_transferred in both construction paths, and routes transferred issues to closed_count in _collect_issues_from_prs and _merge_scan_issues
test plan
pytest covers transferred vs non-transferred in the pr-linked scoring path, the scan merge path, and the repo_scan field population from state_reason transferred/completed. ruff and pyright pass