qualia_core_db/sensing/record.rs
1//! Bounded persistence/index records for physical measurements.
2//!
3//! These records point to raw sample payloads and optional provenance,
4//! calibration, and projection records. They do not embed or derive physical
5//! coordinates, authenticate referenced material, or claim that a measurement
6//! was verified. The wire encoding is independent of NQuin and uses explicit
7//! little-endian fields rather than the overloaded Quin object/metadata lanes.
8//! This experimental encoding is not yet an integrated or stable container
9//! format; it requires review against the existing persistence interfaces.
10//! A payload binding proves only that the selected MID2 declaration, field
11//! semantics, and byte range agree. Callers must obtain payload bytes through
12//! the checked `.10d` envelope resolver and enforce their container-ID binding,
13//! section integrity/CRC, and whole-envelope admission policy before treating
14//! referenced bytes as authentic or trusted. Neither this index nor a
15//! nonzero container ID authenticates content.
16
17mod decode;
18mod encode;
19mod types;
20
21pub const MEASUREMENT_INDEX_VERSION: u16 = 1;
22pub const MEASUREMENT_INDEX_RECORD_SIZE: usize = 264;
23pub const MAX_MEASUREMENT_INDEX_RECORDS: usize = 256;
24
25pub use decode::decode_measurement_index_record;
26pub use encode::encode_measurement_index_records;
27pub use types::{
28 CalibrationArtifactReference, CalibrationDeclaration, MeasurementQuality, MeasurementRecord,
29 PayloadReference, ProjectionDeclaration, ProjectionReference, ProvenanceDeclaration,
30 QualityMetrics, RecordClockStamp, RecordError, ResolvedFieldPayloadBinding,
31};
32
33#[cfg(test)]
34#[path = "record_tests.rs"]
35mod tests;
36
37#[cfg(test)]
38#[path = "record/decode_tests.rs"]
39mod decode_tests;
40
41#[cfg(test)]
42#[path = "record/quin_link_tests.rs"]
43mod quin_link_tests;