---
name: Shared Memory - mql-enrichment-service
description: Shared-memory L7 concern. Canonical state lives in revops.mql_facts; all three L5 platforms read or write through this fact table. Owner is RevOps Data team.
type: cross-platform-artifact
layer: L7-concern
Owner: RevOps Data team; lead {{revops_data_lead}}
---

# Shared Memory - mql-enrichment-service

- **Last reviewed:** 2026-04-22
- **Review cadence:** quarterly + on schema bump
- **Status:** exists-mature

## What this means here

Cross-platform facts about a single MQL ({{intent_score}}, {{firmographic_fields}}, {{routing_history}}, {{sdr_action_history}}, {{consent_state_at_capture}}) that any of the three L5 platforms may read or update. The canonical store is the warehouse fact table `revops.mql_facts`.

Without shared memory, each platform would have its own view of an MQL, and decisions would diverge. The shared store guarantees a single source of truth.

## Implementation

- **Store:** {{warehouse_name}} table `revops.mql_facts`
- **Schema:** versioned in `revops-data` repo; latest version `v4.2.1`
- **Access pattern:** all three platforms read via the kit's data-access library (`{{platform_team_name}}/ai-kit/data-access`); writes are scoped per-platform
- **Conflict resolution:** last-writer-wins for non-PII fields except `sdr_*` fields, which have SDR-edit-respect (Red Line 2 from L2 philosophy); SDR edits are append-only with timestamp
- **Tenancy:** rows are tenant-scoped; reads enforce tenant claim from JWT (cross-tenant reads rejected)

## Participants

| Platform | Read | Write | Notes |
|----------|------|-------|-------|
| mql-enrichment-service | yes | yes | Writes enrichment fields; respects SDR-edit-protected fields |
| mql-router | yes | yes | Writes assignment fields; reads enrichment fields |
| sdr-handoff-helper | yes | no | Read-only; no write surface |

## Schema summary (key fields)

```
revops.mql_facts
├── mql_id (PK)
├── tenant_id (NOT NULL; tenant scoping)
├── email_hash, domain (firmographic seeds)
├── enrichment_tier, enriched_at, enrichment_source_per_field (jsonb)
├── intent_score, intent_signal_breakdown (jsonb), intent_data_snapshot_date
├── consent_state_at_capture, consent_revoked_at (NULL if not revoked)
├── sdr_qualification_status, sdr_edit_history (jsonb; append-only)
├── routing_assignment, assigned_sdr_id, assigned_at
├── created_at, updated_at, schema_version
```

Full schema: `revops-data` repo > `mql_facts.sql`.

## Last verified live

2026-04-22: end-to-end trace through three platforms confirmed shared-memory consistency. A test MQL was injected at mql-enrichment-service; enrichment fields written; mql-router read fields and assigned to test queue; sdr-handoff-helper read fields and rendered helper card. All three reads returned consistent state; SDR-edit-protected field on test MQL respected by enrichment service when SDR-edit was simulated mid-flow.

## Inheritance and dependencies

Inherits from: {{cutting_edge_saas_company}} corporate data warehouse architecture (data residency, tenant scoping conventions).

Consumed by: every L5 dossier in this instance.

## Cross-references inside this instance

- `cross-platform/L7-glue.md` (index)
- `cross-platform/shared-identity.md` (tenant scoping enforced via shared identity)
- `cross-platform/consent-flow.md` (consent state lives in shared memory)
- `policies/framework-contract.md` (L3) - telemetry includes data_snapshot_version pinning the shared-memory snapshot
- `runbooks/shared-memory-incident.md`
