Skip to main content

MemoryError

Enum MemoryError 

Source
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.

Fields

§attempted: u32
§cap: u32
§namespace: String
§

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.

Fields

§attempted: u32
§cap: u32
§namespace: String
§

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.

Fields

§source: String
§target: String
§cycle_path: Vec<String>
§

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§

Source§

impl MemoryError

Source

pub fn code(&self) -> &'static str

Source

pub fn status(&self) -> StatusCode

Source

pub fn message(&self) -> String

Trait Implementations§

Source§

impl Debug for MemoryError

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for MemoryError

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl From<Error> for MemoryError

Source§

fn from(e: Error) -> Self

Converts to this type from the input type.
Source§

impl From<Error> for MemoryError

Source§

fn from(e: Error) -> Self

Converts to this type from the input type.
Source§

impl IntoResponse for MemoryError

Source§

fn into_response(self) -> Response

Create a response.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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 more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToCompactString for T
where T: Display,

Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T> ToStringFallible for T
where T: Display,

Source§

fn try_to_string(&self) -> Result<String, TryReserveError>

ToString::to_string, but without panic on OOM.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more