pub enum Command {
Show 31 variants
Ping,
Metrics,
Get(GetInput),
HookEvaluate(HookEvaluateInput),
ScanPrefix(ScanPrefixInput),
History(HistoryInput),
HistorySince(HistorySinceInput),
SessionCheckConsulted(SessionCheckConsultedInput),
SessionCheckConsultedRecent(SessionCheckConsultedRecentInput),
MemQuery(MemQueryInput),
ScanEnforcementEvents(ScanEnforcementEventsInput),
ConfigGet(ConfigGetInput),
MemGet(MemGetInput),
MemBootstrap(MemBootstrapInput),
GotchaUpsert(GotchaDraftInput),
GotchaConfirm(GotchaConfirmInput),
GotchaTombstone(GotchaTombstoneInput),
FileEnrich(FileEnrichInput),
FileReparse(FileReparseInput),
FileEditHook(FileEditHookInput),
DocCapture(DocCaptureInput),
DecisionUpsert(DecisionUpsertInput),
DevNoteUpsert(DevNoteUpsertInput),
ConfigSet(ConfigSetInput),
SandboxAudit(SandboxAuditInput),
SessionLog(SessionLogInput),
ConsultationHit(ConsultationHitInput),
SessionFlush,
SessionHarvest,
SessionClearConsults,
RecordImport(RecordImportInput),
}Expand description
All commands available over the daemon IPC protocol.
Internally tagged by "type". Each variant either has no arguments (unit)
or wraps a typed input DTO with #[serde(deny_unknown_fields)].
There is no public put or delete command. All mutations are semantic.
Variants§
Ping
Health check. No arguments.
Metrics
Snapshot of live daemon metrics — per-command counters and latency percentiles. Pure read, no audit, no side effects.
Get(GetInput)
Single record lookup by key.
HookEvaluate(HookEvaluateInput)
Bulk lookup for hook decision: file record + linked gotchas + consultation status.
ScanPrefix(ScanPrefixInput)
Scan all records whose key starts with a prefix.
History(HistoryInput)
Version history for a single key.
HistorySince(HistorySinceInput)
Version history for a single key since a timestamp.
SessionCheckConsulted(SessionCheckConsultedInput)
Check whether a consultation receipt exists for a key.
SessionCheckConsultedRecent(SessionCheckConsultedRecentInput)
Check whether a recent consultation receipt exists (within TTL).
MemQuery(MemQueryInput)
BM25 text search or graph traversal.
ScanEnforcementEvents(ScanEnforcementEventsInput)
Scan enforcement events stored as raw JSON in the knowledge tree.
ConfigGet(ConfigGetInput)
Read a runtime configuration value (e.g. audit.write_durability). Pure read — no audit, no side effects.
MemGet(MemGetInput)
Single record lookup with consultation receipt side effect.
MemBootstrap(MemBootstrapInput)
Assemble a token-budgeted context packet for session startup.
GotchaUpsert(GotchaDraftInput)
Create or update a gotcha record. Always sets confirmed=false.
GotchaConfirm(GotchaConfirmInput)
Confirm a gotcha for hook enforcement. Sets confirmed=true.
GotchaTombstone(GotchaTombstoneInput)
Tombstone a gotcha and clean up file links + graph edges.
FileEnrich(FileEnrichInput)
Enrich a file record with LLM-derived purpose, entry points, etc. File record must already exist (created by init/reparse).
FileReparse(FileReparseInput)
Re-analyze a file from disk and update structural fields.
FileEditHook(FileEditHookInput)
Post-edit hook compound: consultation hit + file reparse.
DocCapture(DocCaptureInput)
Extract doc comment from file on disk and update file record purpose.
DecisionUpsert(DecisionUpsertInput)
Create or update a decision record.
DevNoteUpsert(DevNoteUpsertInput)
Create or update a dev note.
ConfigSet(ConfigSetInput)
Write a runtime configuration value. Records an
EnforcementConfigChanged event when the value actually changes.
SandboxAudit(SandboxAuditInput)
Record an EnforcementConfigChanged audit event for an L3 sandbox-floor
change (mati sandbox apply/clear/protect/unprotect). Lets the CLI log
the change even when a daemon holds the store (socket mode).
SessionLog(SessionLogInput)
Append a session analytics event (6 homogeneous event types).
ConsultationHit(ConsultationHitInput)
Record a consultation hit: receipt + access metrics + daily agg.
SessionFlush
Flush session data (collect consulted markers into session:current).
SessionHarvest
Archive session, run promotions, collect stale reviews.
SessionClearConsults
Clear all consult receipts (PostCompact: force re-block after compaction).
RecordImport(RecordImportInput)
Bulk-import a batch of pre-built Records into the knowledge tree.
Bypasses the semantic upsert handlers — records are written verbatim
so an export → import round-trip preserves every field
(confirmed, source, confidence, lifecycle, etc.) without
the destructive resets the typed upsert commands apply.
Only gotcha:*, decision:*, dev_note:*, file:*, stage:*,
and dep:* keys are accepted (the knowledge-tree namespaces).
Session-tree keys (session:*, analytics:*, compliance:*,
audit:*) are rejected at the boundary — those are daemon-owned
telemetry that an export should never round-trip.
Implementations§
Source§impl Command
impl Command
Sourcepub fn kind(&self) -> &'static str
pub fn kind(&self) -> &'static str
Returns the serde rename string for this command variant. Used for audit logging and tracing spans.
Sourcepub fn target_key(&self) -> &str
pub fn target_key(&self) -> &str
Returns the primary target key for this command, if applicable. Used for audit trail correlation.
Sourcepub fn is_mutation(&self) -> bool
pub fn is_mutation(&self) -> bool
Returns true for commands that mutate state (categories B and C).
Category B (reads with audited side effects): MemGet, MemBootstrap Category C (semantic mutations): all 13 mutation commands
Audit entries are written for all of these.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Command
impl<'de> Deserialize<'de> for Command
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>,
Auto Trait Implementations§
impl Freeze for Command
impl RefUnwindSafe for Command
impl Send for Command
impl Sync for Command
impl Unpin for Command
impl UnsafeUnpin for Command
impl UnwindSafe for Command
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> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
impl<T> Fruit for T
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 more