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>,
)
| 315 | /// a linear scan at this layer keeps free-text queries useful |
| 316 | /// without touching the storage layer. |
| 317 | fn scan_memory_bodies( |
| 318 | &self, |
| 319 | repo: &Repository, |
| 320 | seed_query: &str, |
| 321 | candidates: &mut HashMap<String, CandidateScore>, |
| 322 | ) -> CliResult<()> { |
| 323 | let terms = search_terms(seed_query); |
| 324 | if terms.is_empty() { |
| 325 | return Ok(()); |
| 326 | } |
| 327 | let metas = repo |
| 328 | .vault_list("memory/", Some(VaultEntryType::Memory)) |
| 329 | .map_err(CliError::Repository)?; |
| 330 | for meta in metas { |
| 331 | let Some(node_id) = memory_path_to_node_id( |
| 332 | &repo.project_id().map_err(CliError::Repository)?, |
| 333 | &meta.path, |
| 334 | ) else { |
| 335 | continue; |
| 336 | }; |
| 337 | let Some(entry) = repo |
| 338 | .vault_retrieve(&meta.path) |
| 339 | .map_err(CliError::Repository)? |
| 340 | else { |
| 341 | continue; |
| 342 | }; |
| 343 | if !is_eligible_memory(&entry) { |
| 344 | continue; |
| 345 | } |
| 346 | let body = String::from_utf8_lossy(&entry.content_bytes); |
| 347 | let matched = body_match_fraction(&terms, &body); |
| 348 | if matched > 0.0 { |
| 349 | let base = BODY_MATCH_WEIGHT * matched; |
| 350 | merge_candidate(candidates, &node_id, Some(meta.path), base, false); |
| 351 | } |
| 352 | } |
| 353 | Ok(()) |
| 354 | } |
| 355 | |
| 356 | /// Seed query terms and graph-neighbor candidates from an intent. |
| 357 | fn seed_from_intent( |
no test coverage detected