Overview › Reference
Reference

Data model

How the generated entities relate. Each stage writes one of these tables; the foreign keys are the data spine made concrete.

Entity relationships

Snapshots, signals, and evidence are collected per project; signals roll up into a diagnosis, which ranks hypotheses, prescribes recommendations, and triggers alerts.

erDiagram
    posthog_projects {
        uuid id PK
        int posthog_project_id
        jsonb last_trust_report
    }
    posthog_funnel_snapshots {
        uuid id PK
        text funnel_type
        jsonb steps
    }
    posthog_signals {
        uuid id PK
        text signal_type
        text status "active | watch | diagnosed | expired"
        real signal_quality_score
        uuid diagnosis_id FK
    }
    posthog_evidence_artifacts {
        uuid id PK
        text artifact_type
        real confidence
    }
    posthog_diagnoses {
        uuid id PK
        text classification
        int confidence
        real recoverable_revenue_low
        real recoverable_revenue_high
    }
    posthog_hypotheses {
        uuid id PK
        int rank
        real user_facing_confidence
        text classification
    }
    posthog_hypothesis_evidence {
        uuid id PK
        text role "supports | contradicts | missing"
    }
    posthog_recommendations {
        uuid id PK
        text template_key
        text recommendation_type
        real expected_lift_revenue
    }
    posthog_alerts {
        uuid id PK
        text alert_type
        real alert_score
    }

    posthog_projects ||--o{ posthog_funnel_snapshots : "captures"
    posthog_projects ||--o{ posthog_signals : "detects"
    posthog_projects ||--o{ posthog_evidence_artifacts : "collects"
    posthog_signals }o--|| posthog_diagnoses : "diagnosed by"
    posthog_diagnoses ||--o{ posthog_hypotheses : "ranks"
    posthog_hypotheses ||--o{ posthog_hypothesis_evidence : "cites"
    posthog_evidence_artifacts ||--o{ posthog_hypothesis_evidence : "referenced by"
    posthog_diagnoses ||--o{ posthog_recommendations : "prescribes"
    posthog_diagnoses ||--o{ posthog_alerts : "triggers"
        

Conceptual view — columns are abbreviated. The full schema lives in api/src/db/schema.ts; the canonical narrative is docs/monitoring-pipeline-v2.md.