From 770d704bc1b3cee0a8df75419c04598116bbbfe2 Mon Sep 17 00:00:00 2001 From: jedarden Date: Wed, 13 May 2026 17:58:54 -0400 Subject: [PATCH] Bead bf-3mx7: Document winner badge fix completion The code fix was already applied in commit 6fe778b. This commit adds documentation noting that the index builder needs to be run to regenerate static JSON with correct winner badges. Co-Authored-By: Claude Sonnet 4.6 --- .needle-predispatch-sha | 2 +- notes/bf-3mx7.md | 21 +++++++++++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 notes/bf-3mx7.md diff --git a/.needle-predispatch-sha b/.needle-predispatch-sha index a5bf898..7718aad 100644 --- a/.needle-predispatch-sha +++ b/.needle-predispatch-sha @@ -1 +1 @@ -0e6a4977b65041c402e1a5583ac3bd7d1312a6a0 +6fe778be7840665b072a2fb47b55ae09a9a7dfcb diff --git a/notes/bf-3mx7.md b/notes/bf-3mx7.md new file mode 100644 index 0000000..1ae2cb1 --- /dev/null +++ b/notes/bf-3mx7.md @@ -0,0 +1,21 @@ +# Bug Fix bf-3mx7: Match Index Winner Badge + +## Problem +The match index winner badge was never showing because the `Won` field was incorrectly set using `p.BotID == m.WinnerID`. The issue: `m.WinnerID` is a player-slot integer as string (e.g. "2"), not a bot_id. The SQL query already computed the correct winner status in the `p.Won` field. + +## Fix Applied +Fixed in commit `6fe778b` - Changed all occurrences from comparing `p.BotID == m.WinnerID` to using `p.Won` directly: + +1. **matchToSummary** (line ~355): Changed `Won: p.BotID == m.WinnerID` to `Won: p.Won` +2. **buildPlaylistMatch** (line ~982): Changed `Won: p.BotID == m.WinnerID` to `Won: p.Won` +3. **ratingUpsetMagnitude**: Use `p.Won` to identify winner instead of comparing with `m.WinnerID` +4. **maxScoreDiff**: Use `p.Won` to identify winner instead of comparing with `m.WinnerID` +5. **isEvolutionBreakthrough**: Find winner using `p.Won` before checking if evolved + +## Next Steps +To apply the fix to production data: +- Run the index builder to regenerate static JSON files with correct winner badges +- This requires database access and running: `go run cmd/acb-index-builder/main.go` + +## Impact +This fixes the issue where 984/1000 production matches had `winner_id` set but all participants showed `won: false`.