feat(journal): LLM tools (record_moment, search_journal) + system prompt wiring

- services/tools/journal.py — record_moment + search_journal tool handlers
- services/tools/_registry.py: add `journal` flag on ToolDef + tool() decorator
- get_tools_for_user(user_id, conversation_type='chat'|'journal') —
  exclude journal-only tools from chat sessions; exclude set_rag_scope
  from journal sessions
- services/tools/__init__.py: register the new journal module; drop the
  unused get_briefing_tools export
- services/llm.py build_context: short-circuit for journal conversations,
  using journal_pipeline.build_journal_system_prompt and skipping all
  notes-RAG injection (preserves the journal/notes isolation invariant)
- services/generation_task.py: pass conversation_type into get_tools_for_user

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
2026-04-25 22:39:42 -04:00
parent d9ab538ef4
commit ac188c40a5
5 changed files with 203 additions and 18 deletions
@@ -10,6 +10,7 @@ of the app depends on.
from fabledassistant.services.tools import ( # noqa: F401
calendar,
entities,
journal,
notes,
profile,
projects,
@@ -22,12 +23,10 @@ from fabledassistant.services.tools import ( # noqa: F401
)
from fabledassistant.services.tools._registry import (
execute_tool,
get_briefing_tools,
get_tools_for_user,
)
__all__ = [
"execute_tool",
"get_briefing_tools",
"get_tools_for_user",
]