Solution for long term memory for agent coding CLIs and to facilitate handoff between different agent vendors
Rust
test(prompts): pin graph and language guidance
AkitaOnRails1aae06b236d6
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex 779ee682..6a927ada 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -32,6 +32,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0`GROK_HOME`. Grok stays out of the bare-mode automatic pool. Verifiedagainst Grok Build CLI v0.2.111 ([#237]).+### Changed+- Single-page, batch, and bootstrap consolidation prompts now ask the model+ to connect related wiki pages with path-based wikilinks and to mirror the+ dominant natural language of the source material while preserving code,+ identifiers, paths, commands, error strings, and JSON field names. (#238)+### Fixed- `install-mcp --client claude-desktop` now detects an MSIX-packagedClaude Desktop on Windows and writes to its virtualizeddiff --git a/crates/ai-memory-consolidate/prompts/batch_consolidate_system.md b/crates/ai-memory-consolidate/prompts/batch_consolidate_system.mdindex 82270ac6..be69c156 100644--- a/crates/ai-memory-consolidate/prompts/batch_consolidate_system.md+++ b/crates/ai-memory-consolidate/prompts/batch_consolidate_system.md@@ -75,11 +75,11 @@ linking; zero links should be rare.## OUTPUT LANGUAGEWrite ALL page titles (including the sessions/ page) and all body-prose in the dominant natural language-of the input (if the user works in Portuguese, write Portuguese —-do not translate their vocabulary into English). Keep code,-identifiers, file paths, shell commands, and error strings-verbatim in their original form. JSON keys stay in English.+prose in the dominant natural language of the input (if the user+works in Portuguese, write Portuguese — do not translate their+vocabulary into English). Keep code, identifiers, file paths,+shell commands, and error strings verbatim in their original+form. JSON keys stay in English.## Outputdiff --git a/crates/ai-memory-consolidate/prompts/bootstrap_system.md b/crates/ai-memory-consolidate/prompts/bootstrap_system.mdindex 42c06533..2239a482 100644--- a/crates/ai-memory-consolidate/prompts/bootstrap_system.md+++ b/crates/ai-memory-consolidate/prompts/bootstrap_system.md@@ -73,11 +73,11 @@ linking; zero links should be rare.## OUTPUT LANGUAGEWrite ALL page titles (including the sessions/ page) and all body-prose in the dominant natural language-of the input (if the user works in Portuguese, write Portuguese —-do not translate their vocabulary into English). Keep code,-identifiers, file paths, shell commands, and error strings-verbatim in their original form. JSON keys stay in English.+prose in the dominant natural language of the input (if the user+works in Portuguese, write Portuguese — do not translate their+vocabulary into English). Keep code, identifiers, file paths,+shell commands, and error strings verbatim in their original+form. JSON keys stay in English.## Required JSON shapediff --git a/crates/ai-memory-consolidate/prompts/single_consolidate_system.md b/crates/ai-memory-consolidate/prompts/single_consolidate_system.mdindex 688bc79d..73376ec4 100644--- a/crates/ai-memory-consolidate/prompts/single_consolidate_system.md+++ b/crates/ai-memory-consolidate/prompts/single_consolidate_system.md@@ -71,11 +71,11 @@ linking; zero links should be rare.## OUTPUT LANGUAGEWrite ALL page titles (including the sessions/ page) and all body-prose in the dominant natural language-of the input (if the user works in Portuguese, write Portuguese —-do not translate their vocabulary into English). Keep code,-identifiers, file paths, shell commands, and error strings-verbatim in their original form. JSON keys stay in English.+prose in the dominant natural language of the input (if the user+works in Portuguese, write Portuguese — do not translate their+vocabulary into English). Keep code, identifiers, file paths,+shell commands, and error strings verbatim in their original+form. JSON keys stay in English.## Required JSON shapediff --git a/crates/ai-memory-consolidate/src/bootstrap.rs b/crates/ai-memory-consolidate/src/bootstrap.rsindex 7dea1d8c..3149b24d 100644--- a/crates/ai-memory-consolidate/src/bootstrap.rs+++ b/crates/ai-memory-consolidate/src/bootstrap.rs@@ -1356,6 +1356,16 @@ mod tests {assert!(parse_since_to_epoch("garbage").is_none());}+ #[test]+ fn bootstrap_system_prompt_requires_graph_links_and_input_language() {+ assert!(SYSTEM_PROMPT.contains("## WIKILINKS"));+ assert!(SYSTEM_PROMPT.contains("## OUTPUT LANGUAGE"));+ assert!(SYSTEM_PROMPT.contains("[[project:page-path]]"));+ assert!(SYSTEM_PROMPT.contains("[[_global:page-path]]"));+ assert!(SYSTEM_PROMPT.contains("dominant natural language of the input"));+ assert!(SYSTEM_PROMPT.contains("JSON keys stay in English"));+ }+#[test]fn git_collection_drops_trivial_commits() {let tmp = TempDir::new().unwrap();diff --git a/crates/ai-memory-consolidate/src/consolidator.rs b/crates/ai-memory-consolidate/src/consolidator.rsindex e213a919..32d1e710 100644--- a/crates/ai-memory-consolidate/src/consolidator.rs+++ b/crates/ai-memory-consolidate/src/consolidator.rs@@ -871,6 +871,24 @@ mod tests {assert!(BATCH_SYSTEM_PROMPT.contains("must not be presented as current fact"));}+ #[test]+ fn consolidation_system_prompts_require_graph_links_and_input_language() {+ for (name, prompt) in [("single", SYSTEM_PROMPT), ("batch", BATCH_SYSTEM_PROMPT)] {+ assert!(prompt.contains("## WIKILINKS"), "{name} prompt");+ assert!(prompt.contains("## OUTPUT LANGUAGE"), "{name} prompt");+ assert!(prompt.contains("[[project:page-path]]"), "{name} prompt");+ assert!(prompt.contains("[[_global:page-path]]"), "{name} prompt");+ assert!(+ prompt.contains("dominant natural language of the input"),+ "{name} prompt"+ );+ assert!(+ prompt.contains("JSON keys stay in English"),+ "{name} prompt"+ );+ }+ }+#[test]fn build_request_elides_raw_observations_from_current_body() {let raw_dump = (0..2_000)diff --git a/docs/ARCHITECTURE.md b/docs/ARCHITECTURE.mdindex 7869e110..18031a5d 100644--- a/docs/ARCHITECTURE.md+++ b/docs/ARCHITECTURE.md@@ -78,7 +78,9 @@ from hook paths.call `memory_handoff_begin` before quitting when a handoff is needed.4. When `AI_MEMORY_LLM_PROVIDER` is set, `memory_consolidate` rewritesthat summary into a richer durable page or fans out into a- multi-page batch under `concepts/`, `decisions/`, `gotchas/`.+ multi-page batch under `concepts/`, `decisions/`, `gotchas/`. Consolidation+ prompts preserve the source material's dominant natural language and ask+ the model to connect related pages with path-based wikilinks.5. When an LLM provider is configured, the auto-improvement scheduler reviewsnewly completed sessions across all projects outside hook latency. It records validated`concepts/`, `decisions/`, `gotchas/`, `procedures/`, and `_rules/` proposals