Refactor extraction logic into named hook system
Move occurrence and anticipation extraction from inline code in
think/insight.py into standalone hook modules in think/insights/.
Insights now declare extraction via "hook": "occurrence" or
"hook": "anticipation" in frontmatter.
- Add occurrence.py and anticipation.py as named hooks
- Move prompts to think/insights/occurrence.md and anticipation.md
- Extract shared utilities to think/insights.py (should_skip_extraction,
write_events_jsonl, compute_source_insight)
- Update think/utils.py to resolve named hooks from frontmatter
- Remove ~170 lines of extraction logic from think/insight.py
- Update all insight frontmatter to use hook field
- Remove legacy boolean occurrences/anticipations fields
- Update apps/settings/routes.py to detect extraction via hook field
- Update docs and tests
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>