clawft_kernel/model_manifest/mod.rs
1//! Model manifest, adopt-in-place and weights locality (card
2//! mesh-placement-17; ADR-101 section 3, ADR-099 section 6).
3//!
4//! - [`body`]: the `model` manifest body and the operator attestation over
5//! its hash manifest, reusing the workload package envelope, signing
6//! domain and [`crate::workload_pkg::TrustAnchors`].
7//! - [`adopt`]: hash existing HF cache / MLX quant / GGUF / Ollama files
8//! where they lie. Nothing is copied.
9//! - [`registry`]: adopted models, lazy re-hash, refusal on hash mismatch,
10//! `Degraded` on a detached store, and [`ModelRegistry::resolve`], the API
11//! inference-server adapters consume.
12//! - [`advertise`]: `model.present` and `store.tier.external` capabilities
13//! for node facts, from existence and size checks only.
14//! - [`locality`]: the pure fetch-versus-relocate decision with a transfer
15//! policy, and placer preferences / requirements.
16//! - `sharing` (mesh feature): the only door from model weights into the
17//! artifact exchange; redistribution fails closed.
18//!
19//! Inference-server adapters (card mesh-placement-18) consume
20//! [`ModelRegistry::resolve`]; none of that lives here.
21
22pub mod adopt;
23pub mod advertise;
24pub mod body;
25pub mod check;
26pub mod locality;
27pub mod registry;
28mod resolve;
29#[cfg(feature = "mesh")]
30pub mod sharing;
31
32#[cfg(test)]
33mod tests;
34#[cfg(test)]
35mod tests_locality;
36#[cfg(test)]
37mod tests_security;
38
39pub use adopt::{AdoptInput, FileRole, ScannedFile, ScannedModel, hash_file, scan_dir, scan_file, scan_ollama};
40pub use advertise::{StoreTier, TierResolver, model_capabilities};
41pub use body::{
42 KIND_MODEL, MAX_SHARDS, MODEL_MARKER_PREFIX, ModelError, ModelFormat, ModelPackageBody,
43 ModelSource, VerifiedModel, attest, verify_model,
44};
45pub use locality::{
46 LocalityDecision, LocalityPlan, NodeHolding, Sharing, TransferPolicy, Unplaceable, decide,
47 locality_preference, model_present_requirement,
48};
49pub use check::{CheckMode, FileOutcome, ModelCheck, ModelState};
50pub use registry::{AdoptedModel, ModelEntry, ModelRegistry, ModelTrust, ResolvedModel};