From 8d1d1241b605be252df7dfc2de040bc8072cb7d2 Mon Sep 17 00:00:00 2001 From: mikael-lovqvists-claude-agent Date: Sat, 7 Mar 2026 02:07:09 +0000 Subject: [PATCH] Add file attribute tracking TODO to PLAN.md Document planned approach for capturing and restoring file metadata (permissions, mtime, uid/gid) alongside content deltas. Notes the need for a pluggable attribute backend due to filesystem differences, and the requirement to fail loudly on incompatible attributes during restore. Co-Authored-By: Claude Sonnet 4.6 --- PLAN.md | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/PLAN.md b/PLAN.md index 6868468..c179a59 100644 --- a/PLAN.md +++ b/PLAN.md @@ -180,6 +180,28 @@ other. Approaches that could address this: These are significant complexity increases and out of scope for now. +### File attribute tracking (TODO) + +Currently the manifest records only file content changes. File metadata (permissions, mtime, +ownership, xattrs) is not tracked, meaning restore cannot faithfully reconstruct the original +state. + +**Planned approach:** +- On each run, compare attributes between PREV and PEND for every file in the change list +- Encode attribute changes explicitly in the manifest alongside content changes +- Restore walks the delta chain applying both content deltas and attribute deltas in sequence + +**Design considerations:** +- `fs.stat()` gives mode, mtime, uid, gid — but not xattrs, ACLs, or fs-specific attributes +- Attribute richness is highly filesystem-dependent (ext4, btrfs, APFS, NTFS all differ) +- Need a pluggable attribute backend, similar to the delta backend, so the attribute set captured + and restored can be tuned per deployment without changing core logic +- Restore must handle the case where an attribute from an older delta is no longer representable + on the target filesystem (e.g. restoring to a different fs type) — fail loudly rather than + silently skip +- rsync `-a` already preserves attributes into PEND, so PEND is always the authoritative source + of truth for what attributes should be at that point in time + ## Occasional Snapshots Delta chains are efficient but fragile over long chains. Periodic full snapshots (every N deltas,