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

Function write_tracked

atomic-cli/src/commands/intent/bridge.rs:368–389  ·  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

366 /// Mirror `attest`'s tracked-vault write exactly (body = pretty JSON + '\n',
367 /// flat-string frontmatter anchors).
368 fn write_tracked(repo: &Repository, id: &str, node: &CanonicalNode, inputs: &LiftInputs) {
369 let mut body = serde_json::to_string_pretty(&node.to_value()).unwrap();
370 body.push('\n');
371 let mut fm = serde_json::Map::new();
372 fm.insert(
373 "intentId".into(),
374 Value::String(normalized_id(repo, id).unwrap()),
375 );
376 fm.insert(
377 "sourceContentHash".into(),
378 Value::String(source_content_hash(inputs)),
379 );
380 let frontmatter_json = serde_json::to_string(&fm).unwrap();
381 let vpath = attestation_vault_path(repo, id).unwrap();
382 repo.vault_store(
383 &vpath,
384 VaultEntryType::Attestation,
385 body.into_bytes(),
386 frontmatter_json,
387 )
388 .unwrap();
389 }
390
391 /// Mirror `attest`'s legacy sidecar write exactly ({node, source} wrapper).
392 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