Builds the session-start memory digest for `root`, or `None` when injection is disabled, the project has no initialized store, or no injectable facts exist. When `session_id` is present the injected fact ids are recorded so per-prompt recall does not repeat them.
(root: &Path, session_id: Option<&str>)
| 374 | /// injectable facts exist. When `session_id` is present the injected fact ids |
| 375 | /// are recorded so per-prompt recall does not repeat them. |
| 376 | pub async fn session_memory_digest(root: &Path, session_id: Option<&str>) -> Option<String> { |
| 377 | if !memory_injection_enabled() { |
| 378 | return None; |
| 379 | } |
| 380 | if !crate::tracedecay::TraceDecay::has_initialized_store(root).await { |
| 381 | return None; |
| 382 | } |
| 383 | let facts = select_digest_facts(digest_candidates(root).await, SESSION_DIGEST_FACT_COUNT); |
| 384 | let (text, included) = render_fact_block(DIGEST_HEADER, &facts, SESSION_DIGEST_CHAR_BUDGET)?; |
| 385 | record_injected_facts(root, session_id, &included); |
| 386 | Some(text) |
| 387 | } |
| 388 | |
| 389 | /// Builds a prompt-relevance-gated recall block for a `UserPromptSubmit`-style |
| 390 | /// event, or `None` when injection is disabled, the prompt is trivial, or no |
no test coverage detected