# LeadPilot — Architecture Decision Records (ADR)

**Document Version:** 1.0.0 (Phase 25)

---

## ADR 1: Modular Monolith vs Microservices
- **Status:** Accepted
- **Decision:** Build LeadPilot as a cohesive, domain-driven modular PHP application.
- **Rationale:** Minimizes operational complexity for standard PHP hosting while preserving clean domain boundaries.

## ADR 2: Multi-Tenant Scoping via TenantScope Global Scope
- **Status:** Accepted
- **Decision:** Enforce multi-tenancy at the database query level via `TenantScope` and `BelongsToWorkspace` trait.
- **Rationale:** Guarantees zero cross-workspace data leakage across both web and API requests.

## ADR 3: Pragmatic Heuristic AI Fallback
- **Status:** Accepted
- **Decision:** Implement modular AI providers with deterministic heuristic scoring fallback.
- **Rationale:** Ensures lead capture and scoring remain operational even during remote AI API downtime.
