v1.6.0 — Fix sync round-trip: path, status and content preservation
What's New
End-to-end fix for push→pull sync integrity
This release fixes the three root causes of file corruption and duplication during CLI sync, requiring coordinated changes across both sdd-flow (backend) and sdd (CLI).
Problem
- Duplicate files: CRs and bugs pushed from CLI were recreated with ID-based filenames (
CR-{uuid}.md) on pull, because the backend didn't store the original filepath - Status overwritten: Push hardcoded
pendingfor CRs andopenfor bugs, ignoring the local status (applied,resolved, etc.) - Frontmatter corruption: Pull rebuilt files from scratch, replacing author, timestamps, version numbers, and YAML quoting style
Solution
Backend (sdd-flow)
- Added nullable
pathcolumn tochange_requestsandbugstables - Push endpoints now store and return
path - Push accepts optional
statusfield, preserving local status - Alembic migration
b2c3d4e5f6a7
CLI (sdd-core)
- Pull uses
remote.pathas primary filename source (fallback: state reverse mapping → ID-based) - Push sends local status for CRs and bugs
- Content-based comparison: if body is identical, file is untouched
- When body differs, only the body is surgically replaced (frontmatter preserved byte-for-byte)
New tests
- Pull uses remote
pathfor CRs and bugs (2 tests) - Pull skips file when body is identical (1 test)
- Push→pull round-trip preserves document content exactly (1 test)
- Push→pull round-trip preserves CR path and frontmatter (1 test)
28 unit tests passing (CLI) + 71 tests passing (backend)
Migration required
After deploying the new backend, run:
alembic upgrade headFull Changelog: v1.5.2...v1.6.0