docs(ai): materialized snapshot shipped, roadmap functionally complete

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Till JS 2026-04-15 01:29:31 +02:00
parent 8fd9b7da79
commit 5ca5976fad
2 changed files with 13 additions and 5 deletions

View file

@ -1804,9 +1804,14 @@ Code:
- Webapp-Staging-Effect (`server-iteration-staging.ts`) übersetzt
eingehende `source:'server'` Iterationen in lokale Proposals pro
PlanStep mit AI-Actor-Attribution; idempotent via proposalId-Marker
- **Offen für Future Work**: Server-side Input-Resolver (notes/kontext
Projections), Contract-Test zwischen `AI_AVAILABLE_TOOLS` und Webapp-
Policy, Materialized View bei >100 Usern
- Server-side Input-Resolver (`db/resolvers/`) für plaintext Tabellen
(goals); encrypted Tables bleiben privacy-by-design browser-only
- Contract-Test via `@mana/shared-ai`'s `AI_PROPOSABLE_TOOL_NAMES` +
Runtime-Drift-Guard im Service
- `mana_ai.mission_snapshots` — inkrementeller Snapshot, `listDueMissions`
ist ein indexed SELECT statt O(N) LWW-Replay
**Die Workbench-Roadmap ist damit funktional abgeschlossen.**
### 20.5a Symmetrische Registries: Resolver vs. Indexer

View file

@ -18,9 +18,12 @@ What works end-to-end:
- [x] **Write-back**: `db/iteration-writer.ts` appends the server-produced iteration to `Mission.iterations[]` via a `sync_changes` INSERT under an RLS-scoped `withUser` transaction. Row is attributed with actor `{kind:'system', source:'mission-runner'}`.
- [x] Webapp staging effect (`server-iteration-staging.ts`) picks up the synced iteration and translates each PlanStep into a local Proposal with full AI-actor attribution (missionId + iterationId + rationale). Idempotent via durable `proposalId` markers.
- [x] **Server-side input resolvers** for plaintext tables — `db/resolvers/` with a pluggable registry + single-record LWW replay (`record-replay.ts`). `goals` resolver ships by default. Encrypted tables (notes, kontext, tasks, events, journal, …) are intentionally **not** resolved server-side; those missions depend on the foreground runner which decrypts client-side. See `resolvers/types.ts` for the privacy rationale.
- [x] **Materialized mission snapshots**`mana_ai.mission_snapshots` table with per-tick incremental refresh (`db/snapshot-refresh.ts`). `listDueMissions` is now a single indexed SELECT; the prior O(N changes) LWW replay stays only in `mergeAndFilter` for tests. Idempotent `migrate()` on boot creates the schema.
Intentionally **not yet** implemented (future work):
- [ ] Materialized mission snapshot — full LWW replay per tick is O(N changes). Fine pre-launch; revisit when user count grows.
All roadmap items shipped. Future polish (not blockers):
- Multi-instance deploy with advisory locks on snapshot refresh (today single-process)
- Read-only `/internal/missions/:userId` endpoint for ops inspection
- Metrics endpoint for Prometheus (tick latency, plans/hour, parse-failure rate)
## Port: 3066