check given a URL reports the index.mf that fetch saved as an extra file, so a fetched tree fails --no-extra-files #229

Closed
opened 2026-10-15 20:27:46 +02:00 by clawbot · 2 comments
Collaborator

fetch saves the manifest it fetched as index.mf at the top of the tree it writes, "so mfer check can verify the tree later" (README, mfer fetch). check given that same URL then reports the saved index.mf as EXTRA: index.mf (not in manifest), and with --no-extra-files fails the tree fetch just wrote and verified. The walk for extra files in mfer/checker.go skips only the manifest file check was given, and a manifest given by URL is not a file in the base directory. The same happens on the serving side: check --no-extra-files --base DIR <URL> fails on the index.mf that gen wrote in DIR, although gen never lists the file it writes and fetch refuses a manifest that lists index.mf at the top of the tree.

Reproduce on next: gen in a directory srv, serve srv over HTTP, mfer fetch --dest mirror http://HOST/, then mfer check --no-extra-files --base mirror http://HOST/index.mf exits 1 with EXTRA: index.mf (not in manifest); mfer check --no-extra-files mirror passes.

Correct: check never reports index.mf at the top of the base directory as an extra file, whether the manifest was given by URL or by path, since that is where gen and fetch put the manifest. A manifest that does list index.mf still has that entry checked like any other. A leftover .index.mf.tmp is still reported.

Severity: minor

Definition of done

  • Failing test first: through the CLI entry point, check --no-extra-files --base DIR <URL> of an intact tree served by httptest, with index.mf saved at the top of DIR, passes.
  • The fix in package cli (internal/cli/check.go), which owns the default manifest name index.mf; package mfer changes only if the Checker cannot be told which file to leave out another way.
  • README, mfer check section: says index.mf at the top of the base directory is never reported as extra.
  • make check passes.

Model: opus-5-5

`fetch` saves the manifest it fetched as `index.mf` at the top of the tree it writes, "so `mfer check` can verify the tree later" (README, `mfer fetch`). `check` given that same URL then reports the saved `index.mf` as `EXTRA: index.mf (not in manifest)`, and with `--no-extra-files` fails the tree fetch just wrote and verified. The walk for extra files in `mfer/checker.go` skips only the manifest file `check` was given, and a manifest given by URL is not a file in the base directory. The same happens on the serving side: `check --no-extra-files --base DIR <URL>` fails on the `index.mf` that `gen` wrote in `DIR`, although `gen` never lists the file it writes and `fetch` refuses a manifest that lists `index.mf` at the top of the tree. Reproduce on `next`: `gen` in a directory `srv`, serve `srv` over HTTP, `mfer fetch --dest mirror http://HOST/`, then `mfer check --no-extra-files --base mirror http://HOST/index.mf` exits 1 with `EXTRA: index.mf (not in manifest)`; `mfer check --no-extra-files mirror` passes. Correct: `check` never reports `index.mf` at the top of the base directory as an extra file, whether the manifest was given by URL or by path, since that is where `gen` and `fetch` put the manifest. A manifest that does list `index.mf` still has that entry checked like any other. A leftover `.index.mf.tmp` is still reported. Severity: minor ## Definition of done - Failing test first: through the CLI entry point, `check --no-extra-files --base DIR <URL>` of an intact tree served by `httptest`, with `index.mf` saved at the top of `DIR`, passes. - The fix in package `cli` (`internal/cli/check.go`), which owns the default manifest name `index.mf`; package `mfer` changes only if the Checker cannot be told which file to leave out another way. - README, `mfer check` section: says `index.mf` at the top of the base directory is never reported as extra. - `make check` passes. Model: opus-5-5
clawbot self-assigned this 2026-10-15 20:27:46 +02:00
Author
Collaborator

Plan: built as the issue says, after #227 lands, since both change how check hands a downloaded manifest to the Checker in internal/cli/check.go. One PR to next through an independent review. Worker rules: #99 (comment), without the TODO.md step.

Model: opus-5-5

Plan: built as the issue says, after https://git.eeqj.de/sneak/mfer/pulls/227 lands, since both change how `check` hands a downloaded manifest to the Checker in `internal/cli/check.go`. One PR to `next` through an independent review. Worker rules: https://git.eeqj.de/sneak/mfer/issues/99#issuecomment-115880, without the `TODO.md` step. Model: opus-5-5
Author
Collaborator

Built in #232: check no longer reports index.mf at the top of the base directory as a file the manifest does not list, whether the manifest is given by URL or by path. The fix is in package cli; package mfer is unchanged.

Model: opus-5-5

Built in https://git.eeqj.de/sneak/mfer/pulls/232: `check` no longer reports `index.mf` at the top of the base directory as a file the manifest does not list, whether the manifest is given by URL or by path. The fix is in package `cli`; package `mfer` is unchanged. Model: opus-5-5
Sign in to join this conversation.