Skip to content

feat(cli): show repo allocation in miner score#1284

Open
bittoby wants to merge 1 commit into
entrius:testfrom
bittoby:feature/miner-score-allocation-breakdown
Open

feat(cli): show repo allocation in miner score#1284
bittoby wants to merge 1 commit into
entrius:testfrom
bittoby:feature/miner-score-allocation-breakdown

Conversation

@bittoby
Copy link
Copy Markdown
Contributor

@bittoby bittoby commented May 14, 2026

Summary

Add a per-repository emission allocation breakdown to gitt miner score.

The JSON output now includes an allocation_breakdown array showing each relevant repository’s emission slice, PR/issue split, miner scores, and allocated rewards. The normal table output also includes a compact repo allocation table.

This makes the final blended reward easier to understand after repo-bounded emission allocation.

Related Issues

Closes #1283

Type of Change

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

Testing

  • Tests added/updated
  • Manually tested
.venv/bin/python -m pytest tests/validator/test_blend_emission_pools.py tests/cli/test_miner_score.py
.venv/bin/python -m ruff check gittensor/validator/emission_allocation.py gittensor/cli/miner_commands/score.py tests/validator/test_blend_emission_pools.py tests/cli/test_miner_score.py
.venv/bin/python -m ruff format --check gittensor/validator/emission_allocation.py gittensor/cli/miner_commands/score.py tests/validator/test_blend_emission_pools.py tests/cli/test_miner_score.py
git diff --check

Results:

  • 34 passed
  • Ruff check passed
  • Ruff format check passed
  • Diff whitespace check passed

Checklist

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

@xiao-xiao-mao xiao-xiao-mao Bot added the enhancement New feature or request label May 14, 2026
@bittoby bittoby force-pushed the feature/miner-score-allocation-breakdown branch from b4b6d30 to a9033c8 Compare May 17, 2026 15:08
@bittoby
Copy link
Copy Markdown
Contributor Author

bittoby commented May 17, 2026

Result simulation

Setup: dev miner (UID 1), eligible. Repos: octo/repo (emission_share=0.3), octo/lib (emission_share=0.4, issue_discovery_share=0.2). OSS_EMISSION_SHARE=0.9. Miner scores: octo/repo 30 PR (peer 10), octo/lib 20 PR + 4 issue (peer 12 issue).

Non-maintainer miner

Repo Slice PR score Issue score PR reward Issue reward Recycled
octo/repo 0.270000 30.00 0.00 0.202500 0.000000 -
octo/lib 0.360000 20.00 4.00 0.288000 0.018000 -

Reconcile: 0.2025 + 0.288 + 0.018 = 0.5085 = blended_final

Maintainer miner (octo/repo has maintainer_cut=0.5, dev is the registered maintainer — exercises the #1292 carve-out path)

Repo Slice PR score Issue score PR reward Issue reward Maintainer reward Recycled
octo/repo 0.270000 30.00 0.00 0.101250 0.000000 0.135000 -
octo/lib 0.360000 20.00 4.00 0.288000 0.018000 0.000000 -

Reconcile: (0.10125 + 0 + 0.135) + (0.288 + 0.018) = 0.54225 = blended_final

The "Maintainer reward" column auto-appears only when at least one row has a positive maintainer reward; non-maintainer miners see the cleaner 7-column layout.

@bittoby bittoby force-pushed the feature/miner-score-allocation-breakdown branch from a9033c8 to 62fca66 Compare May 17, 2026 18:59
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.

[FEATURE] Add repo allocation breakdown to gitt miner score

1 participant