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: RawSymbolNameSubject.
p: RawSymbolNamePredicate.
keywords: KeywordArgsKeyword arguments — must include src, c, v; may include
projected.
Epi
Episodic memory write — (epi EVENT_ID KIND (PAR*) LOC …).
Fields
event_id: RawSymbolNameStable memory ID for this event.
kind: RawSymbolNameEvent-type symbol.
participants: Vec<RawSymbolName>List of participant symbols.
location: RawSymbolNameLocation symbol.
keywords: KeywordArgsExpected keys: at, obs, src, c.
Pro
Procedural memory write — (pro RULE_ID TRIGGER ACTION …).
Fields
rule_id: RawSymbolNameStable memory ID for this rule.
keywords: KeywordArgsExpected keys: scp, src, c; optional pre.
Inf
Inferential memory write — (inf s p o (DERIVED*) METHOD …).
Fields
s: RawSymbolNameSubject.
p: RawSymbolNamePredicate.
derived_from: Vec<RawSymbolName>Parent memory symbols (must be non-empty).
method: RawSymbolNameRegistered inference method symbol.
keywords: KeywordArgsExpected keys: c, v; optional projected.
Alias
(alias @a @b) — declare two names as aliases.
Rename
(rename @old @new) — rename a symbol.
Retire
(retire @name [:reason STRING]) — soft-retire a symbol.
Correct
(correct @target_episode … epi body …) — correct a prior
Episodic memory. The corrected body is itself a parenthesised
Episodic form.
Fields
target_episode: RawSymbolNameThe 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: RawSymbolNameThe 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: KeywordArgsRemaining 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: EpisodeActionWhether 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 0x35–0x38.
Fields
action: FlagActionWhich flag operation this form carries.
memory: RawSymbolNameThe memory the flag applies to.
actor: RawSymbolNameThe 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
impl Clone for UnboundForm
Source§fn clone(&self) -> UnboundForm
fn clone(&self) -> UnboundForm
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more