Expand description
Kernel-side model-card binding refusal.
When policy.weights_card_required is required or
required_with_pin, the kernel refuses to bind a provider unless a
signed model card matches the loaded weights AND the requested
capability set is admissible under the card. This module is the
refusal-decision surface; the policy load path lives in chio-policy
and the cosign bundle verify path lives in chio-weights.
§Refusal contract
Provider bind verifies, in order:
- The provider’s loaded
weights_hash(lowercase hex sha-256 of the canonical weights blob) byte-equals the card’sweights_hash. Mismatch surfaces asWeightsBindingError::CardMismatch/urn:chio:error:weights:card-mismatch. - The requested capability scope set is a subset of the card’s
allowed_capability_set. Any scope not in the set surfaces asWeightsBindingError::ScopeNotSubset/urn:chio:error:weights:scope-not-subset. - No requested tool intersects the card’s
banned_tools. Banned tools reject at provider bind, not at first call. Surfaces asWeightsBindingError::ToolBanned/urn:chio:error:weights:tool-banned.
All gates fail-closed: the first failing gate short-circuits.
§Async discipline
The verifier surface takes no &mut self.
evaluate_weights_binding is a free function over &ModelCard so
it composes cleanly with the async kernel without locking.
Structs§
- Weights
Binding Request - Inputs the kernel collects at provider bind. The provider supplies its
loaded
weights_hashand the operator supplies the requested capability set. Banned-tool intersection is computed against the samerequested_scopesbecause the provider matrix unifies tool identifiers into the scope namespace.
Functions§
- evaluate_
weights_ binding - Evaluate the kernel binding refusal contract.
- evaluate_
weights_ binding_ with_ loaded_ hash - Evaluate binding after the provider-side loaded-weight digest has been recomputed.
Type Aliases§
- Weights
Binding Error - The kernel-side bind-time decision surface error. Wraps
chio_weights::error::WeightsErrorso consumers get a single result type to pattern-match on.