pub struct ProvenSafeIngest {
pub accepted: bool,
pub refusal: Option<String>,
pub scry_version: String,
pub declared_module_sha256: String,
pub actual_module_sha256: String,
pub declared_memory_min_bytes: u64,
pub offered: Vec<SafeSite>,
pub diagnostics: Vec<String>,
}Expand description
The result of ingesting a safe-accesses.json. TOTAL by design — there is
deliberately no Result in ingest’s return type, mirroring
crate::wsc_facts::parse_wsc_facts: no input may turn a successful
compile into a failed one.
When ProvenSafeIngest::accepted is false, ProvenSafeIngest::offered
is EMPTY — a refused document is not trusted piecemeal — and
ProvenSafeIngest::refusal names why.
Fields§
§accepted: boolDid the document clear every whole-file gate (schema, hash, memory floor)? False ⇒ elide nothing.
refusal: Option<String>Some(reason) exactly when accepted is false.
scry_version: StringThe producer version string, for the attestation. Empty if absent or the document was unreadable.
declared_module_sha256: StringThe module_sha256 the document declared (hex, as written). Empty when
the document did not parse.
actual_module_sha256: StringThe sha256 synth computed over the module it is actually compiling.
declared_memory_min_bytes: u64The memory_min_bytes the document declared.
offered: Vec<SafeSite>Sites the document offered, once the whole-file gates passed. These are
candidates: each still faces ProvenSafeIngest::validate_function.
diagnostics: Vec<String>Human-facing diagnostics (warnings). Never an error.
Implementations§
Source§impl ProvenSafeIngest
impl ProvenSafeIngest
Sourcepub fn offered_for_func(&self, func: u32) -> Vec<&SafeSite>
pub fn offered_for_func(&self, func: u32) -> Vec<&SafeSite>
Sites this document offered for one function, in pc order.
Sourcepub fn validate_function(
&self,
func: u32,
ops: &[WasmOp],
notes: &mut Vec<String>,
) -> Vec<usize>
pub fn validate_function( &self, func: u32, ops: &[WasmOp], notes: &mut Vec<String>, ) -> Vec<usize>
The self-checking key. Validate this function’s offered sites against the operator stream synth actually decoded, and return the operator indices that survive — the per-site elision marks.
An entry is DROPPED (with a diagnostic pushed into notes) when:
pcis out of range for this function’s op count;- the op at
pcis not a linear-memory access; - the op’s access width differs from the declared
width.
Dropping rather than refusing the whole file is deliberate and matches
the wsc.facts per-record rule: a newer scry proving an access class
synth does not guard must not invalidate the sites it does guard. The
safety direction is preserved either way — a dropped entry keeps its
guard.
Trait Implementations§
Source§impl Clone for ProvenSafeIngest
impl Clone for ProvenSafeIngest
Source§fn clone(&self) -> ProvenSafeIngest
fn clone(&self) -> ProvenSafeIngest
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ProvenSafeIngest
impl Debug for ProvenSafeIngest
Source§impl Default for ProvenSafeIngest
impl Default for ProvenSafeIngest
Source§fn default() -> ProvenSafeIngest
fn default() -> ProvenSafeIngest
impl Eq for ProvenSafeIngest
Source§impl PartialEq for ProvenSafeIngest
impl PartialEq for ProvenSafeIngest
impl StructuralPartialEq for ProvenSafeIngest
Auto Trait Implementations§
impl Freeze for ProvenSafeIngest
impl RefUnwindSafe for ProvenSafeIngest
impl Send for ProvenSafeIngest
impl Sync for ProvenSafeIngest
impl Unpin for ProvenSafeIngest
impl UnsafeUnpin for ProvenSafeIngest
impl UnwindSafe for ProvenSafeIngest
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.