Skip to main content

UnboundForm

Enum UnboundForm 

Source
pub enum UnboundForm {
    Sem {
        s: RawSymbolName,
        p: RawSymbolName,
        o: RawValue,
        keywords: KeywordArgs,
    },
    Epi {
        event_id: RawSymbolName,
        kind: RawSymbolName,
        participants: Vec<RawSymbolName>,
        location: RawSymbolName,
        keywords: KeywordArgs,
    },
    Pro {
        rule_id: RawSymbolName,
        trigger: RawValue,
        action: RawValue,
        keywords: KeywordArgs,
    },
    Inf {
        s: RawSymbolName,
        p: RawSymbolName,
        o: RawValue,
        derived_from: Vec<RawSymbolName>,
        method: RawSymbolName,
        keywords: KeywordArgs,
    },
    Alias {
        a: RawSymbolName,
        b: RawSymbolName,
    },
    Rename {
        old: RawSymbolName,
        new: RawSymbolName,
    },
    Retire {
        name: RawSymbolName,
        keywords: KeywordArgs,
    },
    Correct {
        target_episode: RawSymbolName,
        corrected: Box<UnboundForm>,
    },
    Promote {
        name: RawSymbolName,
    },
    Query {
        selector: Option<QuerySelector>,
        keywords: KeywordArgs,
    },
    Episode {
        action: EpisodeAction,
        label: Option<String>,
        parent_episode: Option<RawSymbolName>,
        retracts: Vec<RawSymbolName>,
    },
    Flag {
        action: FlagAction,
        memory: RawSymbolName,
        actor: RawSymbolName,
    },
}
Expand description

An unbound AST form — the parser’s output.

Binding (resolving RawSymbolName into SymbolId, validating kind annotations against SymbolKind, materialising RawValue into Value) happens in a later stage — see librarian-pipeline.md § 3.4.

Variants§

§

Sem

Semantic memory write — (sem s p o :src SRC :c CONF :v V).

Fields

§s: RawSymbolName

Subject.

§p: RawSymbolName

Predicate.

§o: RawValue

Object.

§keywords: KeywordArgs

Keyword arguments — must include src, c, v; may include projected.

§

Epi

Episodic memory write — (epi EVENT_ID KIND (PAR*) LOC …).

Fields

§event_id: RawSymbolName

Stable memory ID for this event.

§kind: RawSymbolName

Event-type symbol.

§participants: Vec<RawSymbolName>

List of participant symbols.

§location: RawSymbolName

Location symbol.

§keywords: KeywordArgs

Expected keys: at, obs, src, c.

§

Pro

Procedural memory write — (pro RULE_ID TRIGGER ACTION …).

Fields

§rule_id: RawSymbolName

Stable memory ID for this rule.

§trigger: RawValue

Trigger — typically a string literal.

§action: RawValue

Action — typically a string literal.

§keywords: KeywordArgs

Expected keys: scp, src, c; optional pre.

§

Inf

Inferential memory write — (inf s p o (DERIVED*) METHOD …).

Fields

§s: RawSymbolName

Subject.

§p: RawSymbolName

Predicate.

§o: RawValue

Object.

§derived_from: Vec<RawSymbolName>

Parent memory symbols (must be non-empty).

§method: RawSymbolName

Registered inference method symbol.

§keywords: KeywordArgs

Expected keys: c, v; optional projected.

§

Alias

(alias @a @b) — declare two names as aliases.

Fields

§a: RawSymbolName

First symbol.

§b: RawSymbolName

Second symbol.

§

Rename

(rename @old @new) — rename a symbol.

Fields

§old: RawSymbolName

The old canonical name.

§new: RawSymbolName

The new canonical name.

§

Retire

(retire @name [:reason STRING]) — soft-retire a symbol.

Fields

§name: RawSymbolName

Target symbol.

§keywords: KeywordArgs

Optional :reason keyword.

§

Correct

(correct @target_episode … epi body …) — correct a prior Episodic memory. The corrected body is itself a parenthesised Episodic form.

Fields

§target_episode: RawSymbolName

The Episode being corrected.

§corrected: Box<UnboundForm>

The corrected Episodic memory (must be an Epi form).

§

Promote

(promote @name) — promote an ephemeral memory to canonical.

Fields

§name: RawSymbolName

The ephemeral memory symbol.

§

Query

(query … keyword args …) — read-path query.

v1 parser treats the body as a keyword-arg bag; selector is an optional single positional. Detailed query DSL validation is in read-protocol.md and will land with the read-protocol milestone.

Fields

§selector: Option<QuerySelector>

Optional positional selector — a symbol or list.

§keywords: KeywordArgs

Remaining keyword arguments.

§

Episode

(episode :start [:label S] [:parent_episode @E] [:retracts (@E1 …)]) or (episode :close) — explicit Episode-boundary directive.

:close is a no-op under the single-compile_batch-per-Episode model (the batch closes the Episode implicitly); the form is still accepted so agents can emit it spec-compliantly.

Note on :retracts: the spec text uses [ … ] brackets (§ 9.1), but Mimir’s write surface doesn’t tokenize brackets. The implementation accepts parenthesised symbol lists — :retracts (@E1 @E2) — matching the existing list convention used by Epi’s participants and Inf’s derived_from.

Fields

§action: EpisodeAction

Whether this form opens or closes an Episode.

§label: Option<String>

Optional human-readable label (spec § 4.3 — capped at 256 bytes; the semantic stage enforces).

§parent_episode: Option<RawSymbolName>

Optional parent Episode symbol (spec § 5.1).

§retracts: Vec<RawSymbolName>

Zero or more Episodes this Episode retracts (spec § 5.2).

§

Flag

Pin / unpin / authoritative flag write — one of the four (pin @mem :actor @A) / (unpin @mem :actor @A) / (authoritative-set @mem :actor @A) / (authoritative-clear @mem :actor @A) forms per confidence-decay.md §§ 7 / 8 and ir-canonical-form.md opcodes 0x350x38.

Fields

§action: FlagAction

Which flag operation this form carries.

§memory: RawSymbolName

The memory the flag applies to.

§actor: RawSymbolName

The agent or user invoking the flag change — required for audit. Must resolve to an Agent-kind symbol at bind time.

Trait Implementations§

Source§

impl Clone for UnboundForm

Source§

fn clone(&self) -> UnboundForm

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for UnboundForm

Source§

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

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

impl PartialEq for UnboundForm

Source§

fn eq(&self, other: &UnboundForm) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for UnboundForm

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
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> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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