gen and freshen list no files when the directory is reached through a symlink #185

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

Found by the reviewer of #184 and reproduced on next.

Problem

When the directory mfer scans is reached through a symlink, it lists no files and says nothing:

  • mfer gen link, where link is a symlink to a directory, writes a manifest with no files and exits 0.
  • mfer gen run in a directory whose path goes through a symlink (the shell's working directory names the link) does the same.
  • mfer freshen run there removes every entry from the existing manifest and exits 0.
  • mfer check of such a manifest then passes, since it lists nothing.

The walk starts at the path as named and does not follow a symlink at its top (enumerateFS in mfer/scanner.go, the walk in internal/cli/freshen.go). check's search for extra files already resolves its base directory first (FindExtraFiles in mfer/checker.go).

Definition of done

  • Failing tests first for each case above.
  • A directory that gen or freshen scans, whether given as an argument or the current directory, is resolved to the directory it names before the walk starts, so it lists the same files as when named by its real path. Symlinks inside the tree still follow --follow-symlinks.
  • make check passes.

Model: opus-5-5

Found by the reviewer of https://git.eeqj.de/sneak/mfer/pulls/184 and reproduced on `next`. ## Problem When the directory mfer scans is reached through a symlink, it lists no files and says nothing: - `mfer gen link`, where `link` is a symlink to a directory, writes a manifest with no files and exits 0. - `mfer gen` run in a directory whose path goes through a symlink (the shell's working directory names the link) does the same. - `mfer freshen` run there removes every entry from the existing manifest and exits 0. - `mfer check` of such a manifest then passes, since it lists nothing. The walk starts at the path as named and does not follow a symlink at its top (`enumerateFS` in `mfer/scanner.go`, the walk in `internal/cli/freshen.go`). `check`'s search for extra files already resolves its base directory first (`FindExtraFiles` in `mfer/checker.go`). ## Definition of done - Failing tests first for each case above. - A directory that `gen` or `freshen` scans, whether given as an argument or the current directory, is resolved to the directory it names before the walk starts, so it lists the same files as when named by its real path. Symlinks inside the tree still follow `--follow-symlinks`. - `make check` passes. Model: opus-5-5
clawbot added the critical label 2026-10-08 04:28:28 +02:00
Author
Collaborator

#186 resolves the directory gen and freshen walk, whether given as an argument or as the working directory, before the walk starts, as the search for extra files in check already did. Tests cover both commands in both cases.

Model: opus-5-5

https://git.eeqj.de/sneak/mfer/pulls/186 resolves the directory `gen` and `freshen` walk, whether given as an argument or as the working directory, before the walk starts, as the search for extra files in `check` already did. Tests cover both commands in both cases. Model: opus-5-5
Sign in to join this conversation.