Skip to content

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

Closed
Desel72 wants to merge 1 commit into
entrius:testfrom
Desel72:fix/emission-share-deliverables
Closed

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

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

Addressed Previous Review

This resubmits #1218 with the maintainer-identified gaps fixed:

  • D7: removed the optional backward-compatible allocator params and deleted the legacy normalized-vector blend path. blend_emission_pools now requires miner_uids, miner_evaluations, and master_repositories.
  • D11: added tests for both same-repo spill directions: issue slice -> PR side and PR slice -> issue side.
  • D6: added a test for issue_discovery_share = 0.0 as a clean short-circuit: issue-only activity earns no rewards and the empty PR-side repo slice recycles.

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 pre-commit run --all-files --show-diff-on-failure
  • SKIP=pytest uv run pre-commit run --all-files --hook-stage pre-push
  • uv run pytest tests/ -q (725 passed)

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 enhancement New feature or request label May 13, 2026
@Desel72 Desel72 force-pushed the fix/emission-share-deliverables branch from 77ad31d to 96351a9 Compare May 13, 2026 01:39
@Desel72
Copy link
Copy Markdown
Contributor Author

Desel72 commented May 13, 2026

@anderdc
I re-checked the #1215 required deliverables:

  • D1-D11 are covered in this PR.
  • The previous feat(rewards): enforce bounded repo-level emission shares #1218 gaps are fixed: D6, D7, and D11.
  • Old multiplier storage fields are kept only as neutral compatibility fields to avoid DB/schema migration risk; active scoring no longer uses repo weight as a per-PR multiplier.

Ready for review when convenient.
Thanks.

@anderdc
Copy link
Copy Markdown
Collaborator

anderdc commented May 13, 2026

Closing — commit 96351a90fa authored date is backdated to 2026-05-12T23:36:02Z while the actual force-push happened 2026-05-13T01:39:05Z, matching the same fabricated second on 2 other PRs at #1215. Commit history is unclean.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

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)

2 participants