# ✅ Icarus Phase 4 — Director Approval & Execution Orders **Approved by:** Matt (Director) **Date:** 2026-04-26 **Status:** EXECUTE IMMEDIATELY --- ## 📋 Approved Scope ### Phase 4 Implementation (Immediate) | Component | Specification | Location | |-----------|-------------|----------| | Family context | Hardcoded FAMILY_CONTEXT string | `briefing/generator.py` | | Family member detection | Model inference + inline keyboard fallback | `telegram/handler.py` | | Bot handler | Webhook endpoint, file download, formatting | `telegram/handler.py` | | API endpoint | `/telegram/webhook` | `api.py` | **Family Context (Hardcoded for Phase 4):** ```python FAMILY_CONTEXT = """ FAMILY MEMBERS: - Sullivan (Sully): 1st grade, St. John's Elementary, teacher Mrs. Smith, likes dinosaurs/space/lego - Harper: pre-K, St. John's Elementary, teacher Ms. Johnson, likes unicorns/dance/art - Aundrea: Mom, works at hospital - Matt: Dad, software engineer INFERENCE RULES: - "1st grade", "first grade", "grade 1", "Mrs. Smith" → Sully (confidence: 0.95) - "pre-K", "preschool", "4 years old", "Ms. Johnson" → Harper (confidence: 0.90) - "parent-teacher conference", "both parents" → Aundrea + Matt (confidence: 0.80) """ ``` --- ## 🏗️ Phase 5 Constraint (Documented) **When building YAML inference_rules:** - Pattern matching → **Deterministic Python logic** (pre-inference) - Rules are **NOT** passed to LLM prompt - Architecture: Match → Confidence score → Assignment - Only unmatched docs go to LLM for fuzzy inference **Rationale:** Separation of concerns. Fast deterministic matching for known patterns, LLM for edge cases. --- ## 🎯 Success Criteria 1. ✅ Telegram bot responds to `/start` 2. ✅ Image/PDF upload → briefing card with family assignment 3. ✅ Low confidence → inline keyboard asks "Who is this for?" 4. ✅ Selection → full briefing with "Assigned to: [name]" 5. ✅ Webhook configured and responding --- ## 📚 Files to Update | File | Action | |------|--------| | `briefing/generator.py` | Add FAMILY_CONTEXT, enhance prompt | | `telegram/handler.py` | Create, implement webhook handler | | `api.py` | Add `/telegram/webhook` endpoint | | `config/staging.py` | Verify TELEGRAM_BOT_TOKEN present | --- ## 🔧 Deployment Commands ```bash # Install httpx if not present pip install --break-system-packages httpx # Restart service sudo systemctl restart icarus-staging.service # Set webhook BOT_TOKEN="8469114191:AAG6w4-uo4VZ8HV3d_wGUOf-KFuvJhSMCbw" curl -X POST "https://api.telegram.org/bot${BOT_TOKEN}/setWebhook" \ -d "url=https://icarus-test.hoffdesk.com/telegram/webhook" # Verify curl "https://api.telegram.org/bot${BOT_TOKEN}/getWebhookInfo" ``` --- **EXECUTE. Socrates to implement. Daily status updates to session.** --- *Questions: @mention Wadsworth in The Hoffmann Board*