Skip to content

Surface fork CTA + fix code-chip misdirection on agent profile#306

Open
PunchTheDev wants to merge 1 commit into
mainfrom
punch/agent-profile-fork-routing
Open

Surface fork CTA + fix code-chip misdirection on agent profile#306
PunchTheDev wants to merge 1 commit into
mainfrom
punch/agent-profile-fork-routing

Conversation

@PunchTheDev
Copy link
Copy Markdown
Owner

Summary

The agent profile page (/rankings/:agentId) had a silent correctness bug and was missing the fork verb the site is built around. This patch fixes both, plus pins champion rows at the top.

Motivation

The flywheel goal is "surface the winning agent code so the next person can fork it and beat it by a decaying margin." The agent profile is the natural place for that — but the per-problem table was hiding it.

Changes

  • Fix misdirection bug (App.tsx L2231–2243 → L2218–2275): every row's ↗ code chip routed to /problems/{round}/{spec}#sota-code. That anchor is the SotaCodeViewer, which only ever renders the CURRENT SOTA's code — so when this agent is NOT Align dashboard types with forge-api response shapes #1 on a problem, the chip loaded a different agent's code under a tooltip saying "Read {this agent's path} inline". Now branches on isSota:
    • Champion rows (rank === 1): keep the routed #sota-code link (correctly shows THIS agent's code since they hold Align dashboard types with forge-api response shapes #1).
    • Non-champion rows: direct submissionCodeUrl(agent_path, commit_hash)github.com/.../blob/{commit}/{path} — the canonical helper proven on Leaderboard.tsx:185.
  • Surface fork verb everywhere (App.tsx L2127–2138, L2218–2275):
    • Header now shows Fork {N} win{s} ↓ routed anchor (147-char tooltip) when total_wins > 0. Scrolls to the first SOTA row (id="fork-targets").
    • Per-row chip renamed ↗ code↗ Fork champion (champion rows, 200-char tooltip) or ↗ Fork (non-champion, tooltip names exact commit hash + path).
  • Sort flipped (L2086–2093): Align dashboard types with forge-api response shapes #1 wins pinned at the top of the table (fork targets first), then the rest by worst-first.
  • Visual (L2222): champion rows tinted bg-yellow-400/5 for at-a-glance scanning.

Verification

Puppeteer 1440×900 on /rankings/PunchTheDev (currently 3 SOTA rows):

  • headerCta = { text: "Fork 3 wins ↓", tooltipLen: 147 }
  • sotaPinnedAtTop = true
  • anchorPresent = true (first SOTA row carries id="fork-targets")
  • All 3 row chips render ↗ Fork champion with 200-char tooltips
  • 0 new console errors

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.

1 participant