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

@ -181,6 +181,13 @@ describe("ProjectsView (with MockProjectGateway)", () => {
);
expect(screen.queryByLabelText("project name")).toBeNull();
// Switch to Context tab — shared project context editor should be visible.
fireEvent.click(screen.getByRole("button", { name: "Context" }));
await waitFor(() =>
expect(screen.getByLabelText("project context")).toBeTruthy(),
);
expect(screen.queryByLabelText("agent name")).toBeNull();
// Switch to Templates tab — the "New template" button should be visible.
fireEvent.click(screen.getByRole("button", { name: "Templates" }));
await waitFor(() =>
@ -199,6 +206,31 @@ describe("ProjectsView (with MockProjectGateway)", () => {
expect(screen.getByLabelText("project name")).toBeTruthy();
});
it("edits the shared project context stored under .ideai", async () => {
const project = new MockProjectGateway();
const created = await project.createProject("alpha", "/p/a");
await project.updateProjectContext(created.id, "# Existing context");
renderView(project);
await screen.findByText("/p/a");
fireEvent.click(screen.getByRole("button", { name: "Open" }));
fireEvent.click(screen.getByRole("button", { name: "Context" }));
const editor = (await screen.findByLabelText(
"project context",
)) as HTMLTextAreaElement;
expect(editor.value).toBe("# Existing context");
fireEvent.change(editor, { target: { value: "# Shared\n\nUse pnpm." } });
fireEvent.click(screen.getByRole("button", { name: "Save" }));
await waitFor(async () => {
await expect(project.readProjectContext(created.id)).resolves.toBe(
"# Shared\n\nUse pnpm.",
);
});
});
it("Browse… button calls pickFolder and fills the root field with the returned path", async () => {
const system = new MockSystemGateway();
renderView(new MockProjectGateway(), system);