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

@ -8,7 +8,7 @@
* rather than xterm's visual output. They stay robust whether or not xterm
* bailed.
*/
import { describe, it, expect } from "vitest";
import { describe, it, expect, vi } from "vitest";
import { render, screen, waitFor, fireEvent } from "@testing-library/react";
import type { Gateways } from "@/ports";
@ -90,8 +90,10 @@ describe("LayoutGrid (with MockLayoutGateway)", () => {
});
});
it("closing a cell removes THAT cell and keeps its sibling (closes the right terminal)", async () => {
it("closing a cell removes THAT cell and keeps its sibling without killing its session", async () => {
const layout = new MockLayoutGateway();
const terminal = new MockTerminalGateway();
const closeSpy = vi.spyOn(terminal, "closeTerminal");
const initial = await layout.loadLayout("p1");
const a = leaves(initial)[0].id;
// Split A → container c with children [A (index 0), b (index 1)].
@ -102,8 +104,18 @@ describe("LayoutGrid (with MockLayoutGateway)", () => {
newLeaf: "b",
container: "c",
});
await layout.mutateLayout("p1", {
type: "setSession",
target: "b",
session: "running-session-b",
});
renderGrid(layout);
const gateways = { layout, terminal } as unknown as Gateways;
render(
<DIProvider gateways={gateways}>
<LayoutGrid projectId="p1" cwd="/home/me/proj" />
</DIProvider>,
);
await waitFor(() =>
expect(screen.getAllByTestId("layout-leaf")).toHaveLength(2),
);
@ -117,6 +129,7 @@ describe("LayoutGrid (with MockLayoutGateway)", () => {
expect(
screen.getByTestId("layout-leaf").getAttribute("data-node-id"),
).toBe(a);
expect(closeSpy).not.toHaveBeenCalled();
});
it("closing the other cell keeps the opposite sibling", async () => {