brackt/app/services
Claude 0baef5a948
Fix reprocess bracket to score mirror windows like the primary
Reprocessing a tennis (qualifying) major recomputed the primary window's
QP correctly (R16 players = 1.5, the average of the 9th–16th values) but
left mirror/sibling windows showing 2 QP. Two defects:

1. The mirror fan-out ran through fanOutMajorIfPrimary, which swallows
   every error and returns void, so reprocess reported a green "success"
   even when mirrors were never re-scored. The reprocess qualifying path
   now calls syncMajorFromPrimaryEvent directly and folds the SyncReport
   (windows synced / failed) into the response, surfacing failures instead
   of hiding them.

2. Mirror windows split QP by counting canonical tournament_results rows
   at each placement, which only equals the round's structural tie span
   when placements are final. Mid-tournament, players floored at a tier
   make the row-count diverge from the tier size, so mirrors split
   differently than the primary. syncMajorFromPrimaryEvent now derives the
   structural span (R16 = 8, QF = 4, SF = 2, Final = 1) from the primary
   bracket via deriveBracketQualifyingStates and merges it over the
   canonical counts, so every window splits identically to the primary at
   every stage. Golf and CS2 Swiss-exit placements keep their canonical
   count via the merge.

Adds a fan-out test covering an R16-in-progress bracket where only 4 rows
sit at placement 9: the mirror is scored with the structural span (8), not
the live count (4).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013UkZVYgLmquWV2xDn349T2
2026-07-04 01:45:53 +00:00
..
__tests__ Fix reprocess bracket to score mirror windows like the primary 2026-07-04 01:45:53 +00:00
match-sync Announce drafted tennis players eliminated in non-scoring rounds 2026-07-03 14:42:06 +00:00
simulations claude/probability-config-review-1tdolw (#119) 2026-06-30 23:24:48 +00:00
standings-sync mlb fix (#87) 2026-06-12 04:09:51 +00:00
bracket-simulator.ts Replace console.* with structured logger, fix no-inferrable-types (closes #98) (#199) 2026-03-21 13:41:39 -07:00
brackt.server.ts Add Brackt as a league-private meta-sport (#200) (#377) 2026-05-04 20:31:44 -07:00
discord.ts claude/wimbledon-qp-scoring-bug-xevhlf (#127) 2026-07-03 21:40:11 +00:00
draft-autostart.ts Add auto-start draft at scheduled time (#437) (#438) 2026-05-16 23:37:29 -07:00
draft-discord.server.ts claude/discord-pick-notification-refactor-FeusJ (#58) 2026-05-29 16:24:22 +00:00
draft-email.server.ts Add draft email notifications feature (#459) 2026-05-20 15:35:43 -07:00
ev-calculator.ts fix: address VORP code review issues (#283) 2026-04-08 23:20:02 -04:00
icm-calculator.ts Replace console.* with structured logger, fix no-inferrable-types (closes #98) (#199) 2026-03-21 13:41:39 -07:00
probability-engine.ts Fix NCAAW futures odds simulation and admin import UX (#420) 2026-05-13 01:06:16 -07:00
probability-updater.ts Fix slow bracket save and stale projected points (#54) 2026-05-27 04:28:10 +00:00
qualifying-points-discord.server.ts claude/wimbledon-qp-scoring-bug-xevhlf (#127) 2026-07-03 21:40:11 +00:00
sync-tournament-results.ts Fix reprocess bracket to score mirror windows like the primary 2026-07-04 01:45:53 +00:00