vernier_partial/lib.rs
1//! Shared partial wire format and merge policy for vernier's
2//! distributed evaluation surface (ADR-0031, generalized in
3//! ADR-0032).
4//!
5//! `vernier-partial` is a leaf crate. The three paradigm crates
6//! (`vernier-core`, `vernier-semantic`, `vernier-panoptic`) each
7//! depend on this one and supply their own paradigm-specific wire
8//! body type plus merge accumulator that embeds
9//! [`merge::BaseMergeAccumulator`]. `vernier-partial` does not depend
10//! on any of them — keeping the dep DAG flat is what makes the
11//! cross-paradigm refactor possible without circular dependencies.
12//!
13//! ## What lives here
14//!
15//! - The wire envelope ([`envelope::WireEnvelopeHeader`]), magic +
16//! version constants ([`envelope::MAGIC`],
17//! [`envelope::FORMAT_VERSION`]), framing helpers
18//! ([`envelope::encode`], [`envelope::with_validated_envelope`]).
19//! - The five typed errors mapped 1:1 to Python exceptions
20//! ([`error::PartialError`]).
21//! - The [`traits::Partial`], [`traits::ParadigmKind`], and
22//! [`traits::PartialExpectation`] surface paradigm crates implement
23//! against.
24//! - The paradigm-agnostic merge policy
25//! ([`merge::BaseMergeAccumulator`]).
26//!
27//! ## What does *not* live here
28//!
29//! - Paradigm-specific body types (instance per-image cells,
30//! semantic confusion matrix, panoptic per-category PqStats).
31//! Each paradigm owns its body archive and decode.
32//! - Dataset / params hashing. Each paradigm hashes against its own
33//! canonical form. The 32-byte hashes carried in the envelope
34//! header are opaque to this crate.
35//! - The streaming evaluator types themselves. `vernier-partial`
36//! knows nothing about evaluator state; it only validates the
37//! envelope and accumulates partition / rank-collision policy.
38
39#![forbid(unsafe_code)]
40#![warn(missing_docs)]
41#![cfg_attr(test, allow(clippy::unwrap_used, clippy::expect_used, clippy::panic))]
42
43pub mod envelope;
44pub mod error;
45pub mod merge;
46pub mod traits;
47
48// Each item lives at exactly one path — its home module. Adding a
49// re-export here widens the headline; treat it as a deliberate
50// decision, not a default for new pub items.
51pub use envelope::{encode, with_validated_envelope, WireEnvelopeHeader, FORMAT_VERSION, MAGIC};
52pub use error::{PartialError, PartialFormatErrorKind};
53pub use merge::RankId;