Skip to content

feat(rewards): enforce bounded repo-level emission shares#1240

Draft
Desel72 wants to merge 1 commit into
entrius:testfrom
Desel72:fix/emission-share-clean
Draft

feat(rewards): enforce bounded repo-level emission shares#1240
Desel72 wants to merge 1 commit into
entrius:testfrom
Desel72:fix/emission-share-clean

Conversation

@Desel72
Copy link
Copy Markdown
Contributor

@Desel72 Desel72 commented May 13, 2026

Summary

  • Renames the repository allocation field from weight to emission_share while keeping a compatibility alias for existing callers.
  • Moves repo allocation out of per-PR scoring and into round aggregation, so a repo can receive at most its configured slice of the 90% scoring pool.
  • Adds issue_discovery_share with same-repo PR/issue spill behavior: an active side receives the full repo slice, while fully inactive repo slices and registry slack recycle to UID 0.
  • Collapses top-level emissions to OSS_EMISSION_SHARE = 0.90 and ISSUES_TREASURY_EMISSION_SHARE = 0.10; removes the fixed recycle baseline.

Related Issues

Fixes #1215

Clean History Note

This is a clean-history resubmission of #1236 after the maintainer flagged the preserved rebase author date. The branch was recreated from latest upstream/test and committed once as a fresh commit with matching author and commit timestamps.

Deliverable Coverage

  • emission_share loads as a bounded [0, 1] repo allocation with registry sum <= 1.0.
  • Existing registry entries are migrated from weight to emission_share; entrius/oc-1 opts out of issue discovery with issue_discovery_share = 0.0.
  • Per-PR repo weighting is neutralized in earned score, collateral score, mirror scoring, and issue discovery; old storage fields remain neutral for compatibility.
  • Repo slices are allocated at aggregation, not per PR, so PR volume can only affect distribution inside the repo slice.
  • PR/issue sub-slices spill only within the same repo; fully inactive repo slices and registry slack route to RECYCLE_UID.
  • Tests cover share bounds, invalid registry sums, fixed repo slices across different PR counts, same-repo spill in both directions, issue_discovery_share = 0.0, full inactivity recycling, and registry slack recycling.

Type of Change

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

Testing

  • Tests added/updated
  • Manually tested

Validation:

  • uv run pytest tests/validator/test_emission_share_allocation.py tests/validator/test_load_weights.py tests/validator/oss_contributions/mirror/test_scored_pr.py tests/validator/oss_contributions/mirror/test_scoring.py -q (133 passed)
  • uv run pytest tests/ -q (737 passed)
  • uv run pre-commit run --all-files --show-diff-on-failure
  • SKIP=pytest uv run pre-commit run --all-files --hook-stage pre-push

Checklist

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

Notes

Recycle now receives only unclaimed repo slices and registry-level slack; it is no longer a fixed baseline. Round-level rewards remain bounded by the 90% scoring pool plus the 10% treasury allocation.

@xiao-xiao-mao xiao-xiao-mao Bot added the feature Net-new functionality label May 13, 2026
@Desel72 Desel72 marked this pull request as draft May 14, 2026 02:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature Net-new functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Convert per-repo weight from unbounded multiplier to emission_share (bounded pool slice)

1 participant