fix(prs): keep time decay chart in sync with subnet multiplier#1358
Merged
Conversation
Resolve per-repo decay config case-insensitively: /repos/{name} only
matches canonical casing while PR records may carry a lowercased
repository name, so the chart silently fell back to default curve
params (e.g. jsonbored/metagraphed showed 0.91x while the subnet
reported 0.11x). On a direct miss the config now falls back to a
case-insensitive match against the repositories list.
As a guard for any remaining param drift, the Now marker and score
prefer the subnet-reported multiplier whenever it disagrees with the
local curve beyond rounding tolerance, with a subline note.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
anderdc
approved these changes
Jul 12, 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.
Problem
The Time Decay chart on the PR details page can directly contradict the subnet-reported multiplier shown in the Score Story chips. Example:
jsonbored/metagraphed#4432 shows TIME DECAY 0.11x in the chip while the chart claims Now 0.91x on a 30-day default curve.Root cause: the chart resolves per-repo decay hyperparameters via
/repos/{name}, but that lookup is case-sensitive while PR records can carry a lowercased repository name (jsonbored/metagraphedvs canonicalJSONbored/metagraphed). The config request 404s and the chart silently falls back to the default curve (midpoint 10, 30-day window), even though the validator scored the PR with the repo's override (midpoint 2, steepness 1, 5-day lookback).Fix
useResolvedRepositoryConfiginReposApi.ts): try/repos/{name}as before; on a miss, fall back to a case-insensitivefullNamematch against the repositories list. The list fetch is only enabled after a direct-lookup error, and reuses the shared react-query cache.prTimeDecayModel.ts): if the subnet-reported multiplier still disagrees with the locally computed curve beyond rounding tolerance (0.05), the Now marker, multiplier, and now-score display the subnet value and the subline notes the curve is approximate. The chart can no longer confidently contradict the chip.Before / after
jsonbored/metagraphed#4432 (merged ~4 days ago, repo overrides decay to midpoint 2 / 5-day lookback):mini-router/minirouter#97 (canonical-case repo, unaffected path stays correct):Validation
npm run buildpasses (tsc + vite), eslint clean on changed files.Note: the backend root cause is also worth fixing separately (make the
/repos/{name}lookup case-insensitive or return canonical casing in PR payloads); this PR makes the UI robust either way.🤖 Generated with Claude Code