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

Function write_tracked

atomic-repository/src/intent_bridge.rs:412–433  ·  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

410 /// Mirror `attest`'s tracked-vault write exactly (body = pretty JSON + '\n',
411 /// flat-string frontmatter anchors).
412 fn write_tracked(repo: &Repository, id: &str, node: &CanonicalNode, inputs: &LiftInputs) {
413 let mut body = serde_json::to_string_pretty(&node.to_value()).unwrap();
414 body.push('\n');
415 let mut fm = serde_json::Map::new();
416 fm.insert(
417 "intentId".into(),
418 Value::String(normalized_id(repo, id).unwrap()),
419 );
420 fm.insert(
421 "sourceContentHash".into(),
422 Value::String(source_content_hash(inputs)),
423 );
424 let frontmatter_json = serde_json::to_string(&fm).unwrap();
425 let vpath = attestation_vault_path(repo, id).unwrap();
426 repo.vault_store(
427 &vpath,
428 VaultEntryType::Attestation,
429 body.into_bytes(),
430 frontmatter_json,
431 )
432 .unwrap();
433 }
434
435 /// Mirror `attest`'s legacy sidecar write exactly ({node, source} wrapper).
436 fn write_legacy_sidecar(

Calls 8

vault_storeMethod · 0.80
normalized_idFunction · 0.70
source_content_hashFunction · 0.70
attestation_vault_pathFunction · 0.70
unwrapMethod · 0.45
to_valueMethod · 0.45
pushMethod · 0.45
insertMethod · 0.45