Normalize a bare id, a `memory/ ` path, an ` .md` name, or a full `memory/ .md` path all to the canonical vault path `memory/ .md`. This is the SINGLE memory id/path resolver: no manifest lookup, no prefix, no case-folding — the manifest key IS the path (contrast the intent normalizer, which is deliberately NOT reused). A memory is a single flat file per id, never a directory.
(id_or_path: &str)
| 66 | /// normalizer, which is deliberately NOT reused). A memory is a single flat |
| 67 | /// file per id, never a directory. |
| 68 | pub fn normalize_memory_path(id_or_path: &str) -> String { |
| 69 | let without_prefix = id_or_path.strip_prefix("memory/").unwrap_or(id_or_path); |
| 70 | let stem = without_prefix.strip_suffix(".md").unwrap_or(without_prefix); |
| 71 | format!("memory/{stem}.md") |
| 72 | } |
| 73 | |
| 74 | /// The `<id>` stem for a bare id or any accepted path form. Used both to build |
| 75 | /// the human-facing messages and (sanitized) to KEY the attestation path. |
no outgoing calls