# Lead Generation (LEAD-GEN) — Core Data Model Specification
**Task:** Minimum Model Definition (`Company` / `Signal` / `Evidence` / `Need` / `Offering` / `Contact` / `Score` / `Status`)

---

## 1. Design Principles & Architecture

1. **Domain-Agnostic Core:** The core engine operates on generic entities, abstraction layers, and relationships. Domain-specific definitions (e.g., software vendors, compliance frameworks, IT roles) are injected solely via campaign configurations.
2. **Strict Provenance & Evidence-First:** No assertion (need, signal, contact) exists without attributable evidence. Every claim links back to immutable source references, timestamps, and confidence levels.
3. **Composability for the Lead Card:** A qualified Lead Card represents an intersection of an eligible **Company**, actionable **Signals** backed by verified **Evidence**, an identified **Need**, a matching **Offering**, a relevant **Contact**, an objective **Score**, and an explicit lifecycle **Status**.

---

## 2. Entity Definitions

### 2.1. Company
The legal entity or organization being evaluated as an account.

* **`id`** (`UUID`): Unique identifier for the company.
* **`name`** (`String`): Registered legal and/or trading commercial name.
* **`domain`** (`String`): Primary web domain / hostname (used as a canonical deduplication key).
* **`country` / `geography`** (`ISO-3166 / String`): Primary operational headquarters or target operational jurisdiction.
* **`industry` / `vertical`** (`String`): Industry classification (configurable taxonomy).
* **`employee_count_range`** (`Enum / String`): Headcount tier (e.g., `1000-5000`, `5000+`).
* **`revenue_range`** (`String`, optional): Revenue estimate tier.
* **`attributes`** (`JSON / Key-Value Map`): Domain-agnostic key-value pairs for flexible campaign attributes (e.g., enterprise complexity tags, subsidiaries, tech stack clues).
* **`created_at` / `updated_at`** (`Timestamp`): Audit timestamps.

---

### 2.2. Evidence
Atomic, verifiable raw observations extracted from external or internal sources. Serves as the ground truth for signals.

* **`id`** (`UUID`): Unique identifier for the piece of evidence.
* **`source_type`** (`Enum`): Source category (e.g., `JOB_BOARD`, `FINANCIAL_FILING`, `REGULATORY_REGISTRY`, `TECH_LOOKUP`, `PRESS_RELEASE`, `NEWS_OUTLET`, `WEBSITE`).
* **`source_uri`** (`URI / String`): Exact URL, API endpoint, or document reference where data was captured.
* **`published_at`** (`Timestamp`, nullable): Original publication/incident date of the source item.
* **`collected_at`** (`Timestamp`): Exact timestamp when the evidence was ingested.
* **`raw_payload`** (`Text / JSON`): Verbatim excerpt, quote, or structured artifact demonstrating the fact (e.g., job snippet text, quote from annual report).
* **`hash`** (`String`): SHA-256 fingerprint of the payload to enforce immutability and prevent duplication.
* **`confidence`** (`Float, 0.0 – 1.0`): Reliability rating of the data source/extractor.

---

### 2.3. Signal
An inferred event, condition, or milestone derived from one or more pieces of Evidence, indicating a potential trigger or change of state.

* **`id`** (`UUID`): Unique identifier for the signal.
* **`company_id`** (`UUID`): Reference to the target `Company`.
* **`evidence_ids`** (`List[UUID]`): Foreign keys to supporting `Evidence` records (minimum 1 required).
* **`signal_type`** (`String`): Campaign-configurable category (e.g., `LEADERSHIP_CHANGE`, `COST_PRESSURE_ANNOUNCEMENT`, `ERP_MIGRATION`, `VENDOR_AUDIT_RISK`, `EXPANSION`).
* **`summary`** (`Text`): Human-readable synthesis of what happened and why it matters.
* **`detected_at`** (`Timestamp`): When the signal was detected/derived.
* **`freshness_date`** (`Date`): Effective date of the event (used to compute signal decay/urgency).
* **`weight`** (`Float`): Inherent strength or relevance multiplier defined by the active campaign rule set.

---

### 2.4. Need
A substantiated business problem, inefficiency, regulatory mandate, or strategic initiative at the Company, synthesized from active Signals.

* **`id`** (`UUID`): Unique identifier for the identified need.
* **`company_id`** (`UUID`): Reference to `Company`.
* **`signal_ids`** (`List[UUID]`): References to the underlying `Signal` instances substantiating the need.
* **`category`** (`String`): Configurable classification (e.g., `COST_OPTIMIZATION`, `COMPLIANCE_RISK`, `CONTRACT_RENEWAL_LEVERAGE`).
* **`hypothesis`** (`Text`): Explicit statement of the pain point and why it is critical right now.
* **`urgency`** (`Enum: LOW | MEDIUM | HIGH | CRITICAL`): Time sensitivity of the underlying issue.
* **`estimated_impact`** (`String / Enum`): Estimated business consequence (e.g., budget overrun risk, operational friction, unoptimized spend).

---

### 2.5. Offering
A service, capability, or solution package configured in the campaign that directly resolves an identified Need.

* **`id`** (`UUID / String`): Unique offering identifier (tied to campaign setup).
* **`campaign_id`** (`String`): Associated campaign identifier.
* **`name`** (`String`): Solution designation (e.g., *Contract Renewal Advisory & Licensing Audit Defense*).
* **`value_proposition`** (`Text`): Concise statement of the business outcome and ROI.
* **`target_need_categories`** (`List[String]`): Need categories this offering maps to.
* **`target_roles`** (`List[String]`): Target buyer and influencer personas for this offering.
* **`proof_points`** (`List[String]`): Relevant reference angles, methodologies, or capabilities supporting the proposition.

---

### 2.6. Contact
A specific individual within the Company who has the authority, budget, or pain ownership matching the Need and Offering.

* **`id`** (`UUID`): Unique identifier for the individual.
* **`company_id`** (`UUID`): Reference to `Company`.
* **`full_name`** (`String`): First and last name.
* **`job_title`** (`String`): Current operational title.
* **`role_archetype`** (`String`): Normalized campaign role (e.g., `HEAD_OF_PROCUREMENT`, `CIO`, `IT_ASSET_MANAGER`, `CFO`).
* **`seniority_level`** (`Enum: C_LEVEL | VP | DIRECTOR | HEAD | MANAGER`).
* **`channels`** (`List[Object]`):
  * `type` (`Enum: EMAIL | LINKEDIN | PHONE`): Communication channel.
  * `value` (`String`): Handle, email address, or URL.
  * `verification_status` (`Enum: UNVERIFIED | DELIVERABLE | RISKY | INVALID`).
* **`relevance_rationale`** (`Text`): Why this specific persona is the correct entry point for the identified Need.

---

### 2.7. Score
Multi-dimensional evaluation measuring account fit, evidence strength, and contact urgency.

* **`id`** (`UUID`): Unique identifier for the score evaluation.
* **`lead_id`** (`UUID`): Reference to the associated Lead instance.
* **`fit_score`** (`Float, 0.0 – 100.0`): Company alignment with campaign ICP (size, industry, geography, tech footprint).
* **`need_score`** (`Float, 0.0 – 100.0`): Strength, clarity, and severity of the identified Need.
* **`timing_score`** (`Float, 0.0 – 100.0`): Freshness of signals and urgency of action window.
* **`evidence_confidence_score`** (`Float, 0.0 – 100.0`): Provenance reliability and corroboration across independent sources.
* **`composite_score`** (`Float, 0.0 – 100.0`): Weighted aggregate score calculated via campaign configuration formulas.
* **`scoring_breakdown`** (`JSON`): Transparent attribution explaining each score component.
* **`qualified_threshold_met`** (`Boolean`): Whether the composite score exceeds the campaign's qualification bar.

---

### 2.8. Status
Explicit state tracking for the Lead and its lifecycle stage, supporting manual MVP review and future automated progression.

* **`current_state`** (`Enum`):
  * `DISCOVERED`: Account or signal detected; incomplete validation.
  * `ENRICHING`: Evidence, contact, or profile lookup in progress.
  * `QUALIFIED`: Complete card meets minimum criteria; candidate for review.
  * `VALIDATED`: Manually approved as genuinely worth contacting (acceptance criterion for MVP).
  * `REJECTED`: Disqualified during automated scoring or manual review.
  * `OUTREACH_READY`: Validated and staged for campaign scheduling (requires explicit authorization).
  * `IN_OUTREACH`: Contact initiated across defined channels.
  * `ENGAGED`: Positive or consultative response received.
  * `CLOSED_UNRESPONSIVE`: Outreach cycle completed without response.
* **`disqualification_reason`** (`Enum / String`, nullable): Required if `REJECTED` (e.g., `ICP_MISMATCH`, `STALE_SIGNAL`, `NO_REACHABLE_CONTACT`, `UNSUBSTANTIATED_NEED`, `COMPETING_RELATIONSHIP`).
* **`transition_history`** (`List[Object]`):
  * `from_state` (`Enum`), `to_state` (`Enum`), `timestamp` (`Timestamp`), `actor` (`SYSTEM | USER`), `comment` (`String`).

---

## 3. Entity Relationships & Structural Flow

```
[ Evidence ] ──(proves)──> [ Signal ] ──(substantiates)──> [ Need ]
                                                              │
                                                              ▼
[ Company ] ──(employs)──> [ Contact ]                  [ Offering ]
     │                           │                            │
     └───────────────────────────┼────────────────────────────┘
                                 │
                                 ▼
                          [ Lead Card ]
                         ┌─────────────┐
                         │   Score     │
                         │   Status    │
                         └─────────────┘
```

1. **`Evidence` $\to$ `Signal`**: 1-to-many or many-to-many. Multiple independent pieces of evidence can corroborate a single signal.
2. **`Signal` $\to$ `Need`**: 1-to-many or many-to-many. One or more signals combine to substantiate an acute business need.
3. **`Need` + `Offering`**: Mapped by campaign logic; an offering addresses specific need categories.
4. **`Company` + `Contact`**: 1-to-many. A company has qualified contacts matched to the relevant need/offering.
5. **`Lead Card`**: The synthesized operational unit binding Company, Need, Offering, Contact, Supporting Evidence, Composite Score, and Lifecycle Status.

---

## 4. Minimum Lead Card Schema (MVP Representation)

For the MVP benchmark (producing and manually validating 10 complete cards), each Lead Card record must satisfy this schema:

```json
{
  "lead_id": "lead-001",
  "campaign_id": "PILOT-EU-LICENSING-2026",
  "status": {
    "current_state": "QUALIFIED",
    "updated_at": "2026-10-08T10:00:00Z"
  },
  "company": {
    "id": "comp-101",
    "name": "Example Logistics SE",
    "domain": "example-logistics.de",
    "geography": "DE",
    "industry": "Transport & Logistics",
    "headcount": "8,500"
  },
  "need": {
    "category": "VENDOR_CONTRACT_RENEWAL_COST_PRESSURE",
    "hypothesis": "Operating under enterprise-wide margin consolidation while hiring for large ERP transformation leads; imminent major software renewal represents high exposure to shelfware and audit true-ups.",
    "urgency": "HIGH"
  },
  "offering": {
    "offering_id": "OFFER-01-OPTIMIZE",
    "name": "Enterprise Software Licensing & Cost Optimization Advisory",
    "value_pitch": "Pre-renewal contract benchmarking, shelfware reclamation, and independent audit defense."
  },
  "signals": [
    {
      "signal_id": "sig-501",
      "type": "COST_REDUCTION_PROGRAM",
      "summary": "Announced corporate cost containment program in Q2 earnings call.",
      "freshness_date": "2026-06-15",
      "evidence": [
        {
          "source_type": "FINANCIAL_FILING",
          "source_uri": "https://ir.example-logistics.de/reports/q2-2026.pdf",
          "collected_at": "2026-10-07T08:30:00Z",
          "raw_payload": "Operating expenditure optimization program targeting 8% administrative and vendor cost reduction by end of fiscal year.",
          "confidence": 0.95
        }
      ]
    }
  ],
  "contact": {
    "id": "cnt-301",
    "name": "Dr. Michael Weber",
    "job_title": "Head of IT Procurement & Vendor Management",
    "role_archetype": "HEAD_OF_PROCUREMENT",
    "channels": [
      {
        "type": "LINKEDIN",
        "value": "https://linkedin.com/in/michael-weber-procurement",
        "verification_status": "DELIVERABLE"
      }
    ],
    "relevance_rationale": "Directly controls vendor renewal sign-offs and vendor margin targets."
  },
  "score": {
    "fit_score": 92.0,
    "need_score": 88.0,
    "timing_score": 85.0,
    "evidence_confidence_score": 95.0,
    "composite_score": 89.4,
    "qualified_threshold_met": true
  }
}
```

---

## 5. MVP Acceptance Checklist (Model Level)

A generated Lead Card is considered **Complete and Validatable** under this model when:
1. `Company` meets campaign geographic and size boundaries.
2. `Need` is supported by at least one verifiable `Signal` linked to a traceable `Evidence` source (URI + excerpt + timestamp).
3. `Offering` clearly resolves the stated `Need`.
4. `Contact` has an identified persona with at least one verifiable outreach channel.
5. `Score` documents why the account was prioritized.
6. `Status` is initialized to `QUALIFIED`, ready for human gatekeeper review against the acceptance criterion (at least 5 of 10 judged genuinely worth contacting).