brackt/app/routes
Chris Parsons 4a167d8cad Formalize simulator system with manifest, input-policy, runner, and admin UI
Introduces three new schema tables (simulator_profiles,
sports_season_simulator_configs, season_participant_simulator_inputs),
a central model layer (app/models/simulator.ts), and a single runner
entry point so every simulator run follows the same prepare → simulate
→ persist → snapshot → recalculate flow.

Key additions:
- manifest.ts: per-simulator display names, default configs, required/
  optional inputs, derivable-input declarations, and setup sections
- input-policy.ts: resolves sourceElo from projectedWins,
  projectedTablePoints, or sourceOdds; resolves ratings from sourceOdds;
  supports block / fallbackElo / averageKnown / worstKnownMinus strategies
- runner.ts: single entry point for admin simulation runs; materialises
  derived inputs, normalises result columns, zeroes omitted participants,
  snapshots EVs, and recalculates linked fantasy standings
- /admin/simulators: inventory page with per-season readiness and bulk run
- /admin/sports-seasons/:id/simulator: per-season setup page with readiness
  summary, input-policy editor, raw JSON config override, and CSV bulk input
- NCAAM/NCAAW simulators now read ratings from season_participant_simulator_inputs,
  falling back to the hardcoded name-keyed maps while DB data is being populated
- Clone flow copies simulator config by default; volatile inputs (odds, Elo)
  only copied when explicitly requested

Code-review fixes included in this commit:
- source field in compatibility bridge checked with !== null instead of !== undefined
- sourceEloRequirementLabel no longer appends "configured fallback" when the
  participant is already excluded from all resolved sources
- Duplicate inline label maps in input-policy.ts replaced with simulatorInputLabel
- save-config preserves existing inputPolicy when the submitted JSON omits it
- Input table truncation label added (Showing 20 of N)
- CSV description notes values must not contain commas
- N+1 comment added to listSportsSeasonSimulatorSummaries
- assertRegistrySchemaDriftFree called in manifest tests
- Runner test suite added covering happy path, already-running guard,
  readiness failure, empty results, and error recovery with status reset

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-11 21:02:56 -07:00
..
__tests__ Formalize simulator system with manifest, input-policy, runner, and admin UI 2026-05-11 21:02:56 -07:00
admin/__tests__ Canonical tournament layer: schema + backfill (1/2) (#365) 2026-05-01 20:13:18 -07:00
api Show why a participant is ineligible to draft (#378) 2026-05-04 21:54:14 -07:00
leagues Add electric flash + fade animation for draft picks, fixes #381 (#407) 2026-05-10 23:17:29 -07:00
teams Show owner avatar in team settings preview (#386) 2026-05-06 16:00:15 -07:00
admin._index.tsx Add Brackt as a league-private meta-sport (#200) (#377) 2026-05-04 20:31:44 -07:00
admin.data-sync.tsx Canonical tournament layer: schema + backfill (1/2) (#365) 2026-05-01 20:13:18 -07:00
admin.participants.tsx feat: add meta title to all route pages (#109) 2026-03-10 12:10:52 -07:00
admin.simulators.tsx Formalize simulator system with manifest, input-policy, runner, and admin UI 2026-05-11 21:02:56 -07:00
admin.sports-seasons.$id.clone.tsx Formalize simulator system with manifest, input-policy, runner, and admin UI 2026-05-11 21:02:56 -07:00
admin.sports-seasons.$id.elo-ratings.tsx Formalize simulator system with manifest, input-policy, runner, and admin UI 2026-05-11 21:02:56 -07:00
admin.sports-seasons.$id.events.$eventId.bracket.server.ts Add Brackt as a league-private meta-sport (#200) (#377) 2026-05-04 20:31:44 -07:00
admin.sports-seasons.$id.events.$eventId.bracket.tsx Fix NBA play-in elimination display and consolidate bracket reprocessing (#299) 2026-04-15 14:56:33 -07:00
admin.sports-seasons.$id.events.$eventId.cs2-setup.tsx Canonical tournament layer: schema + backfill (1/2) (#365) 2026-05-01 20:13:18 -07:00
admin.sports-seasons.$id.events.$eventId.helpers.ts feat: batch qualifying results entry (#290) 2026-04-12 14:52:22 -07:00
admin.sports-seasons.$id.events.$eventId.server.ts Canonical tournament layer: 2026-05-01 21:04:48 -07:00
admin.sports-seasons.$id.events.$eventId.tsx Canonical tournament layer: schema + backfill (1/2) (#365) 2026-05-01 20:13:18 -07:00
admin.sports-seasons.$id.events.server.ts Add Brackt as a league-private meta-sport (#200) (#377) 2026-05-04 20:31:44 -07:00
admin.sports-seasons.$id.events.tsx Remove sports_season_tournaments junction table — derive from scoring_events (#373) 2026-05-02 22:19:59 -07:00
admin.sports-seasons.$id.expected-values.server.ts Canonical tournament layer: schema + backfill (1/2) (#365) 2026-05-01 20:13:18 -07:00
admin.sports-seasons.$id.expected-values.tsx Fix oxlint warnings: no-shadow, consistent-function-scoping, no-non-null-assertion, and others (#196) 2026-03-21 10:59:51 -07:00
admin.sports-seasons.$id.futures-odds.tsx Formalize simulator system with manifest, input-policy, runner, and admin UI 2026-05-11 21:02:56 -07:00
admin.sports-seasons.$id.golf-skills.tsx Canonical golf skills migration + copy participants feature (#369) 2026-05-02 10:29:28 -07:00
admin.sports-seasons.$id.participants.tsx Canonical golf skills migration + copy participants feature (#369) 2026-05-02 10:29:28 -07:00
admin.sports-seasons.$id.regular-standings.tsx Deduplicate soccer simulator helpers (#391) 2026-05-07 11:48:57 -07:00
admin.sports-seasons.$id.simulate.tsx Formalize simulator system with manifest, input-policy, runner, and admin UI 2026-05-11 21:02:56 -07:00
admin.sports-seasons.$id.simulator.tsx Formalize simulator system with manifest, input-policy, runner, and admin UI 2026-05-11 21:02:56 -07:00
admin.sports-seasons.$id.standings.tsx Canonical tournament layer: schema + backfill (1/2) (#365) 2026-05-01 20:13:18 -07:00
admin.sports-seasons.$id.surface-elo.tsx Canonical tournament layer: schema + backfill (1/2) (#365) 2026-05-01 20:13:18 -07:00
admin.sports-seasons.$id.tsx Formalize simulator system with manifest, input-policy, runner, and admin UI 2026-05-11 21:02:56 -07:00
admin.sports-seasons.new.tsx Formalize simulator system with manifest, input-policy, runner, and admin UI 2026-05-11 21:02:56 -07:00
admin.sports-seasons.tsx Add Brackt as a league-private meta-sport (#200) (#377) 2026-05-04 20:31:44 -07:00
admin.sports.$id.tsx Formalize simulator system with manifest, input-policy, runner, and admin UI 2026-05-11 21:02:56 -07:00
admin.sports.new.tsx Formalize simulator system with manifest, input-policy, runner, and admin UI 2026-05-11 21:02:56 -07:00
admin.sports.tsx Add Cloudinary sports icon uploads (#393) 2026-05-07 16:07:34 -07:00
admin.standings-snapshots.tsx Replace console.* with structured logger, fix no-inferrable-types (closes #98) (#199) 2026-03-21 13:41:39 -07:00
admin.templates.$id.tsx Replace console.* with structured logger, fix no-inferrable-types (closes #98) (#199) 2026-03-21 13:41:39 -07:00
admin.templates.new.tsx Replace console.* with structured logger, fix no-inferrable-types (closes #98) (#199) 2026-03-21 13:41:39 -07:00
admin.templates.tsx feat: add meta title to all route pages (#109) 2026-03-10 12:10:52 -07:00
admin.tournaments.$id.tsx Remove sports_season_tournaments junction table — derive from scoring_events (#373) 2026-05-02 22:19:59 -07:00
admin.tournaments._index.tsx Canonical tournament layer: 2026-05-01 21:04:48 -07:00
admin.tsx Formalize simulator system with manifest, input-policy, runner, and admin UI 2026-05-11 21:02:56 -07:00
api.admin.export-sports-data.ts Migrate authentication from Clerk to BetterAuth (#324) 2026-04-24 22:00:49 -07:00
api.auth.$.ts Migrate authentication from Clerk to BetterAuth (#324) 2026-04-24 22:00:49 -07:00
api.upload-avatar.ts Add Cloudinary-backed avatar system (#385) 2026-05-06 14:47:37 -07:00
api.upload-sport-icon.ts Add Cloudinary sports icon uploads (#393) 2026-05-07 16:07:34 -07:00
api.upload-team-logo.ts Add Cloudinary-backed avatar system (#385) 2026-05-06 14:47:37 -07:00
api.webhooks.cloudinary.ts Add Cloudinary-backed avatar system (#385) 2026-05-06 14:47:37 -07:00
check-email.tsx Add email verification for email/password signups (#400) 2026-05-09 23:58:45 -07:00
forgot-password.tsx Migrate auth from Clerk to BetterAuth (#354) 2026-04-29 10:03:50 -07:00
home.tsx Fix mobile spacing for draft board and dashboard layout (#13, #329) (#404) 2026-05-10 19:51:34 -07:00
how-to-play.tsx Add Brackt as a league-private meta-sport (#200) (#377) 2026-05-04 20:31:44 -07:00
i.$inviteCode.tsx Migrate auth from Clerk to BetterAuth (#354) 2026-04-29 10:03:50 -07:00
login.tsx Migrate auth from Clerk to BetterAuth (#354) 2026-04-29 10:03:50 -07:00
privacy-policy.tsx New design (#309) 2026-04-23 13:14:55 -07:00
register.tsx Add email verification for email/password signups (#400) 2026-05-09 23:58:45 -07:00
reset-password.tsx Migrate auth from Clerk to BetterAuth (#354) 2026-04-29 10:03:50 -07:00
rules.tsx Add Brackt as a league-private meta-sport (#200) (#377) 2026-05-04 20:31:44 -07:00
settings.tsx Refactor user profile to comprehensive settings page (#403) 2026-05-10 17:26:14 -07:00
support.tsx Add branded dark-themed HTML email template (#402) 2026-05-10 11:18:57 -07:00
test-socket.tsx Replace console.* with structured logger, fix no-inferrable-types (closes #98) (#199) 2026-03-21 13:41:39 -07:00
upcoming-events.tsx Migrate authentication from Clerk to BetterAuth (#324) 2026-04-24 22:00:49 -07:00
user-profile-redirect.tsx Refactor user profile to comprehensive settings page (#403) 2026-05-10 17:26:14 -07:00