pub enum AttestLevel {
Unsigned,
SelfSigned,
PeerAttested,
SignedByPeer,
DaemonSigned,
}Expand description
v0.7 Track H — attestation level for a memory_links row.
H2 (#566) and H3 (#572) already write the three string variants
directly into the memory_links.attest_level TEXT column
("unsigned", "self_signed", "peer_attested"). H4 formalises
the enum so the memory_verify MCP tool — and any future verifier
surface — can reason in terms of a closed set rather than an
open-ended string.
#[serde(rename_all = "snake_case")] keeps the wire shape byte-
identical to what the database column already holds. The
AttestLevel::from_str / AttestLevel::as_str helpers exist
because the column is read as a String in many call sites that
are not deserialising through serde (e.g. rusqlite::Row::get).
Variants§
Unsigned
No signature on the row, or no key enrolled for observed_by on
the receiver. Federation back-compat default — unsigned rows
still land but downstream consumers know they cannot verify.
SelfSigned
Row was signed locally by this writer (H2 outbound path).
PeerAttested
Row arrived from a peer with a signature that verified against
the enrolled observed_by public key on this host (H3 inbound
path).
SignedByPeer
v0.7.0 #1389 L4 / RFC-0001 — capture_turn host-signed memory.
Distinct from PeerAttested (which is federation H3 inbound):
SignedByPeer means an out-of-process HOST supplied a
host_signature_b64 + host_pubkey_b64; the substrate
verified the signature against
AI_MEMORY_L4_HOST_PUBKEY_ALLOWLIST and the canonical-bytes
encoding. Used at src/mcp/tools/capture_turn.rs::556.
Closes F-C9 spec-drift (#1430).
DaemonSigned
v0.7.0 — daemon-signed governance-audit row. Used by
crate::governance::audit::sign_with_daemon_key when a daemon
keypair is installed and the substrate emits a Custom-action
refusal row to the signed_events chain. Distinct from
SelfSigned (H2 link-write outbound) — this variant is the
substrate’s OWN signature on its OWN audit emissions, not on
content the substrate received from a caller. Closes F-C9
spec-drift (#1430).
Implementations§
Source§impl AttestLevel
impl AttestLevel
Sourcepub fn from_str(s: &str) -> Option<Self>
pub fn from_str(s: &str) -> Option<Self>
Parse the string form stored in memory_links.attest_level /
signed_events.attest_level.
Returns None for unknown values so callers can decide whether
to treat the column as legacy/unsigned or surface an error.
Keeps the unit-of-truth on the database column shape — H2/H3
already write the canonical lowercase snake_case strings.
v0.7.0 #1389 L4 + governance-audit additions parse via the
signed_by_peer and daemon_signed arms.
Trait Implementations§
Source§impl Clone for AttestLevel
impl Clone for AttestLevel
Source§fn clone(&self) -> AttestLevel
fn clone(&self) -> AttestLevel
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for AttestLevel
Source§impl Debug for AttestLevel
impl Debug for AttestLevel
Source§impl<'de> Deserialize<'de> for AttestLevel
impl<'de> Deserialize<'de> for AttestLevel
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl Display for AttestLevel
impl Display for AttestLevel
impl Eq for AttestLevel
Source§impl PartialEq for AttestLevel
impl PartialEq for AttestLevel
Source§fn eq(&self, other: &AttestLevel) -> bool
fn eq(&self, other: &AttestLevel) -> bool
self and other values to be equal, and is used by ==.Source§impl Serialize for AttestLevel
impl Serialize for AttestLevel
impl StructuralPartialEq for AttestLevel
Auto Trait Implementations§
impl Freeze for AttestLevel
impl RefUnwindSafe for AttestLevel
impl Send for AttestLevel
impl Sync for AttestLevel
impl Unpin for AttestLevel
impl UnsafeUnpin for AttestLevel
impl UnwindSafe for AttestLevel
Blanket Implementations§
impl<T> Boilerplate for T
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,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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§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.impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToCompactString for Twhere
T: Display,
impl<T> ToCompactString for Twhere
T: Display,
Source§fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
ToCompactString::to_compact_string() Read moreSource§fn to_compact_string(&self) -> CompactString
fn to_compact_string(&self) -> CompactString
CompactString. Read moreSource§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.