fetch: a listed file at another listed file's temp name is deleted, and fetch still exits 0 #151

Closed
opened 2026-10-04 18:03:18 +02:00 by clawbot · 1 comment
Collaborator

fetch downloads each file to a temp name beside it (.a.txt.tmp for a.txt) and first removes whatever is already at that name (createTempFile in internal/cli/fetch.go). When a manifest lists both a.txt and .a.txt.tmp, .a.txt.tmp is downloaded first, since listed paths are sorted, and is then removed when a.txt is fetched. fetch exits 0 and leaves a tree that mfer check rejects for a missing file. The same holds in any directory. A manifest made with --include-dotfiles over a directory that holds a leftover from an interrupted fetch lists exactly such a pair.

#150 refuses this only for the saved manifest's own name and temp name.

Acceptable: fetch never exits 0 leaving a tree check rejects. For example, it refuses a manifest in which one listed path is another listed path's temp name, before it creates the destination or requests any file, with a test.

Model: opus-5-5

`fetch` downloads each file to a temp name beside it (`.a.txt.tmp` for `a.txt`) and first removes whatever is already at that name (`createTempFile` in `internal/cli/fetch.go`). When a manifest lists both `a.txt` and `.a.txt.tmp`, `.a.txt.tmp` is downloaded first, since listed paths are sorted, and is then removed when `a.txt` is fetched. `fetch` exits 0 and leaves a tree that `mfer check` rejects for a missing file. The same holds in any directory. A manifest made with `--include-dotfiles` over a directory that holds a leftover from an interrupted fetch lists exactly such a pair. https://git.eeqj.de/sneak/mfer/pulls/150 refuses this only for the saved manifest's own name and temp name. Acceptable: `fetch` never exits 0 leaving a tree `check` rejects. For example, it refuses a manifest in which one listed path is another listed path's temp name, before it creates the destination or requests any file, with a test. Model: opus-5-5
Author
Collaborator

#153 widens the existing refusal of the manifest's own names. fetch now refuses a manifest that lists a file, or a directory, at another listed file's temp name, in any letter case. It refuses before it creates the destination or requests any file.

The same kind of problem between two listed files whose names differ only in letter case is filed as #154.

Model: opus-5-5

https://git.eeqj.de/sneak/mfer/pulls/153 widens the existing refusal of the manifest's own names. `fetch` now refuses a manifest that lists a file, or a directory, at another listed file's temp name, in any letter case. It refuses before it creates the destination or requests any file. The same kind of problem between two listed files whose names differ only in letter case is filed as https://git.eeqj.de/sneak/mfer/issues/154. Model: opus-5-5
Sign in to join this conversation.