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

Function write_tracked

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

Mirror `attest`'s tracked-vault write exactly.

(repo: &Repository, id: &str, node: &MemoryNode, inputs: &MemLiftInputs)

Source from the content-addressed store, hash-verified

320
321 /// Mirror `attest`'s tracked-vault write exactly.
322 fn write_tracked(repo: &Repository, id: &str, node: &MemoryNode, inputs: &MemLiftInputs) {
323 let mut body = serde_json::to_string_pretty(&node.to_value()).unwrap();
324 body.push('\n');
325 let mut fm = serde_json::Map::new();
326 fm.insert("memoryId".into(), Value::String(memory_id(id)));
327 fm.insert(
328 "sourceContentHash".into(),
329 Value::String(source_content_hash(inputs)),
330 );
331 let frontmatter_json = serde_json::to_string(&fm).unwrap();
332 let vpath = attestation_vault_path(id);
333 repo.vault_store(
334 &vpath,
335 VaultEntryType::Attestation,
336 body.into_bytes(),
337 frontmatter_json,
338 )
339 .unwrap();
340 }
341
342 /// Mirror `attest`'s legacy sidecar write exactly ({node, source} wrapper).
343 fn write_legacy_sidecar(

Calls 8

memory_idFunction · 0.85
vault_storeMethod · 0.80
source_content_hashFunction · 0.70
attestation_vault_pathFunction · 0.70
unwrapMethod · 0.45
to_valueMethod · 0.45
pushMethod · 0.45
insertMethod · 0.45