Commit 9c7df9d
feat(sync,storage): propagate acceleration_json column through sync pipeline with fail-closed overwrite semantics
sync.rs (+2007 lines):
- All sync export queries (full and incremental) now SELECT and write
acceleration_json to JSONL output
- Import now reads acceleration_json from JSONL as the 12th column and
INSERTs it into the database
- Conflict detection includes acceleration_json comparison for detecting
divergence between local and remote states
- validate_sync() now checks replay_json and acceleration_json fields
against the database to catch deserialization issues
- Overwrite behavior changed to fail-closed: overwrite imports that would
delete child rows (segments, events) now return an explicit error
instead of silently preserving stale data (test renamed from
overwrite_run_preserves_segments_and_events_in_compat_mode to
overwrite_run_with_missing_children_fails_closed)
- Massive test expansion (~1500+ lines) covering edge cases: partial
imports, incremental sync boundaries, conflict resolution, cascade
awareness, duplicate detection
storage.rs (+773 lines):
- load_run_details() now queries acceleration_json column with backward-
compatible fallback ('{}' AS acceleration_json if column is missing)
- Deserialized acceleration_override from the column takes priority over
result.acceleration via .or() fallback for corrupt JSON
- Extensive new tests: corrupt acceleration JSON fallback behavior, column
override priority, concurrent session parameters, duplicate persist
behavior, and additional edge cases
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>1 parent 4c7cc45 commit 9c7df9d
2 files changed
Lines changed: 2713 additions & 67 deletions
0 commit comments