Skip to content

fix: use direct construction for JustifiedSlots#513

Closed
tcoratger wants to merge 1 commit intoleanEthereum:mainfrom
tcoratger:fix/justified-slots-direct-construction
Closed

fix: use direct construction for JustifiedSlots#513
tcoratger wants to merge 1 commit intoleanEthereum:mainfrom
tcoratger:fix/justified-slots-direct-construction

Conversation

@tcoratger
Copy link
Copy Markdown
Collaborator

Summary

  • Replace JustifiedSlots(data=[]).model_copy(update={"data": [...]}) with JustifiedSlots(data=[...]) across 8 occurrences in test_justification.py
  • The model_copy pattern bypassed Pydantic validation, leaving a mutable list instead of the expected immutable tuple
  • Direct construction is simpler and produces correctly validated data

Test plan

  • uvx tox -e all-checks — all green

🤖 Generated with Claude Code

Replace `JustifiedSlots(data=[]).model_copy(update={"data": [...]})` with
`JustifiedSlots(data=[...])` across all 8 occurrences in test_justification.py.

The model_copy pattern bypassed Pydantic validation, leaving a mutable list
instead of the expected immutable tuple. Direct construction is simpler and
produces correctly validated data.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@tcoratger
Copy link
Copy Markdown
Collaborator Author

Closing: the model_copy pattern is intentional. The state transition function builds justified_slots via model_copy internally, which stores data as a list. Direct construction produces a tuple, causing equality mismatches. The fix needs to address the systemic list/tuple inconsistency in model_copy across the codebase first.

@tcoratger tcoratger closed this Apr 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant