Artifact 8157e3faafbfc919421e063911dbc6f55b4103a758d84af4b6f45fc0d5bfe349:
- File
conformance/rfcs/erratum/sync-protocol-01-s5.1-truncated-payload-receiver.md
— part of check-in
[8cc3d7c5e4]
at
2026-10-13 02:23:50
on branch test/conformance-01-drafts
— test(conformance): check the -01 drafts of artifact, repo-state and sync
Re-pin the conformance suite to draft-fossil-artifact-format-01, draft-fossil-repo-state-01 and draft-fossil-sync-protocol-01, copied byte for byte from zit check-in 100351e26c. The delta format has no -01 and stays on -00. The -00 errata are folded into -01 and are no longer pinned; the six -01 errata are pinned for the fossil 2.28 behavior they record. conformance/rfcs/README.md records where each copy came from.
The requirement tables are re-read against -01, and new cases cover the date tag's event time (repo-state §4.2 step 6), the Julian-day grammar, a delta manifest naming a delta, dropped reserved F cards, the trailing-punctuation retry, truncated payloads, errors N, a file card after a refused push, the end of a request after a failed login, and the answer to a gimme for private content.
No library behavior changes. Where -01 departs from fossil 2.28 and go-libfossil follows fossil (a cancelled, unparsable or 0 date tag), the cases are marked as deviations. The non-conformances the re-pin exposes are marked as gaps, tracked in #370, #371, #372, #373, #374 and #375. (user: [email protected], size: 3021) [annotate] [blame] [check-ins using] [more...]
Erratum — draft-fossil-sync-protocol-01 §5.1
| Document | draft-fossil-sync-protocol-01 |
| Section | 5.1 — Message Structure (a body that ends inside a payload) |
| Type | Technical (the receiver's duty is unstated) |
| Status | Applied in draft-fossil-sync-protocol-01 (2026-10-12) |
| Reported | 2026-10-12 |
| Submitter | Dan Mestas |
| Found via | A reader implementing §5.1 from the text alone |
1. Summary
§5.1 says a body that ends before a payload's declared count is malformed and that senders MUST NOT produce one, and it records that Fossil uses the bytes present. It does not say what a conforming receiver does with one. The draft already has the mechanism: a validation failure in the file, cfile or uvfile handler (§5.2) on the server, and the handler content error of §10.1 on the client, which keeps the processed prefix and continues.
2. Location
§5.1, the sentence "A body that ends before a payload's declared count is malformed; senders MUST NOT produce one."
3. The reference behavior
Fossil 2.28 blob_extract() (src/blob.c:674-690) clamps the count to the
bytes remaining and returns them, so a server stores the short payload as a
full-content file and a client does the same. No error is reported. The
stored bytes hash to HASH only by coincidence. For a handler error the
client does warn, count it and leave the reply loop (src/xfer.c:2954-2958),
which is the §10.1 behavior the correction names.
4. Impact
Observable. Without a stated duty, one receiver copies Fossil's leniency and stores a wrong-length artifact, another stops with an error, and a third reads the following bytes as cards.
5. Correction
only at the declared count. A body that ends before a payload's
- declared count is malformed; senders MUST NOT produce one. (Fossil
- instead uses the bytes that are present, and stores a full-content
- file whose shorter payload still hashes to HASH.) A cfile sender
+ declared count is malformed; senders MUST NOT produce one. A
+ receiver MUST NOT store the partial payload: a server treats the
+ card as a validation failure of its handler (Section 5.2), with
+ the error text malformed file line, malformed cfile line or
+ malformed uvfile line, and a client stops reading the reply at
+ that card, keeps the prefix it has already processed, and
+ continues as Section 10.1 describes for a handler content error.
+ (Fossil instead uses the bytes that are present, and stores a
+ full-content file whose shorter payload still hashes to HASH.) A
+ cfile sender
6. Rationale
Reuses the existing handler-failure paths on both sides rather than inventing a new one, names the error texts §5.2 and Appendix C already define, and keeps Fossil's leniency as a recorded divergence.
7. Verification
- Source: Fossil 2.28
src/blob.c:674-690;src/xfer.c:160,:280,:349(the file, cfile and uvfile extraction sites);:2954-2958.