Skip to content

fix: exclude self-filed-and-self-solved issues from mirror valid-solved gate#835

Open
polyjeff529 wants to merge 1 commit intoentrius:testfrom
polyjeff529:fix/mirror-discovery-valid-solved-excludes-self-issues
Open

fix: exclude self-filed-and-self-solved issues from mirror valid-solved gate#835
polyjeff529 wants to merge 1 commit intoentrius:testfrom
polyjeff529:fix/mirror-discovery-valid-solved-excludes-self-issues

Conversation

@polyjeff529
Copy link
Copy Markdown

## Summary

The mirror issue-discovery path increments `valid_solved_count` before the
same-account (self-issue) check in `_score_miner_mirror_issues`
(`gittensor/validator/issue_discovery/mirror_scan.py:266-298`). A miner
who files an issue from their own GitHub account and solves it with a
PR from the same account currently has that solve count toward the
`MIN_VALID_SOLVED_ISSUES = 7` eligibility gate, even though the
discovery-score path correctly skips it (gives credibility only, no
score).

Result: a miner with six legitimate cross-account discoveries plus a
single self-filed-and-self-solved issue clears the gate on padding
rather than work — six real cross-account solves alone would fail it.
The seventh "solve" proves no cross-account discovery activity, which is
exactly what the gate exists to verify per the existing docstring of
`check_issue_eligibility` ("low-quality solves don't carry the miner
past the minimum").

## Fix

`mirror_scan.py:285-301`

Compute `is_self_solved` once and gate `valid_solved_count++` on it.
The same flag is reused for the existing same-account credibility-only
branch (no change to that branch's behaviour).

```python
is_self_solved = issue.author_github_id == solving_pr.author_github_id

# Self-issues are excluded from valid_solved — the gate exists to verify
# cross-account discovery work.
if not is_self_solved and cached.token_score >= MIN_TOKEN_SCORE_FOR_BASE_SCORE:
    valid_solved_count += 1

if is_self_solved:
    bt.logging.debug(...)
    continue

…ed gate

The mirror issue-discovery path increments `valid_solved_count` before the
same-account (self-issue) check. A miner with six legitimate cross-account
discoveries plus one self-filed-and-self-solved issue would clear the
`MIN_VALID_SOLVED_ISSUES = 7` gate on padding rather than work — the seventh
"solve" proves no cross-account discovery activity. The discovery-score path
already excludes self-solves at the same site (gives credibility only); the
valid-solved gate must do the same so it cannot be cleared via self-padding.

Compute `is_self_solved` once, gate `valid_solved_count++` on it, and reuse
the same flag for the existing same-account credibility-only branch.

Tightens the existing self-issue test to also assert
`total_valid_solved_issues == 0`, and adds a regression covering the
6-cross + 1-self mix that the gate must reject.

`total_solved_issues` (credibility input) and the discovery-score path are
unchanged — self-issues still feed credibility, and same-account solves
still produce no discovery_earned_score.
@xiao-xiao-mao xiao-xiao-mao Bot added the bug Something isn't working label Apr 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant