ai-code-battle/cmd/acb-index-builder
jedarden 9bcbd566b6 Bug fix bf-3mx7: Fix match index winner badge - use p.Won instead of comparing BotID with WinnerID
The WinnerID field is a player-slot integer as string (e.g. "2"), not a bot_id.
The SQL query already computes the correct winner status in p.Won field.

Fixed in 3 functions:
- matchToSummary: Changed Won: p.BotID == m.WinnerID to Won: p.Won
- buildPlaylistMatch: Changed Won: p.BotID == m.WinnerID to Won: p.Won
- ratingUpsetMagnitude: Use p.Won to identify winner instead of comparing with m.WinnerID
- maxScoreDiff: Use p.Won to identify winner instead of comparing with m.WinnerID
- isEvolutionBreakthrough: Find winner using p.Won before checking if evolved

This fixes the issue where 984/1000 prod matches had winner_id set but all participants showed won: false.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-13 17:59:02 -04:00
..
blog.go fix(index-builder): correct function name typo in weekly chronicles generation 2026-05-04 03:10:46 -04:00
cards.go Implement S3 functions for R2/B2 integration in acb-index-builder 2026-03-29 09:09:29 -04:00
config.go feat(index-builder): add sitemap.xml generation 2026-05-04 00:09:53 -04:00
db.go Phase 9: Map voting + positional fairness monitoring - verify existing implementation 2026-05-08 14:30:46 -04:00
deploy.go fix(index-builder): run wrangler from /app/web to pick up functions/ bundle 2026-04-30 12:39:57 -04:00
Dockerfile fix(index-builder): run wrangler from /app/web to pick up functions/ bundle 2026-04-30 12:39:57 -04:00
enrichment.go feat(playlists): add playlist curation and rebuild logic per §10, with series/seasons/enrichment 2026-04-21 16:11:27 -04:00
enrichment_test.go fix(index-builder): correct series/season exempt queries, optimize playlist curation 2026-04-21 16:47:13 -04:00
generator.go Bug fix bf-3mx7: Fix match index winner badge - use p.Won instead of comparing BotID with WinnerID 2026-05-13 17:59:02 -04:00
main.go feat(§15.2): generate and stream static meta JSON files to R2 2026-04-22 18:46:27 -04:00
main_test.go feat(config): add season_id + rules_version to Config per §4.2 2026-04-22 18:09:26 -04:00
narrative.go Phase 10: §3.7 chronicles - Update story arc detection to exact specs 2026-05-08 15:07:23 -04:00
narrative_test.go Phase 10: Fix narrative engine tests to match exact specs 2026-05-08 15:10:42 -04:00
rivalry_test.go test(index-builder): fix buildRivalryNarrative call signature 2026-04-28 23:40:57 -04:00
s3.go fix(worker,index-builder): use us-east-1 region for S3-compatible endpoints 2026-04-25 11:07:08 -04:00
s3_test.go feat(config): add season_id + rules_version to Config per §4.2 2026-04-22 18:09:26 -04:00
sitebuild.go fix(types): add missing ReplayPlayer import and type annotation for transcript feature 2026-04-22 18:20:56 -04:00
sitebuild_test.go fix(types): add missing ReplayPlayer import and type annotation for transcript feature 2026-04-22 18:20:56 -04:00