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:
@ -18,6 +18,7 @@ import { useCallback, useState } from "react";
|
||||
import type { MemoryIndexEntry } from "@/domain";
|
||||
import { Button, Panel, Spinner } from "@/shared";
|
||||
import { useGateways } from "@/app/di";
|
||||
import { useEmbedder } from "@/features/embedder";
|
||||
import { MemoryEditor } from "./MemoryEditor";
|
||||
import { useMemory } from "./useMemory";
|
||||
|
||||
@ -31,6 +32,7 @@ type EditorState = { mode: "create" } | { mode: "edit"; entry: MemoryIndexEntry
|
||||
|
||||
export function MemoryPanel({ projectId }: MemoryPanelProps) {
|
||||
const vm = useMemory(projectId);
|
||||
const embedderVm = useEmbedder();
|
||||
const { memory } = useGateways();
|
||||
|
||||
const [editorState, setEditorState] = useState<EditorState | null>(null);
|
||||
@ -87,6 +89,22 @@ export function MemoryPanel({ projectId }: MemoryPanelProps) {
|
||||
)}
|
||||
|
||||
<Panel title="Memory" className="flex flex-col gap-0">
|
||||
{/* ── Active recall tier (read-only transparency) ── */}
|
||||
<p
|
||||
className="border-b border-border px-4 py-2 text-xs text-faint"
|
||||
data-testid="memory-tier"
|
||||
>
|
||||
Tier:{" "}
|
||||
{embedderVm.active ? (
|
||||
<span className="text-content">
|
||||
Vector — {embedderVm.active.strategy}
|
||||
{embedderVm.active.model ? ` ${embedderVm.active.model}` : ""}
|
||||
</span>
|
||||
) : (
|
||||
<span className="text-content">Naïve (None)</span>
|
||||
)}
|
||||
</p>
|
||||
|
||||
{vm.error && (
|
||||
<p
|
||||
role="alert"
|
||||
|
||||
@ -18,7 +18,7 @@
|
||||
import { describe, it, expect, vi } from "vitest";
|
||||
import { render, screen, waitFor, fireEvent } from "@testing-library/react";
|
||||
|
||||
import { MockMemoryGateway } from "@/adapters/mock";
|
||||
import { MockMemoryGateway, MockEmbedderGateway } from "@/adapters/mock";
|
||||
import type { GatewayError } from "@/domain";
|
||||
import type { Gateways } from "@/ports";
|
||||
import { DIProvider } from "@/app/di";
|
||||
@ -28,7 +28,10 @@ const PROJECT_ID = "proj-memory-test";
|
||||
|
||||
function renderMemoryPanel(memory?: MockMemoryGateway) {
|
||||
const mem = memory ?? new MockMemoryGateway();
|
||||
const gateways = { memory: mem } as unknown as Gateways;
|
||||
const gateways = {
|
||||
memory: mem,
|
||||
embedder: new MockEmbedderGateway(),
|
||||
} as unknown as Gateways;
|
||||
return {
|
||||
memory: mem,
|
||||
...render(
|
||||
|
||||
Reference in New Issue
Block a user