Commit Graph

30 Commits

Author SHA1 Message Date
Jonny df933d089b feat: add settings DB helpers with default fallback
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01V57jSQPqwkGG8BuAXg59X5
2026-09-14 07:11:32 +02:00
Jonny b1ba284ad7 feat: add settings table migration 2026-09-13 22:03:58 +02:00
Jonny 84d8288850 docs: add implementation plan for Einstellungen (settings) feature
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01V57jSQPqwkGG8BuAXg59X5
2026-09-13 21:55:55 +02:00
Jonny e23ff8dca6 docs: add design spec for Einstellungen (settings) feature
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01V57jSQPqwkGG8BuAXg59X5
2026-09-13 21:51:13 +02:00
Jonny dece6d838d feat: inject current date/time context into chat system prompt
Without this Claude has no grounding for "heute"/"morgen"/"naechste
Woche" and only understands dates the user states explicitly.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01V57jSQPqwkGG8BuAXg59X5
2026-09-13 21:22:53 +02:00
Jonny 023698b57c fix: include owner field when updating a Deck card
Root cause: PUT .../cards/{id} requires 'owner' in the body (undocumented
in the Deck API reference used for the original design) - update_order
only sent title/description/type/order/duedate, so every edit 400'd with
"owner must be provided and must be not empty". Reproduced and verified
against the live Nextcloud instance before fixing.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01V57jSQPqwkGG8BuAXg59X5
2026-09-13 21:09:08 +02:00
Jonny da48882671 fix: append trailing user message so conversation summary calls don't 400
Root cause: get_messages() returns history ending with the just-saved
assistant reply, but the Anthropic Messages API rejects any request whose
last message is not role=user - this failed on every single chat turn in
production, silently swallowed by the existing try/except.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01V57jSQPqwkGG8BuAXg59X5
2026-09-13 20:58:41 +02:00
Jonny 246fe60ce7 feat: support two calendars (personal default, feuerwehr named)
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01V57jSQPqwkGG8BuAXg59X5
2026-09-13 20:26:57 +02:00
Jonny 529b9c3320 feat: add Storniert status column to Bestellungen board
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01V57jSQPqwkGG8BuAXg59X5
2026-09-13 19:56:40 +02:00
Jonny 69bf530ff3 feat: add update_order tool to edit customer/description/due date
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01V57jSQPqwkGG8BuAXg59X5
2026-09-13 19:38:49 +02:00
Jonny bd73effc73 feat: add Bestellungen dashboard widget
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01V57jSQPqwkGG8BuAXg59X5
2026-09-13 19:15:17 +02:00
Jonny ebbeb0b42c feat: add GET /api/v1/orders endpoint
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01V57jSQPqwkGG8BuAXg59X5
2026-09-13 19:12:57 +02:00
Jonny 940ad510e0 feat: wire order tools into the chat system prompt
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01V57jSQPqwkGG8BuAXg59X5
2026-09-13 19:12:03 +02:00
Jonny c0185bbbf7 feat: add create_order, list_orders and update_order_status chat tools
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01V57jSQPqwkGG8BuAXg59X5
2026-09-13 19:11:01 +02:00
Jonny c10fd61c54 feat: change order status by moving its Deck card between stacks
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01V57jSQPqwkGG8BuAXg59X5
2026-09-13 16:18:42 +02:00
Jonny 21e63685c9 feat: create and list orders as Deck cards
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01V57jSQPqwkGG8BuAXg59X5
2026-09-13 16:17:16 +02:00
Jonny 2313c3c490 feat: lazily find-or-create the Bestellungen Deck board and status stacks
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01V57jSQPqwkGG8BuAXg59X5
2026-09-13 16:16:14 +02:00
Jonny dfe76db184 feat: add generic Nextcloud Deck API request helper
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01V57jSQPqwkGG8BuAXg59X5
2026-09-13 16:15:14 +02:00
Jonny c879ffc625 feat: summarize conversations in the background after each turn
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01V57jSQPqwkGG8BuAXg59X5
2026-09-13 15:40:59 +02:00
Jonny 2d9bf6a42b feat: inject remembered facts and similar summaries into chat system prompt
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01V57jSQPqwkGG8BuAXg59X5
2026-09-13 15:39:31 +02:00
Jonny 33016bdf0a feat: assemble memory context from facts and similar summaries
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01V57jSQPqwkGG8BuAXg59X5
2026-09-13 15:36:55 +02:00
Jonny 72d2bc379c feat: add remember_fact and forget_fact chat tools
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01V57jSQPqwkGG8BuAXg59X5
2026-09-13 15:35:23 +02:00
Jonny 9c4ad034e5 feat: add conversation_summaries DB helpers
Add upsert_conversation_summary() and search_similar_conversation_summaries()
functions to manage conversation summaries with vector embeddings. These helpers
support cross-chat memory retrieval and background summarization tasks.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019iZMEPk2Kt1UC96Lo9bC5w
2026-09-13 15:00:44 +02:00
Jonny 8a7ac5aad6 fix: add explanatory comments for psycopg2 mocking in test_memory.py
Document why psycopg2 mocking is necessary in local test environment:
- psycopg2-binary cannot be installed on Python 3.14 (no Wheel)
- main.py imports psycopg2 at module level
- pg_pool only used at runtime, not during import, so mocking is safe
- Docker test environment (JARVIS_HANDOFF.md) has psycopg2-binary available

Also ensures test_memory.py matches pattern of other test files
while explaining the necessary deviation for local test execution.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019iZMEPk2Kt1UC96Lo9bC5w
2026-09-13 14:35:05 +02:00
Jonny affb97474c docs: fix migration path in cross-chat-memory spec/plan, add plan file
Corrects migrations/006_memory.sql -> Claude outputs/migrations/006_memory.sql
throughout (matches the existing local convention where 002-005 live).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019iZMEPk2Kt1UC96Lo9bC5w
2026-09-13 12:52:32 +02:00
Jonny 09fc20c9df chore: track pre-existing test_chat_tools.py baseline
Was never committed before. Tracking it now (unmodified) so Task 6 of
the cross-chat-memory plan, which edits this file, produces a clean
incremental diff instead of showing the whole file as new.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019iZMEPk2Kt1UC96Lo9bC5w
2026-09-13 12:24:01 +02:00
Jonny 99dd1a1f8f fix: move 006_memory.sql to Claude outputs/migrations/
Matches the existing local convention (002-005 already live there) -
the plan/spec text mistakenly said top-level migrations/.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019iZMEPk2Kt1UC96Lo9bC5w
2026-09-13 12:23:51 +02:00
Jonny 18e2ff87d2 feat: add memory_facts DB helpers
Implement four async DB-helper functions for memory_facts table:
- insert_memory_fact(user_id, content) -> int
- search_memory_facts(query) -> list
- delete_memory_fact(fact_id) -> None
- get_all_memory_facts() -> list

Add test_memory.py with 4 passing tests for these helpers.
All tests pass with mocked db_query.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019iZMEPk2Kt1UC96Lo9bC5w
2026-09-13 12:10:23 +02:00
Jonny 8856ef16a1 feat: add migration 006_memory.sql for cross-chat memory tables
Add two new tables for cross-chat memory feature:
- memory_facts: stores explicit user-provided facts (user_id, content, created_at)
- conversation_summaries: stores conversation summaries with vector embeddings for similarity search

This migration prepares the database schema for Task 2-7 of the cross-chat memory feature plan.
No indexes yet (sequential scan sufficient for expected data volume).

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019iZMEPk2Kt1UC96Lo9bC5w
2026-09-13 11:56:32 +02:00
Jonny 32026d4264 docs: add design spec for cross-chat memory (facts + summaries)
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019iZMEPk2Kt1UC96Lo9bC5w
2026-09-13 11:46:21 +02:00