Final two TODOs resolved — the Companion Brain backlog is now empty.
Goal Editor (GoalEditor.svelte):
- Modal with event type picker (13 options), count/sum mode,
optional filter field/value, target value/period/comparison
- Integrated into Goals ListView with "Eigenes" button alongside
the existing "Vorlage" template picker
- Creates custom goals via goalStore.create()
Incremental Streaks (rewritten streaks.ts):
- Persistent _streakState table replaces the 90-day lookback scan
- 6 streak definitions: water goal, tasks, meals, workout, journal,
meditation — each triggered by specific domain events
- Event bus subscription marks streaks active on matching events
- markActive() is O(1): read state → check if today already active
→ increment or reset based on consecutive day check
- useStreaks() reads from _streakState (single table scan, no
per-day queries) instead of 270+ queries worst case
- startStreakTracker/stopStreakTracker wired into layout lifecycle
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>