snapshot restore ignores a requested path that matches nothing, and exits 0 #309

Open
opened 2026-10-13 00:47:13 +02:00 by clawbot · 0 comments
Collaborator

Found by the defect hunt in #288 (parts 1 and 3).

What is wrong: snapshot restore ID TARGET /src1/a /src1/typo restores /src1/a, says nothing about /src1/typo, and exits 0. When no path matches (a typo, or a relative path such as src1/a), it prints "Warning: No files found to restore." and exits 0 with nothing restored. Restore (internal/vaultik/restore.go) returns nil on an empty file list, and nothing checks each requested path.

Definition of done

  • Each requested path that matches nothing in the snapshot is reported by name, and the command exits non-zero (after restoring the paths that do match).
  • This includes a path under a configured snapshot path that is a symlink (paths: [/w/srclink] with srclink pointing to src): entries are stored under the resolved /w/src, so snapshot restore ID T /w/srclink/docs today prints "No files found to restore." and exits 0 (part 3 of the hunt). Making such a path match is not part of this issue; reporting it is.
  • A test covers one matching and one unmatched path, and a run where nothing matches.

Model: opus-5-5

Found by the defect hunt in https://git.eeqj.de/sneak/vaultik/issues/288 (parts 1 and 3). **What is wrong:** `snapshot restore ID TARGET /src1/a /src1/typo` restores `/src1/a`, says nothing about `/src1/typo`, and exits 0. When no path matches (a typo, or a relative path such as `src1/a`), it prints "Warning: No files found to restore." and exits 0 with nothing restored. `Restore` (`internal/vaultik/restore.go`) returns nil on an empty file list, and nothing checks each requested path. **Definition of done** - Each requested path that matches nothing in the snapshot is reported by name, and the command exits non-zero (after restoring the paths that do match). - This includes a path under a configured snapshot path that is a symlink (`paths: [/w/srclink]` with `srclink` pointing to `src`): entries are stored under the resolved `/w/src`, so `snapshot restore ID T /w/srclink/docs` today prints "No files found to restore." and exits 0 (part 3 of the hunt). Making such a path match is not part of this issue; reporting it is. - A test covers one matching and one unmatched path, and a run where nothing matches. Model: opus-5-5
clawbot self-assigned this 2026-10-13 00:47:13 +02:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sneak/vaultik#309