Make docs/FORMAT.md a complete, independently-implementable specification #84
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Context
The README states the goal plainly: mfer should "emerge as a de-facto
standard and be incorporated into other software", and "a compatible
javascript library is planned".
That goal has exactly one hard requirement: someone must be able to write an
interoperable implementation from the specification alone, without reading
the Go code.
FORMAT.mddoes not currently meet that bar.Gaps:
hex casing, its delimiters, what exactly is covered by the outer SHA-256
(compressed vs uncompressed bytes), and the steps a verifier performs are
not written down precisely enough to reimplement.
forward-slash-only, relative-only,
.., leading/, or Unicodenormalization. A second implementation will get these wrong.
is achieved, what a writer must do to produce byte-identical output.
mfer/mf.protoas "the format specification" ratherthan to
FORMAT.md. The proto is a schema, not a specification.consistency.
Definition of done
docs/FORMAT.mdfully specifies: the magic, the outer framing, thecompression, the inner structure, path invariants, the signature scheme
end to end, and canonical serialization rules for deterministic output.
writer and verifier from the document.
bytes, its hash, and its signature, so a second implementation can check
itself.
docs/FORMAT.mdas the primary specificationreference, not to the
.proto.mfer/andinternal/cli/are audited forconsistency: same capitalization convention, no trailing punctuation, no
redundant "error:" prefixes, and each one names the thing that failed.
make checkpasses.TODO.mdupdated in the same commit.Implementation requirements
and signature decisions are answered — writing the spec against the
current behavior and then rewriting it after the answers land is wasted
work. Confirm both are closed before beginning.
do. Where the two differ, that is a bug to file, not a line in the spec.
to round-trip. A hand-written test vector that does not parse is worse
than none.
reclassifying which errors are returned, no changing sentinel identity.
Wording only. If an error is wrong rather than badly worded, file it.
FORMAT.mdhaving moved todocs/(#74). Coordinate theordering or rebase.
(closes #84).