fix(dev): set last_evaluated_at to now() on rollback reset

Step 8 of the rollback algorithm previously set last_evaluated_at
to NULL. While step 13's evaluate_card() overwrites it back to
now(), leaving the column transiently NULL is fragile: callers
that use /refractor/cards default evaluated_only=true filter
would miss the row if they observed it mid-rollback, and the
intermediate state would be invalid if step 13 is ever
refactored to skip the write.

Defensive: step 8 now writes a valid non-NULL timestamp itself.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Cal Corum 2026-04-11 10:01:26 -05:00
parent c78ae347f8
commit b44c4a6949

View File

@ -306,7 +306,7 @@ def rollback_test_game(game_id: int) -> dict:
state.current_tier = new_tier
state.variant = new_variant if new_variant else None
state.fully_evolved = new_tier >= 4
state.last_evaluated_at = None
state.last_evaluated_at = datetime.now()
state.save()
# ------------------------------------------------------------------