✅ All functions copy on write
| Category | Ability |
| Status | Passing |
| Test | tests/test_turn_sequence.py::test_all_functions_copy_on_write |
State-changing functions return new states without mutating the input state.
Preconditions
- An initial game state
Action
-
Call multiple state-changing functions (march, attack, ability, phase advance)
-
Keep reference to the original state
Expected Postconditions
-
Original state unchanged after each function call
-
Each function returns a new state object
-
Copy-on-write semantics enforced throughout the engine
-
No shared mutable references between old and new states