Artifact d2878767d9b74ef7b24f6a9e3844126c4a3f2f0204c47e123ba631bb0bae2d5e:
- File projects/fossil/briefs/delta.md — part of check-in [3ba2975e8e] at 2026-07-07 14:05:17 on branch trunk — Split RFC workflow into neutral core and Fossil project pack (user: dmestas, size: 2374) [annotate] [blame] [check-ins using]
Delta RFC Brief
Mission
Draft the Fossil delta document:
The Fossil Delta Format
This document defines the byte-level delta encoding used by Fossil artifacts and content transfer.
Front matter
- Use the title above.
- Intended status is Proposed Standard.
- The abstract should state that Fossil represents an artifact as a delta against a source artifact and that the document specifies the delta encoding.
Required sections
Structure
The document must define the delta as:
- a header,
- a segment list,
- a trailer.
Header
Specify:
- the target length,
- then one
0x0anewline byte.
Segments
Specify both segment kinds and their argument encoding:
- copy operations,
- literal operations.
Make the payload boundary explicit wherever a literal segment carries opaque bytes: the payload is located by byte count, not by scanning for separators.
Trailer
Specify the checksum trailer and its role in validating the reconstructed target.
Application
Specify how a reader produces the target from a source artifact and a delta.
This section must include the behavior when the delta source is absent, as implemented, rather than leaving the case implicit.
Production
The original suite goal also required the delta document to let an implementer produce a delta as well as apply one. Keep the producer-side explanation sufficient for an interoperable implementation, not just a decoder.
Required appendix
- Examples — observed create/apply examples captured from the implementation surfaces used by the suite.
Delta-specific drafting priorities
- Separate format, application semantics, failure behavior, and producer guidance cleanly.
- Make the header newline and payload-count framing visible in prose and examples.
- Keep artifact identity and sync transport as cross-references only; this document owns the delta format itself.
High-risk Fossil specifics to preserve
- a delta is against a supplied source artifact,
- header newline is part of the format and must not disappear in rendered examples,
- literal payloads are opaque bytes and may contain newline bytes,
- source-absent behavior must be stated from implementation, not inferred from generic delta lore,
- examples must be observed from the implementation and must round-trip from rendered text back through the tool or parser.