managarten/docs/plans
Till JS 6bb9d77be9 feat(sync): F3 — drop updatedAt as a synced data field
Removes `updatedAt` from the wire protocol and from every Local-prefixed
record type. Replaced by two orthogonal mechanisms — deriveUpdatedAt()
for read-side public-facing values, _updatedAtIndex shadow for indexed
sorts.

Local-side:
- New `_updatedAtIndex` shadow column. Stamped by the Dexie creating /
  updating hook on every write. Stripped from the pending-change payload
  so it never travels to mana-sync. Indexed in Dexie v53 on the 22 tables
  that previously indexed `updatedAt`.
- `deriveUpdatedAt(record)` in sync.ts returns max(__fieldMeta[*].at) so
  the public-facing Task / Note / etc. shape keeps an `updatedAt: string`
  property without holding it as data.
- Type-converters across ~60 module/queries.ts and types.ts files now
  call `deriveUpdatedAt(local)` instead of reading `local.updatedAt`.

Module-store sweep:
- Regex codemod removed `updatedAt: new Date().toISOString()` /
  `: now` / `: now()` / `: nowIso()` stamping from 121 store files
  (~382 call sites total). Single-property update calls
  (`{ updatedAt: now }`) collapsed to `{}`; touch-only patterns
  (writing/drafts, writing/generations) kept the call as a no-op
  because the hook now stamps `_updatedAtIndex` automatically on
  any Dexie modification.
- Local* interfaces stripped of `updatedAt: string` (43 types.ts files).
  Public-facing types (Task, Note, Mission, Agent, …) keep
  `updatedAt: string` as a computed read-side property.
- Companion's chat conversation now sorts on a real
  `lastMessageAt` data field instead of touching `updatedAt`.
- Session-only stores (times/session-alarms, session-countdown-timers)
  stamp `updatedAt: now` directly because they're not in Dexie and
  have no field-meta layer to derive from.

Sync engine:
- applyServerChanges sets `_updatedAtIndex` itself when applying
  server changes (max of server-field times for updates, recordTime
  for inserts) so server-replays land orderable.
- Dropped the legacy `localUpdatedAt` fallback — every record now has
  `__fieldMeta`, the per-field at is the canonical source.
- Soft-delete tombstone path stops stamping `updatedAt: serverTime`,
  uses `_updatedAtIndex` instead.

Server-side:
- mana-ai iteration-writer no longer emits `updatedAt` in
  sync_changes.data; receivers derive it from the field-meta map.
- mana-sync types: no change (the wire format already uses
  `field_meta` / `at` from F1).

Out of scope: backend Drizzle schemas (mana-credits, mana-events, …)
keep their `updated_at` columns. Those are pure server-internal — not
part of the sync_changes / __fieldMeta mechanism F3 cleans up.

Tests + checks:
- 0 svelte-check errors over 7652 files.
- 29/29 sync.test.ts (vitest).
- 61 mana-ai bun tests.
- mana-sync go test ./... cached green.

Plan: docs/plans/sync-field-meta-overhaul.md F3.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-26 23:12:22 +02:00
..
agent-loop-improvements-m1.md docs(plans): agent-loop plan reflects M1 shipped + M2 core shipped 2026-04-23 18:12:58 +02:00
ai-mission-key-grant.md feat(ai): Mission Grant rollout gating — flag, alerts, runbook, user docs 2026-04-15 14:02:47 +02:00
articles-homepage.md feat(articles): M9 workbench homepage — 4-tab shell + QuickAdd + StatsView 2026-04-22 17:50:38 +02:00
articles-module.md feat(articles): M8 highlights view + stats + dashboard widget 2026-04-22 14:12:18 +02:00
augur-module.md feat(augur): new module — signs collected, patterns read 2026-04-25 15:02:15 +02:00
broadcast-module.md docs(broadcast): plan newsletter / broadcast module 2026-04-20 19:32:53 +02:00
comic-module.md feat(comic): Mc5 — Wardrobe-Hook "Als Comic-Character" 2026-04-26 19:32:29 +02:00
data-export-v2.md feat(backup): client-driven v2 snapshot export, drop server-side backup 2026-04-22 18:46:29 +02:00
destructive-tools-opt-in.md docs(plans): spec for per-Space destructive-tools opt-in 2026-04-23 18:39:56 +02:00
event-discovery.md feat(events): add Event Discovery — Phase 1 + 2 2026-04-18 15:30:46 +02:00
feedback-hub.md refactor(feedback): align package + DB enums, plan central hub 2026-04-26 21:52:25 +02:00
invoices-module.md docs(invoices): mark all milestones done, list Phase-2/3 open items 2026-04-20 18:23:02 +02:00
lasts-module.md feat(lasts): M1-M7 — module ship + Meilensteine-Aggregator 2026-04-26 21:40:29 +02:00
library-module.md feat(library): M3 — progress tracking (pages, episodes, issues) + restart 2026-04-17 13:17:22 +02:00
llm-fallback-aliases.md docs(plans): mark llm-fallback-aliases SHIPPED, add M-by-M commit table 2026-04-26 21:27:57 +02:00
mail-module-plan.md docs(mail): add TODO checklist for remaining Phase 1-4 work 2026-04-13 20:46:00 +02:00
mana-mcp-and-personas.md feat(personas): M5.a — Playwright visual suite scaffold 2026-04-23 14:33:06 +02:00
mana-research-service.md feat(research): Phase 3a — 4 sync research agents 2026-04-17 15:06:12 +02:00
me-images-and-reference-generation.md feat(wardrobe): solo-garment try-on + plan-doc status updates (M4.1) 2026-04-23 21:14:35 +02:00
me-images-space-scope-migration.md refactor(profile,tool-registry): flip meImages from user-scoped to space-scoped (v40) 2026-04-23 18:09:57 +02:00
multi-agent-workbench.md docs: flesh out Multi-Agent plan shipping log + Team Workbench forward plan 2026-04-15 22:17:04 +02:00
news-research-module.md docs: flesh out Multi-Agent plan shipping log + Team Workbench forward plan 2026-04-15 22:17:04 +02:00
onboarding-flow.md feat(onboarding): M1 — data model + endpoints + client store 2026-04-23 22:24:49 +02:00
per-space-vs-user-global-tags.md docs(plans): per-Space vs user-global tags — decision deferred 2026-04-22 15:32:15 +02:00
planner-function-calling.md docs(plans): mark shared-llm tool-call integration as deferred 2026-04-20 18:36:07 +02:00
README.md docs: update tool coverage table + server-side research + templates 2026-04-16 12:35:40 +02:00
scene-scope-empty-state.md docs(workbench): plan for scene-scope empty state 2026-04-18 16:23:13 +02:00
shared-space-smoketest.md feat(spaces): end-to-end shared-space sync (membership lookup + plaintext) 2026-04-20 20:46:53 +02:00
social-relay-module.md feat(spaces): add space types + module allowlist as multi-tenancy foundation 2026-04-20 15:57:57 +02:00
space-scoped-data-model.md docs(plans): point at-rest-sweep row at the restored commit 2026-04-22 22:43:19 +02:00
spaces-foundation.md feat(spaces): migrate calendar module to scoped-db wrapper (pilot) 2026-04-20 16:42:10 +02:00
sync-field-meta-overhaul.md feat(sync): F3 — drop updatedAt as a synced data field 2026-04-26 23:12:22 +02:00
team-workbench.md docs: flesh out Multi-Agent plan shipping log + Team Workbench forward plan 2026-04-15 22:17:04 +02:00
tipps-module.md Create tipps-module.md 2026-04-22 14:21:57 +02:00
unlisted-sharing.md docs(unlisted-sharing): park M8.6-readiness check as 2026-05-09 plan-TODO 2026-04-25 12:54:51 +02:00
visibility-system.md fix(shared-privacy): default all new records to 'space', not 'private' 2026-04-24 14:46:48 +02:00
wardrobe-module.md feat(wardrobe): solo-garment try-on + plan-doc status updates (M4.1) 2026-04-23 21:14:35 +02:00
website-builder-smoketest.md docs(website): smoketest walkthrough + manual-test-backlog entry 2026-04-23 18:42:42 +02:00
website-builder.md feat(wardrobe): module foundation — garments + outfits space-scoped data layer (M1) 2026-04-23 18:27:37 +02:00
workbench-cards-migration.md docs(plans): revise workbench-cards plan for cards-for-workflows rule 2026-04-22 15:05:48 +02:00
workbench-seeding-cleanup.md docs(workbench-seeding-cleanup): record polish-pass commits 2026-04-26 19:34:25 +02:00
workbench-templates.md feat(templates): generalise to WorkbenchTemplate + ship Calmness pilot (T1) 2026-04-16 01:07:41 +02:00
writing-module.md feat(writing): M1+M2 — new Ghostwriter module with manual draft CRUD 2026-04-24 14:59:56 +02:00

Plans

Design + rollout plans, grouped by topic. Plans are long-form docs with baked-in decisions, phasing, open questions, and (when shipped) a history section with commit refs.

AI / Workbench roadmap

The Mana AI Workbench has evolved in three successive planned waves — each one laying foundations the next one relies on:

  User hat einen Companion (v0 — shipped before these docs)
        │
        ▼
  AI Missions + Proposals + Policy + Revert
        │
        ▼
  Mission Key-Grants  ←  ai-mission-key-grant.md  ✅
    (encrypted inputs decryptable by the server runner)
        │
        ▼
  Multi-Agent Workbench  ←  multi-agent-workbench.md  ✅
    (named agents, per-agent policy/memory/budget,
     identity-aware Actor, scene→agent lens)
        │
        ▼
  Team Workbench  ←  team-workbench.md  📝 (not started)
    (multi-user + shared AI context,
     admin lens on team members)
Plan Status Scope
ai-mission-key-grant.md Shipped Per-mission RSA-wrapped key grant so mana-ai can decrypt allowlisted encrypted records when user opts in.
multi-agent-workbench.md Shipped Identity-aware Actor + named AI agents owning missions + per-agent policy + scene lens. 28 tools across 11 modules including server-side web-research.
workbench-templates.md T1 Shipped Generalised templates: 3 agent-templates + 3 non-AI workbench starter-kits. Seed-handler registry for per-module data seeding.
team-workbench.md 📝 Forward-looking TeamSpace with membership, team-encrypted records, admin lens on team members. Reuses Actor.principalId + key-wrapping patterns from the two above.

Cross-references:

Other plans

Plan Topic
mail-module-plan.md Mail module — IMAP/SMTP integration
news-research-module.md News + research pipeline