Add all memory nodes adjacent to `node_id` as neighbor candidates.
(
repo: &Repository,
node_id: &str,
depth: u8,
candidates: &mut HashMap<String, CandidateScore>,
)
| 449 | |
| 450 | /// Add all memory nodes adjacent to `node_id` as neighbor candidates. |
| 451 | fn add_memory_neighbors( |
| 452 | repo: &Repository, |
| 453 | node_id: &str, |
| 454 | depth: u8, |
| 455 | candidates: &mut HashMap<String, CandidateScore>, |
| 456 | ) -> CliResult<()> { |
| 457 | let subgraph = repo |
| 458 | .vault_kg_neighbors(node_id, depth) |
| 459 | .map_err(CliError::Repository)?; |
| 460 | for node in subgraph.nodes { |
| 461 | if node.kind == "memory" && node.id != node_id { |
| 462 | merge_candidate( |
| 463 | candidates, |
| 464 | &node.id, |
| 465 | memory_path_from_node(&node), |
| 466 | 0.0, |
| 467 | true, |
| 468 | ); |
| 469 | } |
| 470 | } |
| 471 | Ok(()) |
| 472 | } |
| 473 | |
| 474 | /// Load candidate bodies from the vault, score, and rank them. |
| 475 | fn resolve_and_rank( |
no test coverage detected