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

Function write_tracked

atomic-cli/src/commands/memory/bridge.rs:375–393  ·  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

373
374 /// Mirror `attest`'s tracked-vault write exactly.
375 fn write_tracked(repo: &Repository, id: &str, node: &MemoryNode, inputs: &MemLiftInputs) {
376 let mut body = serde_json::to_string_pretty(&node.to_value()).unwrap();
377 body.push('\n');
378 let mut fm = serde_json::Map::new();
379 fm.insert("memoryId".into(), Value::String(memory_id(id)));
380 fm.insert(
381 "sourceContentHash".into(),
382 Value::String(source_content_hash(inputs)),
383 );
384 let frontmatter_json = serde_json::to_string(&fm).unwrap();
385 let vpath = attestation_vault_path(id);
386 repo.vault_store(
387 &vpath,
388 VaultEntryType::Attestation,
389 body.into_bytes(),
390 frontmatter_json,
391 )
392 .unwrap();
393 }
394
395 /// Mirror `attest`'s legacy sidecar write exactly ({node, source} wrapper).
396 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