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

Function write_tracked

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

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