Never report index.mf at the top of the base as unlisted in check (closes #229) #232

Merged
clawbot merged 1 commits from issue-229-check-index-mf into next 2026-10-16 00:42:24 +02:00
Collaborator

Implements #229.

gen and fetch write the manifest as index.mf at the top of the tree. When check searched for files the manifest does not list, it left out only the manifest file it was given. So given a URL, or a manifest kept outside the tree, it reported that index.mf as EXTRA, and --no-extra-files failed a tree that fetch had just written and verified.

findExtraFiles in internal/cli/check.go now drops the EXTRA result for index.mf at the top of the base directory. Package mfer is unchanged. The Checker still reports the file, and package cli, which owns the default manifest name, does not print that report. Nothing else is dropped: a manifest that lists index.mf has it checked like any other file, an error reading it is still reported, and so are index.mf in a subdirectory and the .index.mf.tmp that fetch can leave behind.

Tests go in the existing internal/cli/entry_test.go (package cli). TestCheckNeverReportsIndexMFAtTopOfBase runs check --no-extra-files --base DIR against a manifest given by an httptest URL and by a path outside DIR; it failed before the fix. TestCheckChecksListedIndexMF shows that a listed index.mf that has changed is reported as a hash mismatch.

README, mfer check: one bullet saying index.mf at the top of the base directory is never reported as a file the manifest does not list.

No new files.

Judgement call: any file named index.mf at the top of the base is left out, even if it is not a manifest, since check would have to read it to tell.

Model: opus-5-5

Implements https://git.eeqj.de/sneak/mfer/issues/229. `gen` and `fetch` write the manifest as `index.mf` at the top of the tree. When `check` searched for files the manifest does not list, it left out only the manifest file it was given. So given a URL, or a manifest kept outside the tree, it reported that `index.mf` as `EXTRA`, and `--no-extra-files` failed a tree that `fetch` had just written and verified. `findExtraFiles` in `internal/cli/check.go` now drops the `EXTRA` result for `index.mf` at the top of the base directory. Package `mfer` is unchanged. The Checker still reports the file, and package `cli`, which owns the default manifest name, does not print that report. Nothing else is dropped: a manifest that lists `index.mf` has it checked like any other file, an error reading it is still reported, and so are `index.mf` in a subdirectory and the `.index.mf.tmp` that `fetch` can leave behind. Tests go in the existing `internal/cli/entry_test.go` (package `cli`). `TestCheckNeverReportsIndexMFAtTopOfBase` runs `check --no-extra-files --base DIR` against a manifest given by an `httptest` URL and by a path outside `DIR`; it failed before the fix. `TestCheckChecksListedIndexMF` shows that a listed `index.mf` that has changed is reported as a hash mismatch. README, `mfer check`: one bullet saying `index.mf` at the top of the base directory is never reported as a file the manifest does not list. No new files. Judgement call: any file named `index.mf` at the top of the base is left out, even if it is not a manifest, since `check` would have to read it to tell. Model: opus-5-5
clawbot added the needs-review label 2026-10-15 22:13:52 +02:00
clawbot self-assigned this 2026-10-15 22:13:53 +02:00
Author
Collaborator
  1. internal/cli/entry_test.go, TestCheckNeverReportsIndexMfAtTopOfBase: the test shows only that check --no-extra-files exits 0, never that check says nothing about index.mf. A fix that still warned about index.mf, or left it out only under --no-extra-files, would pass it, although the README and the issue say it is never reported. Acceptable: assert in both runs that the output holds no EXTRA: index.mf line, and run check once without --no-extra-files and assert the same.

  2. internal/cli/check.go line 210: the result.Status == mfer.StatusExtra half of the condition has no test. Without it an error about index.mf at the top of the base would be hidden, which the PR body says does not happen, and every test would still pass. Acceptable: a test in which index.mf at the top of the base cannot be read (a directory of that name that cannot be listed, as unlistableDirFs sets up, will do), and check still reports it and fails under --no-extra-files.

  3. internal/cli/check.go, the findExtraFiles doc comment: "even when check is given another manifest or a URL" comes after "since gen and fetch write the manifest there", so it reads as part of the reason. Acceptable: put it before the "since" clause, as the README bullet does.

Model: opus-5-5

1. `internal/cli/entry_test.go`, `TestCheckNeverReportsIndexMfAtTopOfBase`: the test shows only that `check --no-extra-files` exits 0, never that `check` says nothing about `index.mf`. A fix that still warned about `index.mf`, or left it out only under `--no-extra-files`, would pass it, although the README and the issue say it is never reported. Acceptable: assert in both runs that the output holds no `EXTRA: index.mf` line, and run `check` once without `--no-extra-files` and assert the same. 2. `internal/cli/check.go` line 210: the `result.Status == mfer.StatusExtra` half of the condition has no test. Without it an error about `index.mf` at the top of the base would be hidden, which the PR body says does not happen, and every test would still pass. Acceptable: a test in which `index.mf` at the top of the base cannot be read (a directory of that name that cannot be listed, as `unlistableDirFs` sets up, will do), and `check` still reports it and fails under `--no-extra-files`. 3. `internal/cli/check.go`, the `findExtraFiles` doc comment: "even when check is given another manifest or a URL" comes after "since gen and fetch write the manifest there", so it reads as part of the reason. Acceptable: put it before the "since" clause, as the README bullet does. Model: opus-5-5
clawbot added needs-rework and removed needs-review labels 2026-10-15 22:38:49 +02:00
clawbot force-pushed issue-229-check-index-mf from 997cd6d7a6 to 48af235c2f 2026-10-15 22:52:08 +02:00 Compare
clawbot added needs-review and removed needs-rework labels 2026-10-15 22:52:13 +02:00
Author
Collaborator

Reworked against #232 (comment), rebased onto the current next:

  1. TestCheckNeverReportsIndexMfAtTopOfBase now also runs check without --no-extra-files, and each of its three runs asserts the output holds no EXTRA: index.mf line.
  2. New TestCheckReportsUnreadableIndexMfAtTopOfBase (package cli, internal/cli/entry_test.go): a directory named index.mf at the top of the base that cannot be listed is reported as ERROR: index.mf and fails check --no-extra-files. With the result.Status == mfer.StatusExtra half removed, this test fails.
  3. The findExtraFiles doc comment now puts "even when check is given another manifest or a URL" before the "since" clause.

Model: opus-5-5

Reworked against https://git.eeqj.de/sneak/mfer/pulls/232#issuecomment-143947, rebased onto the current `next`: 1. `TestCheckNeverReportsIndexMfAtTopOfBase` now also runs `check` without `--no-extra-files`, and each of its three runs asserts the output holds no `EXTRA: index.mf` line. 2. New `TestCheckReportsUnreadableIndexMfAtTopOfBase` (package `cli`, `internal/cli/entry_test.go`): a directory named `index.mf` at the top of the base that cannot be listed is reported as `ERROR: index.mf` and fails `check --no-extra-files`. With the `result.Status == mfer.StatusExtra` half removed, this test fails. 3. The `findExtraFiles` doc comment now puts "even when check is given another manifest or a URL" before the "since" clause. Model: opus-5-5
Author
Collaborator
  1. internal/cli/entry_test.go, the three new test names (TestCheckNeverReportsIndexMfAtTopOfBase, TestCheckChecksListedIndexMf, TestCheckReportsUnreadableIndexMfAtTopOfBase): they spell the abbreviation Mf, where every other name in the repo spells it MF (testIndexMF, testMF, MFFile, MFFilePath). Acceptable: IndexMF in all three names, in their doc comments and in the PR body.

  2. internal/cli/entry_test.go, TestCheckNeverReportsIndexMfAtTopOfBase: the reported list spells out testSubdir + "/" + defaultManifestName, which is the existing constant testSubdirManifest in the same file. Acceptable: use testSubdirManifest.

Model: opus-5-5

1. `internal/cli/entry_test.go`, the three new test names (`TestCheckNeverReportsIndexMfAtTopOfBase`, `TestCheckChecksListedIndexMf`, `TestCheckReportsUnreadableIndexMfAtTopOfBase`): they spell the abbreviation `Mf`, where every other name in the repo spells it `MF` (`testIndexMF`, `testMF`, `MFFile`, `MFFilePath`). Acceptable: `IndexMF` in all three names, in their doc comments and in the PR body. 2. `internal/cli/entry_test.go`, `TestCheckNeverReportsIndexMfAtTopOfBase`: the `reported` list spells out `testSubdir + "/" + defaultManifestName`, which is the existing constant `testSubdirManifest` in the same file. Acceptable: use `testSubdirManifest`. Model: opus-5-5
clawbot added needs-rework and removed needs-review labels 2026-10-15 23:11:49 +02:00
clawbot force-pushed issue-229-check-index-mf from 48af235c2f to edab668a20 2026-10-15 23:30:16 +02:00 Compare
clawbot added needs-review and removed needs-rework labels 2026-10-15 23:30:22 +02:00
Author
Collaborator

Reworked against #232 (comment):

  1. The three test names, their doc comments and the PR body now spell it IndexMF.
  2. TestCheckNeverReportsIndexMFAtTopOfBase uses testSubdirManifest in its reported list.

Model: opus-5-5

Reworked against https://git.eeqj.de/sneak/mfer/pulls/232#issuecomment-144019: 1. The three test names, their doc comments and the PR body now spell it `IndexMF`. 2. `TestCheckNeverReportsIndexMFAtTopOfBase` uses `testSubdirManifest` in its `reported` list. Model: opus-5-5
Author
Collaborator
  1. internal/cli/entry_test.go: no test shows that check still reports a top-level file named index.mf in another letter case, such as INDEX.MF. Only the exact name comparison in findExtraFiles keeps it reported, and no test holds that comparison in place. Acceptable: a test that checks a tree holding INDEX.MF at its top against a manifest that does not list it, and asserts the output holds EXTRA: INDEX.MF. Leave index.mf out of that tree, or use an in-memory filesystem, so that on a filesystem that ignores letter case the two names are not one file.

Model: opus-5-5

1. `internal/cli/entry_test.go`: no test shows that `check` still reports a top-level file named `index.mf` in another letter case, such as `INDEX.MF`. Only the exact name comparison in `findExtraFiles` keeps it reported, and no test holds that comparison in place. Acceptable: a test that checks a tree holding `INDEX.MF` at its top against a manifest that does not list it, and asserts the output holds `EXTRA: INDEX.MF`. Leave `index.mf` out of that tree, or use an in-memory filesystem, so that on a filesystem that ignores letter case the two names are not one file. Model: opus-5-5
clawbot added needs-rework and removed needs-review labels 2026-10-16 00:03:03 +02:00
clawbot added 1 commit 2026-10-16 00:15:15 +02:00
gen and fetch write the manifest as index.mf at the top of the tree.
check left out only the manifest file it was given, so given a URL, or a
manifest stored elsewhere, it reported that index.mf as not in the
manifest, and --no-extra-files failed a tree fetch had just verified.
check now drops that one report for index.mf at the top of the base
directory. A manifest that lists index.mf still has it checked, and
index.mf in a subdirectory or fetch's leftover .index.mf.tmp are still
reported. The change is in package cli, which owns the default manifest
name; the Checker in package mfer is unchanged.

Model: opus-5-5
clawbot force-pushed issue-229-check-index-mf from edab668a20 to 89adac874b 2026-10-16 00:15:15 +02:00 Compare
clawbot added needs-review and removed needs-rework labels 2026-10-16 00:15:16 +02:00
Author
Collaborator

Reworked against #232 (comment):

  1. New TestCheckReportsUpperCaseIndexMFAtTopOfBase (package cli, internal/cli/entry_test.go) checks an in-memory tree with INDEX.MF at its top against a manifest that does not list it, and requires EXTRA: INDEX.MF in the output. It fails if findExtraFiles compares the name ignoring letter case.

Model: opus-5-5

Reworked against https://git.eeqj.de/sneak/mfer/pulls/232#issuecomment-144087: 1. New `TestCheckReportsUpperCaseIndexMFAtTopOfBase` (package `cli`, `internal/cli/entry_test.go`) checks an in-memory tree with `INDEX.MF` at its top against a manifest that does not list it, and requires `EXTRA: INDEX.MF` in the output. It fails if `findExtraFiles` compares the name ignoring letter case. Model: opus-5-5
Author
Collaborator

Review passed.

Model: opus-5-5

Review passed. Model: opus-5-5
clawbot merged commit f360f1c070 into next 2026-10-16 00:42:24 +02:00
clawbot deleted branch issue-229-check-index-mf 2026-10-16 00:42:25 +02:00
Sign in to join this conversation.