managarten/packages/shared-stores/src
Till JS a480393bfd fix(ai): P1 batch — N+1 queries, vault-locked, debug hardening, timeout
Four P1 fixes from the AI Workbench audit:

#3 N+1 junction queries → batch lookups:
  - TagLinkOps gains getTagIdsForMany(entityIds) — single
    where(field).anyOf(ids).toArray() instead of N calls.
  - filterBySceneScopeBatch() uses a pre-fetched Map<id, tagId[]>.
  - All 4 module queries (notes, todo, contacts, calendar) migrated.
  - 500 notes now = 2 Dexie queries (records + junctions) instead of 501.

#4 Vault-locked detection in readLocalNote:
  - Catches VaultLockedError from decryptRecords.
  - Throws descriptive "Vault ist gesperrt" instead of returning null.
  - Tools surface it as a clear error to the planner ("bitte Vault
    entsperren") instead of "Notiz nicht gefunden".

#5 Debug log hardening:
  - Resolved-input content truncated to 500 chars before storage.
  - Time-based purge: entries older than 7 days auto-deleted.
  - Reduces privacy exposure if device is stolen/profile synced.

#6 Timeout 90s → 180s:
  - 5 LLM calls on slow models (Ollama/GPU) regularly hit 90s.
  - 180s gives comfortable headroom for the reasoning loop.

Audit doc updated with status markers.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-16 16:25:17 +02:00
..
test feat(shared-stores): add createViewStore factory for view/filter/sort 2026-04-02 14:25:31 +02:00
archive.test.ts feat(shared-stores): add createArchiveOps factory + unify archive pattern 2026-04-02 16:33:07 +02:00
archive.ts feat: rename ManaCore to Mana across entire codebase 2026-04-05 20:00:13 +02:00
data-export.test.ts feat(shared-stores): add generic data export/import utilities 2026-04-02 17:01:53 +02:00
data-export.ts feat: rename ManaCore to Mana across entire codebase 2026-04-05 20:00:13 +02:00
guest-mode.svelte.ts feat: rename ManaCore to Mana across entire codebase 2026-04-05 20:00:13 +02:00
index.ts feat: rename ManaCore to Mana across entire codebase 2026-04-05 20:00:13 +02:00
keyboard-shortcuts.test.ts feat(shared-stores): add centralized keyboard shortcuts registry 2026-04-02 17:03:38 +02:00
keyboard-shortcuts.ts feat: rename ManaCore to Mana across entire codebase 2026-04-05 20:00:13 +02:00
navigation-simple.ts ♻️ refactor(shared-ui): simplify PillNavigation - remove sidebar mode 2026-02-17 13:27:23 +01:00
navigation.svelte.ts ♻️ refactor: unify web app patterns across monorepo 2025-12-05 03:35:26 +01:00
notifications.test.ts feat(shared-stores,shared-ui): add shared reminder system 2026-04-02 16:54:15 +02:00
notifications.ts feat: rename ManaCore to Mana across entire codebase 2026-04-05 20:00:13 +02:00
reminder-scheduler.test.ts feat(shared-stores,shared-ui): add shared reminder system 2026-04-02 16:54:15 +02:00
reminder-scheduler.ts refactor: rename planta → plants, clean up codebase 2026-04-12 18:59:44 +02:00
settings.svelte.ts ♻️ refactor: create createAppSettingsStore factory and migrate 3 apps 2026-01-29 16:30:22 +01:00
tag-links.test.ts feat(shared-stores): add createTagLinkOps factory for junction tables 2026-04-02 15:33:18 +02:00
tag-links.ts fix(ai): P1 batch — N+1 queries, vault-locked, debug hardening, timeout 2026-04-16 16:25:17 +02:00
tags-local.svelte.ts feat: rename ManaCore to Mana across entire codebase 2026-04-05 20:00:13 +02:00
tags.svelte.ts feat: rename ManaCore to Mana across entire codebase 2026-04-05 20:00:13 +02:00
toast.svelte.ts ♻️ refactor: unify web app patterns across monorepo 2025-12-05 03:35:26 +01:00
toggle-field.test.ts feat(shared-ui,shared-stores): add FavoriteButton component and toggleField utility 2026-04-02 16:16:23 +02:00
toggle-field.ts fix: revert tier test patch, widen toggleField, add spiral-db prepare 2026-04-10 18:35:20 +02:00
view.svelte.test.ts feat(shared-stores): add createViewStore factory for view/filter/sort 2026-04-02 14:25:31 +02:00
view.svelte.ts refactor(mana): rename inventar → inventory across the codebase 2026-04-09 15:50:24 +02:00