# LeadPilot — Scope Specification & Boundary Lock

**Document Version:** 1.0.0 (Phase 1 Scope Lock)  
**Status:** Frozen & Enforced  
**Target:** V1 Commercial Release  

---

## 1. Scope Governance & The Critical Scope Rule

Every single proposed feature in LeadPilot must pass the **7-Pillar Scope Gate**. If a feature does not unequivocally satisfy at least one of these criteria with zero disproportionate support overhead, it is rejected or deferred:

```
+-----------------------------------------------------------------------------------+
|                            THE 7-PILLAR SCOPE GATE                                |
+-----------------------------------------------------------------------------------+
|  1. Does it directly increase lead-to-opportunity conversion / revenue?           |
|  2. Does it dramatically reduce user response/follow-up time or operational cost? |
|  3. Does it measurably improve client retention and daily habit formation?        |
|  4. Does it eliminate manual triage, forgotten leads, or human errors?            |
|  5. Does it materially elevate UX clarity and speed of execution?                 |
|  6. Does it uniquely reinforce the "No Lead Left Behind" product moat?           |
|  7. Does it significantly increase perceived commercial value to the buyer?       |
+-----------------------------------------------------------------------------------+
```

---

## 2. Comprehensive Priority Breakdown

### 2.1 P0: Launch-Critical (Strictly V1 Foundation)

These capabilities are non-negotiable for commercial deployment.

| Module | Feature / Component | Scope Definition in V1 |
| :--- | :--- | :--- |
| **Workspace & Auth** | Multi-Tenancy Engine | Workspace creation, member invitations, role-based access (Owner, Admin, Member), strict tenant scoping. |
| **Lead Ingestion** | Embeddable Form Endpoint | Plain HTML/JS `<form>` submission endpoint with CORS check, anti-spam honeypot, and JSON response. |
| **Lead Ingestion** | Dedicated Capture Page | Public hosted landing URL (`/capture/{workspace_uuid}`) with customizable brand header. |
| **Lead Ingestion** | Ingest REST API | Token-authenticated `POST /api/v1/leads` with payload validation, rate-limiting, and error reporting. |
| **Lead Ingestion** | Inbound Webhooks | Endpoint accepting arbitrary JSON payloads with flexible UI-based key-mapping (e.g. mapping `user_phone` to `phone`). |
| **Lead Ingestion** | CSV Importer | 3-step import wizard: File upload, column mapping preview, duplicate handling strategy, and background processing. |
| **Lead Ingestion** | Manual Entry Modal | Quick modal accessible from anywhere in the app with required validation and instant assignment. |
| **Lead Management** | Central Lead Inbox | High-performance lead table with sorting, full-text search, status/stage tabs, temperature chips, and pagination. |
| **Lead Management** | 360 Lead Detail View | Unified view containing contact metadata, AI analysis card, follow-up timeline, note composer, and task actions. |
| **Lead Management** | Notes & Activities | Timestamped internal notes, status change logs, follow-up execution logs, and stage progression history. |
| **Lead Management** | Tags & Assignment | Workspace-scoped color-coded tags and direct single-user lead assignment. |
| **Pipeline** | Linear Kanban Board | 5 core stages (`New`, `Contacted`, `Qualified`, `Proposal`, `Won`) + drag-to-`Lost` terminal dropzone. |
| **Pipeline** | Pipeline List View | Tabular alternative to Kanban with inline stage switcher for fast bulk triage. |
| **Pipeline** | Lost Reason Modal | Compulsory reason selection (`Price`, `Competitor`, `No Response`, `Not Qualified`, `Timing`, `Requirement Changed`, `Other`) + optional notes. |
| **AI Intelligence** | Async Scoring Worker | Background LLM prompt extraction returning structured JSON: Score (0–100), Temp (`HOT`/`WARM`/`COLD`), Intent, Urgency, Fit, Reason, Recommended Action. |
| **AI Intelligence** | Rule-Based Fallback | Zero-downtime deterministic heuristic scoring if LLM API is unavailable, throttled, or unconfigured. |
| **AI Intelligence** | Usage & Cost Tracking | Workspace-level token consumption counter, execution time logging, and failure telemetry. |
| **Follow-Up Engine** | One-Time Scheduler | Schedule specific follow-up date/time with reminder note and notification trigger. |
| **Follow-Up Engine** | Automated Sequences | Linear multi-day sequence (Day 0 Initial -> Day 1 Follow-up -> Day 3 Value -> Day 7 Break-up). |
| **Follow-Up Engine** | Sequence Auto-Pause | Invariant trigger: Auto-pauses active sequences immediately when lead replies, calls, or transitions to Won/Lost. |
| **Follow-Up Engine** | Message Templates | Reusable pre-written message templates with merge tags (`{{lead.name}}`, `{{workspace.name}}`, `{{user.name}}`). |
| **Attention Engine** | "No Lead Left Behind" Hub | Dedicated action center showing Response Overdue, Follow-up Overdue, Stale Proposals, and Neglected Hot Leads. |
| **Attention Engine** | 1-Click Action Triggers | Quick action cards: "Mark Contacted", "Send Follow-up Template", "Reschedule Reminder", "Mark Lost". |
| **Dashboard** | Operational Command Center | Uncluttered metrics: New Today, Needs Attention, Overdue Tasks, Conversion Rate, Avg First Response Time, Recovered Revenue. |
| **Administration** | Workspace Settings | Workspace profile, notification email settings, API keys generator, custom lost reasons, and team member list. |

---

### 2.2 P1: Post-Launch Enhancements (V1.1 Horizon)

These features provide clear value but are intentionally deferred to ensure V1 is rock-solid and delivered rapidly.

* **Custom Fields Engine:** Ability to define dynamic text, number, date, or dropdown fields per workspace.
* **Multiple Custom Pipelines:** Creating custom sales funnels for distinct product lines or service offerings.
* **Saved Filter Views:** Storing complex filter combinations (e.g. "Hot Inbound Real Estate Leads This Week") as persistent sidebar links.
* **Direct Outbound Email Dispatch:** Sending direct emails from within LeadPilot with 1x1 pixel open tracking and click tracking.
* **AI Draft Reply Assistant:** Generating 1-click tailored email responses based on enquiry context and business profile.
* **CSV Bulk Export:** Workspace data export with filtering and date ranges for external accounting or backup.
* **Advanced Team Analytics:** Individual sales rep leaderboard, response time by agent, and stage-by-stage cycle velocity.
* **Outbound Webhook Dispatcher:** Firing webhook events to external URLs when a lead is created, won, or lost.

---

### 2.3 P2: Future Roadmap & Integrations (V2.0 Horizon)

Integrations requiring third-party developer approvals, app directory verification, or complex external token management.

* **WhatsApp Business Cloud API:** Direct 2-way messaging and automated WhatsApp template reminders.
* **Meta (Facebook / Instagram) Lead Ads:** Direct OAuth connection to Meta Lead Ad forms for sub-second lead ingestion.
* **Google Ads Webhook Integration:** Native mapping for Google Search Lead Extensions.
* **Bi-directional Google Sheets Sync:** Automatic two-way streaming of leads into client spreadsheets.
* **Native Zapier & Make.com Apps:** Certified public integrations on Zapier and Make marketplaces.
* **Calendar Booking Integration:** Two-way sync with Google Calendar / Calendly for automatic stage progression upon meeting booked.
* **Agency Whitelabel & Multi-Client Mode:** Agency dashboard to toggle between 20+ client workspaces with custom CNAME domains and custom branding.
* **Native Mobile Apps:** iOS and Android notification companions for instant lead alerts.

---

### 2.4 P3: Explicitly Rejected (Anti-Scope)

Features that are **permanently barred** from LeadPilot to prevent scope bloat, architectural contamination, and commercial positioning collapse.

```
+-------------------------------------------------------------------------------------------------------+
| FEATURE AREA            | RATIONALE FOR EXCLUSION & COMMERCIAL RISK                                   |
+-------------------------+-----------------------------------------------------------------------------+
| Invoicing & Accounting  | Requires tax compliance (GST/VAT), currency ledgers, ledger reconciliation, |
|                         | and PDF invoice engines. Competes with QuickBooks/Xero. Huge support drag.  |
+-------------------------+-----------------------------------------------------------------------------+
| HR & Payroll Management | Completely unrelated domain. Dilutes focus, complicates user models.       |
+-------------------------+-----------------------------------------------------------------------------+
| Project Management / PM | Task hierarchies, Gantt charts, and sprint tracking belong in Linear/Asana. |
|                         | CRM/PM hybrids fail because sales reps hate project management tools.       |
+-------------------------+-----------------------------------------------------------------------------+
| Full Marketing Broadcast| Newsletter campaigns, email warmups, IP reputation management, and spam    |
|                         | deliverability defense create massive customer support overhead.            |
+-------------------------+-----------------------------------------------------------------------------+
| Cold Outbound Scraping  | Scrapers, B2B data enrichment APIs, and mass cold spam engines ruin sender  |
|                         | reputation and attract low-quality spammers rather than real businesses.    |
+-------------------------+-----------------------------------------------------------------------------+
| Autonomous AI Sales Bot | Autonomous unmonitored AI emailing/calling causes severe reputational damage|
|                         | to clients through hallucinations or bad promises. AI must assist, not own. |
+-------------------------+-----------------------------------------------------------------------------+
| Drag-and-Drop Node Graph| Visual node workflow canvases (like Zapier/Make) have steep learning curves |
|                         | and extreme UI rendering bugs. Linear opinionated stages are 10x faster.    |
+-------------------------+-----------------------------------------------------------------------------+
```

---

## 3. Scope Lock Invariants & Enforcement

1. **No Silent Additions:** Any developer or agent proposing additions to P0 during Phases 2–18 will be halted.
2. **Phase Sequentiality:** Application features must not be built out of sequence. Phase 2 (Architecture & ADR) must be complete before any UI or database work starts.
3. **No Domain Bleed:** Zero concepts or terminology from external projects (e.g. ReviewPilot, DocPilot, generic ERPs) shall enter the codebase.
