Skip to main content

Module store

Module store 

Source
Expand description

Partition / packfile management — format v3.

A PartitionStore owns exactly one partition’s on-disk subtree:

<store_root>/<partition_id_hex>/
  active/active.pack        — currently-open, appendable pack (no trailer)
  packs/<xx>/<pack_id>.pack — sealed, immutable, content-addressed packs
  packs/<xx>/<pack_id>.idx  — derived index, rebuildable, never authoritative
  manifests/*.json          — manifests ingested into this partition

No pack file, and no PartitionStore, ever spans more than one partition — that’s the physical boundary the whole GC and dedup story relies on.

Modules§

packfile
Packfile on-disk layout — format v3, per the 2026-09-23 storage-addressing rulings (the design and security reviews, Branch A). Entry meta is 54 bytes; the context reservation the spec this superseded (the format-reservations spec) carried is withdrawn by both rulings — (hash, context) addressing never lands, so there is no 16-byte slot to grow into. key_epoch (u32, equality-only, single legal value 0 today) and flags (single legal value 0x00, no bit assigned) remain exactly as that spec reserved them.

Structs§

PartitionStore
The reference ImmutableStore implementation: a single partition’s packfiles on the local filesystem.

Constants§

SEAL_CAP_BYTES
Soft cap: an active pack is sealed once it reaches this size.

Traits§

ImmutableStore
The full content-addressed storage contract a backend must satisfy: partition-scoped, immutable once written, hash-verified on every read.
MutableStore
Cache-state store for the bitchain protocol layer (e.g. a “latest” pointer keyed by name) — distinct from ImmutableStore, which has no notion of a mutable pointer: every address it serves is a stable content hash. Declared per the 2026-06 lock’s target trait shape so the vocabulary exists; no implementation ships with this relocation — bitchain’s manifest protocol treats manifests as immutable, content-addressed artifacts and has no current caller for this trait.

Functions§

list_partitions
Enumerate every provisioned partition under store_root — one with a partition.json record, not merely a 32-hex-char directory. Used by CLI commands (ls, gc, push) that operate “over every partition” when the caller doesn’t name one explicitly.