Skip to content

[codex] fix setup preview record distribution#70

Merged
KevinBigham merged 1 commit into
mainfrom
codex/team-record-distribution-fix
Apr 28, 2026
Merged

[codex] fix setup preview record distribution#70
KevinBigham merged 1 commit into
mainfrom
codex/team-record-distribution-fix

Conversation

@KevinBigham
Copy link
Copy Markdown
Owner

Summary

  • Replaces absolute Day One roster-grade projected-win math with a deterministic league-rank curve centered on 81 wins per team.
  • Keeps setup preview records zero-sum across the 32-team league so team selection no longer shows nearly every club around 97-65.
  • Adds sim-core and worker API regression coverage for 162-game formatting, realistic spread, and league-total projected wins.

Root Cause

The old Day One org review formula calculated projected wins as 64 + raw roster-grade components, so ordinary generated MLB ratings pushed almost every team into the high-90s before clamping.

Save / Schema Safety

  • CURRENT_GAME_SNAPSHOT_VERSION remains v33.
  • No contracts changes.
  • No save migration required; setup previews are generated fresh from seeded roster inputs.

Verification

  • cd packages/sim-core && node ./node_modules/typescript/bin/tsc --noEmit
  • cd packages/sim-core && node ./node_modules/vitest/vitest.mjs run — 1609/1609
  • cd apps/web && node ./node_modules/typescript/bin/tsc --noEmit
  • cd apps/web && node ./node_modules/vitest/vitest.mjs run src/workers/sim.worker.test.ts — 102/102
  • cd apps/web && node ./node_modules/vite/bin/vite.js build
  • cd apps/web && node ./node_modules/vitest/vitest.mjs run src/build/bundleBudget.test.ts
  • git diff --check

@KevinBigham KevinBigham marked this pull request as ready for review April 28, 2026 15:51
@KevinBigham KevinBigham merged commit 1c61336 into main Apr 28, 2026
1 check passed
@KevinBigham KevinBigham deleted the codex/team-record-distribution-fix branch April 28, 2026 15:52
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