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

Function write_tracked

atomic-cli/src/commands/intent/bridge.rs:350–371  ·  view source on GitHub ↗

Mirror `attest`'s tracked-vault write exactly (body = pretty JSON + '\n', flat-string frontmatter anchors).

(repo: &Repository, id: &str, node: &CanonicalNode, inputs: &LiftInputs)

Source from the content-addressed store, hash-verified

348 /// Mirror `attest`'s tracked-vault write exactly (body = pretty JSON + '\n',
349 /// flat-string frontmatter anchors).
350 fn write_tracked(repo: &Repository, id: &str, node: &CanonicalNode, inputs: &LiftInputs) {
351 let mut body = serde_json::to_string_pretty(&node.to_value()).unwrap();
352 body.push('\n');
353 let mut fm = serde_json::Map::new();
354 fm.insert(
355 "intentId".into(),
356 Value::String(normalized_id(repo, id).unwrap()),
357 );
358 fm.insert(
359 "sourceContentHash".into(),
360 Value::String(source_content_hash(inputs)),
361 );
362 let frontmatter_json = serde_json::to_string(&fm).unwrap();
363 let vpath = attestation_vault_path(repo, id).unwrap();
364 repo.vault_store(
365 &vpath,
366 VaultEntryType::Attestation,
367 body.into_bytes(),
368 frontmatter_json,
369 )
370 .unwrap();
371 }
372
373 /// Mirror `attest`'s legacy sidecar write exactly ({node, source} wrapper).
374 fn write_legacy_sidecar(

Calls 8

normalized_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