Skip to content

fix: clear duplicate issue discovery rows#1280

Open
jakearmstrong59 wants to merge 1 commit into
entrius:testfrom
jakearmstrong59:fix/duplicate-penalty-issue-discovery-rows
Open

fix: clear duplicate issue discovery rows#1280
jakearmstrong59 wants to merge 1 commit into
entrius:testfrom
jakearmstrong59:fix/duplicate-penalty-issue-discovery-rows

Conversation

@jakearmstrong59
Copy link
Copy Markdown
Contributor

Summary

Fixes a duplicate-GitHub penalty leak where penalized evaluations could keep cached issue_discovery_issues rows and still consume issue-discovery repo allocation.

Problem

_zero_for_duplicate_penalty() cleared issue-discovery scalar fields, but did not clear MinerEvaluation.issue_discovery_issues.

After repo-level emission allocation, issue-discovery rewards are calculated from per-repo issue rows. A duplicate-penalized miner restored from cache could therefore have:

  • issue_discovery_score = 0.0
  • failed_reason set
  • stale issue_discovery_issues still populated

Those stale rows could consume issue-discovery allocation before the later UID blacklist zeroing step.

Fix

  • Clear issue_discovery_issues inside _zero_for_duplicate_penalty().
  • Make emission allocation collectors ignore evaluations with failed_reason.
  • Add regression coverage for duplicate-penalized cached issue rows.
  • Add allocation tests proving failed PR and issue rows do not consume repo slices.

Tests

  • .venv/bin/pytest tests/validator/test_duplicate_penalty_propagation.py tests/validator/test_blend_emission_pools.py -q
  • .venv/bin/pytest tests/validator/test_github_identity_fallback.py -q
  • .venv/bin/pytest tests/validator/oss_contributions/mirror/test_classes_integration.py -q
  • .venv/bin/ruff check .
  • .venv/bin/ruff format --check .
  • git diff --check

Notes

Manual reproduction now shows duplicate-penalized miners have empty issue-discovery rows and receive no issue-discovery allocation.

Closes #1279

@xiao-xiao-mao xiao-xiao-mao Bot added the bug Something isn't working label May 14, 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.

[Bug] Duplicate-GitHub penalty leaves cached issue_discovery_issues in repo allocation

1 participant