Physical V1 contract for a sealed private inspection artifact.
The layout is:
16-byte versioned header
length-framed deterministic JSON evidence
192-byte terminal footerMultibyte integers are unsigned big-endian. Offsets are absolute. A reader rejects a size that does not match the opened file, a header/footer version mismatch, overlap, gaps, or trailing bytes before following any range.
Summary
Functions
Reads a footer's declared versions without requiring the current ones.
Reads a header's declared versions without requiring the current ones.
Types
@type versions() :: %{format_version: pos_integer(), schema_version: pos_integer()}
Format and schema versions read without committing to a field layout.
Functions
@spec decode_header(binary()) :: {:ok, :header} | {:error, :malformed_source}
Reads a header's declared versions without requiring the current ones.
decode_header/1 matches this version's constants, so it cannot tell an
artifact written by another version from a corrupt one. A bounded metadata
probe must report those two states differently, and the magic plus the two
version fields sit at fixed offsets for every version of the container.
@spec encode_header() :: binary()
@spec format_version() :: pos_integer()
@spec frame_payload_offset(non_neg_integer()) :: non_neg_integer()
@spec header_magic() :: binary()
@spec header_size() :: pos_integer()
@spec schema_version() :: pos_integer()