From 84801a7971d2118b3d7b0cad6309450ba87b0f6b Mon Sep 17 00:00:00 2001 From: mikael-lovqvists-claude-agent Date: Sat, 7 Mar 2026 01:07:21 +0000 Subject: [PATCH] Update plan: use rsync --itemize-changes for change detection, no dir walk --- PLAN.md | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/PLAN.md b/PLAN.md index c61a6e2..faf8edd 100644 --- a/PLAN.md +++ b/PLAN.md @@ -20,7 +20,7 @@ backup storage grow proportionally to what actually changed. 1. **Clear PEND** — remove all contents 2. **rsync PREV → PEND** — seed locally (fast) 3. **rsync SOURCE → PEND** — apply remote changes (only diffs travel over the wire) -4. **Generate delta** — diff PREV vs PEND, produce per-file deltas + manifest +4. **Generate delta** — parse rsync itemize output to get change list, produce per-file deltas + manifest 5. **Commit delta** — write to DELTAS atomically 6. **Promote PEND → PREV** — swap working area to become new base @@ -47,6 +47,22 @@ State.json is a recoverable cache — can be reconstructed by scanning DELTAS. - `DELTAS/N/` exists but `last_complete` is N-1 → finish promotion, update state - state.json missing → reconstruct from directory scan +## Change Detection + +No directory walk needed. rsync SOURCE→PEND is run with `--itemize-changes`, producing a +machine-readable list of exactly what changed. Output is captured (not streamed) and parsed: + +| rsync prefix | Meaning | +|-------------|----------| +| `>f+++++++++` | New file | +| `>f.st......` | Modified file (any combination of change flags) | +| `*deleting` | Deleted file | +| `cd+++++++++` | New directory (ignored for delta purposes) | + +Lines starting with `>f` or `*deleting` are extracted. The path is the remainder after the +11-character itemize code + space. This becomes the change list fed directly into delta generation +— no separate directory walk required. + ## Delta Format Pluggable backend interface with two operations: