Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions gittensor/validator/issue_discovery/scan.py
Original file line number Diff line number Diff line change
Expand Up @@ -463,18 +463,21 @@ async def _score_miner_issues(
)
continue

# Valid-solved gate: solving PR must meet the repo's token threshold.
if cached.token_score >= cfg.min_token_score_for_valid_issue:
acc.valid_solved += 1

# Same-account: discoverer == solver gets credibility only, no score
# Same-account: discoverer == solver gets credibility only, no score.
# Must run before the valid-solved increment so self-loops don't satisfy
# the MIN_VALID_SOLVED_ISSUES eligibility gate (see module docstring:
# anti-self-issue is an applied anti-gaming gate).
if issue.author_github_id == solving_pr.author_github_id:
bt.logging.debug(
f' issue #{issue.issue_number} ({issue.repo_full_name}): same-account '
f'(discoverer == solver {issue.author_github_id}) — credibility only'
)
continue

# Valid-solved gate: solving PR must meet the repo's token threshold.
if cached.token_score >= cfg.min_token_score_for_valid_issue:
acc.valid_solved += 1

pr_key = (issue.repo_full_name, solving_pr.pr_number)
own_marker = (issue.created_at or _FAR_FUTURE, issue.issue_number, evaluation.uid)
if canonical_pr_owners.get(pr_key) != own_marker:
Expand Down
6 changes: 5 additions & 1 deletion tests/validator/issue_discovery/test_scan.py
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,11 @@ def test_self_issue_counts_credibility_but_no_score(self):
)
)
assert eval_.total_solved_issues == 1 # credibility counts
# But no discovery_earned_score because self-solve
# Self-solves must NOT contribute to the valid-solved gate — otherwise
# a miner could self-file + self-solve to bypass MIN_VALID_SOLVED_ISSUES
# without performing any discovery activity.
assert eval_.total_valid_solved_issues == 0
# And no discovery_earned_score because self-solve
assert eval_.issue_discovery_score == 0

def test_not_planned_bumps_closed_count(self):
Expand Down