Drop mimeType and ctime from the manifest format (closes #235) #237

Merged
clawbot merged 1 commits from issue-235-drop-mimetype-ctime into next 2026-10-19 20:52:01 +02:00
Collaborator

Implements #235 under the rule that nothing goes in the 1.0 manifest that 1.0 does not read or write (#81 (comment)). mfer never wrote either field.

  • mfer/mf.proto drops mimeType (301) and ctime (303) from MFFilePath and reserves both numbers and both names there; mf.pb.go and mf.proto.sha256 come from make generate.
  • The decoded-size check counts file entries, hashes and timestamps only, a file entry at 160 bytes, 16 fewer without the two fields. Loading drops fields it does not know, so 301 or 303 in a manifest is dropped and costs nothing.
  • export prints no ctime, and FileEntry.Ctime, which nothing set, is gone.
  • docs/FORMAT.md drops both rows, counts 160, 112 and 64 bytes in the decompression paragraph, and says mf.proto reserves 301 and 303 and no field uses them. The test vector holds neither field, so its bytes are unchanged.
  • README.md no longer promises ctime.

Tests: the file entry field list, a check that 301, 303 and both names are reserved, an entry carrying 301 and 303 that loads with both dropped, and export printing exactly the fields of an entry.

Judgement call: TestDeserializeRefusesEntriesThatDecodeTooLarge gives each entry a second, empty hash, counting 160 + 112 + 112 + 64. An entry of a path, one SHA-256 hash and a modification time takes at least 47 bytes and is counted at 336, so it never passes 8 times its size; without the second hash no case could be refused.

Model: opus-5-5

Implements https://git.eeqj.de/sneak/mfer/issues/235 under the rule that nothing goes in the 1.0 manifest that 1.0 does not read or write (https://git.eeqj.de/sneak/mfer/issues/81#issuecomment-127074). mfer never wrote either field. - `mfer/mf.proto` drops `mimeType` (301) and `ctime` (303) from `MFFilePath` and reserves both numbers and both names there; `mf.pb.go` and `mf.proto.sha256` come from `make generate`. - The decoded-size check counts file entries, hashes and timestamps only, a file entry at 160 bytes, 16 fewer without the two fields. Loading drops fields it does not know, so 301 or 303 in a manifest is dropped and costs nothing. - `export` prints no `ctime`, and `FileEntry.Ctime`, which nothing set, is gone. - `docs/FORMAT.md` drops both rows, counts 160, 112 and 64 bytes in the decompression paragraph, and says `mf.proto` reserves 301 and 303 and no field uses them. The test vector holds neither field, so its bytes are unchanged. - `README.md` no longer promises `ctime`. Tests: the file entry field list, a check that 301, 303 and both names are reserved, an entry carrying 301 and 303 that loads with both dropped, and `export` printing exactly the fields of an entry. Judgement call: `TestDeserializeRefusesEntriesThatDecodeTooLarge` gives each entry a second, empty hash, counting 160 + 112 + 112 + 64. An entry of a path, one SHA-256 hash and a modification time takes at least 47 bytes and is counted at 336, so it never passes 8 times its size; without the second hash no case could be refused. Model: opus-5-5
clawbot added the needs-review label 2026-10-19 20:22:28 +02:00
clawbot self-assigned this 2026-10-19 20:22:28 +02:00
Author
Collaborator
  • mfer/constants.go: decodedFileEntrySize stays at 176, but it is meant to be what decoding sets aside for each file entry, and dropping the MimeType and Ctime fields makes a decoded entry 16 bytes smaller: back to 160, the value it had before mode raised it to 176. Acceptable: 160, with every number that follows from it worked out again: the maxDecodedGrowth comment (352, about 7.49 times, about 7%), the decoded-size sentence in docs/FORMAT.md, and the comment and path lengths of TestDeserializeRefusesEntriesThatDecodeTooLarge.

Model: opus-5-5

- `mfer/constants.go`: `decodedFileEntrySize` stays at 176, but it is meant to be what decoding sets aside for each file entry, and dropping the `MimeType` and `Ctime` fields makes a decoded entry 16 bytes smaller: back to 160, the value it had before `mode` raised it to 176. Acceptable: 160, with every number that follows from it worked out again: the `maxDecodedGrowth` comment (352, about 7.49 times, about 7%), the decoded-size sentence in `docs/FORMAT.md`, and the comment and path lengths of `TestDeserializeRefusesEntriesThatDecodeTooLarge`. Model: opus-5-5
clawbot added needs-rework and removed needs-review labels 2026-10-19 20:33:44 +02:00
clawbot added 1 commit 2026-10-19 20:41:03 +02:00
Nothing goes in the 1.0 manifest that 1.0 does not read or write, and
mfer never wrote either field. mf.proto now reserves the numbers 301 and
303 and both names in MFFilePath, and mf.pb.go is regenerated. The
decoded-size check counts only file entries, hashes and timestamps, and
counts a file entry, 16 bytes smaller without the two fields, at 160
bytes. export prints no ctime, and FileEntry loses the Ctime nothing
set. FORMAT.md and the README no longer describe either field.

The test of entries that decode too large gives each entry a second,
empty hash: an entry with one hash and a modification time can no
longer reach 8 times its size.

Model: opus-5-5
clawbot force-pushed issue-235-drop-mimetype-ctime from 0c3b342329 to b9583fea27 2026-10-19 20:41:03 +02:00 Compare
Author
Collaborator
  • decodedFileEntrySize is 160; the maxDecodedGrowth comment (336, about 7.15 times, about 12%), the decoded-size sentence in docs/FORMAT.md and TestDeserializeRefusesEntriesThatDecodeTooLarge (448 per entry; a 7-character path refused, an 8-character one loaded) are worked out again from it, and the PR body's numbers match.

Model: opus-5-5

- `decodedFileEntrySize` is 160; the `maxDecodedGrowth` comment (336, about 7.15 times, about 12%), the decoded-size sentence in `docs/FORMAT.md` and `TestDeserializeRefusesEntriesThatDecodeTooLarge` (448 per entry; a 7-character path refused, an 8-character one loaded) are worked out again from it, and the PR body's numbers match. Model: opus-5-5
clawbot added needs-review and removed needs-rework labels 2026-10-19 20:43:19 +02:00
Author
Collaborator

Review passed.

Model: opus-5-5

Review passed. Model: opus-5-5
clawbot removed the needs-review label 2026-10-19 20:51:13 +02:00
clawbot merged commit e2deea2e34 into next 2026-10-19 20:52:01 +02:00
clawbot deleted branch issue-235-drop-mimetype-ctime 2026-10-19 20:52:02 +02:00
Sign in to join this conversation.