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

Function source_content_hash

atomic-cli/src/commands/memory/bridge.rs:165–172  ·  view source on GitHub ↗

A hash of the source lift inputs, recorded so a later edit to the memory can be detected as making the attestation stale. Standalone digest of (frontmatter + body); NOT the vault's `content_hash`. Copied verbatim from `intent/bridge.rs::source_content_hash`.

(inputs: &MemLiftInputs)

Source from the content-addressed store, hash-verified

163/// (frontmatter + body); NOT the vault's `content_hash`. Copied verbatim from
164/// `intent/bridge.rs::source_content_hash`.
165pub fn source_content_hash(inputs: &MemLiftInputs) -> String {
166 let fm = serde_json::to_string(&inputs.frontmatter).unwrap_or_default();
167 let mut hasher = blake3::Hasher::new();
168 hasher.update(fm.as_bytes());
169 hasher.update(b"\0");
170 hasher.update(inputs.body.as_bytes());
171 format!("blake3:{}", hasher.finalize().to_hex())
172}
173
174/// The state of a memory's attestation relative to the current source.
175pub enum Attestation {

Callers 6

load_attestationFunction · 0.70
write_trackedFunction · 0.70
write_legacy_sidecarFunction · 0.70
runMethod · 0.70
write_trackedFunction · 0.70

Calls 2

updateMethod · 0.80
as_bytesMethod · 0.45

Tested by 2

runMethod · 0.56