Commit Graph
69 Commits
Author SHA1 Message Date
Markus GrafandGitHub 3188106dbf Merge pull request #9 from gurix/claude/remove-contact-info-ykUMh
Replace personal email addresses with generic placeholders
2026-02-27 17:18:36 +01:00
Claude 0829f5e603 Remove personal contact info from .env.example and README
Replace Andrea Sigrist's and Barbara's email addresses and names with
generic placeholders to avoid exposing personal contact information
in the public repository.

https://claude.ai/code/session_01Y6uFfnbjzxHoAYQYd2vyuS
2026-02-27 16:02:00 +00:00
gurixandClaude Sonnet 4.6 f509d984ba docs: add Docker Compose section to README
Documents the docker-compose.yml setup added in PR #7, including how
to start both services, volume mounts for persistent data, and common
operational commands (logs, rebuild).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-27 14:13:16 +01:00
Markus GrafandGitHub fdf674d8d6 Merge pull request #8 from gurix/claude/fix-email-loop-prevention-bD8vX
Add loop detection and automated sender handling
2026-02-26 22:20:15 +01:00
Claude 514d235a2f docs(openspec): add change artifacts for email-loop-prevention
Creates openspec/changes/email-loop-prevention/ with all artifacts:

- proposal.md: Why (MAILER-DAEMON bounce loop incident), what changes
  (automated sender detection + message-count cap), capabilities affected
- design.md: Two-layer defence rationale, detection signal table, decisions
  on channel/agent boundary split, 20-message cap, one-shot alert, CC-only
  routing; risks and trade-offs documented
- specs/email-channel/spec.md: ADDED requirements for detect_automated_message(),
  is_automated/automated_reason message dict fields, no-reply guarantee
- specs/registration-notifications/spec.md: ADDED requirements for
  notify_loop_escalation() — alert content, one-shot guarantee, CC-only
  routing, dev-mode guard
- tasks.md: All 6 sections fully checked (implementation already complete)

https://claude.ai/code/session_01KwvR5hDPjSuJg4kvw5b5e5
2026-02-26 21:06:53 +00:00
Claude 491c2d3495 test: add tests for email loop prevention
Add tests/test_email_loop_prevention.py (47 tests) covering:
- detect_automated_message(): sender patterns (mailer-daemon, postmaster,
  noreply, …), RFC headers (Auto-Submitted, X-Auto-Response-Suppress,
  multipart/report, X-Loop, Precedence), subject heuristics (German and
  English bounce/OOO phrases), and negative cases for normal senders
- EmailAgent.handle_automated_message(): state creation, loop_escalated
  flag, one-shot admin alert, silent drop on repeat, notifier failure safety
- EmailAgent.process_message() message-count cap: at-limit still processes,
  over-limit returns "", escalation called once, duplicate prevention,
  notifier failure safety, constant value assertion
- AdminNotifier.notify_loop_escalation(): SMTP dispatch, [WARNUNG] subject,
  body content, no-CC guard, no-SMTP dev-mode guard

Add TestConversationStateLoopEscalated to test_models.py (5 tests):
default value, to_dict inclusion, True round-trip, from_dict backward
compatibility with persisted conversations missing the key.

All 168 tests pass.

https://claude.ai/code/session_01KwvR5hDPjSuJg4kvw5b5e5
2026-02-26 21:03:01 +00:00
Claude 9dac54fe81 fix: prevent email loop by detecting bounces and capping conversation length
- email_channel.py: add detect_automated_message() that inspects RFC 3834
  Auto-Submitted, mailer-daemon/postmaster sender patterns, X-Loop,
  multipart/report Content-Type, Precedence, and subject heuristics.
  fetch_unread_messages() now includes is_automated / automated_reason
  in every message dict.

- main.py: if is_automated is set, call agent.handle_automated_message()
  instead of process_message() — no reply is ever sent to a bounce source.

- agent/core.py: add MAX_USER_MESSAGES = 20 cap; process_message() returns
  "" without replying once a conversation exceeds the limit and calls
  notifier.notify_loop_escalation() on first breach.  New public method
  handle_automated_message() records the event and triggers the same
  one-shot admin alert.

- models/conversation.py: add loop_escalated: bool field (persisted) so
  the admin alert fires at most once per conversation.

- notifications/notifier.py: add notify_loop_escalation() which sends a
  plain-text warning to the admin CC list (Markus Graf / spielgruppen@).

https://claude.ai/code/session_01KwvR5hDPjSuJg4kvw5b5e5
2026-02-26 20:46:09 +00:00
Markus GrafandGitHub fa6b520f19 Merge pull request #7 from gurix/claude/add-docker-compose-setup-PoDxl
Add Docker support with Compose configuration
2026-02-26 21:32:19 +01:00
gurixandClaude Sonnet 4.6 cab16078a2 document SIMPLE_MODEL and THINKING_BUDGET env vars in README
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-26 17:43:35 +01:00
Claude 6866d126cb Add Docker Compose setup for web chat and email worker
Two services sharing a single image:
- web: Chainlit chat interface on port 8000
- email-worker: IMAP polling agent (main.py)

./data is mounted for persistent storage (registrations + conversations).
./openspec is mounted read-only so knowledge-base markdown files can be
edited on the host without rebuilding the image.

Configuration via .env (see .env.example).

https://claude.ai/code/session_015tJePX9eyQENYpJUF8XvvK
2026-02-26 16:31:11 +00:00
gurix e3bdfbcb9e Merge remote-tracking branch 'origin/claude/registration-confirmation-email-9c8Uh' 2026-02-23 22:54:20 +01:00
gurixandClaude Sonnet 4.6 91ba940951 update language hint to reflect any-language support
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-23 22:52:57 +01:00
Markus GrafandGitHub 52901dd7c4 Merge pull request #6 from gurix/claude/registration-confirmation-email-9c8Uh
Add registration confirmation email spec configuration
2026-02-23 22:51:48 +01:00
gurixandClaude Sonnet 4.6 8275286647 fix gemini 3 flash model name to gemini-3-flash-preview
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-23 22:51:04 +01:00
gurixandClaude Sonnet 4.6 75691879aa add jinja2 and pyyaml to project dependencies
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-23 22:19:30 +01:00
gurixandClaude Sonnet 4.6 602b8eddc3 introduce separate SIMPLE_MODEL config for lightweight tasks
Add a distinct simple_model field alongside ai_model so operators can
route cheap, simple tasks (e.g. email-label translation) to a low-cost
model while keeping the strong model for parent conversations. The two
models can be from different providers (e.g. Gemini + Haiku). If
SIMPLE_MODEL is unset, falls back to AI_MODEL with a warning.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-23 22:18:28 +01:00
Claude 14fde88c89 replace static translation files with LLM-based i18n
Instead of maintaining a YAML file per language, German (de.yaml) is the
single source of truth. For any other language, the label strings are
translated on demand via an LLM call and cached in memory — no static
files to maintain, any language the parent writes in is served
automatically.

- Add src/notifications/i18n.py: get_strings(), _translate() via
  litellm.completion, in-memory cache, clear_cache() for tests
- Passthrough keys (reg_fee_amount, deposit_amount) are never sent to
  the LLM so currency amounts are guaranteed to be unchanged
- Falls back to German silently if the LLM call fails
- Remove src/notifications/i18n/en.yaml (no longer needed)
- Remove load_strings() from context.py (moved to i18n.py)
- Add model parameter to AdminNotifier (defaults to claude-haiku)
- Add TestGetStrings suite covering: no LLM for German, LLM called for
  others, caching, fallback, passthrough key preservation
- Add autouse reset_translation_cache fixture to isolate tests

https://claude.ai/code/session_01LjjK7RjKVnC8bETtccfgna
2026-02-23 16:08:27 +00:00
Claude f1d0ad045c simplify calculate_monthly_fee to linear formula
Rates are CHF 130/indoor day and CHF 250/outdoor day — exactly linear.
Replace the if/elif table with indoor_days * 130 + outdoor_days * 250.

https://claude.ai/code/session_01LjjK7RjKVnC8bETtccfgna
2026-02-23 15:06:47 +00:00
Claude 54d88d1d64 refactor notifications to MVC: extract templates, context, and renderer
- Move all email layout to Jinja2 templates (4 files: admin_new,
  admin_update, parent_confirmation html+txt)
- Extract pure helper/context-builder functions to context.py
  (format_types, calculate_age, format_dob, calculate_monthly_fee,
  format_days, build_admin_new_context, build_admin_update_context,
  build_parent_context)
- Move i18n label strings out of Python into YAML locale files
  (i18n/de.yaml, i18n/en.yaml) — admin-editable without code changes
- Add renderer.py as thin Jinja2 wrapper (render_template)
- Reduce notifier.py to routing + SMTP dispatch only
- Update tests to call context functions directly and render
  templates via renderer instead of calling private builder methods
- Add jinja2 and pyyaml as explicit dependencies in pyproject.toml

https://claude.ai/code/session_01LjjK7RjKVnC8bETtccfgna
2026-02-23 10:05:03 +00:00
Claude b2e04fa07b implement registration-confirmation-email
- Add qrbill and pillow dependencies for Swiss QR-bill PNG generation
- Add _STRINGS_DE / _STRINGS_EN bilingual string tables to AdminNotifier
- Add _generate_qr_bill_png(): Swiss QR code with cross overlay (PNG bytes)
- Add _build_parent_html(): HTML confirmation with inline cid:qrbill image
- Add _build_parent_text(): plain-text fallback with IBAN in full
- Add notify_parent(): multipart/mixed MIME email to parent on completion
- Persist metadata.language in _build_record() in json_store.py
- Wire notify_parent() into src/agent/core.py and chat_app.py completion events
- Add 9 tests for notify_parent, _generate_qr_bill_png, language fallback
- Update tasks.md: tasks 1–5 complete; task 6 (smoke test) remains manual

112 tests passing.

https://claude.ai/code/session_01LjjK7RjKVnC8bETtccfgna
2026-02-22 21:23:32 +00:00
Claude 1632433b6a add specs and tasks for registration-confirmation-email
specs/registration-notifications/spec.md:
- MODIFIED: parent confirmation email sent on completion (alongside admin)
- Bilingual body (de/en), QR-bill embedded inline, plain-text fallback
- Language persisted as metadata.language in registration record

tasks.md:
- 6 sections: qrbill dep, language persistence, notify_parent() impl,
  wire into both completion sites (email agent + chat), tests, smoke test

https://claude.ai/code/session_01LjjK7RjKVnC8bETtccfgna
2026-02-22 21:05:32 +00:00
Claude 9981a9121e update design: match confirmation email language to parent's language
- Narrow the Non-Goal to just the QR-bill slip labels (SIX standard),
  not the surrounding email body
- Add language field to RegistrationData via new metadata dataclass,
  aligned with registration-schema.json metadata object
- Confirmation email body rendered in detected language (de/en)
- Two template dicts in notifier; admin notifications stay German-only
- Remove language-mismatch risk entry; replace with detection-accuracy note

https://claude.ai/code/session_01LjjK7RjKVnC8bETtccfgna
2026-02-22 20:58:17 +00:00
Claude 42a01a011e add design for registration-confirmation-email
Covers: notify_parent() on AdminNotifier, multipart HTML email with
inline Swiss QR-bill (qrbill library), CHF 80 fixed payment data,
German default language, best-effort error handling.

https://claude.ai/code/session_01LjjK7RjKVnC8bETtccfgna
2026-02-22 20:49:43 +00:00
Claude e8cf170007 add proposal for registration-confirmation-email
Parents currently receive no confirmation after submitting a registration.
This change adds an HTML confirmation email with full registration summary,
payment instructions, and a Swiss QR-bill for the CHF 80 registration fee.

https://claude.ai/code/session_01LjjK7RjKVnC8bETtccfgna
2026-02-22 20:46:24 +00:00
Claude c6fd7497aa scaffold registration-confirmation-email change
Creates the OpenSpec change directory for sending HTML confirmation
emails to parents on registration completion, including payment
instructions and Swiss QR-bill code.

https://claude.ai/code/session_01LjjK7RjKVnC8bETtccfgna
2026-02-22 20:44:12 +00:00
Markus GrafandGitHub 43ec87e151 Merge pull request #5 from gurix/claude/implement-web-chat-ObR0B
chore: scaffold implement-web-chat OpenSpec change
2026-02-22 21:33:33 +01:00
Claude 1bd11e6acd feat: inject today's date into system prompt and add extended thinking support
Fixes age validation errors caused by the LLM not knowing the current date.

Changes:
- prompts.py: inject date.today() at the top of both system prompts so the
  LLM can accurately calculate a child's age from their date of birth
- llm.py: add optional thinking_budget parameter to complete(); when set,
  passes thinking={"type": "enabled", "budget_tokens": N} to litellm and
  raises max_tokens to thinking_budget + 4096 (Anthropic models only)
- config.py: add thinking_budget field, read from THINKING_BUDGET env var
- .env.example: document the THINKING_BUDGET option
- core.py: pass thinking_budget through to llm.complete()
- main.py: pass thinking_budget when constructing EmailAgent
- chat_app.py: switch from stream_complete to asyncio.to_thread(complete)
  so extended thinking works and so only the reply field is shown to
  the parent (not the raw JSON wrapper)

To enable extended thinking set THINKING_BUDGET=8000 in .env.

https://claude.ai/code/session_01SUWzMzFvSfWiHXA2p6rPg9
2026-02-22 19:57:32 +00:00
gurixandClaude Sonnet 4.6 13cb35111d fix(chat): simplify user label to German; expose host via env var
- Change user message author label from "Du / You" to "Du" (German-first)
- Add CHAINLIT_HOST env var to .env.example so the server listens on all
  interfaces and is reachable from outside localhost

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-22 20:45:33 +01:00
Claude 72189d2b7b fix(chat): use native async LLM call to prevent session reset on message submit
The previous implementation used asyncio.to_thread(llm.complete) to avoid
blocking the event loop, but Chainlit's contextvars context is not reliably
propagated across thread boundaries, causing the session to reset and clear
the message history on each user submission.

Changes:
- Add llm.acomplete() using litellm.acompletion() (native coroutine)
- Replace asyncio.to_thread() in on_message with await llm.acomplete()
- Store the welcome message in state.messages so it is replayed on reconnect
- Persist state to cl.user_session immediately after appending the user's
  message (before the LLM call) so reconnect detection has the latest history
- Add pytest-asyncio dev dependency and asyncio_mode = "auto" config
- Add 6 async tests for acomplete() in tests/test_llm.py

https://claude.ai/code/session_01SUWzMzFvSfWiHXA2p6rPg9
2026-02-22 12:38:20 +00:00
Claude 981948c106 fix(chat): restore message history on reconnect; fix event loop blocking
Two related issues caused the screen to clear after each answer:

1. Blocking event loop: the synchronous llm.stream_complete() for-loop
   was running directly in the async on_message handler, blocking the
   event loop for the full LLM response duration. This caused the
   WebSocket to time out and Chainlit to reconnect after each message.

   Fix: replace stream_complete() with asyncio.to_thread(llm.complete)
   so the network-bound LLM call runs in a thread pool and the event
   loop (and WebSocket) stay alive throughout.

2. Reconnect resets history: on_chat_start always created a fresh empty
   state and sent the welcome message, even on WebSocket reconnections
   where cl.user_session still held the existing conversation.

   Fix: if cl.user_session["state"] is already present, replay the
   stored message history into the new thread instead of starting fresh.

https://claude.ai/code/session_01SUWzMzFvSfWiHXA2p6rPg9
2026-02-22 08:30:52 +00:00
Claude 808be0185f fix(chat): show only reply text to user, not raw JSON
The LLM returns a structured JSON object. Previously, raw tokens were
streamed directly to the user via msg.stream_token(), causing the full
JSON blob to appear in the chat.

Fix: collect all chunks silently, parse the JSON, then send only the
reply field with cl.Message(content=reply_text).send(). The JSON fields
(updates, next_step, registration_complete, language, intent) are still
processed in the background — parents never see them.

https://claude.ai/code/session_01SUWzMzFvSfWiHXA2p6rPg9
2026-02-22 08:16:12 +00:00
Claude e4b4cdd41e docs(readme): document web chat setup and running
Add dedicated "Web chat" section under Running with:
- chainlit run command and port/host flags
- Minimum required env vars for chat-only deployments
  (no IMAP needed; only AI model + SMTP + admin emails)
- "Running both channels together" example with two terminals
- Note that both channels share DATA_DIR and notification config

https://claude.ai/code/session_01SUWzMzFvSfWiHXA2p6rPg9
2026-02-22 08:09:37 +00:00
Claude e204e29b09 chore: add .chainlit/ to .gitignore
Chainlit auto-generates this directory at runtime (translations, config).
It should not be tracked in version control.

https://claude.ai/code/session_01SUWzMzFvSfWiHXA2p6rPg9
2026-02-22 07:43:02 +00:00
Claude 9fdbe341be feat(chat): implement web chat interface with accessibility
Core implementation:
- chat_app.py: Chainlit entry point with @cl.on_chat_start,
  @cl.on_message (streaming via llm.stream_complete), @cl.on_chat_end
  Reuses Config, KnowledgeBase, ConversationStore, AdminNotifier from src/
  Handles registration completion, post-completion updates, new-child flow

- src/llm.py: add stream_complete() generator (litellm stream=True)
  alongside existing complete(); tests added in tests/test_llm.py

- src/agent/response_parser.py: extract parse_llm_response(),
  apply_updates(), fallback_message() from EmailAgent into shared module
  EmailAgent now delegates to these functions (no logic change)

Chainlit configuration:
- chainlit.toml: telemetry off, German default, custom CSS + JS paths
- chainlit.md: German welcome page with playgroup info

Accessibility (WCAG 2.1 AA):
- public/custom.css: contrast overrides (≥4.5:1), prefers-reduced-motion
  (static "…" replaces animated dots), skip link styles, 100dvh fix
- public/accessibility.js: MutationObserver injects aria-live="polite"
  on message list, focus management after agent replies, skip link element

Other:
- .gitignore: add .chainlit/ (Chainlit runtime, auto-generated)
- openspec/config.yaml: populate context field with tech stack
- openspec/changes/implement-web-chat/tasks.md: mark completed tasks

95 tests pass.

https://claude.ai/code/session_01SUWzMzFvSfWiHXA2p6rPg9
2026-02-22 07:42:29 +00:00
Claude 08bee013f9 docs(opsx/implement-web-chat): revise tasks to match existing ecosystem
Key corrections from codebase analysis:
- Use `uv add chainlit` (not requirements.txt) — project already uses uv+pyproject.toml
- Remove .env.example task — file already exists with full config
- Add task to extend src/llm.py with stream_complete() using litellm streaming
  instead of calling Anthropic SDK directly
- Reuse existing src/ modules directly in chat_app.py:
  Config, KnowledgeBase, ConversationStore, AdminNotifier, prompts.py
- chat_app.py lives at project root (parallel to main.py), not in a new app/ dir
- Parse LLM response with existing _parse_llm_response logic from core.py
- Session state stored in cl.user_session, keyed by Chainlit session ID

https://claude.ai/code/session_01SUWzMzFvSfWiHXA2p6rPg9
2026-02-22 07:20:18 +00:00
Claude da0e6823f0 docs(openspec): add tasks for implement-web-chat change
35 implementation tasks across 9 groups:
1. Project setup (requirements.txt, .env, chainlit.toml, dirs)
2. Chainlit app shell (on_chat_start, on_message, welcome message)
3. Accessibility CSS (contrast overrides, reduced-motion, skip link, dvh)
4. Agent core stub (process_message, session state wiring)
5. ARIA and focus management (live region, post-reply focus move)
6. Session management (refresh persistence, disconnect message)
7. Mobile testing (iOS Safari, Android Chrome, landscape)
8. Accessibility verification (axe-core, keyboard, VoiceOver, motion)
9. Final integration check

https://claude.ai/code/session_01SUWzMzFvSfWiHXA2p6rPg9
2026-02-22 05:21:23 +00:00
Claude b0ebd40302 docs(openspec): add chat-interface spec for implement-web-chat change
MODIFIED spec extending the scoping-phase chat-interface requirements with:
- WCAG 2.1 AA compliance (automated + manual screen reader)
- Full keyboard navigation and no keyboard traps
- Skip-to-content link
- ARIA live regions for agent messages (polite, completed only)
- Focus management after agent reply
- Colour contrast ≥ 4.5:1 (normal text), ≥ 3:1 (large text)
- prefers-reduced-motion: static indicator fallback
- Mobile viewport / virtual keyboard visibility
- Session persistence and graceful disconnect notification
- Chainlit implementation constraints and telemetry-off requirement

https://claude.ai/code/session_01SUWzMzFvSfWiHXA2p6rPg9
2026-02-22 05:18:43 +00:00
Claude cb78b90332 docs(openspec): add design for implement-web-chat change
Selects Chainlit as the chat UI library (AI-native, Python, handles
WebSocket/streaming/session out of the box). Establishes Python as the
project language. Documents accessibility gap mitigations (ARIA live
regions, focus management, reduced-motion, contrast overrides). Defines
project layout and Chainlit configuration.

https://claude.ai/code/session_01SUWzMzFvSfWiHXA2p6rPg9
2026-02-22 05:15:25 +00:00
Claude eb2b69557e docs(openspec): add proposal for implement-web-chat change
Defines why the web chat is being built now, what changes (chat-interface
capability moving from spec to implementation), and adds accessibility as
a first-class requirement (WCAG 2.1 AA, keyboard nav, ARIA live regions).

https://claude.ai/code/session_01SUWzMzFvSfWiHXA2p6rPg9
2026-02-22 05:12:17 +00:00
Claude 3b32652d3e chore: scaffold implement-web-chat OpenSpec change
Creates the change directory for the web chat implementation with
.openspec.yaml metadata. First artifact (proposal.md) is pending.

https://claude.ai/code/session_01SUWzMzFvSfWiHXA2p6rPg9
2026-02-22 05:10:29 +00:00
Markus GrafandGitHub bab0e5fe5e Merge pull request #4 from gurix/claude/clarify-api-key-docs-McxCw
Update documentation for multi-language support and API keys
2026-02-21 23:14:29 +01:00
Claude 905debb48e Clarify API key docs and language support in README
- Remove ANTHROPIC_API_KEY and OPENAI_API_KEY from the Required
  variables table; they are provider-specific, not universally
  required. Add a note pointing readers to the Switching AI providers
  section instead.
- Replace "Supports German and English; defaults to German" with
  "Responds in any language the parent uses; defaults to German" to
  accurately reflect that the agent is fully language-agnostic.

https://claude.ai/code/session_01F9RoUQYKktPrmsvemSYrPk
2026-02-21 22:13:33 +00:00
Markus GrafandGitHub 2fac05c4ee Merge pull request #2 from gurix/claude/email-agent-multi-model-c3ShZ
Implement Python email agent with multi-model AI support
2026-02-21 23:06:40 +01:00
Claude eba450c5a5 Fix email quoting to include full conversation history
fetch_unread_messages now returns both `body` (stripped, for the LLM)
and `raw_body` (full with nested quotes, for the outgoing reply).
main.py passes raw_body as quoted_text so each reply carries the
complete conversation thread, not just the single last message.

https://claude.ai/code/session_01HaUFs7SaLD5SoiuGCY27Tw
2026-02-21 21:54:35 +00:00
Claude 8217b33f38 Remove hardcoded language list from greeting prompt
Replace the explicit enumeration of German, English, French, Italian,
and Spanish with "any human language" to be inclusive of all parents
(Arabic, Turkish, etc.).

https://claude.ai/code/session_01HaUFs7SaLD5SoiuGCY27Tw
2026-02-21 21:44:38 +00:00
Claude db97a357c9 Restore per-leader routing with configurable email addresses
Previously routing was hardcoded (Andrea for indoor, Barbara for outdoor).
Then it was replaced with a flat ADMIN_EMAILS list which lost the routing.
This commit restores routing via three separate env vars:

  ADMIN_EMAIL_INDOOR  — indoor leader, To when indoor days are booked
  ADMIN_EMAIL_OUTDOOR — outdoor leader, To when outdoor days are booked
  ADMIN_EMAIL_CC      — always Cc'd (comma-separated for multiple)

For testing, set all three to your own address so no real leader gets mail.

Changes:
- Config: replaced admin_emails with admin_email_indoor/outdoor/cc fields
- AdminNotifier: replaced admin_emails param with indoor_email/outdoor_email/
  cc_emails; _recipients_for() restored as an instance method using these
- main.py: wires the three new config fields into AdminNotifier
- .env.example: documents the three new variables with production defaults
- Tests: fixture updated to use new params

https://claude.ai/code/session_01HaUFs7SaLD5SoiuGCY27Tw
2026-02-21 21:31:49 +00:00
Claude 7fb1d1fa0f Make admin notification recipients configurable via ADMIN_EMAILS
Previously the To/Cc addresses were hardcoded in notifier.py (Andrea,
Barbara, Markus). This caused accidental emails to production contacts
during testing.

Changes:
- New ADMIN_EMAILS env var: comma-separated list of addresses.
  First address → To; remaining addresses → Cc.
- AdminNotifier now accepts admin_emails list; warns and skips if empty.
- Removed hardcoded _INDOOR_EMAIL / _OUTDOOR_EMAIL / _ADMIN_CC_EMAIL
  constants and the _recipients_for() routing method.
- Config.from_env() parses ADMIN_EMAILS into a list.
- main.py passes config.admin_emails to AdminNotifier.
- .env.example documents the new variable with production example.
- Tests: fixture updated; TestRecipientsFor removed (routing gone).

For testing: ADMIN_EMAILS=you@example.com
For production: ADMIN_EMAILS=andrea.sigrist@gmx.net,baba.laeubli@gmail.com,spielgruppen@familien-verein.ch

https://claude.ai/code/session_01HaUFs7SaLD5SoiuGCY27Tw
2026-02-21 21:23:51 +00:00
Claude af96c7a310 German admin emails and German-only registration data storage
notifier.py:
- All email body text translated to German (section headers, labels,
  day names, playgroup type names, age format, change diff labels)
- Subject lines changed to German: "Neue Anmeldung:" / "Anmeldung aktualisiert:"
- Channel label localised: "E-Mail" / "Chat"
- Fallback special needs label changed to "Keine"

prompts.py:
- New rule: always store free-text field values (especially specialNeeds)
  in German in `updates`, translating from the parent's language if needed;
  use "Keine" for no special needs

https://claude.ai/code/session_01HaUFs7SaLD5SoiuGCY27Tw
2026-02-21 21:13:19 +00:00
Claude c488a0061e Improve email conversation efficiency: language hint + aggressive info collection
Two prompt changes:

1. Greeting step: explicitly tell parents they can write in any language
   (German, English, French, Italian, Spanish, …) and the agent will reply
   in the same language. Also kick off info collection immediately by asking
   for child name + DOB in the greeting reply.

2. Personality: replace the "1–2 questions at a time" rule with a strategy
   that gathers all relevant questions per step in one message (woven into
   natural sentences, not a form), and explicitly re-asks any unanswered
   questions before advancing — no open question is silently skipped.

https://claude.ai/code/session_01HaUFs7SaLD5SoiuGCY27Tw
2026-02-21 21:01:01 +00:00
Claude 4440b00d91 Prepend email headers to message text passed to LLM
The LLM previously only received the stripped email body, giving it no
way to extract the sender's email address for the parentGuardian.email
field. Prepend Von:/Betreff: headers to every message so the LLM can
read the From address and subject without asking the parent for them.

The quoted_text sent back in the reply still uses only msg["body"] so
the quote block stays clean.

https://claude.ai/code/session_01HaUFs7SaLD5SoiuGCY27Tw
2026-02-21 20:46:20 +00:00