Skip to content

fix(compare): fresh input is lower-wins in the compare tally - #324

Merged
SunrisesIllNeverSee merged 1 commit into
mainfrom
fix/compare-tally-input-2026-10-21
Oct 21, 2026
Merged

SunrisesIllNeverSee merged 1 commit into
mainfrom
fix/compare-tally-input-2026-10-21

Conversation

@SunrisesIllNeverSee

Copy link
Copy Markdown
Owner

What

compareTally() counted 10 contests, with all 4 raw pillars as more-wins, including fresh input. Fresh input is the denominator of Yield (Υ = cache_read × output / input²), so using less of it for the same output is what the product rewards. Scoring more input as a win contradicted "Volume isn't Yield".

  • lib/analytics/compare-facts.ts: fresh input is now LOWER-wins. Output, cache read and cache write stay higher-wins (volume).
  • components/compare/CompareLedger.tsx: the Input row uses lower-wins for its winner and bar. The Raw band is labelled "Raw · Flow · Total".
  • components/share/CompareMatchupCard.tsx: its private copy of the tally (which would have kept the old rule) is replaced by the shared compareTally.
  • CompareMatchup, the LEADING chip, the page score, CompareMobileScore and the Context panel already read compareTally, so they follow automatically. deriveFacts has no input winner logic. CompareVersus is unused and has no input axis.
  • No metric definitions changed. Canon context loaded; the change only flips which direction wins on a raw row.

MO§ES vs Kabir (live numbers from the task)

Input 25,766,329 vs 387,900; output 199.3M vs 192.0M; cache read 51,791.3M vs 50,412.5M; cache write 2,737.8M vs 939.2M; Kabir wins all 6 derived metrics.

  • Before: MO§ES 4, Kabir 6 (MO§ES "won" input, output, cache read, cache write).
  • After: MO§ES 3, Kabir 7 (Kabir wins the 6 derived metrics plus input).

Tests

  • New __tests__/board/compare-tally-input.test.ts (3 cases, including the MO§ES vs Kabir shape).
  • npx tsc --noEmit clean, eslint clean on changed files, npm run test:ui 397 passed, npm test 695 passed (4 skipped).
  • Local visual check on /compare (H82 vs Kabir, local data): ledger, chip, Context panel and page all show 1–9. Not checked on a phone viewport, since the mobile score reads the same function.

Not done

🤖 Generated with Claude Code

Fresh input is the Yield denominator, so less input for the same output is the
rewarded direction. compareTally, the ledger input row and the share card now
agree (card's duplicate tally replaced by the shared function). Raw band labelled
RAW · FLOW · TOTAL.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Oct 21, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 62853b7e-d315-4504-b77e-961f53acafa4
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@SunrisesIllNeverSee
SunrisesIllNeverSee merged commit ef14dd3 into main Oct 21, 2026
4 checks passed
@SunrisesIllNeverSee
SunrisesIllNeverSee deleted the fix/compare-tally-input-2026-10-21 branch October 21, 2026 21:52

This branch was successfully deployed

1 active deployment
Preview — 37c67417 Deployed Oct 21, 2026 by vercel[bot]
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