system-prompts-and-models-o.../salesflow-saas/backend/app/services/forecast_control_center.py
Claude a319feb6d7
feat(dealix): complete Tier-1 Sovereign Enterprise Growth OS
Governance layer (14 docs):
- MASTER_OPERATING_PROMPT.md — operating constitution (five planes, six tracks, policy classes)
- docs/ai-operating-model.md — five-plane architecture (Decision/Execution/Trust/Data/Operating)
- docs/dealix-six-tracks.md — six strategic tracks (Revenue/Intelligence/Compliance/Expansion/Operations/Trust)
- docs/governance/execution-fabric.md — OpenClaw execution plane deep dive
- docs/governance/trust-fabric.md — trust plane with contradiction engine + evidence packs
- docs/governance/saudi-compliance-and-ai-governance.md — PDPL/ZATCA/SDAIA/NCA live controls
- docs/governance/technology-radar-tier1.md — Core/Strong/Pilot/Watch/Hold classification
- docs/governance/partnership-os.md — alliance lifecycle management
- docs/governance/ma-os.md — M&A corporate development lifecycle
- docs/governance/expansion-os.md — geographic and vertical growth
- docs/governance/pmi-os.md — post-merger integration framework
- docs/governance/executive-board-os.md — executive decision surfaces
- docs/execution-matrix-90d-tier1.md — 90-day sprint execution plan
- docs/adr/0001-tier1-execution-policy-spikes.md — 8 architectural decisions

Backend (3 models, 6 services, 8 API routes):
- Contradiction Engine — detect/track system conflicts
- Evidence Pack System — tamper-evident audit proof with SHA256
- Saudi Compliance Matrix — live PDPL/ZATCA/SDAIA/NCA controls
- Executive Room — unified executive decision surface
- Connector Governance — integration health monitoring
- Model Routing Dashboard — LLM provider metrics
- Forecast Control Center — actual vs forecast across tracks
- Approval Center — enhanced approval queue with SLA

Frontend (9 components):
- Executive Room, Evidence Pack Viewer, Approval Center
- Connector Governance Board, Saudi Compliance Dashboard
- Actual vs Forecast Dashboard, Risk Heatmap
- Policy Violations Board, Partner Pipeline Board

Tooling:
- scripts/architecture_brief.py — preflight validation (40/40 checks pass)
- Updated CLAUDE.md and AGENTS.md with governance references

https://claude.ai/code/session_01W1rJthWDkasijTdXCfxVHs
2026-04-16 12:48:13 +00:00

62 lines
1.8 KiB
Python

"""Forecast Control Center — unified actual vs forecast across all tracks."""
from __future__ import annotations
from typing import Any, Dict
class ForecastControlCenter:
"""Provides unified actual vs forecast view across revenue, partnerships, M&A, expansion."""
def get_unified_view(self, tenant_id: str) -> Dict[str, Any]:
return {
"tenant_id": tenant_id,
"tracks": {
"revenue": {
"actual": 0,
"forecast": 0,
"variance": 0,
"variance_percent": 0.0,
"unit": "SAR",
},
"partnerships": {
"actual_count": 0,
"target_count": 0,
"variance": 0,
"unit": "partners",
},
"ma": {
"deals_in_progress": 0,
"pipeline_target": 0,
"variance": 0,
"unit": "deals",
},
"expansion": {
"markets_launched": 0,
"markets_planned": 0,
"variance": 0,
"unit": "markets",
},
},
"overall_health": "on_track",
}
def get_variance_analysis(self, tenant_id: str) -> Dict[str, Any]:
return {
"tenant_id": tenant_id,
"top_variances": [],
"root_causes": [],
"recommendations": [],
}
def get_accuracy_trend(self, tenant_id: str, periods: int = 6) -> Dict[str, Any]:
return {
"tenant_id": tenant_id,
"periods": periods,
"trend": [],
"average_accuracy_percent": 0.0,
}
forecast_control_center = ForecastControlCenter()