The RAW memory attestation sources: the tracked `attestations/memory/ /attested.md` entry and the single legacy sidecar path's text.
(repo: &Repository, id: &str)
| 951 | /// `attestations/memory/<id>/attested.md` entry and the single legacy |
| 952 | /// sidecar path's text. |
| 953 | fn 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 | |
| 981 | fn memory_is_index_scaffold(repo: &Repository, path: &str) -> bool { |
| 982 | let Ok(Some(entry)) = repo.vault_retrieve(path) else { |
no test coverage detected