managarten/packages/shared-ai/src
Till JS ae6a14fb76 feat(shared-ai): SYSTEM_BOOTSTRAP system source — fallback inserts now stamp origin='system'
The race-window `getOrCreateLocalDoc()` fallback in userContextStore +
kontextStore stays (without it, a write that lands between "endpoint
provisioned the singleton in mana_sync" and "first pull landed it in
IndexedDB" would hit `update(missing-id, diff)` — a Dexie no-op that
silently swallows the user's edit). But it was semantically lying: the
insert stamped `origin='user'` even though the row is logically a
client-side replica of the server-side bootstrap.

This commit adds `SYSTEM_BOOTSTRAP = 'system:bootstrap'` to
`@mana/shared-ai` and wraps the two fallback inserts in
`runAsAsync(makeSystemActor(SYSTEM_BOOTSTRAP), ...)`. The Dexie hook
now stamps `origin: 'system'` on the empty-row insert — structurally
identical to the row mana-auth's bootstrap-singletons.ts writes. When
the server's pull arrives later both sides carry the same origin and
the conflict-gate stays quiet. The user's subsequent writes still
stamp `origin: 'user'` on the changed fields.

Plan: docs/plans/sync-field-meta-overhaul.md (F4-fu Fallback-Origin row).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-27 01:44:30 +02:00
..
agents feat(comic): Mc4 — MCP + AI-Catalog für Character-System 2026-04-26 19:27:15 +02:00
guardrails feat(ai): guardrail layer — pre/post-plan + pre-execute checks 2026-04-16 15:11:34 +02:00
missions feat(agents): Agent CRUD + default bootstrap + Mission.agentId (Phase 2) 2026-04-15 20:35:49 +02:00
planner feat(shared-ai): LLM-facing task tool wrapper for runSubAgent (M3.2) 2026-04-23 19:05:09 +02:00
policy refactor(ai): dynamic tool registry — single-source catalog in shared-ai 2026-04-16 13:06:07 +02:00
tools feat(lasts): M1-M7 — module ship + Meilensteine-Aggregator 2026-04-26 21:40:29 +02:00
actor.test.ts refactor(actor): identity-aware Actor for Multi-Agent Workbench (Phase 1) 2026-04-15 20:13:57 +02:00
actor.ts feat(shared-ai): SYSTEM_BOOTSTRAP system source — fallback inserts now stamp origin='system' 2026-04-27 01:44:30 +02:00
field-meta.ts feat(sync): F2 — origin-gated conflict-detection 2026-04-26 21:38:56 +02:00
index.ts feat(shared-ai): SYSTEM_BOOTSTRAP system source — fallback inserts now stamp origin='system' 2026-04-27 01:44:30 +02:00
llm-aliases.ts feat(llm-aliases): M5 — migrate consumers to MANA_LLM aliases 2026-04-26 21:26:03 +02:00