Skip to content

fix(prs): keep time decay chart in sync with subnet multiplier#1358

Merged
anderdc merged 1 commit into
testfrom
fix/pr-decay-repo-config
Jul 12, 2026
Merged

fix(prs): keep time decay chart in sync with subnet multiplier#1358
anderdc merged 1 commit into
testfrom
fix/pr-decay-repo-config

Conversation

@e35ventura

Copy link
Copy Markdown
Collaborator

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/metagraphed vs canonical JSONbored/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

  1. Case-insensitive config resolution (useResolvedRepositoryConfig in ReposApi.ts): try /repos/{name} as before; on a miss, fall back to a case-insensitive fullName match against the repositories list. The list fetch is only enabled after a direct-lookup error, and reuses the shared react-query cache.
  2. Subnet multiplier wins on disagreement (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):

Before After
before after

mini-router/minirouter #97 (canonical-case repo, unaffected path stays correct):

Before After
before after

Validation

  • npm run build passes (tsc + vite), eslint clean on changed files.
  • Verified in a live dev server against the production API with a headless browser: metagraphed #4432 now renders the override curve (5-day axis, Now 0.11x matching the chip); minirouter Fix #95: Redesign Miner Details Page as Personal Dashboard #97 unchanged and correct (7-day axis, Now 0.70x).

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

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
anderdc merged commit 9b4940e into test Jul 12, 2026
2 checks passed
@anderdc
anderdc deleted the fix/pr-decay-repo-config branch July 12, 2026 23:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants