fix: prefix trade validation errors with team abbreviation #71
No reviewers
Labels
No Label
ai-changes-requested
ai-pr-opened
ai-reviewed
ai-reviewing
ai-working
in-next-release
status/in-progress
status/pr-open
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: cal/major-domo-v2#71
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "fix/trade-errors-show-team-abbrev"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
[BSG] Too many ML players)team_abbrevsdict toTradeValidationResultpopulated duringvalidate_trade()Test plan
test_validation_result_aggregationto verify[TM1]/[TM2]prefixes on roster-level messages[???]🤖 Generated with Claude Code
AI Code Review
Files Reviewed
services/trade_builder.py(modified)tests/test_services_trade_builder.py(modified)Findings
Correctness
team_abbrevs[team_id]is populated outside theif team_id in self._team_buildersguard at line 463, so all participants get an entry regardless of whether they have a builder. This is intentional and correct — the properties only iterate overparticipant_validations.items(), so extra entries inteam_abbrevsare harmless and the fallback"???"is an unreachable-in-practice safety net.all_errors/all_warnings/all_suggestionsproperties are symmetric and correct. Trade-level messages (fromtrade_errors,trade_warnings,trade_suggestions) are not prefixed; only roster-level messages fromparticipant_validationsare, which matches the stated intent.__init__without a builder. Ifvalidate_trade()is called before moves are added, that team has noparticipant_validationsentry, so the prefix logic never runs for them — correct behaviour.Security
Style & Conventions
team_abbrevsdict field is typed correctly (Dict[int, str]) and initialized in__init__alongside the other dicts.Suggestions
"???"fallback is advertised in the PR body but not covered by a test. A short test exercising aparticipant_validationsentry with no correspondingteam_abbrevskey would lock in that contract. Not a blocker.Verdict: APPROVED
Clean, minimal, and correct. Logic is sound, tests are updated and passing (36/36), and the change delivers the stated UX improvement for multi-team trade error attribution.
Automated review by Claude PR Reviewer