Commit graph

5 commits

Author SHA1 Message Date
Claude
4e48a23f6b
Add a repair script for brackets advanced before the re-seed fix
The fix only changes how new results advance, so a bracket already advanced
under the fixed crossover keeps its wrong Elimination Finals pairings — and
the admin UI cannot re-trigger advancement, since a completed match renders
as "Complete" with no way to re-submit the winner.

Extract the reconcile step as reseedAflEliminationFinals, which resolves the
pairings from the results recorded so far (the winner being advanced is
passed in, since that row can predate the write), and add a script that runs
it over afl_10 events. It moves only Wildcard teams between the two
Elimination Final slots, leaves a correct bracket untouched, and reports
rather than rewrites an Elimination Final that has already been played.

  npx tsx scripts/fix-afl-wildcard-reseed.ts --dry

An event with no Wildcard/Elimination Finals matches now raises instead of
reporting nothing to do — a mistyped event id should not read as success.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VDbHrCce1UhahbkwKkc7hK
2026-09-04 21:34:56 +00:00
Claude
a7b7921b9b
Rename a shadowed variable in the AFL advancement test mock
All checks were successful
🚀 Deploy / 🧪 Test (pull_request) Successful in 3m9s
🚀 Deploy / ʦ🔍 Typecheck & Lint (pull_request) Successful in 1m19s
🚀 Deploy / 🐳 Build (pull_request) Has been skipped
🚀 Deploy / 🚀 Deploy (pull_request) Has been skipped
The db mock's local match lookup shadowed the test helper of the same name,
which oxlint's no-shadow rejects.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VDbHrCce1UhahbkwKkc7hK
2026-09-04 20:49:10 +00:00
Claude
a747d73a4c
Refuse to re-seed an Elimination Final that has been played
Some checks failed
🚀 Deploy / 🧪 Test (pull_request) Successful in 3m12s
🚀 Deploy / ʦ🔍 Typecheck & Lint (pull_request) Failing after 46s
🚀 Deploy / 🐳 Build (pull_request) Has been skipped
🚀 Deploy / 🚀 Deploy (pull_request) Has been skipped
Reconciling both slots on every Wildcard result means a late correction
could otherwise rewrite who contested a game that already has a recorded
winner. Raise instead — with a message callers do not swallow, so the admin
sees it and can clear and regenerate.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VDbHrCce1UhahbkwKkc7hK
2026-09-04 15:30:05 +00:00
Claude
273735e572
Re-resolve both Elimination Final slots on every Wildcard result
Now that a Wildcard winner's destination depends on both games, guarding
only the slot about to be written is not enough. Correcting a recorded
result placed the new winner in the other Elimination Final and left the
beaten team alive in the one it had been written to, and a bracket already
advanced under the old fixed crossover ended up with one team in both
Elimination Finals once the second result came in — the second write hit
"already filled", which every caller swallows.

Each result now reconciles both slots against the resolved pairings:
a Wildcard team sitting in the wrong slot is vacated, the right ones are
written, and a slot held by anyone outside the Wildcard Round still raises
"already filled" rather than being taken. Clearing and filling share one
transaction, so a half-applied re-seed cannot leave a team in both games,
and pairings that are already correct do no writes at all.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VDbHrCce1UhahbkwKkc7hK
2026-09-04 15:27:16 +00:00
Claude
b566c5f1a5
Re-seed AFL Wildcard winners into the Elimination Finals
The two Wildcard Round winners were crossed into the Elimination Finals by
which game they came out of — the 7v10 winner always met 6th and the 8v9
winner always met 5th. The AFL pairs those games by ladder position, as the
classic final eight pairs 5v8 and 6v7: the higher host draws the
lower-ranked survivor. So when 10th wins through, 5th should meet 10th, not
the 8v9 winner.

Placement now resolves both games together. A 7v10 winner is placed as soon
as it is decided (7th outranks either possible opponent, 10th is outranked
by both), while an 8v9 winner is held until the other game is decided rather
than being placed and later moved, so results can be entered in either
order.

The simulator paired the Elimination Finals the same fixed way, which biased
every projection that ran off an undecided Wildcard Round; it now re-seeds
too.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VDbHrCce1UhahbkwKkc7hK
2026-09-04 15:13:13 +00:00