Multi-Provider FailoverAnthropic primary → OpenAI automatic via circuit breaker (opens after 5 failures). LLMProvider ABC ensures consistent interface. Automatic return on recovery.
Cross-Provider Hallucination CheckWhen on OpenAI fallback, reviewer switches to GPT-4o-mini. Never the same provider family reviewing its own output.
Async PipelineCelery-based, feature-flagged (default OFF), sync fallback. Webhook <1s. max_retries=0, acks_late, reject_on_worker_lost.
Timing ChainPipeline (85s) < Lock TTL (90s) < Watchdog (90s) < Celery soft (100s) < Celery hard (120s) ≤ Gunicorn (120s). Cooperative budget via PipelineContext.
8 Thread-Safe SingletonsDouble-checked locking in gevent context: DatabasePool, ClaudeClient, OpenAIClient, DeidentificationEngine, PresidioEngine, WhatsAppClient, WebhookSecurity, SMSClient.
Three-Layer Duplicate PreventionRedis lock (SET NX) + PostgreSQL MessageSid uniqueness + in-memory lock. Zero duplicate responses.
EncryptionAES-256-GCM delivery queue, HMAC-SHA256 phone hashing, constant-time comparison (hmac.compare_digest) for auth tokens.
CI/CDGitHub Actions with real PostgreSQL 15 + Redis 7 containers. Full test suite + smoke test mandatory. mypy enforced (137 errors, threshold 150).
18
Alembic migrations (zero-downtime)
86
Pinned dependencies
7
Feature flags (all default OFF)
50
Type-annotated modules (mypy enforced)