Problem
novelforge/progress.py lines 184-190: snapshot() returns shallow copies while get() returns deep copies. Nested structures in returned entries are shared references to the internal store.
Why It Matters
Code using snapshot() could inadvertently mutate the internal store by modifying nested data, contradicting the safety guarantee established by get().
Recommended Fix
def snapshot(self) -> dict[str, ProgressState]:
with self._lock:
return {k: copy.deepcopy(v) for k, v in self._store.items()}
Problem
novelforge/progress.pylines 184-190:snapshot()returns shallow copies whileget()returns deep copies. Nested structures in returned entries are shared references to the internal store.Why It Matters
Code using
snapshot()could inadvertently mutate the internal store by modifying nested data, contradicting the safety guarantee established byget().Recommended Fix