Skip to content

feat(dreaming): auto-classify memory topics on fact extraction#23

Draft
stackbilt-admin wants to merge 1 commit intomainfrom
feat/dreaming-auto-classify-topics
Draft

feat(dreaming): auto-classify memory topics on fact extraction#23
stackbilt-admin wants to merge 1 commit intomainfrom
feat/dreaming-auto-classify-topics

Conversation

@stackbilt-admin
Copy link
Copy Markdown
Member

Summary

  • Wires recordMemoryWithAutoTopic() into the dreaming cycle's fact and preference extraction phases
  • When tarotscriptFetcher is available, facts are classified via the TarotScript memory-topic-classify spread against the 15-topic canonical taxonomy
  • Produces real observation data against the v1 memory-topics deck's 70% synthetic accuracy baseline (tarotscript#165)

Changes

Swapped (2 call sites):

  • processFacts fact writes: LLM-provided topics → classifier
  • processFacts preference writes: hardcoded operator_preferences → classifier

Deliberately left alone (3 call sites):

  • persona.ts: operator_persona — deliberate phase-specific topic
  • pattern-synthesis.ts: meta_insight — deliberate PRISM categorization
  • symbolic.ts: symbolic_reflection — deliberate phase-specific topic

Behavior

  • Classification metadata (topic, confidence, source) logged in existing [dreaming] lines
  • No tarotscriptFetcher → graceful fallback to original recordMemory path
  • Classifier failure / low confidence → falls through to general safely
  • Blocked topic prefixes (synthesis_*) still rejected even with auto-topic active

Test plan

  • 7 new tests covering auto-topic invocation, fallback paths, classifier failure, preference classification, and dangerous topic blocking
  • All 1480 existing tests pass
  • TypeScript typecheck passes

🤖 Generated with Claude Code

Wire recordMemoryWithAutoTopic into the dreaming cycle's fact and
preference extraction phases. When tarotscriptFetcher is available,
facts are classified via the memory-topic-classify spread against
the 15-topic canonical taxonomy (v1 memory-topics deck). This
produces real observation data against the 70% synthetic accuracy
baseline from tarotscript#165.

Classification metadata (topic, confidence, source) is logged in
existing [dreaming] log lines for live accuracy observation.

Fallback behavior:
- Classifier failure / low confidence → falls through to 'general'
  topic safely (existing recordMemoryWithAutoTopic semantics)
- No tarotscriptFetcher → original recordMemory path with LLM-
  provided or hardcoded topics (existing behavior preserved)
- Blocked topic prefixes (synthesis_*) still rejected even when
  auto-topic is active

Call sites swapped (2):
- processFacts: fact writes (LLM-provided topics → classifier)
- processFacts: preference writes (hardcoded 'operator_preferences' → classifier)

Call sites deliberately left alone (3):
- persona.ts: 'operator_persona' (deliberate phase-specific topic)
- pattern-synthesis.ts: 'meta_insight' (deliberate PRISM categorization)
- symbolic.ts: 'symbolic_reflection' (deliberate phase-specific topic)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant