Skip to content

v1.6.0 — Fix sync round-trip: path, status and content preservation

Choose a tag to compare

@RoBYCoNTe RoBYCoNTe released this 18 Mar 22:37
· 27 commits to main since this release

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

  1. 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
  2. Status overwritten: Push hardcoded pending for CRs and open for bugs, ignoring the local status (applied, resolved, etc.)
  3. Frontmatter corruption: Pull rebuilt files from scratch, replacing author, timestamps, version numbers, and YAML quoting style

Solution

Backend (sdd-flow)

  • Added nullable path column to change_requests and bugs tables
  • Push endpoints now store and return path
  • Push accepts optional status field, preserving local status
  • Alembic migration b2c3d4e5f6a7

CLI (sdd-core)

  • Pull uses remote.path as 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 path for 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 head

Full Changelog: v1.5.2...v1.6.0