Staging Environment Implementation Summary
Status: COMPLETE ✓
The Icarus Family Assistant now supports dual environments (staging vs prod) with environment-variable-driven database selection.
Files Created/Modified
New Files
-
config_env.py(130 lines)
- Environment-aware configuration module
- Defaults tostagingfor safety
- Path isolation validation
- Logs ENV on startup -
staging_data.py(420 lines)
- Miller family test data
- Document seeding functions
- Calendar event templates
- Verification script -
startup_verify.py(120 lines)
- Pre-flight safety checks
- Path overlap detection
- Environment logging -
icarus.service(36 lines)
- Systemd service template
- Production-ready configuration
- Security hardening -
family_staging.yaml(110 lines)
- Miller family configuration
- Test schools, activities, maintenance items
- Located at~/.family_assistant/family_staging.yaml -
.env.staging(32 lines)
- Staging environment template
- All paths configured for staging -
.env.prod(28 lines)
- Production environment template
- Hoffmann family paths -
STAGING_ENV.md(180 lines)
- Complete documentation
- Quick start guide
- Testing instructions -
tests/test_env.sh(120 lines)
- Bash test script
- Verifies environment isolation
- Runs sample queries
Modified Files
-
family_brain.py(lines 23-24)
- Now importsCHROMA_DB_PATHfromconfig_env
- Uses environment-aware path -
config.py(lines 83-115)
- AddedENVvariable detection
- Staging-aware family config resolution
- Addedget_current_env()function
Directory Structure
~/.icarus/
├── staging/ # NEW: Staging data directory
│ ├── staging.db # SQLite database
│ ├── chroma_db/ # Vector store (4 documents)
│ ├── grocery_lists/
│ ├── recipes/
│ ├── ingress_spool/
│ └── vision_cache/
└── data/ # EXISTING: Production data
├── prod.db
├── chroma_db/
└── ...
~/.family_assistant/
├── family_staging.yaml # NEW: Miller family config
├── family.yaml # EXISTING: Hoffmann family config
├── .env.staging # NEW: Staging template
└── .env.prod # NEW: Production template
~/hoffdesk-agents/services/family_assistant/
├── config_env.py # NEW: Environment config
├── staging_data.py # NEW: Test data seeder
├── startup_verify.py # NEW: Startup checks
├── icarus.service # NEW: Systemd service
├── STAGING_ENV.md # NEW: Documentation
├── family_brain.py # MODIFIED: Use config_env
├── config.py # MODIFIED: ENV awareness
└── tests/
└── test_env.sh # NEW: Test script
Safety Features
- Default to Staging: If
ENVnot set, defaults tostaging - Path Isolation: Staging paths cannot overlap with prod paths
- No Auto-Seed in Prod: Production never auto-seeded
- Startup Verification: Logs ENV and paths on startup
- Explicit Opt-In:
SEED_STAGING=1required to seed
Test Results
# Environment isolation
✓ Staging DB != Prod DB: True
✓ Staging Chroma != Prod Chroma: True
✓ Staging paths isolated: True
# Data seeding
✓ 4 documents ingested to staging ChromaDB
- March Newsletter — Lincoln Elementary
- Invoice #MDA-2026-0342 - Spring Ballet Session
- Receipt #4582 - Buster Miller Wellness Exam
- Soccer Schedule Update
# Query test
✓ Query "Is Friday a half-day?" returns results
- Top result: March Newsletter (score: 0.612)
- Found relevant documents
Usage
Quick Test
cd ~/hoffdesk-agents/services/family_assistant
ENV=staging python -m family_assistant.staging_data
ENV=staging python -c "
from family_assistant.family_brain import answer
result = answer('Is Friday a half-day?')
print(result['answer'])
"
Production Service
sudo cp icarus.service /etc/systemd/system/
sudo systemctl daemon-reload
sudo systemctl enable icarus
sudo systemctl start icarus
Success Criteria Checklist
- [x]
ENV=stagingboots with Miller family test data - [x]
ENV=prodboots with empty DB (or existing prod data) - [x] Database connections route to correct file
- [x] Test queries return Miller data in staging
- [x] Test queries return Hoffmann data (or nothing) in prod
- [x] Cannot accidentally write test data to prod
Next Steps for Brain Query Development
The staging environment is now ready for:
1. Brain Query Interface development
2. Testing new RAG pipelines
3. Experimenting with prompt engineering
4. CI/CD integration with automated tests
All work can be done against the Miller family test data without risk to production Hoffmann data.