{"slug":"internal/architecture/SYSTEM_DATA_FLOW_AND_TWIN_ACTIVATION","title":"System Data Flow & Twin Activation","section":"internal","sectionLabel":"Internal","status":"unclassified","type":"document","path":"internal/architecture/SYSTEM_DATA_FLOW_AND_TWIN_ACTIVATION.mdx","bytes":2801,"description":null,"updated":null,"source":"integratewise/Integratewise-docs-wiki","content":"\n## End-to-End Data Flow\n\n```\nConnector OAuth → Loader (creamy/full/delta) → Pipeline Queue\n    ↓\n8-Stage Normalizer:\n  S1 Analyze → S2 Classify → S3 Filter → S4 Refine\n  S5 Extract → S6 Validate → S7 Sanity → S7.5 Identity Resolution → S8 Sectorize\n    ↓\nSpine-v2 (schema-routed write) → Entity 360 Cache\n    ↓\nSignal Queue → Intelligence Service → Python Analysis (B5-B7)\n    ↓\nTwin Trigger Engine (10 triggers) → Evidence-backed Insights\n    ↓\nGovern (approval gate) → Act (execution) → Re-ingestion\n```\n\n## Twin Activation\n\nThe Twin reads ONLY from Entity 360. Never from scattered sources.\n\n### Entity 360 Assembly (6 layers, parallel fetch)\n\n| Layer         | Source                          | Content                              |\n| ------------- | ------------------------------- | ------------------------------------ |\n| Truth         | Spine-v2 / Spine DB             | Canonical entity data with freshness |\n| Context       | Knowledge service               | Emails, docs, meetings (Flow B)      |\n| Signals       | Spine DB signals table          | Active alerts with evidence          |\n| Memory        | Knowledge consolidated_memories | AI-extracted knowledge (Flow C)      |\n| Goals         | Spine DB goals table            | Linked goals with health scoring     |\n| Relationships | Spine DB entities               | Parent/child/related graph           |\n\n### Twin Trigger Evaluation\n\n10 hardcoded triggers evaluate Entity 360:\n\n1. **health_drop** — 15+ point decline → critical\n2. **renewal_approaching** — 90/60/30 day windows\n3. **engagement_drop** — 30+ days no activity\n4. **arr_change** — 10%+ revenue change\n5. **goal_at_risk** — linked goals failing\n6. **support_escalation** — 5+ open tickets\n7. **stale_data** — entity data older than 24h\n8. **memory_conflict** — low-confidence AI decisions\n9. **context_gap** — high-value account with no context\n10. **signal_cluster** — 3+ critical/high signals\n\n### Constraints\n\n- Max 3 insights per entity per day\n- Every insight must have evidence chain\n- Every insight answers: what, why, action, risk_if_ignored\n- Sorted by severity then confidence\n\n## Hydration Buckets (B0-B7)\n\n| Bucket | State            | Twin Capability        |\n| ------ | ---------------- | ---------------------- |\n| B0     | No data          | None                   |\n| B1     | Schema resolved  | Entity types known     |\n| B2     | Creamy load done | Basic truth available  |\n| B3     | Full load done   | Complete truth         |\n| B4     | Context linked   | Flow B active          |\n| B5     | Signals active   | Twin triggers fire     |\n| B6     | Memory active    | Flow C feeding Twin    |\n| B7     | Full cognitive   | All layers operational |\n"}