MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / is_freeform_memory

Function is_freeform_memory

atomic-cli/src/commands/memory/bridge.rs:125–129  ·  view source on GitHub ↗

Whether this is a freeform memory rather than a malformed canonical one. `memory write` and the default `MEMORY.md` have only simple metadata. Once any canonical identity/kind field is present, lift errors stay visible instead of silently falling back to raw output.

(inputs: &MemLiftInputs)

Source from the content-addressed store, hash-verified

123/// any canonical identity/kind field is present, lift errors stay visible
124/// instead of silently falling back to raw output.
125pub fn is_freeform_memory(inputs: &MemLiftInputs) -> bool {
126 ["@id", "uid", "id", "memoryKind", "kind"]
127 .iter()
128 .all(|key| !inputs.frontmatter.contains_key(*key))
129}
130
131/// Sanitize a memory id for use as a directory name in the sidecar/vault path.
132/// Keeps ASCII alphanumerics, `-` and `_`; everything else becomes `_`.

Callers 1

runMethod · 0.85

Calls 3

contains_keyMethod · 0.80
allMethod · 0.45
iterMethod · 0.45

Tested by

no test coverage detected