Skip to main content

Module header

Module header 

Source
Expand description

Normative .10d container header — the barrier surface every later P0 task consumes.

Layout: 64 bytes, repr(C), all fields naturally aligned, one explicit pad0[2] field that must be zero. The header carries:

  • magic + version (the parse-rejection gates for bad magic / unknown version)
  • axis_roles[10] — the normative axis-role taxonomy (one AxisRole per axis in AXIS_ORDER); any Undefined entry is rejected
  • metric_descriptor — the super::metric_check::MetricCompletenessDescriptor verified against Tensor10D::full_distance’s actual v-branch behaviour; a diverging descriptor is rejected (the “queryability claim == code” gate)
  • header_crc32c — spec-reserved in P0.1: the field exists and is written as zero on encode, but P0.3 wires the shared CRC-32C (delegated from q42/p64_weight.rs) and starts enforcing it. P0.1 does not enforce the CRC — that is P0.3’s acceptance gate, not P0.1’s.
  • reserved[8] — zero, future use (governance default-disposition flags, capability bits, time-base selector — all P0.2+ territory).

The header is the foundation every later P0 task writes into. Its 64-byte physical layout stays fixed across v1 and v2; v2 changes the file contract while preserving a dual-version reader. header_is_pod_with_exact_size asserts the exact layout and zero padding.

Modules§

prefix
Allocation-free structural prefix validation for bounded selective readers. Header-only structural admission with an independently established full extent. No source authentication or whole-file CRC verification is performed here.

Structs§

Container10dHeader
The normative .10d header — v1/v2 are 64 bytes, repr(C), naturally aligned.

Enums§

HeaderParseError
Parse error categories — one per acceptance-gate rejection.

Constants§

FLAG_DEFAULT_DISPOSITION_REFUSE
Header flag bit 0: default disposition = Refuse. A reader that ignores the Governance section still fails closed. Always set in v1 headers produced by Container10dHeader::proposed.
HEADER_BYTE_SIZE
Exact byte size of the header POD. Asserted by the size-of test so a future field addition cannot silently shift the layout.
HEADER_VERSION
Current .10d writer version. V2 formalizes the single-envelope, typed-parts contract while retaining the v1 header’s 64-byte physical layout.
LEGACY_HEADER_VERSION
V1 remains readable for existing assets. New writers emit HEADER_VERSION.
MAGIC_10D
.10d container magic — ASCII "10d\0".
MAX_SECTION_COUNT
Maximum number of section descriptors the parser will accept. Bounds the section-table allocation against a hostile/malformed file. 1024 is far beyond any realistic .10d (the design’s section types number ~10) while keeping the table trivially small.
SUPPORTED_HEADER_VERSIONS