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

Function source_content_hash

atomic-repository/src/intent_bridge.rs:257–264  ·  view source on GitHub ↗

A hash of the source lift inputs, recorded in the sidecar so a later edit to the intent can be detected as making the attestation stale. This is a standalone digest of (frontmatter + body); it is NOT the vault's `content_hash` and never feeds it. `attest` writes it; `validate`/`show`/ `verify` recompute it to decide whether a sidecar is still fresh.

(inputs: &LiftInputs)

Source from the content-addressed store, hash-verified

255/// `content_hash` and never feeds it. `attest` writes it; `validate`/`show`/
256/// `verify` recompute it to decide whether a sidecar is still fresh.
257pub fn source_content_hash(inputs: &LiftInputs) -> String {
258 let fm = serde_json::to_string(&inputs.frontmatter).unwrap_or_default();
259 let mut hasher = blake3::Hasher::new();
260 hasher.update(fm.as_bytes());
261 hasher.update(b"\0");
262 hasher.update(inputs.body.as_bytes());
263 format!("blake3:{}", hasher.finalize().to_hex())
264}
265
266/// The state of an intent's attestation sidecar relative to the current source.
267pub enum Attestation {

Callers 13

view_intent_sourcesFunction · 0.70
classify_attestationFunction · 0.70
write_trackedFunction · 0.70
write_legacy_sidecarFunction · 0.70
context_from_inputsFunction · 0.70
review_decision_scopeMethod · 0.50
review_coverageMethod · 0.50
check_review_subjectMethod · 0.50
approve_review_intentMethod · 0.50
verifyFunction · 0.50

Calls 2

updateMethod · 0.45
as_bytesMethod · 0.45