# Latent: Divergence Engine (Week 3) This is the core logic of Latent. It implements the **Skeptic Lens** by comparing the "Official Truth" (Tier 0) against the "Latent Signal" (Tier 5). ## Logic (The "Alpha") The engine calculates a `divergence_score` (0.0 - 1.0) for every symptom cluster found on Reddit. $$ Divergence = \begin{cases} 0.1 \times Volume & \text{if present in FDA Label} \\ 0.9 \times Volume \times Severity & \text{if absent from FDA Label} \end{cases} $$ * **High Divergence (>0.6):** Means Reddit is screaming about something the FDA label does not mention. **This is the Alpha.** * **Low Divergence (<0.3):** Means Reddit is complaining about nausea, and the FDA label says "Nausea is common." This is **Noise**. ## Usage 1. **Prerequisites:** You must have run `ingest-fda` and `ingest-reddit` first to generate the `.jsonl` graph files. 2. **Install:** `pip install -r requirements.txt` 3. **Run:** `python main.py` ## Output Generates `divergence_report.json`. ```json [ { "molecule": "semaglutide", "signal": "gastroparesis", "volume": 42, "divergence_score": 0.85, "status": "LATENT_SIGNAL", "regulatory_status": "Silent/Absent" } ] ```