Description
Implement a versioning layer for the puzzles module so that puzzle edits do not break active sessions or invalidate historical scores. Every time an admin modifies a puzzle's conditions, effects, or hints, a new version is created. Active sessions always reference the version that was live when they started, preserving result integrity across the game's full history.
Acceptance Criteria
Description
Implement a versioning layer for the puzzles module so that puzzle edits do not break active sessions or invalidate historical scores. Every time an admin modifies a puzzle's conditions, effects, or hints, a new version is created. Active sessions always reference the version that was live when they started, preserving result integrity across the game's full history.
Acceptance Criteria
PuzzleVersionentity stores a full snapshot of puzzle data with a version number and createdAtPATCH /puzzles/:idcreates a new version instead of mutating the existing recordpuzzleVersionIdreference at creation timeGET /puzzles/:id/versions(admin-only) returns the full version historyGET /puzzles/:id/versions/:versionIdreturns a specific version snapshotPOST /puzzles/:id/rollback/:versionIdrestores a previous version as the latest