Skip to content

Feat/emission share allocation#1216

Closed
tao-hunter wants to merge 2 commits into
entrius:testfrom
tao-hunter:feat/emission-share-allocation
Closed

Feat/emission share allocation#1216
tao-hunter wants to merge 2 commits into
entrius:testfrom
tao-hunter:feat/emission-share-allocation

Conversation

@tao-hunter
Copy link
Copy Markdown

Summary

  • Replaces registry weight (used as a per-PR multiplier) with emission_share: each repo’s share of the unified 90% scoring pool (OSS_EMISSION_SHARE), enforced at round allocation in allocate_round_emissions, not in the per-PR multiplier chain.
  • Adds issue_discovery_share on RepositoryConfig (default 0.5): splits each repo’s slice between PR scoring and issue discovery, with same-repo spill when one side has no eligible weight; recycle only when both sides are empty.
  • Removes repo_weight from earned-score math (legacy + mirror PRs + issue discovery); repo_weight_multiplier / discovery_repo_weight_multiplier stay 1.0 for DB/schema compatibility where needed.
  • Monetary policy: Drops the fixed 45% recycle floor. RECYCLE_UID only receives registry slack (1 − Σ emission_share) × OSS_EMISSION_SHARE and unclaimed per-repo slices (no redistribution to other repos). Treasury is a flat 10% to UID 111 (ISSUES_TREASURY_EMISSION_SHARE trimmed from 15%).
  • Migrates master_repositories.json: weightemission_share, preserving relative weights and normalizing so Σ emission_share = 1.0. Loader validates [0, 1] per entry and Σ ≤ 1 (strict > 1 → empty registry).
  • Pipeline: get_rewards returns evaluations only (no global OSS normalize); allocate_round_emissions runs after issue discovery. CLI gitt miner score uses the same path; rewards JSON highlights blended_final.
  • Test fixes: remaining RepositoryConfig(weight=...) in test_label_multiplier.py and test_load.py updated to emission_share for pyright/pytest.

Related Issues

Type of Change

  • Bug fix
  • New feature
  • Refactor
  • Documentation
  • Other (emission / monetary policy — recycle no longer a fixed baseline)

Testing

  • tests/validator/test_emission_allocation.py — allocation, slack, spill, slice vs PR count.
  • tests/validator/test_load_weights.pyemission_share invariants + JSON fixtures.
  • Mirror/legacy scoring, label, review-quality, CLI miner-score, test_load / test_label_multiplier updated for RepositoryConfig(emission_share=...).
  • Full pytest + pyright in CI / local (dev env: uv pip install -e ".[dev]" for pre-commit hooks).
  • Manual: one validator round — rewards.sum() ≈ 1.0 when treasury + recycle UIDs exist on metagraph.

Checklist

  • Code style / ruff / pre-commit (after dev install).
  • Self-review; focused diff (no accidental lockfile churn unless intentional).
  • Maintainer-facing docs / changelog if required for emission policy.
  • PR text calls out recycle baseline removal and 90/10 split explicitly.

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