feat(governance): 新增服務健康缺口矩陣
All checks were successful
CD Pipeline / tests (push) Successful in 1m28s
Code Review / ai-code-review (push) Successful in 13s
CD Pipeline / build-and-deploy (push) Successful in 3m50s
CD Pipeline / post-deploy-checks (push) Successful in 1m55s

This commit is contained in:
Your Name
2026-06-05 14:22:30 +08:00
parent 24d4342e11
commit 1007a1bc04
17 changed files with 1941 additions and 81 deletions

View File

@@ -282,6 +282,11 @@ export const apiClient = {
return handleResponse<AiProviderRouteMatrixSnapshot>(res)
},
async getServiceHealthGapMatrix() {
const res = await fetch(`${API_BASE_URL}/agents/service-health-gap-matrix`)
return handleResponse<ServiceHealthGapMatrixSnapshot>(res)
},
async getBackupDrTargetInventory() {
const res = await fetch(`${API_BASE_URL}/agents/backup-dr-target-inventory`)
return handleResponse<BackupDrTargetInventorySnapshot>(res)
@@ -1105,6 +1110,83 @@ export interface AiProviderRouteMatrixSnapshot {
approval_boundaries: Record<string, false>
}
export interface ServiceHealthGapMatrixSnapshot {
schema_version: 'service_health_gap_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_targets: number
by_kind: Record<string, number>
by_status: Record<string, number>
by_freshness_status: Record<string, number>
target_ids_requiring_action: string[]
health_gap_ids: string[]
stale_endpoint_ids: string[]
critical_target_ids: string[]
read_only_denials_total: number
service_restart_allowed_count: number
endpoint_change_allowed_count: number
active_probe_allowed_count: number
notification_send_allowed_count: number
runtime_execution_allowed_count: number
}
service_health_targets: Array<{
target_id: string
display_name: string
kind: string
status: 'verified' | 'action_required' | 'blocked'
risk_level: 'low' | 'medium' | 'high' | 'critical'
freshness_status: string
health_contract: string
endpoint_contract: string
evidence_refs: string[]
next_action: string
}>
health_gaps: Array<{
gap_id: string
display_name: string
status: string
severity: 'low' | 'medium' | 'high' | 'critical'
summary: string
target_ids: string[]
evidence_refs: string[]
next_action: string
}>
stale_endpoints: Array<{
endpoint_id: string
display_name: string
status: string
severity: 'low' | 'medium' | 'high' | 'critical'
stale_ref: string
current_truth: 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_service_health_gap_matrix'
must_not_interpret_as: string[]
secret_display_policy: string
restart_policy: string
endpoint_policy: string
notification_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