Expand description
The persisted format of an HMS store: its version constants, an offline verifier and the
migration framework behind hms-format.
The byte-level specification is docs/file-format/; this module is its executable form.
Everything that has a version number is defined here once (FormatVersions), and
tests/format_golden.rs fails when a constant moves without a matching golden store.
Re-exports§
pub use upgrade::plan_upgrade;pub use upgrade::upgrade_store;pub use upgrade::UpgradePlan;pub use upgrade::UpgradeReport;pub use upgrade::UpgradeStep;pub use verify::verify_path;pub use verify::VerifyOptions;
Modules§
- scan
- Pure readers for the persisted artefacts: byte slices in, findings out. None of them
panics, none allocates more than a bounded multiple of its input, and none touches the
filesystem, so
fuzz/fuzz_targets/format_readers.rscan drive every one with arbitrary bytes. The store-level verifier (super::verify) is built from them. - upgrade
- The migration framework behind
hms-format upgrade. - verify
- Offline verification of a store directory. Read-only: it never opens the engine unless
deepis set, and then only on a private copy, because opening a store writes to it (end marker,format.json,documents.text, the lock file).
Structs§
- Finding
- One observation about a store.
- Format
Versions - Every version number a store carries, as this build reads and writes them.
- Report
- Result of verifying one store directory.
- Store
Versions - Versions read from a store’s files;
Nonewhere the file is absent or unreadable. - Tenant
Report - A tenant store inside a server data directory.
Enums§
- Severity
- How bad a finding is. The order is the order of precedence for the exit code.
- Verdict
- Overall verdict of a verification, and the exit code of
hms-format verify.
Constants§
- AUDIT_
ENTRY_ LEN - Bytes of one
audit.binentry. - BINARY_
TRANSACTION_ MAGIC - Prefix of a binary journal frame payload (schema 3 stores).
- CURRENT
- The versions this build writes.
- END_
MARK - Version word of the end-of-log marker header.
- FRAME_
HEADER_ LEN - Bytes of a journal frame header.
- KDF_
ITERATIONS - See
KDF_MEMORY_KIB. - KDF_
LANES - See
KDF_MEMORY_KIB. - KDF_
MEMORY_ KIB - Argon2id memory cost in KiB, iteration count and lanes used to derive the AES-256 key.
- MANIFEST_
MAGIC magicofformat.json.- MAX_
FRAME_ PAYLOAD - Largest decompressed frame payload.
- SALT_
LEN - Bytes of
encryption.salt. - STORAGE_
FORMAT_ CURRENT - Version of the arena manifest (
vectors_data.bin/format.json) this build writes. - STORAGE_
FORMAT_ OLDEST - Oldest arena manifest version this build opens. Version 1 (no manifest) is read as 2.
- STORE_
SCHEMA_ OLDEST - Oldest
store.jsonschema this build opens. - STORE_
SCHEMA_ VERSION versionfield of thestore.jsona new store gets. Schema 2 stores writeTRANSACTION_MAGICframes, schema 3 storesBINARY_TRANSACTION_MAGICframes; a store keeps the schema it was created with.- TEXT_
SEGMENT_ HEADER_ LEN - Length of the
documents.textheader. - TEXT_
SEGMENT_ MAGIC - First four bytes of
documents.text. - TEXT_
SEGMENT_ VERSION - Header layout version of
documents.textthis build writes. - TRANSACTION_
MAGIC - Prefix of a JSON journal frame payload (schema 2 stores); the digit is the journal format version.
- TRANSACTION_
MAGIC_ PREFIX - Bytes shared by every journal format version:
HMS-TXN-, then ASCII digits, then NUL. - VECTOR_
LOG_ MAGIC - Vector update log magic.
- VECTOR_
MANIFEST_ MAGIC - Vector checkpoint manifest magic.
- VECTOR_
ROWS_ MAGIC - Full-precision vector row magic.
- VECTOR_
UPDATE_ FORMAT_ VERSION - Version of the standalone persisted vector update directory.