Read a vault path from KG node metadata; the legacy fallback maps the node identity onto ``memory/ .md``.
(node: &KgNode)
| 213 | /// Read a vault path from KG node metadata; the legacy fallback maps the |
| 214 | /// node identity onto ``memory/<name>.md``. |
| 215 | fn memory_path_from_node(node: &KgNode) -> Option<String> { |
| 216 | node.metadata |
| 217 | .as_ref() |
| 218 | .and_then(|metadata| metadata.get("vault_path")) |
| 219 | .and_then(|path| path.as_str()) |
| 220 | .filter(|path| path.starts_with("memory/") && path.ends_with(".md")) |
| 221 | .map(String::from) |
| 222 | .or_else(|| memory_node_id_to_path(&node.id)) |
| 223 | } |
| 224 | |
| 225 | /// Legacy fallback: `memory:architecture` -> `memory/architecture.md`. |
| 226 | fn memory_node_id_to_path(node_id: &str) -> Option<String> { |
no test coverage detected