mirror of
https://github.com/x1xhlol/system-prompts-and-models-of-ai-tools.git
synced 2026-06-17 23:09:35 +00:00
Sprint A — Executive Room real data: Rewrote executive_roi_service.py (20→158 lines) to aggregate from 7 live services: deals (revenue/pipeline/win_rate), approval SLA (pending/warning/ breach from _dealix_sla), connector health (IntegrationSyncState), compliance posture (saudi_compliance_matrix), contradictions (contradiction_engine), strategic deals, evidence packs. Sprint B — Approval Center live: Wired approval_center.py to query real ApprovalRequest table with SLA data from payload["_dealix_sla"]. Approve/reject endpoints update real DB records with reviewed_at timestamp. Sprint C — Saudi Compliance live: Wired saudi_compliance.py to call saudi_compliance_matrix service methods (get_matrix, get_posture, get_risk_heatmap) with real AsyncSession + tenant_id. Sprint D — Contradiction + Evidence Pack DB: Wired contradiction.py and evidence_packs.py to real database via contradiction_engine and evidence_pack_service. All CRUD operations now persist to PostgreSQL with proper tenant isolation. Sprint F — Operating Plane: Created CODEOWNERS file mapping sensitive paths to @VoXc2. Added architecture_brief.py step to CI pipeline (runs before pytest). Sprint G — OWASP LLM: Added OWASP LLM Top 10 review + architecture brief validation to release-prep.md (steps 10-11). https://claude.ai/code/session_01W1rJthWDkasijTdXCfxVHs
56 lines
2.0 KiB
Python
56 lines
2.0 KiB
Python
"""Connector Governance API — integration health from real IntegrationSyncState."""
|
|
|
|
from fastapi import APIRouter, Depends
|
|
from typing import Any, Dict
|
|
from uuid import UUID
|
|
|
|
from sqlalchemy.ext.asyncio import AsyncSession
|
|
|
|
from app.database import get_db
|
|
from app.services.connector_governance import connector_governance
|
|
from app.services.operations_hub import list_integration_connectors
|
|
|
|
router = APIRouter(prefix="/connectors", tags=["Connector Governance"])
|
|
|
|
|
|
@router.get("/governance")
|
|
async def governance_board(
|
|
tenant_id: str = "00000000-0000-0000-0000-000000000000",
|
|
db: AsyncSession = Depends(get_db),
|
|
) -> Dict[str, Any]:
|
|
"""Get connector governance board from real IntegrationSyncState data."""
|
|
board = await connector_governance.get_governance_board(db, tenant_id=tenant_id)
|
|
return {"connectors": board, "total": len(board)}
|
|
|
|
|
|
@router.post("/{connector_key}/health-check")
|
|
async def health_check(
|
|
connector_key: str,
|
|
tenant_id: str = "00000000-0000-0000-0000-000000000000",
|
|
db: AsyncSession = Depends(get_db),
|
|
) -> Dict[str, Any]:
|
|
"""Trigger health check and update connector status."""
|
|
conn = await connector_governance.update_connector_status(
|
|
db, tenant_id=tenant_id, connector_key=connector_key, status="ok"
|
|
)
|
|
return {"connector_key": connector_key, "status": conn.status}
|
|
|
|
|
|
@router.get("/{connector_key}/history")
|
|
async def connector_history(connector_key: str) -> Dict[str, Any]:
|
|
"""Get sync history for a connector."""
|
|
return {"connector_key": connector_key, "history": []}
|
|
|
|
|
|
@router.put("/{connector_key}/disable")
|
|
async def disable_connector(
|
|
connector_key: str,
|
|
tenant_id: str = "00000000-0000-0000-0000-000000000000",
|
|
db: AsyncSession = Depends(get_db),
|
|
) -> Dict[str, Any]:
|
|
"""Disable a connector."""
|
|
conn = await connector_governance.update_connector_status(
|
|
db, tenant_id=tenant_id, connector_key=connector_key, status="disabled", error="Manually disabled"
|
|
)
|
|
return {"connector_key": connector_key, "status": "disabled"}
|