Re-Review: Per-sport analytics: add sport breakdown to scoreboard service
Verdict: APPROVED
Re-review of board item #1851. Previous review (
review-1851-2026-07-10) returned NEEDS_REFINEMENT for two reasons: (1) missing arch note, (2) issue body included already-completed dashboard work. Both issues are now resolved.Template Completeness
- [x] Type -- Feature
- [x] Lineage -- Standalone, references #19 dependency
- [x] Repo -- ldraney/botfire
- [x] User Story -- "As a trader, I want the scoreboard service to log Live Edge win rate, P&L, and trade count broken down by sport"
- [x] Context -- Explains Live Edge expansion, notes dashboard already has sport analytics
- [x] File Targets -- Modify scoreboard.rb, create scoreboard_test.rb, explicit NOT-touch list
- [x] Feature Flag -- none (internal analytics)
- [x] Acceptance Criteria -- 3 scoreboard-specific criteria
- [x] Test Expectations -- unit test with run command
- [x] Constraints -- SQLite, BotFire->Market->Game path
- [x] Checklist -- standard PR/test/scope checklist
- [x] Related -- project-botfire, issue #19
Traceability
- [x] story:bot-strategy label -- "As a bot operator, I want to identify and exploit profitable trading conditions..."
- [x] story note verified -- found in project-botfire user-stories section
- [x] arch:bots label -- bots architecture component
- [x] arch note verified -- arch-bots note exists in pal-e-docs (ID 2527, "Architecture: BotFire Bot Engine"); arch-domain-bots also exists (ID 2541, "Domain Model: BotFire"). Previous review's [SCOPE] finding resolved.
- [x] Forgejo issue -- ldraney/botfire#20, open
File Targets
- [x]
app/services/scoreboard.rb-- verified: file exists (102 lines), groups by bot only, no sport_type references. Valid modification target. - [x]
test/services/scoreboard_test.rb-- verified: does not exist yet.test/services/directory exists with sibling test files (bot_engine_active_hours_test.rb, position_monitor_test.rb, volatility_bot_test.rb). Valid creation target. - [x] NOT-touch list correct: dashboard view already has sport analytics, bot_engine is sport-agnostic, scanner is separate ticket (#19).
Repo Placement
OK -- all work is in ldraney/botfire, matching the Forgejo issue repo. Single repo, no cross-repo concerns.
Dependencies
- Issue #19 (scanner bug, board item #1850) is documented in Lineage. Currently in backlog. Non-blocking -- scoreboard changes work with whatever BotFire records exist. Basketball trades will flow once #19 is fixed, and per-sport breakdown will pick them up automatically.
- No other blocking dependencies on the board.
Acceptance Criteria
All 3 AC are scoreboard-specific, verifiable by an agent:
- [x] AC1: "Scoreboard service outputs per-sport stats" -- agent can verify by checking Scoreboard.report output contains sport grouping
- [x] AC2: "When a sport has 0 trades, it doesn't appear" -- agent can verify with test data (empty sports excluded)
- [x] AC3: "All-sport totals still displayed alongside per-sport breakdown" -- agent can verify totals_line still present in report output
Previous review's flagged AC about the dashboard has been removed. All remaining AC are valid.
Blast Radius
Scoreboard is consumed by two callers:
bot_engine.rbline 269 -- printsScoreboard.reportto terminal log. Adding sport grouping to report output changes log format (expected, that's the goal).dashboard_controller.rbline 36 -- usesScoreboard.new.bot_summary(bot)for bot card data. As long as bot_summary return hash is not modified, dashboard is unaffected.
portfolio_grouper.rb line 67 already uses f.market.game.sport_type for grouping, validating the data path pattern. Not affected by this change.No downstream consumers beyond these two callers.
Decomposition Assessment
1 file to modify (scoreboard.rb), 1 file to create (scoreboard_test.rb), 3 AC, single repo. Well within single-agent pass (<5 min). No decomposition needed. Points of 2 are appropriate.
Recommendation
No action needed. All previous NEEDS_REFINEMENT findings have been addressed:
- arch-bots note now exists (resolved [SCOPE])
- Issue body scoped to scoreboard only, dashboard references removed (resolved [BODY])
- AC rewritten to scoreboard-specific criteria (resolved [BODY])
- Points reduced from 3 to 2 (resolved [BODY])
- scoreboard_test.rb correctly listed as file to CREATE in File Targets (resolved [BODY])