system-prompts-and-models-o.../salesflow-saas/docs/governance/connector-standard.md
Claude e11253ab12
feat(dealix): Tier-1 closure program — 10 tracks complete
Track 1 — Truth Lock:
  docs/current-vs-target-register.md: Full subsystem maturity register
  (73 Production, 27 Partial, 2 Pilot, 32 Target, 6 Watch = 52.1% maturity)

Track 2 — Document Consistency:
  docs/governance/document-consistency-audit.md: All 6 checks PASS
  (no dangling refs, no overclaim, all paths root-safe, naming consistent)

Track 3 — Decision Plane:
  backend/app/schemas/structured_outputs.py: 17 Pydantic schemas with Provenance
  (LeadScoreCard, QualificationMemo, ProposalPack, PricingDecisionRecord,
   PartnerDossier, EconomicsModel, ApprovalPacket, TargetProfile, DDPlan,
   ValuationMemo, SynergyModel, ICMemo, BoardPackDraft, ExpansionPlan,
   StopLossPolicy, PMIProgramPlan, ExecWeeklyPack)

Track 4 — Execution Plane:
  docs/governance/workflow-inventory.md: 8 short + 8 medium + 6 long-lived
  workflows classified. 3 Temporal candidates with compensation logic.

Track 5 — Trust Fabric:
  docs/governance/trust-closure-plan.md: 5 live components + Watch adoption
  criteria for OPA/OpenFGA/Vault/Keycloak

Track 6 — Data & Connectors:
  docs/governance/connector-standard.md: Connector facade contract, semantic
  metrics dictionary, radar additions (Airbyte, Unstructured, Great Expectations)

Track 7 — Operating Plane:
  docs/governance/operating-plane-checklist.md: GitHub governance, CI/CD
  enhancements, CODEOWNERS template, OIDC/attestation roadmap

Track 8 — Saudi/GCC:
  docs/governance/saudi-enterprise-readiness.md: PDPL processing register,
  data classification, NCA ECC readiness, OWASP LLM Top 10, NIST AI RMF

Track 9 — Executive Surfaces:
  docs/governance/executive-surface-closure.md: Wiring plan with real data
  queries for Executive Room, Approval Center, Compliance Dashboard

Track 10 — Market Dominance:
  docs/governance/market-dominance-plan.md: 3-tier packaging (Core/Strategic/
  Sovereign), ROI narrative, competitive wedge, capability moat map,
  executive sales stories (CEO/CTO/CFO/CISO)

Master Checklist: docs/tier1-master-closure-checklist.md
  50 items total — 25 Done (documentation), 25 Target (runtime/integration)

https://claude.ai/code/session_01W1rJthWDkasijTdXCfxVHs
2026-04-16 13:08:26 +00:00

150 lines
5.3 KiB
Markdown

# Connector Governance Standard — Track 6
> **Parent**: [`MASTER_OPERATING_PROMPT.md`](../../MASTER_OPERATING_PROMPT.md)
> **Plane**: Data | **Version**: 1.0
---
## Objective
Every integration connector in Dealix follows a standard interface. No direct vendor bindings from agents. All connectors are governed, monitored, and auditable.
---
## Connector Contract
Every connector MUST implement:
```python
class ConnectorContract:
"""Standard interface for all Dealix connectors."""
# Identity
connector_key: str # e.g. "whatsapp", "salesforce"
display_name: str # English
display_name_ar: str # Arabic
version: str # Semantic version
# Governance
approval_policy: str # "auto" | "approval_required"
audit_mapping: str # Which audit event types
data_classification: str # "public" | "internal" | "confidential" | "restricted"
# Reliability
retry_policy: RetryPolicy # max_retries, backoff, timeout
timeout_ms: int # Max wait per call
idempotency: bool # Supports idempotent calls
# Observability
health_check(): HealthResult
metrics(): ConnectorMetrics
# Lifecycle
initialize(): void
execute(payload): Result
compensate(payload): void # Rollback action
shutdown(): void
```
---
## Required Metadata Per Connector
| Field | Description | Example |
|-------|-------------|---------|
| `connector_key` | Unique identifier | `whatsapp` |
| `display_name` | Human name (EN) | WhatsApp Business API |
| `display_name_ar` | Human name (AR) | واتساب بيزنس |
| `version` | Current version | `2026.4.1` |
| `contract_url` | API docs reference | Meta Developer docs URL |
| `retry_max` | Max retry attempts | 3 |
| `retry_backoff_ms` | Backoff between retries | 1000, 2000, 4000 |
| `timeout_ms` | Call timeout | 30000 |
| `idempotent` | Supports idempotency | true |
| `approval_policy` | Policy class | `B` (approval required) |
| `data_classification` | Sensitivity level | `confidential` |
| `audit_events` | Logged event types | `message_sent`, `message_failed` |
---
## Current Connectors
| Connector | Key | Standard? | Health Check? | Retry? | Audit? |
|-----------|-----|-----------|---------------|--------|--------|
| WhatsApp | `whatsapp` | Partial | No live probe | Partial | Yes (messages) |
| Salesforce | `salesforce` | Partial | No live probe | Partial | Partial |
| Stripe | `stripe` | Partial | No live probe | Yes (webhook) | Yes (payments) |
| Voice (Twilio) | `voice` | Pilot | No | Partial | Partial |
| Contract Intel | `contract_intel` | Pilot | No | No | No |
| Email (SMTP) | `email` | Partial | No live probe | Yes | Yes (messages) |
| Cal.com | `cal` | Pilot | No | No | No |
---
## Connector Health Board
The Connector Governance Board (`/api/v1/connectors/governance`) shows:
| Column | Source |
|--------|--------|
| Connector name (AR/EN) | `KNOWN_CONNECTORS` in `connector_governance.py` |
| Status (ok/degraded/error) | `IntegrationSyncState` model |
| Last success | `last_success_at` field |
| Last attempt | `last_attempt_at` field |
| Last error | `last_error` field |
| Registered | Whether tenant has configured it |
---
## Semantic Metrics Layer
### Purpose
Prevent multiple conflicting definitions of the same metric.
### Metric Dictionary (mandatory)
| Metric | Definition | Source | Owner |
|--------|-----------|--------|-------|
| `revenue_actual` | Sum of closed-won deal values in period | `deals` table WHERE status='won' | Revenue Track |
| `pipeline_value` | Sum of open deal values | `deals` table WHERE status IN ('open', 'negotiating') | Revenue Track |
| `win_rate` | Won deals / total closed deals | `deals` table | Revenue Track |
| `cac` | Total acquisition cost / new customers in period | `commissions` + marketing spend | Revenue Track |
| `consent_coverage` | Leads with active consent / total leads | `consents` + `leads` tables | Compliance Track |
| `approval_sla_compliance` | Approvals within SLA / total approvals | `approval_requests` table | Trust Track |
| `connector_health` | Connectors with status=ok / total connectors | `integration_sync_states` table | Operations Track |
### Rule
No two services may define the same metric differently. The metric dictionary above is canonical. Any service computing these metrics MUST use the definition above.
---
## Radar Additions
### Airbyte (Connector Orchestration)
**Status**: Watch
**Why**: 600+ pre-built connectors, MCP server, agent engine
**Adopt when**: 5+ external data sources need governed ingestion
**Spike**: Prototype with one CRM source (HubSpot or Salesforce)
### Unstructured (Document Extraction)
**Status**: Watch
**Why**: Extract contracts, CIMs, PDFs for DD workstreams
**Adopt when**: M&A DD workflow goes live
**Spike**: Prototype with sample contract extraction
### Great Expectations (Data Quality)
**Status**: Watch
**Why**: Production-grade data quality checks
**Adopt when**: Data pipeline exceeds 5 sources
**Spike**: Quality suite for leads and deals tables
---
## Gate: Data & Connector Closure
- [ ] Metric dictionary published and enforced
- [ ] Connector facade standard documented
- [ ] Health board shows real status for all active connectors
- [ ] No direct vendor bindings from agents (all via facade)
- [ ] At least one connector has full contract metadata