system-prompts-and-models-o.../salesflow-saas/frontend/src/components/dealix/policy-violations-board.tsx
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

83 lines
3.7 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

"use client";
type Violation = {
id: string; source: string; description: string;
severity: string; status: string; detected_at: string;
owner?: string;
};
const SEVERITY_STYLES: Record<string, { bg: string; text: string; labelAr: string }> = {
critical: { bg: "bg-red-500/20", text: "text-red-500", labelAr: "حرج" },
high: { bg: "bg-orange-500/20", text: "text-orange-500", labelAr: "عالي" },
medium: { bg: "bg-yellow-500/20", text: "text-yellow-500", labelAr: "متوسط" },
low: { bg: "bg-gray-500/20", text: "text-gray-400", labelAr: "منخفض" },
};
const STATUS_LABELS: Record<string, string> = {
detected: "تم الاكتشاف",
reviewing: "قيد المراجعة",
resolved: "تم الحل",
accepted: "مقبول",
};
export function PolicyViolationsBoard({ violations = [] }: { violations?: Violation[] }) {
const active = violations.filter((v) => v.status === "detected" || v.status === "reviewing");
const resolved = violations.filter((v) => v.status === "resolved" || v.status === "accepted");
return (
<div className="space-y-4 p-6" dir="rtl">
<h2 className="text-xl font-bold text-right">لوحة مخالفات السياسات | Policy Violations Board</h2>
{/* Summary */}
<div className="grid grid-cols-4 gap-3">
<div className="glass-card p-3 border border-border/40 text-center">
<div className="text-xs text-muted-foreground">الإجمالي</div>
<div className="text-xl font-bold">{violations.length}</div>
</div>
<div className="glass-card p-3 border border-border/40 text-center">
<div className="text-xs text-muted-foreground">نشطة</div>
<div className="text-xl font-bold text-yellow-500">{active.length}</div>
</div>
<div className="glass-card p-3 border border-border/40 text-center">
<div className="text-xs text-muted-foreground">حرجة</div>
<div className="text-xl font-bold text-red-500">{violations.filter((v) => v.severity === "critical" && (v.status === "detected" || v.status === "reviewing")).length}</div>
</div>
<div className="glass-card p-3 border border-border/40 text-center">
<div className="text-xs text-muted-foreground">محلولة</div>
<div className="text-xl font-bold text-emerald-500">{resolved.length}</div>
</div>
</div>
{/* Active Violations */}
{active.length > 0 && (
<section>
<h3 className="text-lg font-semibold mb-2 text-right">المخالفات النشطة</h3>
<div className="space-y-2">
{active.map((v) => {
const style = SEVERITY_STYLES[v.severity] || SEVERITY_STYLES.medium;
return (
<div key={v.id} className="glass-card p-4 border border-border/40">
<div className="flex justify-between items-start">
<span className="text-xs text-muted-foreground">{STATUS_LABELS[v.status] || v.status}</span>
<div className="text-right">
<div className="flex items-center gap-2 justify-end">
<span className={`text-xs px-2 py-0.5 rounded ${style.bg} ${style.text}`}>{style.labelAr}</span>
<span className="text-xs text-muted-foreground">{v.source}</span>
</div>
<p className="text-sm mt-1">{v.description}</p>
</div>
</div>
</div>
);
})}
</div>
</section>
)}
{violations.length === 0 && (
<p className="text-sm text-muted-foreground text-center py-8">لا توجد مخالفات مسجلة</p>
)}
</div>
);
}