Skip to content

Refactor: Route save_sync_state.json through PersistenceAdapter #166

@danielcopper

Description

@danielcopper

Problem

SaveService.save_state() (saves.py:143-152) reimplements the same flock + tmp + replace pattern that PersistenceAdapter._locked_write already provides. This is code duplication — the locked-write pattern exists in exactly two places.

Proposed Solution

Route save_sync_state.json through PersistenceAdapter like all other state files. Either:

  1. Add save_save_sync_state / load_save_sync_state methods to PersistenceAdapter
  2. Or extract the locked-write pattern into a shared utility that both use

Priority

P0 — architecture hygiene, part of refactoring sprint

Area

Architecture, Saves

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions