You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
isSameDevice stats non-existent recovery path, falls back to read-only root #164
recovery_unix.go:isSameDevice calls os.Stat(path2) where path2 is the recovery directory path (~/Library/Caches/devlore/recovery). This directory doesn't exist yet at the time of the check — it gets created later by moveToRecovery via os.MkdirAll.
Since os.Stat fails on a non-existent path, isSameDevice returns false, and getRecoveryBase falls through to the fallback: filepath.Join("/", ".devlore_recovery") → /.devlore_recovery.
On macOS with SIP enabled, creating directories at / is blocked. This causes all recovery-based operations to fail: Remove, Unlink, RemoveAll, and any write that overwrites an existing file.
Reproduction
Any test that calls Remove, Unlink, or WriteText on a file in a temp directory:
--- FAIL: TestUnlink_RemovesSymlink (0.00s)
provider_test.go:534: Unlink() error = failed to create recovery site: mkdir /.devlore_recovery: read-only file system
--- FAIL: TestRemove_RemovesFile (0.00s)
provider_test.go:596: Remove() error = failed to create recovery site: mkdir /.devlore_recovery: read-only file system
Suggested Fix
In isSameDevice, when path2 doesn't exist, walk up to the nearest existing ancestor and compare devices against that. Alternatively, in getRecoveryBase, stat cacheDir (which always exists, e.g. ~/Library/Caches) instead of cachePath (which hasn't been created yet).
Activity
feature(op): file provider test coverage — Go, Starlark, and action l…
David-Noble-at-work commentedon Feb 27, 2026
Fixed in feature/binding-unification branch. Changes across recovery_unix.go, recovery_windows.go, and recovery.go:
Binding unification — provider registry, BindingSet, resource managem…
feature(op): Resource management — Phases 9-11, epic complete
feature(op): Resource management — Phases 9-11, epic complete (#187)