From 185e8cd0e48941bca645bacea8f222a8335e10d9 Mon Sep 17 00:00:00 2001 From: Cal Corum Date: Fri, 20 Feb 2026 14:30:15 -0600 Subject: [PATCH] =?UTF-8?q?store:=20Fix:=20Scorebug=20win=20probability=20?= =?UTF-8?q?orientation=20=E2=80=94=20C8=3Dwinning=20team,=20D8=3Dpercentag?= =?UTF-8?q?e?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...-orientation-c8winning-team-d8pe-8ce81b.md | 43 +++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 graph/fixes/fix-scorebug-win-probability-orientation-c8winning-team-d8pe-8ce81b.md diff --git a/graph/fixes/fix-scorebug-win-probability-orientation-c8winning-team-d8pe-8ce81b.md b/graph/fixes/fix-scorebug-win-probability-orientation-c8winning-team-d8pe-8ce81b.md new file mode 100644 index 00000000000..c35d0b53a68 --- /dev/null +++ b/graph/fixes/fix-scorebug-win-probability-orientation-c8winning-team-d8pe-8ce81b.md @@ -0,0 +1,43 @@ +--- +id: 8ce81bc9-3bce-44a9-89e8-c01e54e6df7a +type: fix +title: "Fix: Scorebug win probability orientation — C8=winning team, D8=percentage" +tags: [major-domo, scorebug, win-probability, google-sheets, fix, data-orientation] +importance: 0.7 +confidence: 0.8 +created: "2026-02-20T20:30:15.225730+00:00" +updated: "2026-02-20T20:30:15.225730+00:00" +--- + +# Scorebug Win Probability Orientation Bug + +## Project +major-domo / discord-app-v2 + +## File +`services/scorebug_service.py` + +## Google Sheets Layout +The scorecard outputs: +- **C8** (`all_data[6][1]`): winning team's abbreviation +- **D8**: that team's win probability percentage + +## Problem +Code was treating D8 as always the **home team's** win%, regardless of which team C8 named. This produced an inverted win probability whenever the away team was winning. + +## Fix +Read C8 and compare to the home team abbreviation (from `game_state[4][1]`). + +```python +winning_team_abbr = all_data[6][1] # C8 +home_team_abbr = game_state[4][1] + +win_percentage = float(d8_value) +if winning_team_abbr != home_team_abbr: + win_percentage = 100 - win_percentage # flip to home team's perspective +``` + +`ScorebugData.win_percentage` is always stored from the **home team's perspective**. + +## Key Takeaway +When consuming a spreadsheet that outputs "winning team + that team's probability," always check orientation and normalize to a consistent perspective before storing.