Add all memory nodes adjacent to `node_id` as neighbor candidates.
(
repo: &Repository,
node_id: &str,
depth: u8,
candidates: &mut HashMap<String, CandidateScore>,
)
| 410 | |
| 411 | /// Add all memory nodes adjacent to `node_id` as neighbor candidates. |
| 412 | fn add_memory_neighbors( |
| 413 | repo: &Repository, |
| 414 | node_id: &str, |
| 415 | depth: u8, |
| 416 | candidates: &mut HashMap<String, CandidateScore>, |
| 417 | ) -> CliResult<()> { |
| 418 | let subgraph = repo |
| 419 | .vault_kg_neighbors(node_id, depth) |
| 420 | .map_err(CliError::Repository)?; |
| 421 | for node in subgraph.nodes { |
| 422 | if node.kind == "memory" && node.id != node_id { |
| 423 | merge_candidate( |
| 424 | candidates, |
| 425 | &node.id, |
| 426 | memory_path_from_node(&node), |
| 427 | 0.0, |
| 428 | true, |
| 429 | ); |
| 430 | } |
| 431 | } |
| 432 | Ok(()) |
| 433 | } |
| 434 | |
| 435 | /// Load candidate bodies from the vault, score, and rank them. |
| 436 | fn resolve_and_rank( |
no test coverage detected