From bf6b9cdd4b871f59df2fd9033ff05be5addb7488 Mon Sep 17 00:00:00 2001 From: Till JS Date: Tue, 14 Apr 2026 22:30:20 +0200 Subject: [PATCH] docs(ai): mark Missions UI + input picker (Step 6) done; document resolver/indexer symmetry Co-Authored-By: Claude Opus 4.6 (1M context) --- apps/mana/CLAUDE.md | 8 +++++--- .../COMPANION_BRAIN_ARCHITECTURE.md | 18 +++++++++++++++++- 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/apps/mana/CLAUDE.md b/apps/mana/CLAUDE.md index 809868ace..b88a65834 100644 --- a/apps/mana/CLAUDE.md +++ b/apps/mana/CLAUDE.md @@ -167,15 +167,17 @@ pnpm test:e2e # Playwright Svelte 5 runes are mandatory — no legacy `let count = 0; $: doubled = count * 2`. Always `$state`, `$derived`, `$effect`. See [`.claude/guidelines/sveltekit-web.md`](../../.claude/guidelines/sveltekit-web.md). -## AI Workbench (in progress) +## AI Workbench -The companion is being rebuilt into a **second actor** that works alongside the human in every module. Foundation shipped 2026-04-14: +The companion is a **second actor** that works alongside the human in every module. Foundation shipped 2026-04-14, end-to-end pipeline live: - **Actor attribution** — every event, record, and sync row carries `{ kind: 'user' | 'ai' | 'system' }`. Code: `src/lib/data/events/actor.ts`. - **AI policy** — per-tool `auto | propose | deny`. AI-attributed tool calls default to `propose`, which stages an intent in `pendingProposals` instead of writing. Code: `src/lib/data/ai/policy.ts`. - **Proposal inbox** — drop `` into any module page to render pending proposals inline as ghost cards with approve/reject. Wired in `/todo` as pilot. +- **Missions** — long-lived autonomous work items. User creates at `/companion/missions` (title + objective + concept markdown + linked inputs + cadence). Foreground tick in `(app)/+layout.svelte` runs due missions; the Planner (LLM) generates a plan, each step stages a Proposal. Code: `src/lib/data/ai/missions/`. +- **Input picker** — `` sources candidates from the `input-index` registry (notes / kontext / goals by default). The Runner resolves them via the parallel `input-resolvers` registry when building Planner prompts. -Full architecture + roadmap (Missions, Runner, Workbench lens, server-side runner): [`docs/architecture/COMPANION_BRAIN_ARCHITECTURE.md` §20](../../docs/architecture/COMPANION_BRAIN_ARCHITECTURE.md). +Full architecture + still-open work (Workbench timeline lens, mana-sync actor field, server-side runner): [`docs/architecture/COMPANION_BRAIN_ARCHITECTURE.md` §20](../../docs/architecture/COMPANION_BRAIN_ARCHITECTURE.md). ## Reference Documents diff --git a/docs/architecture/COMPANION_BRAIN_ARCHITECTURE.md b/docs/architecture/COMPANION_BRAIN_ARCHITECTURE.md index d71710239..59ec24f6d 100644 --- a/docs/architecture/COMPANION_BRAIN_ARCHITECTURE.md +++ b/docs/architecture/COMPANION_BRAIN_ARCHITECTURE.md @@ -1768,10 +1768,26 @@ Code: - `runMission(id, deps)` + `runDueMissions(now, deps)` — injiziert, testbar - Default-Input-Resolver für Notes / Kontext / Goals - 60-Sekunden-Tick, Overlap-Guard, idempotent -- [ ] Schritt 6 — Missions-UI (Create/Edit-Form + Iteration-History) +- [x] Schritt 6 — Missions-UI unter `/companion/missions` + - Create-Form mit Konzept-Markdown + Objective + Cadence-Picker + - List / Detail mit pause / resume / complete / delete / "Jetzt ausführen" + - Iteration-History + pro-Iteration Freitext-Feedback-Textarea + - ``-Komponente mit Indexer-Registry, Default-Indexer + für notes / kontext / goals (symmetrisch zu den Resolvern) - [ ] Schritt 7 — Workbench-Timeline-Lens (cross-module AI-Aktivitaet) - [ ] Schritt 8 — Server-side `mana-ai` Bun-Service (offline-of-tab Runs) +### 20.5a Symmetrische Registries: Resolver vs. Indexer + +Zwei parallele Module-Opt-in-Points für die AI-Layer: + +| Registry | Richtung | Nutzer | Beispiel | +|----------|----------|--------|----------| +| `input-resolvers.ts` | `Ref → Prompt-Text` | Runner (Planner-Kontext) | `notes/abc-123 → "Titel\nContent…"` | +| `input-index.ts` | `Module → Candidates[]` | UI (Picker) | `notes → [{label:"Idee", hint:"…"}]` | + +Beide werden im selben `default-resolvers.ts` zusammen registriert, damit die Paare synchron bleiben. Neues Modul anbinden = `registerInputResolver(name, resolver) + registerInputIndexer(name, indexer)` — keine Änderungen am AI-Core nötig. + ### 20.6 Offene Follow-ups - **mana-sync (Go) + Postgres-Migration** fuer `actor`-Feld im pendingChange-Payload