Skip to content

fix(issue-discovery): apply repository label policy to solving-PR scoring#1282

Open
bitloi wants to merge 1 commit into
entrius:testfrom
bitloi:fix/1281-issue-discovery-label-multiplier
Open

fix(issue-discovery): apply repository label policy to solving-PR scoring#1282
bitloi wants to merge 1 commit into
entrius:testfrom
bitloi:fix/1281-issue-discovery-label-multiplier

Conversation

@bitloi
Copy link
Copy Markdown
Contributor

@bitloi bitloi commented May 14, 2026

Summary

_mirror_issue_for_scoring in issue_discovery/scan.py resolved discovery_base_score, discovery_time_decay_multiplier, and discovery_review_quality_multiplier from the solving PR but never applied the repository label policy (default_label_multiplier / label_multipliers). This left issue-discovery scoring inconsistent with OSS PR scoring, which applies the same policy via _resolve_trusted_scoring_label since #1027.

Changes:

  • Add Issue.discovery_label_multiplier: float = 1.0 alongside the existing discovery_* multiplier fields in classes.py
  • In _mirror_issue_for_scoring, resolve the label multiplier from solving_pr.labels using the same trusted_label_pipeline trust gate as _resolve_trusted_scoring_label
  • Multiply discovery_label_multiplier into discovery_earned_score in the scoring loop

Repos with default_label_multiplier: 0.0 (e.g. entrius/oc-1, which is receiving issue_discovery_share > 0 imminently) will now correctly produce discovery_earned_score == 0.0 for unlabelled solving PRs. Downweight labels (refactor: 0.25 in entrius/allways, entrius/gittensor, entrius/das-github-mirror) are also applied consistently across both scoring paths.

Related Issues

Closes #1281

Type of Change

  • Bug fix
  • New feature
  • Refactor
  • Documentation
  • Other (describe below)

Testing

  • Tests added/updated
  • Manually tested

Added TestMirrorIssueForScoringLabelMultiplier (4 unit tests) and TestLabelPolicyIssueDiscovery (3 integration tests) covering: zero-default multiplier with unlabelled solving PR earns zero score; matching label overrides zero default; downweight label reduces score; untrusted actor label falls back to default multiplier.

Checklist

  • Code follows project style guidelines
  • Self-review completed
  • Changes are documented (if applicable)

@xiao-xiao-mao xiao-xiao-mao Bot added the bug Something isn't working label May 14, 2026
…ring

_mirror_issue_for_scoring resolved discovery_base_score, time_decay, and
review_quality but never applied the repository label policy
(default_label_multiplier / label_multipliers) from repo_config. This
left the issue-discovery path inconsistent with OSS PR scoring since entrius#1027.

Fix:
- Add Issue.discovery_label_multiplier (float, default 1.0) alongside the
  existing discovery_* multiplier fields in classes.py.
- In _mirror_issue_for_scoring, resolve the label multiplier from
  solving_pr.labels using the same trusted_label_pipeline trust gate as
  _resolve_trusted_scoring_label in oss_contributions/mirror/scoring.py.
- Multiply discovery_label_multiplier into discovery_earned_score in the
  scoring loop.

repos with default_label_multiplier: 0.0 (e.g. entrius/oc-1, which is
scheduled to receive issue_discovery_share > 0 imminently) will now
correctly produce discovery_earned_score == 0.0 for unlabelled solving PRs.
Downweight labels (refactor: 0.25 in entrius/allways, entrius/gittensor, etc.)
are also now applied consistently across both scoring paths.

Tests: add TestMirrorIssueForScoringLabelMultiplier (unit) and
TestLabelPolicyIssueDiscovery (integration) covering zero-default/no-label,
matching-label override, downweight, and untrusted-actor gate cases.
@bitloi bitloi force-pushed the fix/1281-issue-discovery-label-multiplier branch from 92e42f8 to b3b9269 Compare May 14, 2026 21:06
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] issue-discovery scoring ignores repository label policy on solving PRs

1 participant