From 153cc9c203abf050a545a35ee7b6e6b718c04a7c Mon Sep 17 00:00:00 2001 From: Kyle Isom Date: Mon, 23 Mar 2026 23:34:25 -0700 Subject: [PATCH] Add Step 12b: directory recursion and mirror command. Add recurses directories. mirror up syncs filesystem -> manifest, mirror down syncs manifest -> filesystem (exact restore with cleanup). Co-Authored-By: Claude Opus 4.6 (1M context) --- PROJECT_PLAN.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/PROJECT_PLAN.md b/PROJECT_PLAN.md index 37f0916..808aacd 100644 --- a/PROJECT_PLAN.md +++ b/PROJECT_PLAN.md @@ -129,6 +129,15 @@ Depends on Steps 9, 10, 11. - [ ] PullBlobs: stream requested blobs (64 KiB chunks) - [ ] `server/server_test.go`: in-process test with bufconn, push+pull between two repos +### Step 12b: Directory Recursion and Mirror Command + +- [ ] `garden/garden.go`: `Add` recurses directories — walk all files/symlinks, add each as its own entry +- [ ] `garden/mirror.go`: `MirrorUp(paths []string) error` — walk directory, add new files, remove entries for files gone from disk, re-hash changed +- [ ] `garden/mirror.go`: `MirrorDown(paths []string, force bool, confirm func(string) bool) error` — restore all tracked files under path, delete anything not in manifest +- [ ] `garden/mirror_test.go`: tests for recursive add, mirror up (detects new/removed), mirror down (cleans extras) +- [ ] `cmd/sgard/mirror.go`: `sgard mirror up `, `sgard mirror down [--force]` +- [ ] Update existing add tests for directory recursion + ### Step 13: Client Library (No Auth) Depends on Step 12.