Expand description
Unified .q42 v3 volume — lexicon, block index, and LZ4-compressed SuperBlocks in one file.
Layout (all little-endian):
[0..256) Q42VolumeHeader
[lex_offset ..] Q42LEX blob (uncompressed)
[bidx_offset ..] BIDX blob (uncompressed)
[block_dir_offset ..] block_count × BlockDirectoryEntry (16 bytes each)
[data_offset ..] concatenated LZ4 block payloads (lz4_flex prepend_size)Legacy v1 sidecars (.q42.lex, .q42.bidx) and separate .c.q42 transport files
are deprecated; new ingest writes v3 only.
Structs§
- Bidx
Block Range - A contiguous half-open block interval selected by an object hash.
- Bidx
Match Page - One caller-buffered page from a BIDX match interval.
- Block
Directory Entry - Block
Field Postings - One SuperBlock’s compact S/P/C membership.
- CidSha256
- A verified content identifier. Only sha2-256 (32-byte) digests are accepted.
- Classification
Counts - Http
Range Source - Native HTTP byte-range source for trusted gateways. It never accepts a
200 OKfull-body fallback: large Q42 access must stay range-bounded. - Ipfs
Gateway Segment Factory - Opens manifest
ipfs://CIDchild locators through one configured gateway. The CID and byte length remain manifest-committed; the gateway is merely a transport route and cannot substitute a different-length object. - Local
File Range Source - Native local-file implementation. The mutex serialises seek/read pairs; high-concurrency remote adapters should instead use independent requests.
- Opfs
Callback Range Source - Host fill callback:
(offset, length, buf) -> bytes_written. - Opfs
Slice Range Source - Caller-buffered view of host-supplied bytes (slice or owned entity).
- Q42Block
Cursor - Sequential, caller-buffered view of a Q42 volume’s SuperBlocks.
- Q42Block
Meta - Metadata for one decoded SuperBlock returned by
Q42BlockCursor. - Q42Byte
Range - A half-open byte interval, represented without an end-offset overflow.
- Q42Inspect
Report - Machine-readable inspect receipt. Empty lexicon and missing postings are named, not papered over.
- Q42Lexicon
Segment - Immutable physical Q42 file holding a contiguous hash range of the shared Q42LEX dictionary. It has no graph blocks: terms remain front-embedded in a Q42 container and can be retrieved by exact ranges independently of data segment size.
- Q42Magnet
- A single-file magnet for one immutable Q42 artifact.
- Q42Object
Match Page - One page of exact object matches written by
Q42RangeVolume::find_object_into. - Q42Object
Search Cursor - Resume state for a caller-buffered object search. It is tied to the object
hash passed to
Q42RangeVolume::find_object_into. - Q42Publication
Verdict - Q42Range
Query Cursor - Resume state for a bounded range-query page.
- Q42Range
Query Page - Q42Range
Query Pattern - A simple physical pattern for range-backed Q42 scans.
Noneis an unbound SPARQL position. The planner selects the BIDX object index whenobjectis bound and otherwise performs a bounded sequential block scan. - Q42Range
Query Plan - Q42Range
Volume - A Q42 reader that fetches exactly the bytes needed from a random-access source. All variable-size buffers remain caller-owned.
- Q42Range
Volume Set - Transport-neutral logical Q42 snapshot. Root and child volumes can be opened from HTTP/IPFS range sources just as from a local file.
- Q42Rollover
Publisher - Writes object-sorted SuperBlocks into successive
.q42children and publishes an atomic root catalog when finished. - Q42Section
Report - One named byte interval inside the file.
- Q42Segment
Match Page - One caller-buffered page from a manifest object-hash segment match.
- Q42Segment
Match Range - A contiguous interval of volume segments that can contain one object hash.
- Q42Verification
Receipt - Exhaustive cold-path verification receipt for one physical Q42 segment.
- Q42Verify
Receipt - Q42Verify
SetReport - One root plus every physical child named by its catalog.
- Q42Volume
- Memory-mapped unified v2 volume reader.
- Q42Volume
Header - Q42 volume header — 256 bytes,
repr(C, packed). v3 builds hard-reject files withversion < 3— runq42 migrate metafirst. - Q42Volume
Manifest - Front-embedded catalog which makes immutable Q42 segments one snapshot.
- Q42Volume
Segment - One immutable child segment in a logical Q42 volume.
- Q42Volume
Set - Locally backed multi-segment query snapshot. It deliberately has no remote transport yet: IPFS/HTTP range sources will implement the same contract.
- Q42Volume
SetMagnets - Root + children, each with its own magnet (one info-hash per file).
- Q42Volume
SetQuery Cursor - Resume state for a range-backed scan across a logical Q42 volume set.
- Q42Volume
SetQuery Page - Streaming
Q42Volume Writer - Writes a sorted Q42 segment without retaining its compressed payload or per-block metadata in heap collections. Temporary streams are RAII-owned.
- Streaming
Volume Appender - Streaming append-only interface for Q42 Unified Volumes. Allows continuous block accumulation without loading the entire volume in memory.
- Unified
Volume Builder - Incremental builder for large external-sort merges (one SuperBlock at a time).
- Verified
CarBlock - One verified raw-leaf block from a CARv1 stream.
- Verify
Check
Enums§
- Check
Status - Publication
Intent - What the caller asserts about a file. Never overrides Quin-level rights.
- Q42Publication
Class - How this volume may move, if at all.
- Q42Query
Mode - Q42Range
Query Strategy - Q42Transport
- Where a classified volume is allowed to travel.
- Verify
Level
Constants§
- BIDX_
MAGIC - DEFAULT_
SEGMENT_ MAX_ BYTES - Default child-segment cap (512 MiB). Includes header, lexicon, indexes, data.
- FIELD_
POSTINGS_ MAGIC - FIELD_
RANGE_ INDEX_ ENTRY_ BYTES - FIELD_
RANGE_ INDEX_ HEADER_ BYTES - FIELD_
RANGE_ INDEX_ MAGIC - FLAG_
BLOCKS_ LZ4 - FLAG_
FIELD_ POSTINGS - Compact per-block S/P/C postings (or measured Bloom) are present.
- FLAG_
FIELD_ RANGES - A per-SuperBlock subject/predicate/context range index is present in front matter. It supplements (but does not replace) the object-sorted BIDX.
- FLAG_
OBJECT_ SORTED - FLAG_
PERMISSIVE_ COMMONS - Affirmative Permissive Commons catalog. Required (with a clean Quin scan) before a public magnet / HTTP web-seed / IPFS pin is emitted.
- FLAG_
SANCTUARY - Affirmative Sanctuary / Selfhood volume. Public hash addressing is denied. Writers also set this when any Quin is restricted, classified, medical, legal, fiduciary, or bilateral.
- FLAG_
VOLUME_ ROOT - HEADER_
SIZE - MAX_
COMPRESSED_ SUPERBLOCK_ SIZE - Conservative caller-buffer bound for an LZ4
prepend_sizeencoding of one Q42 SuperBlock. The bound includes its four-byte decoded-size prefix. - MAX_
VOLUME_ MANIFEST_ BYTES - Q42_
MAGIC - Q42_
VERSION_ V3 - QUIN_
SIZE - RESIDENT_
QUERY_ MAX_ BYTES - 4 MiB decoded-file threshold. Above this, callers must not
read_all_quins. - SUPERBLOCK_
HEADER - SUPERBLOCK_
SIZE
Traits§
- Q42Lexicon
Range Factory - Opens a manifest-attested Q42LEX shard through a range transport.
- Q42Range
Source - Exact, caller-buffered random access. Implementations must fail if the source returns a short response; partial data is never treated as success.
- Q42Segment
Range Factory - Opens an immutable child source identified by the front-embedded manifest. Construction may allocate; all subsequent block reads remain caller-buffered.
Functions§
- append_
segment_ to_ root - Append a finished child segment to an existing root by publishing a new
generation (
stem-root.q42overwritten atomically via temp + rename). - bidx_
blocks_ for_ hash - BIDX binary search (shared with sidecar format).
- classify_
q42_ path - classify_
q42_ volume - classify_
q42_ volume_ set - Volume-set: any child that cannot be public denies the whole public set.
- compact_
volume_ set - Compact
rootintoout_dir. - compose_
magnet - decode_
and_ verify_ car - Decode a CARv1 buffer, verify every block CID, and concatenate raw (0x55) leaves as the UnixFS entity. Non-raw blocks are verified but not appended (dag-pb roots are proofs, not Q42 bytes).
- decode_
superblock_ quins - Live Quins in a decompressed SuperBlock (160-byte header + 48-byte slots).
- deny_
public_ publication - encode_
bidx - Encode BIDX bytes from per-block min/max object hashes.
- encode_
block_ postings - Encode one SuperBlock’s three fields. Chooses Bloom when it is strictly smaller than the exact posting list.
- encode_
field_ range_ index - Encode conservative per-block ranges for the non-object triple fields. Every range encloses all values in its block, so a range miss is safe to skip while a hit still requires normal Quin-level matching.
- encode_
lex - Encode Q42LEX bytes from a hash → string map.
- encode_
lex_ with_ entries - Encode Q42LEX bytes from a hash → LexiconEntry map (supports embedded triples).
- encode_
postings_ section - encode_
raw_ car - Encode a one-block raw CARv1 used by tests and fixtures.
- encode_
superblock - Encode Q42LEX bytes from a hash → LexiconEntry map (supports embedded triples).
- extract_
entity_ bytes - Extract a half-open entity-byte interval from verified raw leaves.
- header_
to_ bytes - inclusive_
entity_ bytes - Inclusive
entity-bytes=start:end(IPIP-0402) → half-open Q42 range. - ipfs_
gateway_ range_ source - ipns_
gateway_ range_ source - Construct a range source for an IPNS-published root. Resolution is bounded by the HTTP adapter’s 10-second connect and 30-second request timeouts; after the root manifest is read, child segments must use immutable CIDs.
- is_
unified_ volume - Returns true if
pathbegins with a unified volume header. - measure_
bloom_ false_ positives - Measured false-positive rate of the Bloom encoding on a synthetic field.
- migrate_
v2_ to_ v3 - Upgrade a v1/v2
.q42file to v3 by rewriting the version field and zeroing the new extension fields in the 256-byte header. Data blocks are untouched. - quin_
requires_ sanctuary - True when this Quin is Selfhood, bilateral, or a protected ODRL tier.
- root_
relative_ path - sha1_
hex_ file - validate_
exact_ range_ response - Validate an HTTP/IPFS adapter response before it is accepted by a reader.
content_range_startis the start declared byContent-Rangeor the verified CAR block offset;returned_lenis its actual payload size. - verify_
car_ bytes_ as_ q42_ source - Decode and CID-verify a CARv1 buffer, then expose raw-leaf entity bytes.
- verify_
local_ car_ as_ q42_ source - Read a local CARv1 path, CID-verify every block, expose entity bytes.
- verify_
source_ sha256 - Stream the complete immutable source through a caller-provided scratch buffer and compare it to the SHA-256 committed by the root descriptor. This is the bounded verification path for a trusted HTTP/IPFS gateway; partial-CAR block proofs can later authenticate individual ranges sooner.
- verify_
volume_ set_ from_ root - Verify a standalone file, or a volume-set root and every named child.
- write_
sorted_ quins_ volume - Sort
quinsby object hash, chunk into SuperBlocks, and write a unified v3 volume. - write_
sorted_ quins_ volume_ with_ author - Same as
write_sorted_quins_volume, with a DAG author DID on each SuperBlock commit. - write_
unified_ volume - Write a unified v3
.q42volume. - write_
unified_ volume_ with_ entries - Write a unified v3 .q42 volume with embedded triple support.
- write_
volume_ root - Publish a root Q42 segment whose front matter catalogs immutable child
segments. The root is intentionally data-empty; query code opens the
catalog snapshot through
Q42VolumeSet. - write_
volume_ root_ for_ commons - Same as
write_volume_root, but marks the catalog as Permissive Commons. Use for public ontologies / knowledge graphs, never for personal volumes. - write_
volume_ root_ with_ lex - Publish a logical-volume root with a lossless shared Q42LEX in its front matter. Child data segments may keep empty local lexicons because all term resolution for the snapshot is recoverable from this immutable root.
Type Aliases§
- Verified
CarRange Source - Verified UnixFS entity reconstructed from a local CARv1 file.