feat(governance): 新增 AI Provider 路由矩陣
All checks were successful
CD Pipeline / tests (push) Successful in 1m29s
Code Review / ai-code-review (push) Successful in 15s
CD Pipeline / build-and-deploy (push) Successful in 3m51s
CD Pipeline / post-deploy-checks (push) Successful in 1m30s

This commit is contained in:
Your Name
2026-06-05 13:28:38 +08:00
parent 77abbe4cf9
commit 45556f8fd1
17 changed files with 1819 additions and 59 deletions

View File

@@ -277,6 +277,11 @@ export const apiClient = {
return handleResponse<ObservabilityContractMatrixSnapshot>(res)
},
async getAiProviderRouteMatrix() {
const res = await fetch(`${API_BASE_URL}/agents/ai-provider-route-matrix`)
return handleResponse<AiProviderRouteMatrixSnapshot>(res)
},
async getBackupDrTargetInventory() {
const res = await fetch(`${API_BASE_URL}/agents/backup-dr-target-inventory`)
return handleResponse<BackupDrTargetInventorySnapshot>(res)
@@ -1025,6 +1030,81 @@ export interface ObservabilityContractMatrixSnapshot {
approval_boundaries: Record<string, false>
}
export interface AiProviderRouteMatrixSnapshot {
schema_version: 'ai_provider_route_matrix_v1'
generated_at: string
program_status: {
overall_completion_percent: number
current_priority: 'P0' | 'P1' | 'P2' | 'P3'
current_task_id: string
next_task_id: string
read_only_mode: true
}
source_refs: string[]
rollups: {
total_routes: number
by_kind: Record<string, number>
by_status: Record<string, number>
by_route_gate: Record<string, number>
route_ids_requiring_action: string[]
candidate_gate_ids_requiring_approval: string[]
source_gap_ids: string[]
read_only_denials_total: number
provider_switch_allowed_count: number
paid_api_call_allowed_count: number
shadow_or_canary_allowed_count: number
runtime_route_change_allowed_count: number
}
provider_routes: Array<{
route_id: string
display_name: string
kind: string
status: 'verified' | 'action_required' | 'blocked'
risk_level: 'low' | 'medium' | 'high' | 'critical'
route_gate: string
evidence_status: string
current_policy: string
provider_order: string[]
fallback_policy: string
evidence_refs: string[]
next_action: string
}>
candidate_gates: Array<{
gate_id: string
display_name: string
status: string
approval_required: boolean
summary: string
evidence_refs: string[]
next_action: string
}>
source_gaps: Array<{
gap_id: string
display_name: string
status: string
severity: 'low' | 'medium' | 'high' | 'critical'
summary: string
evidence_refs: string[]
next_action: string
}>
latest_observations: Array<{
observation_id: string
status: string
summary: string
evidence_refs: string[]
}>
operator_contract: {
display_mode: 'read_only_ai_provider_route_matrix'
must_not_interpret_as: string[]
secret_display_policy: string
provider_switch_policy: string
cost_policy: string
runtime_policy: string
}
operation_boundaries: Record<string, boolean>
approval_boundaries: Record<string, false>
}
export interface BackupDrTargetInventorySnapshot {
schema_version: 'backup_dr_target_inventory_v1'
generated_at: string