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

Function memory_attestation_sources

libatomic/src/daemon/services_agent.rs:953–979  ·  view source on GitHub ↗

The RAW memory attestation sources: the tracked `attestations/memory/ /attested.md` entry and the single legacy sidecar path's text.

(repo: &Repository, id: &str)

Source from the content-addressed store, hash-verified

951/// `attestations/memory/<id>/attested.md` entry and the single legacy
952/// sidecar path's text.
953fn memory_attestation_sources(repo: &Repository, id: &str) -> Value {
954 let vpath = format!("attestations/memory/{}/attested.md", sanitize_id(id));
955 let tracked = repo.vault_retrieve(&vpath).ok().flatten().map(|entry| {
956 serde_json::json!({
957 "path": vpath,
958 "frontmatter_json": entry.frontmatter_json,
959 "content": entry.content_bytes,
960 })
961 });
962 let sidecar_path = repo
963 .dot_dir()
964 .join("canonical")
965 .join("memory")
966 .join(sanitize_id(id))
967 .join("attested.jsonld");
968 let sidecar = if sidecar_path.exists() {
969 std::fs::read_to_string(&sidecar_path).ok().map(|text| {
970 serde_json::json!({
971 "path": sidecar_path.display().to_string(),
972 "text": text,
973 })
974 })
975 } else {
976 None
977 };
978 serde_json::json!({ "tracked": tracked, "sidecar": sidecar })
979}
980
981fn memory_is_index_scaffold(repo: &Repository, path: &str) -> bool {
982 let Ok(Some(entry)) = repo.vault_retrieve(path) else {

Callers 1

vault_entry_bundleFunction · 0.85

Calls 5

vault_retrieveMethod · 0.80
sanitize_idFunction · 0.70
okMethod · 0.45
dot_dirMethod · 0.45
existsMethod · 0.45

Tested by

no test coverage detected