brackt/app/services/simulations
Chris Parsons 143698cb96
Fix NCAAM/NCAAW simulators: FF completion handling and validation hardening (#169)
Fixes the "slot is already filled" simulation error when First Four games
have already been played and their winners advanced to the Round of 64.

Changes:
- Fix FF→R64 validation to allow a filled R64 slot when the corresponding
  First Four match is already complete (the original bug)
- Fix isComplete guard for E8/FF/Championship: derive loser from stored
  participant IDs when loserId is null rather than re-simulating a real game
- Add round count validation for all rounds (R32 16, S16 8, E8 4, FF 2, Champ 1)
  to catch malformed brackets before the hot sim loop instead of producing
  silent garbage output
- Add participant1Id null check in the First Four path (mirrors the no-FF path)
- Add console.warn when participant IDs are missing from DB (fall-back to
  average strength instead of crashing)
- Import NCAA_68.regions from bracket-templates.ts instead of duplicating the
  hardcoded fallback in each simulator
- Fix duplicate step-9 comment number in ncaam-simulator.ts

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-18 01:37:55 -07:00
..
__tests__ Add NCAAM and NCAAW bracket Monte Carlo simulators (#150) 2026-03-15 23:31:47 -07:00
auto-racing-simulator.ts Consolidate F1/IndyCar simulators into shared AutoRacingSimulator class (#151) 2026-03-16 12:22:08 -07:00
bracket-simulator.ts User/chris/ev f1 framework (#93) 2026-03-09 15:34:31 -07:00
golf-simulator.ts User/chris/ev f1 framework (#93) 2026-03-09 15:34:31 -07:00
nba-simulator.ts Add NBA playoff bracket Monte Carlo simulator (#154) 2026-03-16 21:43:39 -07:00
ncaam-simulator.ts Fix NCAAM/NCAAW simulators: FF completion handling and validation hardening (#169) 2026-03-18 01:37:55 -07:00
ncaaw-simulator.ts Fix NCAAM/NCAAW simulators: FF completion handling and validation hardening (#169) 2026-03-18 01:37:55 -07:00
nhl-simulator.ts Add NHL playoff simulator and fix simulator dropdown (#166) 2026-03-18 01:23:53 -07:00
registry.ts Add NHL playoff simulator and fix simulator dropdown (#166) 2026-03-18 01:23:53 -07:00
types.ts User/chris/ev f1 framework (#93) 2026-03-09 15:34:31 -07:00
ucl-simulator.ts feat: add UCL bracket Monte Carlo simulator (#131) 2026-03-10 23:04:51 -07:00