check reports symlinks gen never lists as extra files, so --no-extra-files cannot pass on a tree with a directory symlink #192

Open
opened 2026-10-12 11:17:37 +02:00 by clawbot · 1 comment
Collaborator

Checker.FindExtraFiles in mfer/checker.go reports every non-directory entry the manifest does not list, symlinks included. gen never lists a symlink to a directory, with or without --follow-symlinks (Scanner.enumerateFileWithInfo in mfer/scanner.go skips it), and lists a symlink to a file only with --follow-symlinks. So on a tree holding a directory symlink, no manifest gen can write passes check --no-extra-files, and a plain check warns on every run.

Reproduce on next (0fbb3da): mkdir -p t/real; echo r > t/real/r.txt; ln -s real t/linkdir; mfer gen t; mfer check --no-extra-files t exits 1 with EXTRA: linkdir; the same after mfer gen --force --follow-symlinks t.

Correct: the extra-file search reports a symlink only when it points to a regular file, which --follow-symlinks would have listed; a symlink to a directory or a broken one, which nothing can list, is never reported. The README's check entry says what is reported.

Definition of done

  • Failing test first: a tree with a symlink to a directory, one to a file and a broken one; a manifest from gen --follow-symlinks passes check --no-extra-files; one from plain gen fails only on the file symlink.
  • The fix in mfer/checker.go.
  • README check entry updated.
  • make check passes.

Model: fable-5-1

`Checker.FindExtraFiles` in `mfer/checker.go` reports every non-directory entry the manifest does not list, symlinks included. `gen` never lists a symlink to a directory, with or without `--follow-symlinks` (`Scanner.enumerateFileWithInfo` in `mfer/scanner.go` skips it), and lists a symlink to a file only with `--follow-symlinks`. So on a tree holding a directory symlink, no manifest `gen` can write passes `check --no-extra-files`, and a plain `check` warns on every run. Reproduce on `next` (0fbb3da): `mkdir -p t/real; echo r > t/real/r.txt; ln -s real t/linkdir; mfer gen t; mfer check --no-extra-files t` exits 1 with `EXTRA: linkdir`; the same after `mfer gen --force --follow-symlinks t`. Correct: the extra-file search reports a symlink only when it points to a regular file, which `--follow-symlinks` would have listed; a symlink to a directory or a broken one, which nothing can list, is never reported. The README's `check` entry says what is reported. ## Definition of done - Failing test first: a tree with a symlink to a directory, one to a file and a broken one; a manifest from `gen --follow-symlinks` passes `check --no-extra-files`; one from plain `gen` fails only on the file symlink. - The fix in `mfer/checker.go`. - README `check` entry updated. - `make check` passes. Model: fable-5-1
clawbot self-assigned this 2026-10-12 11:17:37 +02:00
Author
Collaborator

Fixed in #212: the search for extra files in check now reports only regular files, reached directly or through a symlink, so a symlink to a directory or a broken one is never reported. The README's check entry says what is reported.

Model: opus-5-5

Fixed in https://git.eeqj.de/sneak/mfer/pulls/212: the search for extra files in `check` now reports only regular files, reached directly or through a symlink, so a symlink to a directory or a broken one is never reported. The README's `check` entry says what is reported. Model: opus-5-5
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sneak/mfer#192