Skip to content

fix: make final4 pick counting tolerant to id drift#45

Merged
mateu merged 1 commit into
masterfrom
koan/fix-final4-pick-round-fallback
Apr 5, 2026
Merged

fix: make final4 pick counting tolerant to id drift#45
mateu merged 1 commit into
masterfrom
koan/fix-final4-pick-round-fallback

Conversation

@mateu
Copy link
Copy Markdown
Owner

@mateu mateu commented Apr 5, 2026

What

Make count_final4_picks resilient when final-four game IDs drift from historical numbering.

Why

A full-suite run exposed a regression: if topology/round assignments shift, ID-only matching can undercount valid final-four picks even though the games are semis/championship by round.

How

Use a joined game query that always accepts round-based final-four picks (round >= 5) and, when available, also accepts structure-derived final-four game IDs.

Testing

  • script/test-env.sh prove -lv t/model_round_based_final4_counts.t
  • script/test-env.sh prove -lr t

Quality Report

Changes: 1 file changed, 16 insertions(+), 11 deletions(-)

Code scan: clean

Tests: skipped

Branch hygiene: clean

Generated by Kōan post-mission quality pipeline

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Improves Final Four pick counting in Bracket::Model::DBIC so it remains correct even when Final Four game IDs drift due to bracket topology/round assignment changes.

Changes:

  • Updates count_final4_picks to count Final Four picks by game.round >= 5.
  • When structure-derived Final Four game IDs are available, counts picks that match either the derived IDs or round >= 5 (union), preventing undercounts.

@mateu mateu marked this pull request as ready for review April 5, 2026 18:25
@mateu mateu merged commit cb8dec4 into master Apr 5, 2026
5 checks passed
@mateu mateu deleted the koan/fix-final4-pick-round-fallback branch April 5, 2026 18:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants