brackt/app/services/simulations
Chris Parsons 6772079e86
All checks were successful
🚀 Deploy / 🧪 Test (pull_request) Successful in 2m53s
🚀 Deploy / ʦ🔍 Typecheck & Lint (pull_request) Successful in 1m19s
🚀 Deploy / 🐳 Build (pull_request) Has been skipped
🚀 Deploy / 🚀 Deploy (pull_request) Has been skipped
🚀 Deploy / 🧪 Test (push) Successful in 3m6s
🚀 Deploy / ʦ🔍 Typecheck & Lint (push) Successful in 1m22s
🚀 Deploy / 🐳 Build (push) Successful in 1m13s
🚀 Deploy / 🚀 Deploy (push) Successful in 13s
Reflect group stage in World Cup sim; seed R32 from real 2026 bracket
The World Cup Monte Carlo simulator ignored the admin-populated knockout
draw and re-paired its own simulated group output sequentially, so bracket
paths from the Round of 32 onward did not match the real tournament. It
also silently invented 12 synthetic groups when none were configured,
discarding real group-stage results.

Rework the simulator around three regimes:
- draw set     → simulate the real R32 matchups, advancing through the
  bracket tree via the canonical ceil(matchNumber/2) rule (matching
  advanceWinnerTemplate) so sim paths match the admin tooling.
- groups only  → simulate remaining group matches, then seed the R32 with
  the official 2026 group-position template + FIFA's exact Annex C
  best-third-place allocation (495-row published table).
- neither      → futures-seeded bracket fallback, flagged via result source.

Completed group and knockout matches still lock in real results at every
round.

New app/lib/fifa-2026-bracket.ts encodes the R32 group-position template
(official FIFA matches 73-88 mapped onto DB matchNumbers 1-16 so the tree
reproduces the real halves) and assignThirdPlaceSlots(). The Annex C table
is generated deterministically by scripts/gen-fifa-third-place.mjs into
app/lib/fifa-2026-third-place-allocation.ts.

Tests assert exact Annex C values, cross-check the template's eligible
groups against all 495 combinations, and cover each regime including the
partial-draw dedup and fully-drawn fast path.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-23 12:15:45 -07:00
..
__tests__ Reflect group stage in World Cup sim; seed R32 from real 2026 bracket 2026-06-23 12:15:45 -07:00
afl-simulator.ts Deduplicate soccer simulator helpers (#391) 2026-05-07 11:48:57 -07:00
auto-racing-simulator.ts claude/trusting-heisenberg-r6xnfi (#90) 2026-06-15 03:34:44 +00:00
bracket-simulator.ts Canonical tournament layer: schema + backfill (1/2) (#365) 2026-05-01 20:13:18 -07:00
brackt-simulator.ts Add Brackt as a league-private meta-sport (#200) (#377) 2026-05-04 20:31:44 -07:00
college-hockey-simulator.ts Fix college hockey bracket resolution (#396) 2026-05-08 12:29:39 -07:00
cs-major-simulator.ts Unify majors: score once, fan out across windows + tennis bracket EV 2026-06-22 20:32:22 -07:00
darts-simulator.ts Fix simulator correctness bugs and reduce test iteration counts (#61) 2026-05-31 17:39:43 +00:00
epl-simulator.ts Fix simulator correctness bugs and reduce test iteration counts (#61) 2026-05-31 17:39:43 +00:00
golf-simulator.ts Add not-participating exclusion support for event results (#446) 2026-05-19 11:13:32 -07:00
input-policy.ts Fix NCAAW futures odds simulation and admin import UX (#420) 2026-05-13 01:06:16 -07:00
llws-simulator.ts Fix MLB standings 406 error and refactor ESPN adapter shared code (#62) 2026-06-01 03:31:18 +00:00
manifest.ts Fix simulator correctness bugs and reduce test iteration counts (#61) 2026-05-31 17:39:43 +00:00
mlb-simulator.ts Fix MLB simulator: projected wins drive seeding, perf fix, + surface simulate errors (#65) 2026-06-01 20:50:03 +00:00
mls-simulator.ts Add MLS standings sync and fix simulator conference resolution (#423) 2026-05-14 15:39:40 -07:00
nba-simulator.ts Canonical tournament layer: schema + backfill (1/2) (#365) 2026-05-01 20:13:18 -07:00
ncaa-basketball-simulator.ts Upgrade NCAA preseason simulators (#419) 2026-05-12 22:26:25 -07:00
ncaa-football-simulator.ts Canonical tournament layer: schema + backfill (1/2) (#365) 2026-05-01 20:13:18 -07:00
ncaam-simulator.ts Upgrade NCAA preseason simulators (#419) 2026-05-12 22:26:25 -07:00
ncaaw-simulator.ts Fix NCAAW futures odds simulation and admin import UX (#420) 2026-05-13 01:06:16 -07:00
nfl-simulator.ts Canonical tournament layer: schema + backfill (1/2) (#365) 2026-05-01 20:13:18 -07:00
nhl-simulator.ts Canonical tournament layer: schema + backfill (1/2) (#365) 2026-05-01 20:13:18 -07:00
nll-simulator.ts Add NLL box lacrosse simulator implementation plan and preseason-draftability guidance (#417) 2026-05-12 14:22:34 -07:00
registry.ts Add MLS sport simulator (mls_bracket) (#422) 2026-05-14 12:45:53 -07:00
runner.ts Hide completed seasons in admin tools (#418) 2026-05-12 16:52:26 -07:00
shared-major.ts Unify majors: score once, fan out across windows + tennis bracket EV 2026-06-22 20:32:22 -07:00
simulation-probabilities.ts Deduplicate soccer simulator helpers (#391) 2026-05-07 11:48:57 -07:00
simulator-config.ts Add MLS sport simulator (mls_bracket) (#422) 2026-05-14 12:45:53 -07:00
snooker-simulator.ts Canonical tournament layer: schema + backfill (1/2) (#365) 2026-05-01 20:13:18 -07:00
soccer-helpers.ts Deduplicate soccer simulator helpers (#391) 2026-05-07 11:48:57 -07:00
tennis-simulator.ts Unify majors: score once, fan out across windows + tennis bracket EV 2026-06-22 20:32:22 -07:00
types.ts User/chris/ev f1 framework (#93) 2026-03-09 15:34:31 -07:00
ucl-simulator.ts Canonical tournament layer: schema + backfill (1/2) (#365) 2026-05-01 20:13:18 -07:00
wnba-simulator.ts Canonical tournament layer: schema + backfill (1/2) (#365) 2026-05-01 20:13:18 -07:00
world-cup-simulator.ts Reflect group stage in World Cup sim; seed R32 from real 2026 bracket 2026-06-23 12:15:45 -07:00