Refuse a path with a . segment (closes #208) #214

Merged
clawbot merged 1 commits from issue-208-refuse-dot-segment into next 2026-10-14 00:01:13 +02:00
Collaborator

ValidatePath refused a .. segment but accepted a . segment, so a manifest from another writer, or edited by hand, could list ./a.txt. check verified a.txt against that entry and then reported a.txt as an extra file, so check --no-extra-files failed on a tree that matches its manifest. The same file could also be listed twice, as a.txt and ./a.txt, which the "Listed once" rule in docs/FORMAT.md is there to prevent.

A . segment is now refused like .., both when a manifest is written and when it is loaded, since both go through ValidatePath. The Path Rules in docs/FORMAT.md and the path comment in mfer/mf.proto list it; mfer/mf.pb.go and mfer/mf.proto.sha256 are regenerated to match.

Not visible in the diff:

  • gen and freshen never write such a path, so the manifests they produce are unaffected.
  • Two fetch tests built manifests listing ./index.mf and ./x.txt to check that fetch refuses a name clash. Those manifests can no longer be built or loaded, so both cases are removed; the load test in mfer/deserialize_path_test.go now covers a leading ./.

Closes #208

Model: opus-5-5

`ValidatePath` refused a `..` segment but accepted a `.` segment, so a manifest from another writer, or edited by hand, could list `./a.txt`. `check` verified `a.txt` against that entry and then reported `a.txt` as an extra file, so `check --no-extra-files` failed on a tree that matches its manifest. The same file could also be listed twice, as `a.txt` and `./a.txt`, which the "Listed once" rule in `docs/FORMAT.md` is there to prevent. A `.` segment is now refused like `..`, both when a manifest is written and when it is loaded, since both go through `ValidatePath`. The Path Rules in `docs/FORMAT.md` and the path comment in `mfer/mf.proto` list it; `mfer/mf.pb.go` and `mfer/mf.proto.sha256` are regenerated to match. Not visible in the diff: - `gen` and `freshen` never write such a path, so the manifests they produce are unaffected. - Two fetch tests built manifests listing `./index.mf` and `./x.txt` to check that fetch refuses a name clash. Those manifests can no longer be built or loaded, so both cases are removed; the load test in `mfer/deserialize_path_test.go` now covers a leading `./`. Closes https://git.eeqj.de/sneak/mfer/issues/208 Model: opus-5-5
clawbot added the needs-review label 2026-10-13 20:57:25 +02:00
clawbot self-assigned this 2026-10-13 20:57:25 +02:00
Author
Collaborator

Review failed.

  • mfer/mf.proto, lines 51 to 53: the comment on MFFilePath.path lists the path rules and still leaves out the new one, so the format definition another writer works from allows ./a.txt, which mfer now refuses to load. The same text is in the generated mfer/mf.pb.go. Acceptable: add the . segment to that list, then regenerate with make generate and commit mf.pb.go and mf.proto.sha256 with it.

Judgement call: the new rule is taken as part of the path rules already settled on #81, not as a question for sneak.

Model: opus-5-5

Review failed. - `mfer/mf.proto`, lines 51 to 53: the comment on `MFFilePath.path` lists the path rules and still leaves out the new one, so the format definition another writer works from allows `./a.txt`, which mfer now refuses to load. The same text is in the generated `mfer/mf.pb.go`. Acceptable: add the `.` segment to that list, then regenerate with `make generate` and commit `mf.pb.go` and `mf.proto.sha256` with it. Judgement call: the new rule is taken as part of the path rules already settled on https://git.eeqj.de/sneak/mfer/issues/81, not as a question for sneak. Model: opus-5-5
clawbot added needs-rework and removed needs-review labels 2026-10-13 22:36:28 +02:00
clawbot added 1 commit 2026-10-13 22:46:51 +02:00
Refuse a path with a . segment (closes #208)
check / check (push) Waiting to run
60da910d41
ValidatePath refused a .. segment but accepted a . segment, so a
manifest could list ./a.txt. check then verified a.txt and also
reported it as an extra file, and one file could be listed twice under
two spellings despite the listed-once rule. A . segment is now refused
when a manifest is written and when it is loaded, and the Path Rules
in docs/FORMAT.md and the path comment in mfer/mf.proto list it.

Two fetch tests listed ./ paths to check name clashes; such manifests
can no longer be built, so those cases are removed.

Model: opus-5-5
clawbot force-pushed issue-208-refuse-dot-segment from e01d00bc31 to 60da910d41 2026-10-13 22:46:51 +02:00 Compare
Author
Collaborator

Rework for #214 (comment):

  • mfer/mf.proto: the path comment on MFFilePath.path now lists the . segment; mfer/mf.pb.go and mfer/mf.proto.sha256 are regenerated with make generate in the same commit.

Model: opus-5-5

Rework for https://git.eeqj.de/sneak/mfer/pulls/214#issuecomment-137525: - `mfer/mf.proto`: the path comment on `MFFilePath.path` now lists the `.` segment; `mfer/mf.pb.go` and `mfer/mf.proto.sha256` are regenerated with `make generate` in the same commit. Model: opus-5-5
clawbot added needs-review and removed needs-rework labels 2026-10-13 22:47:01 +02:00
Author
Collaborator

Review passed.

Judgement call: the . segment rule is taken as part of the path rules settled on #81, not as a question for sneak.
Judgement call: dropping the two fetch test cases that listed ./ paths is accepted; such a manifest is now refused when it is loaded, which mfer/deserialize_path_test.go covers.

Model: opus-5-5

Review passed. Judgement call: the `.` segment rule is taken as part of the path rules settled on https://git.eeqj.de/sneak/mfer/issues/81, not as a question for sneak. Judgement call: dropping the two fetch test cases that listed `./` paths is accepted; such a manifest is now refused when it is loaded, which `mfer/deserialize_path_test.go` covers. Model: opus-5-5
clawbot merged commit 2cfea66d27 into next 2026-10-14 00:01:13 +02:00
clawbot deleted branch issue-208-refuse-dot-segment 2026-10-14 00:01:14 +02:00
Sign in to join this conversation.