When some mirror windows fail to sync during reprocess, return an error
result so it renders as a warning banner (with the synced/failed counts and
reasons) instead of a green success the admin might skim past while those
windows are left stale.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013UkZVYgLmquWV2xDn349T2
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