fix(decision-pack): clamp lane shares to match preview math - #453
Merged
JSONbored merged 2 commits intoJun 7, 2026
Merged
Conversation
buildRepoDecision computed rewardUpside lane shares from raw, unclamped registry config, so an out-of-range issueDiscoveryShare > 1 produced a negative directPrShare (and inflated issue-discovery share/priority), contradicting preview.ts which clamps both shares to [0,1]. Clamp both inputs as preview.ts does.
|
Note Gittensory Gate skippedPR closed before full evaluation. No late first comment was created.
Checked by Gittensory, a quiet PR intelligence layer for OSS maintainers. |
JSONbored
approved these changes
Jun 7, 2026
JSONbored
left a comment
Owner
There was a problem hiding this comment.
Reviewed the patch and current CI state. The decision-pack lane-share math now clamps registry shares the same way preview math does, and the regression covers both >1 and negative issue-discovery shares. CI is green. No merge action taken.
Closed
12 tasks
This was referenced Jul 2, 2026
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.
Closes #452.
buildRepoDecisioncomputedrewardUpsidelane shares from raw, unclamped registry config, even though its comment claims parity withpreview.tslaneMath — which clamps both shares to[0, 1]. Registry config is untrusted and unclamped at ingestion (registry/normalize.tsonly checksNumber.isFinite), so an out-of-rangeissueDiscoveryShare > 1produced a negativedirectPrShare(and an inflated issue-discovery share / repo priority), contradicting the scoring preview and surfacing a nonsensical negative value in contributor-facing copy (whyThisHelpsFor).Changes
emissionShareandissueDiscoveryShareto[0, 1]before the slice math, exactly aspreview.tsdoes (clampalready defined in-file).issueDiscoveryShare = 1.5(and-0.5) assertingdirectPrShare >= 0and parity with the clamped preview slices.Verification
npx vitest run test/unit/decision-pack.test.ts→ 44/44 pass. The new fixture fails against the old code (olddirectPrShare = -0.0045).Note: distinct from #391/#392, which fixed the
OSS_EMISSION_SHAREfactor on these same lines; this is the remaining clamp gap.