First-time local setup: quick-start.md.
No pull requests — work on develop, promote to main at stable milestones.
git checkout develop
# ... work, commit, push ...
git push origin develop
# Stable milestone only:
git checkout main && git merge develop && ./scripts/pre-push-gate.sh && git push origin main
git checkout developEvery feature: Red → Green → Refactor
- Write a failing test
- Implement minimum code to pass
- Refactor with tests green
./scripts/run-tests.sh # backend pytest (+ frontend when configured)
./scripts/lint.sh # ruff + oxlint
./scripts/pre-push-gate.sh # full gate before pushBug fixes require a regression test first.
| Hook | Trigger | Checks |
|---|---|---|
| pre-commit | git commit |
gitleaks (staged), whitespace, YAML, private keys |
| pre-push | git push |
tests, lint, full-repo gitleaks |
Install once:
pre-commit install
pre-commit install --hook-type pre-pushcd backend
source .venv/bin/activate
pytest -v # all tests
pytest tests/test_matching_engine.py -v # single file
ruff check .
ruff format .- Session API tests use in-memory SQLite with
ENABLE_OLLAMA=false - Ollama client tests mock
httpx— no live model required in CI - Provider tests read
data/providers.jsonfrom repo root
cd frontend
npm run dev
npm run lint
npm run buildUse import type for TypeScript types — runtime imports of export type cause white-screen crashes under Vite.
Copy .env.example → .env (never commit).
| Variable | Purpose |
|---|---|
DATABASE_URL |
Postgres connection (auto-converts to psycopg v3 driver) |
OLLAMA_BASE_URL |
Local Ollama server |
OLLAMA_MODEL |
Model tag (default llama3.2:3b) |
OLLAMA_MAX_RETRIES |
Retry count for Ollama HTTP failures |
ENABLE_OLLAMA |
Toggle LLM layer (web replies + web extraction) |
USE_ALEMBIC |
Apply Alembic migrations on startup instead of create_all |
REDACT_LOGS |
Mask PII in log output |
CORS_ORIGINS |
Allowed frontend origins |
ENABLE_TELEPHONY |
Enable Twilio webhooks and media stream |
TWILIO_ACCOUNT_SID / TWILIO_AUTH_TOKEN |
Twilio credentials |
TWILIO_PHONE_NUMBER |
Inbound number shown in UI header |
PUBLIC_BASE_URL |
Tunnel HTTPS URL for Twilio signature validation |
PUBLIC_WEBSOCKET_URL |
WSS URL for /twilio/media |
TELEPHONY_SCRIPTED_REPLIES |
Scripted phone prompts (default true) |
WHISPER_MODEL / PIPER_VOICE_ID |
STT/TTS model selection for phone |
Frontend: frontend/.env → VITE_API_BASE_URL
See AGENTS.md. Local Cursor rules live in .cursor/ (gitignored).
Before coding:
- Read handoff.md
- Read SECURITY.md
- Follow TDD
| Module | Path |
|---|---|
| State machine | backend/app/agent/state_machine.py |
| Care recommender | backend/app/agent/care_recommender.py |
| Matching engine | backend/app/matching/engine.py |
| Conversation orchestration | backend/app/services/conversation.py |
| Ollama client | backend/app/services/ollama.py |
| Redaction | backend/app/security/redaction.py |
| Session API | backend/app/api/sessions.py |
| Twilio API | backend/app/api/twilio.py |
| Pipecat voice pipeline | backend/app/voice/florence_processor.py |
| Operator dashboard API | backend/app/api/operator.py |
Backend test suite: 71 tests (pytest --collect-only).
- Update or read relevant doc in
/docs - Write failing test
- Implement
- Run
./scripts/pre-push-gate.sh - Update roadmap.md if milestone status changes
- Commit to
develop