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

Function source_content_hash

libatomic/src/daemon/services_agent.rs:3072–3079  ·  view source on GitHub ↗

blake3 source hash of (frontmatter + body) — the attestation freshness anchor, mirroring the CLI bridges.

(frontmatter: &Map<String, Value>, body: &str)

Source from the content-addressed store, hash-verified

3070/// blake3 source hash of (frontmatter + body) — the attestation freshness
3071/// anchor, mirroring the CLI bridges.
3072fn source_content_hash(frontmatter: &Map<String, Value>, body: &str) -> String {
3073 let fm = serde_json::to_string(frontmatter).unwrap_or_default();
3074 let mut hasher = blake3::Hasher::new();
3075 hasher.update(fm.as_bytes());
3076 hasher.update(b"\0");
3077 hasher.update(body.as_bytes());
3078 format!("blake3:{}", hasher.finalize().to_hex())
3079}
3080
3081fn write_all(path: &std::path::Path, bytes: &[u8]) -> Result<(), Status> {
3082 if let Some(parent) = path.parent() {

Callers 6

fresh_attested_intentFunction · 0.70
fresh_attested_memoryFunction · 0.70
intent_list_attestationFunction · 0.70
memory_list_attestationFunction · 0.70
record_attestationMethod · 0.70
verify_attestationMethod · 0.70

Calls 2

updateMethod · 0.45
as_bytesMethod · 0.45

Tested by

no test coverage detected