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

Function write_tracked

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

483 /// Mirror `attest`'s tracked-vault write exactly (body = pretty JSON + '\n',
484 /// flat-string frontmatter anchors).
485 fn write_tracked(repo: &Repository, id: &str, node: &CanonicalNode, inputs: &LiftInputs) {
486 let mut body = serde_json::to_string_pretty(&node.to_value()).unwrap();
487 body.push('\n');
488 let mut fm = serde_json::Map::new();
489 fm.insert(
490 "intentId".into(),
491 Value::String(normalized_id(repo, id).unwrap()),
492 );
493 fm.insert(
494 "sourceContentHash".into(),
495 Value::String(source_content_hash(inputs)),
496 );
497 let frontmatter_json = serde_json::to_string(&fm).unwrap();
498 let vpath = attestation_vault_path(repo, id).unwrap();
499 repo.vault_store(
500 &vpath,
501 VaultEntryType::Attestation,
502 body.into_bytes(),
503 frontmatter_json,
504 )
505 .unwrap();
506 }
507
508 /// Mirror `attest`'s legacy sidecar write exactly ({node, source} wrapper).
509 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