fix(decision-pack): apply OSS_EMISSION_SHARE to rewardUpside lane shares - #392
Merged
JSONbored merged 2 commits intoJun 5, 2026
Merged
Conversation
JSONbored
approved these changes
Jun 5, 2026
JSONbored
left a comment
Owner
There was a problem hiding this comment.
@galuis116 this looks ready.
A few notes:
- Including reward upside in the decision pack fixes the behavior at the right output boundary.
- The unit test covers the calculation path clearly.
- No code changes requested from me.
Validation expected:
- Current green CI is sufficient.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
buildRepoDecision(src/services/decision-pack.ts) computed therewardUpsidelane shares straight from the raw registryemissionShare, without theOSS_EMISSION_SHARE(0.9) factor that the canonical lane math applies.directPrShare/issueDiscoveryShareare the analogs ofpreview.tslaneMath.directPrSlice/issueDiscoverySlice(a split of the OSS mining poolemissionShare * OSS_EMISSION_SHARE), so they were inflated by1 / 0.9(~11.1%).Proof the value was impossible: with
issueDiscoveryShare = 0, the old code yieldeddirectPrShare = emissionShare— the repo's entire raw emission — yet the whole OSS mining pool is onlyemissionShare * 0.9. A single lane's share exceeded the pool it is drawn from. The two surfaces also disagreed:reward-risk.tsbuilds itsrewardUpsidefrompreview.laneMath(correctly OSS-adjusted), while decision-pack re-derived the shares and dropped the factor. Closes #391.This is not cosmetic:
rewardUpsidefeedspriorityFor(upside = max(directPrShare, issueDiscoveryShare, emissionShare * 0.35) * 1000), which drivespriorityScoreand the repo ranking (pursueRepos/topActions). The inflation is non-uniform (theemissionShare * 0.35floor term uses the raw value and is unchanged), so it distorted relative ranking, and the inflated shares were printed verbatim in miner-facing reason strings.Scope
src/services/decision-pack.ts— multiply the two lane shares byOSS_EMISSION_SHARE, threaded from the already-loadedscoringSnapshot.constants(in scope at thebuildContributorDecisionPackcall site) viaresolveOssEmissionShare, defaulting to0.9fromDEFAULT_SCORING_CONSTANTSfor direct callers — same source/semantics asconstant(constants, "OSS_EMISSION_SHARE", 0.9)inpreview.ts. The rawemissionSharefield stays raw (it mirrorslaneMath.repoEmissionShare).test/unit/decision-pack.test.ts— fail-on-revert: a new test pins the OSS-adjusted math on both the default-0.9 path and an explicit override and asserts a lane share never exceeds the repo mining pool; two existing assertions updated to the corrected values (issueDiscoveryShare0.02 → 0.018; downstreampriorityScore40 → 38).Validation
npx tsc --noEmit— clean.npx vitest run(full suite) — 1066 passed, 1 skipped; no other assertions affected.Safety
OSS_EMISSION_SHARE, decision-pack now honors it, matchingpreview.ts/reward-risk.tsinstead of diverging.emissionSharefield is unchanged.Notes
Scoped to decision-pack, the lone outlier.
reward-risk.tsalready consumespreview.laneMathand needs no change.