managarten/apps/mana/apps/web/src/lib/modules/todo
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
..
components fix(a11y): replace 215 suppression comments with real fixes 2026-04-10 22:43:05 +02:00
composables fix(timeblocks): type errors from recurrence migration 2026-04-07 13:22:59 +02:00
stores feat(ai-scope): wire filterByScope into list_tasks/contacts/events + note tag UI 2026-04-16 15:06:11 +02:00
utils feat: rename ManaCore to Mana across entire codebase 2026-04-05 20:00:13 +02:00
views refactor(mana/web): migrate module DetailViews + sub-views to theme tokens (P5) 2026-04-09 12:15:47 +02:00
collections.ts feat: rename ManaCore to Mana across entire codebase 2026-04-05 20:00:13 +02:00
index.ts chore(mana/web): pre-launch module cleanup — schema collapse, dead code, lazy search 2026-04-07 22:31:08 +02:00
ListView.svelte feat(ai-agents): missions lookup + simple policy + agent fingerprint (UX 3-6) 2026-04-16 15:22:55 +02:00
module.config.ts fix(mana/web): commit module-registry + module.config.ts files (build-critical) 2026-04-07 19:49:58 +02:00
queries.ts fix(ai): P1 batch — N+1 queries, vault-locked, debug hardening, timeout 2026-04-16 16:25:17 +02:00
quick-input-adapter.ts feat(crypto): phase 7.1 — encrypt timeBlocks-coupled tasks + calendar events 2026-04-07 20:37:59 +02:00
reminder-source.ts feat(crypto): phase 7.1 — encrypt timeBlocks-coupled tasks + calendar events 2026-04-07 20:37:59 +02:00
tools.ts feat(ai-scope): wire filterByScope into list_tasks/contacts/events + note tag UI 2026-04-16 15:06:11 +02:00
types.ts fix(mana/web+packages): clear all 270 warnings to zero 2026-04-10 17:34:49 +02:00
view-grouping.ts feat: rename ManaCore to Mana across entire codebase 2026-04-05 20:00:13 +02:00