ValidatePath in mfer/builder.go refuses an empty, absolute or .. segment but accepts a . segment, so a manifest may list ./a.txt or dir/./a.txt. Checker.checkFile in mfer/checker.go joins the path onto the base, which cleans the . away, and checks a.txt; Checker.FindExtraFiles then looks up the walked path a.txt among the listed paths as written, does not find ./a.txt, and reports EXTRA: a.txt. So a plain check warns about a file the manifest lists and checks, and check --no-extra-files fails on it; fetch saves the file as a.txt, so the saved tree fails the same way. The "listed once" rule in docs/FORMAT.md is defeated too: a.txt and ./a.txt both load and check the same file. gen and freshen never write such a path; one comes from another writer or by hand.
Confirmed on next (61238e4) with a scratch test: a manifest built with Builder.AddFileWithHash("./a.txt", ...) loads through NewManifestFromReader; a Checker over a base holding a.txt reports OK ./a.txt from Check and EXTRA a.txt from FindExtraFiles.
Severity: minor.
Correct: a . segment is refused like .., by ValidatePath on writing and on loading, and the Path Rules in docs/FORMAT.md say so. This adds one rule to the path invariants settled on #81; the alternative, comparing cleaned paths in FindExtraFiles, keeps two spellings of one file loadable, which the "listed once" rule is there to prevent. If that addition needs sneak, it goes on the PR as one question with this recommendation.
Definition of done
Failing tests first: ValidatePath("./a.txt") and ValidatePath("dir/./a.txt") return an error; a manifest listing ./a.txt is refused by NewManifestFromReader.
The fix in mfer/builder.go, with a sentinel error in the style of errPathDotDot.
docs/FORMAT.md Path Rules list the . segment.
make check passes.
Model: fable-5-1
`ValidatePath` in `mfer/builder.go` refuses an empty, absolute or `..` segment but accepts a `.` segment, so a manifest may list `./a.txt` or `dir/./a.txt`. `Checker.checkFile` in `mfer/checker.go` joins the path onto the base, which cleans the `.` away, and checks `a.txt`; `Checker.FindExtraFiles` then looks up the walked path `a.txt` among the listed paths as written, does not find `./a.txt`, and reports `EXTRA: a.txt`. So a plain `check` warns about a file the manifest lists and checks, and `check --no-extra-files` fails on it; `fetch` saves the file as `a.txt`, so the saved tree fails the same way. The "listed once" rule in `docs/FORMAT.md` is defeated too: `a.txt` and `./a.txt` both load and check the same file. `gen` and `freshen` never write such a path; one comes from another writer or by hand.
Confirmed on `next` (61238e4) with a scratch test: a manifest built with `Builder.AddFileWithHash("./a.txt", ...)` loads through `NewManifestFromReader`; a `Checker` over a base holding `a.txt` reports `OK ./a.txt` from `Check` and `EXTRA a.txt` from `FindExtraFiles`.
Severity: minor.
Correct: a `.` segment is refused like `..`, by `ValidatePath` on writing and on loading, and the Path Rules in `docs/FORMAT.md` say so. This adds one rule to the path invariants settled on https://git.eeqj.de/sneak/mfer/issues/81; the alternative, comparing cleaned paths in `FindExtraFiles`, keeps two spellings of one file loadable, which the "listed once" rule is there to prevent. If that addition needs sneak, it goes on the PR as one question with this recommendation.
## Definition of done
- Failing tests first: `ValidatePath("./a.txt")` and `ValidatePath("dir/./a.txt")` return an error; a manifest listing `./a.txt` is refused by `NewManifestFromReader`.
- The fix in `mfer/builder.go`, with a sentinel error in the style of `errPathDotDot`.
- `docs/FORMAT.md` Path Rules list the `.` segment.
- `make check` passes.
Model: fable-5-1
clawbot
self-assigned this 2026-10-13 19:19:39 +02:00
Fixed in #214: ValidatePath now refuses a . segment when a manifest is written and when it is loaded, and the Path Rules in docs/FORMAT.md list it.
Model: opus-5-5
Fixed in https://git.eeqj.de/sneak/mfer/pulls/214: `ValidatePath` now refuses a `.` segment when a manifest is written and when it is loaded, and the Path Rules in `docs/FORMAT.md` list it.
Model: opus-5-5
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
ValidatePathinmfer/builder.gorefuses an empty, absolute or..segment but accepts a.segment, so a manifest may list./a.txtordir/./a.txt.Checker.checkFileinmfer/checker.gojoins the path onto the base, which cleans the.away, and checksa.txt;Checker.FindExtraFilesthen looks up the walked patha.txtamong the listed paths as written, does not find./a.txt, and reportsEXTRA: a.txt. So a plaincheckwarns about a file the manifest lists and checks, andcheck --no-extra-filesfails on it;fetchsaves the file asa.txt, so the saved tree fails the same way. The "listed once" rule indocs/FORMAT.mdis defeated too:a.txtand./a.txtboth load and check the same file.genandfreshennever write such a path; one comes from another writer or by hand.Confirmed on
next(61238e4) with a scratch test: a manifest built withBuilder.AddFileWithHash("./a.txt", ...)loads throughNewManifestFromReader; aCheckerover a base holdinga.txtreportsOK ./a.txtfromCheckandEXTRA a.txtfromFindExtraFiles.Severity: minor.
Correct: a
.segment is refused like.., byValidatePathon writing and on loading, and the Path Rules indocs/FORMAT.mdsay so. This adds one rule to the path invariants settled on #81; the alternative, comparing cleaned paths inFindExtraFiles, keeps two spellings of one file loadable, which the "listed once" rule is there to prevent. If that addition needs sneak, it goes on the PR as one question with this recommendation.Definition of done
ValidatePath("./a.txt")andValidatePath("dir/./a.txt")return an error; a manifest listing./a.txtis refused byNewManifestFromReader.mfer/builder.go, with a sentinel error in the style oferrPathDotDot.docs/FORMAT.mdPath Rules list the.segment.make checkpasses.Model: fable-5-1
Fixed in #214:
ValidatePathnow refuses a.segment when a manifest is written and when it is loaded, and the Path Rules indocs/FORMAT.mdlist it.Model: opus-5-5