fix(scoring): per-event output cap on scaled reward (cannot fill the scale in one insert) - #739
Draft
DealAppSeo wants to merge 1 commit into
Draft
DealAppSeo wants to merge 1 commit into
DealAppSeo wants to merge 1 commit into
Conversation
…scale in one insert) clampEventDelta ±9990 is the int4/full-scale backstop — one event can still walk 10–10000. Cap the formula output at ±50 (code constant, not repid_config) so a poisoned impact_factor_cap, a zero count-floor, or a factor explosion cannot fill the scale in a single score-event. Does not close parallel-event summing (documented in tests). Does not flip REPID_RUN_EARN_GATE. SQL get_scaled_reward rpc is not this path (measured return 9, no args); live scoring is calculateFullReward at the route. Draft, do not merge. Co-authored-by: XC <xc@trustshell.dev>
This was referenced Sep 16, 2026
DealAppSeo
added a commit
that referenced
this pull request
Sep 16, 2026
…checked; #743 flagged to Sean (#759) - Verifies prior beat (PR #758, 19231d3): merged 2026-09-16T04:30:32Z — all claims hold - #743 (HAL free-tier quorum fix, 98/98): needs Sean to mark ready + merge + recycle Railway - #739 (scaled reward cap): SAFE-CLASS but Sean-flagged draft; needs clearance - All 3 open PRs have explicit "Do not merge" — none auto-merged - Item 7 (ANFIS staging) deferred to own dedicated beat; this beat stops here Co-authored-by: claude[bot] <41898282+claude[bot]@users.noreply.github.com> Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
DealAppSeo
added a commit
that referenced
this pull request
Sep 16, 2026
…staging confirmed complete (8/8 tests pass); no new code needed (#760) Prior beat (#759) verified: same 3 draft PRs (#749/#743/#739) still DRAFT, no Sean action. Item 7 ANFIS staging acceptance tests found to already exist in tests/anfis-enablement.test.ts (305 lines, 8/8 pass) — prevented a prior-work redo. All remaining Item 7 work is Sean-gated (flag flips + key mint). Co-authored-by: claude[bot] <41898282+claude[bot]@users.noreply.github.com> Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
This was referenced Sep 16, 2026
Merged
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.
Dispatch #64 P3 — XC drafted because no CC1
get_scaled_rewardPR existed after one wakeupDraft — do not merge. Did not flip
REPID_RUN_EARN_GATE.The hole
Live clamp is only
clampEventDelta ±9990— the full 10–10000 scale width. One poisoned factor / config-injectedimpact_factor_capfills the scale in a singlerepid_score_eventsinsert. Parallel events are unrate-limited. Earn-gate is SHADOW.The SQL rpc
get_scaled_reward(Args: never) is not this path: livePOST /rest/v1/rpc/get_scaled_rewardreturns 9 [V 2026-09-14]. Scoring goes throughcalculateFullRewardinagents-external.ts.What this PR does
capScaledReward/MAX_ABS_SCALED_REWARD = 50inwisdom-normalize.ts— a code constant, notrepid_config.clampEventDelta.XC red-team (the tests)
vdrCount=0)impactCap=1e9+ exploding factors)clampEventDeltanpx jest tests/wisdom-normalize.test.ts→ 19/19.Not this PR
Per-agent rate limit (the race hole). SQL
CREATE OR REPLACE get_scaled_reward(no function body in-repo; live rpc is not the scoring path). Earn-gate enforce. Merging.