pub enum MemoryError {
NotFound(String),
ValidationFailed(String),
DatabaseError(String),
Conflict(String),
ReflectionDepthExceeded {
attempted: u32,
cap: u32,
namespace: String,
},
SynthesisDepthExceeded {
attempted: u32,
cap: u32,
namespace: String,
},
ReflectionCycleDetected {
source: String,
target: String,
cycle_path: Vec<String>,
},
RefusedByGovernance(String),
RefusedByGovernanceGate(GovernanceRefusal),
}Variants§
NotFound(String)
ValidationFailed(String)
DatabaseError(String)
Conflict(String)
ReflectionDepthExceeded
v0.7.0 recursive-learning Task 4/8 (issue #655) — emitted by the
memory_reflect write path when the proposed reflection’s depth
exceeds the resolved namespace
crate::models::GovernancePolicy::effective_max_reflection_depth
cap. The variant carries the structured triple so Task 5/8 can
match on it without parsing a string, then emit a signed_events
audit row for the refusal decision.
Wire shape (HTTP): 409 CONFLICT with code REFLECTION_DEPTH_EXCEEDED.
SynthesisDepthExceeded
Issue #1240 (HIGH) — emitted by the memory_store write path when
the synthesis-pass recursion depth (post-store hooks that fire
further memory_store calls, e.g. via curator chain-fire) exceeds
the compiled-in cap of 3. Mirrors the
Self::ReflectionDepthExceeded variant so audit + wire shape
stay symmetric across the two recursive-write primitives.
Wire shape (HTTP): 409 CONFLICT with code SYNTHESIS_DEPTH_EXCEEDED.
ReflectionCycleDetected
v0.7.0 L1-2 (issue #659) — emitted by the memory_link write path
when adding a reflects_on edge would close a cycle in the
reflection graph. Carries source, target, and the reconstructed
cycle_path (ordered source → … → source) for the audit row and
the operator-readable error message.
Wire shape (HTTP / MCP): surfaced as a String error at the MCP
layer with code REFLECTION_CYCLE_DETECTED.
RefusedByGovernance(String)
v0.7.0 L1-6 Deliverable E (issue #691) — emitted by
crate::storage::insert, crate::storage::insert_with_conflict,
and crate::storage::insert_if_newer when the optional
crate::storage::GOVERNANCE_PRE_WRITE hook returns Err(reason).
The hook is installed once at daemon serve boot and consults the
substrate’s signed governance_rules table via
governance::agent_action::check_agent_action against a synthetic
Custom { custom_kind = "memory_write" } action; a Refuse
decision short-circuits the SQL INSERT cleanly (no row written,
no partial state).
The hook is NOT installed in CLI one-shot mode — operator-direct CLI invocations stay unimpeded by design (operator standing directive: rules gate AGENT writes, not the operator’s own hands-on substrate ops).
Wire shape (HTTP): 403 FORBIDDEN with code GOVERNANCE_REFUSED.
Carries the operator-authored reason from the matching
governance_rules.reason column verbatim.
RefusedByGovernanceGate(GovernanceRefusal)
#963 Phase 2 — substrate gate-evaluator refusal
(crate::storage::enforce_governance /
Store::enforce_governance_action). Distinguished from
Self::RefusedByGovernance (the substrate pre-write hook) by
carrying the typed crate::governance::GovernanceRefusal
envelope so handlers can surface
denied_level / namespace / owner in HTTP / MCP / CLI
responses without re-parsing the wire message.
Wire shape (HTTP): 403 FORBIDDEN with code GOVERNANCE_REFUSED.
The message() is the canonical envelope Display
("<action> denied by governance: <reason>"), byte-identical to
the pre-#963 free-form Deny(String) wire shape.
Implementations§
Trait Implementations§
Source§impl Debug for MemoryError
impl Debug for MemoryError
Source§impl Display for MemoryError
impl Display for MemoryError
Source§impl From<Error> for MemoryError
impl From<Error> for MemoryError
Source§impl From<Error> for MemoryError
impl From<Error> for MemoryError
Source§impl IntoResponse for MemoryError
impl IntoResponse for MemoryError
Source§fn into_response(self) -> Response
fn into_response(self) -> Response
Auto Trait Implementations§
impl Freeze for MemoryError
impl RefUnwindSafe for MemoryError
impl Send for MemoryError
impl Sync for MemoryError
impl Unpin for MemoryError
impl UnsafeUnpin for MemoryError
impl UnwindSafe for MemoryError
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
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.