feat(memory): config embedders (LOT C2) + suggestion contextuelle (LOT C3) + contexte projet partagé

- LOT C2 (§14.5.3) : use cases de configuration des embedders déclaratifs
  (List/Save/Delete + DescribeEmbedderEngines : modèles ONNX recommandés,
  environnement local détecté, stratégies compilées). UI EmbedderSettings.
- LOT C3 (§14.5.5) : suggestion contextuelle best-effort à l'activation quand la
  mémoire dépasse le budget de recall sans embedder configuré (event
  EmbedderSuggested, anti-spam 1×/session, « ne plus demander »).
- Contexte projet partagé .ideai/CONTEXT.md (model-agnostic) injecté à tous les
  agents/profils au lancement, avant la persona. UI ProjectContextPanel.

Tests : backend workspace vert (0 échec) ; frontend 306/306.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-06-09 09:24:51 +02:00
parent 32398827fb
commit 785e9935fd
118 changed files with 5793 additions and 866 deletions

View File

@ -105,10 +105,19 @@ fn profile_uses_camel_case_keys_and_skips_none_options() {
)
.unwrap();
let json = serde_json::to_string(&p).unwrap();
assert!(json.contains("\"apiKeyEnv\":\"MY_KEY\""), "camelCase apiKeyEnv: {json}");
assert!(json.contains("\"strategy\":\"api\""), "camelCase strategy: {json}");
assert!(
json.contains("\"apiKeyEnv\":\"MY_KEY\""),
"camelCase apiKeyEnv: {json}"
);
assert!(
json.contains("\"strategy\":\"api\""),
"camelCase strategy: {json}"
);
// `model` is None ⇒ skipped from the wire form.
assert!(!json.contains("\"model\""), "None model must be skipped: {json}");
assert!(
!json.contains("\"model\""),
"None model must be skipped: {json}"
);
}
#[test]
@ -138,7 +147,10 @@ fn none_profile_has_none_strategy() {
let p = EmbedderProfile::none();
assert_eq!(p.strategy, EmbedderStrategy::None);
assert_eq!(p.id, "none");
assert!(p.dimension > 0, "even the none profile keeps a non-zero dimension");
assert!(
p.dimension > 0,
"even the none profile keeps a non-zero dimension"
);
// And it round-trips like any other profile.
roundtrip(&p);
}
@ -151,7 +163,9 @@ fn none_profile_has_none_strategy() {
fn new_rejects_empty_id() {
assert!(matches!(
EmbedderProfile::new("", "Name", EmbedderStrategy::None, None, None, None, 8),
Err(DomainError::EmptyField { field: "embedder.id" })
Err(DomainError::EmptyField {
field: "embedder.id"
})
));
}
@ -177,7 +191,8 @@ fn new_rejects_zero_dimension() {
#[test]
fn new_accepts_valid_minimal_profile() {
let p = EmbedderProfile::new("id", "Name", EmbedderStrategy::None, None, None, None, 1).unwrap();
let p =
EmbedderProfile::new("id", "Name", EmbedderStrategy::None, None, None, None, 1).unwrap();
assert_eq!(p.dimension, 1);
assert_eq!(p.strategy, EmbedderStrategy::None);
}