Match seed terms against memory bodies directly. The KG FTS indexes only node ids/labels/summaries, so body words are invisible to `vault_kg_search`. Memories are few and small; a linear scan at this layer keeps free-text queries useful without touching the storage layer.
(
&self,
repo: &Repository,
seed_query: &str,
candidates: &mut HashMap<String, CandidateScore>,
)
| 294 | /// a linear scan at this layer keeps free-text queries useful |
| 295 | /// without touching the storage layer. |
| 296 | fn scan_memory_bodies( |
| 297 | &self, |
| 298 | repo: &Repository, |
| 299 | seed_query: &str, |
| 300 | candidates: &mut HashMap<String, CandidateScore>, |
| 301 | ) -> CliResult<()> { |
| 302 | let terms = search_terms(seed_query); |
| 303 | if terms.is_empty() { |
| 304 | return Ok(()); |
| 305 | } |
| 306 | let metas = repo |
| 307 | .vault_list("memory/", Some(VaultEntryType::Memory)) |
| 308 | .map_err(CliError::Repository)?; |
| 309 | for meta in metas { |
| 310 | let Some(node_id) = memory_path_to_node_id(&meta.path) else { |
| 311 | continue; |
| 312 | }; |
| 313 | let Some(entry) = repo |
| 314 | .vault_retrieve(&meta.path) |
| 315 | .map_err(CliError::Repository)? |
| 316 | else { |
| 317 | continue; |
| 318 | }; |
| 319 | if !is_eligible_memory(&entry) { |
| 320 | continue; |
| 321 | } |
| 322 | let body = String::from_utf8_lossy(&entry.content_bytes); |
| 323 | let matched = body_match_fraction(&terms, &body); |
| 324 | if matched > 0.0 { |
| 325 | let base = BODY_MATCH_WEIGHT * matched; |
| 326 | merge_candidate(candidates, &node_id, Some(meta.path), base, false); |
| 327 | } |
| 328 | } |
| 329 | Ok(()) |
| 330 | } |
| 331 | |
| 332 | /// Seed query terms and graph-neighbor candidates from an intent. |
| 333 | fn seed_from_intent( |
no test coverage detected