fix(signals): dedupe reward-risk next-actions before capping - #464
Merged
JSONbored merged 1 commit intoJun 8, 2026
Merged
Conversation
buildRepoRewardRisk and buildContributorRewardRiskStrategy sliced the flattened next-actions to N before deduping (slice inside new Set), so duplicate early entries (e.g. same action kind across repos yields the same nextActionsFor string) collapsed the result below the cap and dropped distinct lower-priority steps. Move the cap outside the Set to dedupe first, matching the rest of the codebase (e.g. decision-pack.ts).
|
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 8, 2026
JSONbored
left a comment
Owner
There was a problem hiding this comment.
@galuis116 this is ready.
A few notes:
- Dedupe now happens before the cap, so duplicate early entries no longer crowd out distinct next actions.
- The change matches the existing convention used elsewhere in the codebase.
- No code changes requested.
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 #463.
buildRepoRewardRisk(line 274) andbuildContributorRewardRiskStrategy(line 372) applied.slice(0, N)insidenew Set(...), truncating the flattened next-actions before deduping. When the first N entries contain duplicates — common in the cross-repo aggregate, sincenextActionsFor(kind)returns the same string for a given action kind regardless of repo — the deduped result collapses below the cap and distinct lower-priority steps (e.g.file_issue_discovery,maintainer_lane) are silently dropped.Change
Move the cap outside the
Setso the list is deduped first, then capped — matching the rest of the codebase, including the identical flatMap-nextActions pattern insrc/services/decision-pack.ts:619and the dedupe-then-slice convention inqueue/processors.ts,agent-orchestrator.ts,local-branch.ts, etc.Verification
buildRepoRewardRisk/buildContributorRewardRiskStrategytests insignals-v2.test.ts. Full unit suite green (1254 passed). The observable regression only surfaces with many same-kind repos, which the current fixtures don't construct.