91bafb641f
Mega-commit. Strips all server-side LLM machinery now that Phase 7 has
removed the corresponding UI surfaces and the MCP HTTP endpoint is the
sole assistant interface.
Deleted (services/):
chat, generation_buffer, generation_log, generation_task, llm, tools/
(entire package), stt, tts, voice_config, voice_library, push,
journal_closeout, journal_pipeline, journal_prep, journal_scheduler,
journal_search, curator, curator_scheduler, consolidation,
tag_suggestions, research, weather, article_fetcher, pending_actions,
moments, assist, wikipedia.
Deleted (routes/):
chat, voice, push, journal, quick_capture, fable_mcp_dist.
Deleted (models/):
conversation, generation_tool_log, push_subscription,
pending_curator_action, moment, weather_cache.
Deleted (tests/):
test_generation_log, test_journal_*, test_consolidation, test_lookup_tool,
test_notes_consolidation_trigger, test_record_moment_guards,
test_research_pipeline, test_tools_*, test_tool_use_fixes,
test_voice_library, test_weather_service, test_calendar_tool_tz,
test_wikipedia.
Deleted (top-level):
fable-mcp/ (legacy standalone stdio package — wheel-build pipeline
also removed from Dockerfile).
app.py:
- blueprint registrations for the 6 deleted routes
- startup hook trimmed: no more Ollama warmup, KV-cache priming,
journal/curator schedulers, voice model loading
- shutdown hook simplified
- httpx import dropped (was for Ollama calls)
pyproject.toml:
- removed deps: pywebpush, feedparser, html2text, trafilatura
- removed [voice] extras entirely
- description updated for the MCP-first architecture
Dockerfile:
- removed faster-whisper / piper-tts install steps
- removed bundled piper voice download stage
- removed fable-mcp wheel build stage
Surviving-file edits:
- services/auth.py: drop Conversation table claim on first-user setup
- services/backup.py: drop conversation / push-subscription export+restore;
v1/v2 restore now silently skip pre-pivot conversation data
- services/notes.py: drop maybe_consolidate trigger on task done/cancelled;
drop _maybe_trigger_project_summary (LLM auto-summary)
- services/projects.py: drop generate_project_summary + backfill_project_summaries
(both LLM-driven)
- services/user_profile.py: drop append_observations / consolidate /
clear_learned_data (curator-tied) and build_profile_context
(was LLM system-prompt builder)
- services/notifications.py: stub out _fire_push_notif (was send_push_notification)
- services/event_scheduler.py: drop event-reminder push + chat-retention
cleanup job; keep CalDAV pull-sync + reminders job (in-app)
- services/diagnostics.py: _curator_busy() always False
- routes/notes.py: drop /assist, /assist/stream, /suggest-tags endpoints
- routes/tasks.py: drop /<id>/consolidate endpoint
- routes/settings.py: drop /models, KV-cache-prime-on-save, journal-schedule
timezone hook, and the SearXNG search-test endpoint; inline _is_private_url
(was in services/llm.py)
- routes/admin.py: drop /voice, /voice/reload endpoints
- routes/profile.py: drop /consolidate, /observations (GET, DELETE)
- models/__init__.py: drop the 6 dead model imports
Frontend cascade:
- stores/push.ts: deleted entirely (no callers after Phase 7)
- stores/settings.ts: drop checkVoiceStatus + voice-status state
- views/SettingsView.vue: drop Locations section + journalConfig state
(was tied to /api/journal/config); drop JournalConfig + journal/voice
api/client imports
- frontend/api/client.ts: orphaned voice/journal/profile-observation/
fable-mcp-dist exports are left as dead but harmless (call them and
they 404; type-check is clean).
Pre-existing v1 backups that contained conversations/messages still
restore — those tables are silently dropped from the import path.
Anyone pulling the new image with a populated database will need the
Phase 9 migration to drop the dead tables (coming next).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
57 lines
2.0 KiB
Python
57 lines
2.0 KiB
Python
"""User profile service — structured per-user preferences.
|
|
|
|
Post-pivot the LLM-driven observation/consolidation surface is gone (curator
|
|
deleted in Phase 8). The profile model is preserved as user-managed metadata
|
|
(name, job, expertise, style, tone, interests, work schedule) — Claude can
|
|
read it via the upcoming MCP profile tools.
|
|
"""
|
|
import logging
|
|
|
|
from sqlalchemy import select
|
|
|
|
from fabledassistant.models import async_session
|
|
from fabledassistant.models.user_profile import UserProfile
|
|
|
|
logger = logging.getLogger(__name__)
|
|
|
|
VALID_EXPERTISE = {"novice", "intermediate", "expert"}
|
|
VALID_STYLES = {"concise", "balanced", "detailed"}
|
|
VALID_TONES = {"casual", "professional", "technical"}
|
|
|
|
|
|
async def get_profile(user_id: int) -> UserProfile:
|
|
"""Get or create the profile row for a user."""
|
|
async with async_session() as session:
|
|
result = await session.execute(
|
|
select(UserProfile).where(UserProfile.user_id == user_id)
|
|
)
|
|
profile = result.scalar_one_or_none()
|
|
if profile is None:
|
|
profile = UserProfile(user_id=user_id)
|
|
session.add(profile)
|
|
await session.commit()
|
|
await session.refresh(profile)
|
|
return profile
|
|
|
|
|
|
async def update_profile(user_id: int, data: dict) -> UserProfile:
|
|
"""Upsert structured profile fields from a validated dict."""
|
|
allowed = {
|
|
"display_name", "job_title", "industry", "expertise_level",
|
|
"response_style", "tone", "interests", "work_schedule",
|
|
}
|
|
async with async_session() as session:
|
|
result = await session.execute(
|
|
select(UserProfile).where(UserProfile.user_id == user_id)
|
|
)
|
|
profile = result.scalar_one_or_none()
|
|
if profile is None:
|
|
profile = UserProfile(user_id=user_id)
|
|
session.add(profile)
|
|
for key, value in data.items():
|
|
if key in allowed:
|
|
setattr(profile, key, value)
|
|
await session.commit()
|
|
await session.refresh(profile)
|
|
return profile
|