Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

File formats

mado’s binary formats are self-describing: each begins with a 4-byte ASCII magic and a version byte, and every format is ossified (a reader rejects a higher-than-known version with a typed error; a newer reader can still read the old version). This table lists each magic, a one-line description, and the module that owns its encoder/decoder.

MagicNameOwning moduleOne-line description
MDLPMado Locality Packcrates/mado-filestore/src/pack.rsA content-addressed bundle of a subtree’s inline files (and, in v2, chunked-file manifests + chunks as typed members), so one ranged GET hydrates a whole small-file subtree instead of one GET per file.
MDPIMado Pack Indexcrates/mado/src/pack_build.rsThe directory → covering-pack index a mado pack build records; content-addressed by the tree it describes. v1 = per-directory (exact match); v2 = recursive-subtree (ancestor-walk covering lookup). The daemon loads either version.
MDPWMado Pack Well-known (pointer)crates/mado/src/pack_publish.rsThe well-known derived discovery pointer — a tiny blob at a key derived from the tree id — that points at the freshest MDPI index for a tree, enabling zero-config pack discovery with no local file and no new RPC.
MDFMMado File Manifestcrates/mado-filestore/src/manifest.rsA chunked file’s manifest: the ordered content-defined-chunk list that reassembles a large file, plus its size (so file_size can stat without fetching content).
MDSMMado Scratch Manifestcrates/mado-filestore/src/scratch.rsThe snapshot of a workspace’s scratch (off-snapshot build-dir) tree — the redirected paths and their content, captured for a checkpoint / pause.
MDSPMado Scratch (manifest) Pointercrates/mado/src/scratch.rsA pointer record naming the freshest MDSM scratch-manifest blob (distinct from the MDSM manifest it points at).
MDWCMado Workspace Checkpointcrates/mado/src/scratch.rsThe durable checkpoint record binding a jj operation id, the scratch-manifest hash, and attr-table presence into one blob — the record mado ws pause / resume travel on.
MDWLMado Workspace Lease (handoff)crates/mado/src/ws.rsA local, single-machine lease-handoff file (.jj/working_copy/ws-lease) recording the lease held by this workspace so a daemon and a mado ws command on the same box rendezvous on it.
MDOJMado Op Journalcrates/mado-server/src/journal.rsAn op-heads journal record in the blobstore’s opjournal namespace: every op-heads mutation is chained here (hash chain per scope) before it commits, so mado recover-op-heads can rebuild the op-heads database from blobs alone.

Notes

  • The magics MDLP, MDSM, MDWC, and MDPI share a v1 header layout (magic | version | encryption byte | …); the encryption byte reserves space for a future key-wrapping scheme and is currently a fixed marker.
  • MDLP is grouping-agnostic: per-directory (v1) and recursive-subtree (v2) packs use the identical pack format — only the builder grouping, the MDPI index semantics, and the trigger gate differ. See Performance § Locality packs.
  • These magics are the wire/at-rest contract; the store’s own at-rest format (loose files vs the fjall LSM engine, and whether the production Pack(zstd)/Prefix/Multiplexed composition wraps it) is a separate, orthogonal concern selected at mado init / mado serve time. A store’s at-rest format is recorded in a blobs-format marker inside .jj/repo/store (absent = the original loose-file layout).