Add all memory nodes adjacent to `node_id` as neighbor candidates.
(
repo: &Repository,
node_id: &str,
depth: u8,
candidates: &mut HashMap<String, CandidateScore>,
)
| 477 | |
| 478 | /// Add all memory nodes adjacent to `node_id` as neighbor candidates. |
| 479 | fn add_memory_neighbors( |
| 480 | repo: &Repository, |
| 481 | node_id: &str, |
| 482 | depth: u8, |
| 483 | candidates: &mut HashMap<String, CandidateScore>, |
| 484 | ) -> CliResult<()> { |
| 485 | let subgraph = repo |
| 486 | .vault_kg_neighbors(node_id, depth) |
| 487 | .map_err(CliError::Repository)?; |
| 488 | for node in subgraph.nodes { |
| 489 | if node.has_type(atomic_core::kg::ontology::Class::Memory) && node.id != node_id { |
| 490 | merge_candidate( |
| 491 | candidates, |
| 492 | &node.id, |
| 493 | memory_path_from_node(&node), |
| 494 | 0.0, |
| 495 | true, |
| 496 | ); |
| 497 | } |
| 498 | } |
| 499 | Ok(()) |
| 500 | } |
| 501 | |
| 502 | /// Load candidate bodies from the vault, score, and rank them. |
| 503 | fn resolve_and_rank( |
no test coverage detected