feat(governance): 顯示 Agent 可委派版本治理
All checks were successful
CD Pipeline / tests (push) Successful in 1m25s
Code Review / ai-code-review (push) Successful in 13s
CD Pipeline / build-and-deploy (push) Successful in 5m42s
CD Pipeline / post-deploy-checks (push) Successful in 1m37s

This commit is contained in:
Your Name
2026-06-11 18:03:16 +08:00
parent c9d0eb69df
commit 308fd3d80e
15 changed files with 744 additions and 45 deletions

View File

@@ -267,6 +267,16 @@ export const apiClient = {
return handleResponse<AiAgentDeploymentLayoutSnapshot>(res)
},
async getAiAgentProactiveOperationsContract() {
const res = await fetch(`${API_BASE_URL}/agents/agent-proactive-operations-contract`)
return handleResponse<AiAgentProactiveOperationsContractSnapshot>(res)
},
async getAiAgentHostStatefulVersionInventory() {
const res = await fetch(`${API_BASE_URL}/agents/agent-host-stateful-version-inventory`)
return handleResponse<AiAgentHostStatefulVersionInventorySnapshot>(res)
},
async getRuntimeSurfaceInventory() {
const res = await fetch(`${API_BASE_URL}/agents/runtime-surface-inventory`)
return handleResponse<RuntimeSurfaceInventorySnapshot>(res)
@@ -927,6 +937,215 @@ export interface AiAgentDeploymentLayoutSnapshot {
>
}
export interface AiAgentProactiveOperationsContractSnapshot {
schema_version: 'ai_agent_proactive_operations_contract_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
runtime_authority: string
status_note: string
}
delegation_model: {
autonomy_levels: Array<{
level: string
meaning: string
}>
agent_responsibilities: Array<{
agent_id: string
responsibility: string
}>
telegram_policy: {
allowed_now: string
failure_only: string
success_spam: string
}
}
version_lifecycle_domains: Array<{
domain_id: string
display_name: string
primary_owner: string
cadence: string
current_allowed_autonomy: string
update_authority: string
approval_gate: string
tracked_examples: string[]
}>
delegable_capabilities: Array<{
capability_id: string
display_name: string
primary_owner: string
risk_tier: 'low' | 'medium' | 'high' | 'critical'
automation_level: string
outputs: string[]
approval_gate: string
telegram_policy: string
}>
cadence_matrix: Array<{
cadence_id: string
frequency: string
scope: string
allowed_now: boolean
next_gate: string
}>
mcp_tool_requirements: Array<{
tool_id: string
display_name: string
purpose: string
owner_agent: string
status: string
approval_gate: string
}>
rag_memory_contract: Array<{
memory_id: string
display_name: string
storage: string
owner_agent: string
purpose: string
redaction_policy: string
}>
rollout_tasks: Array<{
task_id: string
priority: 'P0' | 'P1' | 'P2' | 'P3'
status: string
completion_percent: number
owner_agent: string
summary: string
next_gate: string
}>
approval_boundaries: Record<string, false>
rollups: {
version_domain_count: number
delegable_capability_count: number
cadence_count: number
mcp_tool_count: number
rag_memory_count: number
rollout_task_count: number
auto_execute_allowed_count: number
approval_required_capability_count: number
blocked_update_domain_ids: string[]
telegram_action_required_capability_ids: string[]
}
}
export interface AiAgentHostStatefulVersionInventorySnapshot {
schema_version: 'ai_agent_host_stateful_version_inventory_v1'
generated_at: string
program_status: {
overall_completion_percent: number
current_task_id: string
next_task_id: string
read_only_mode: true
runtime_authority: string
status_note: string
}
source_refs: string[]
operation_boundaries: Record<string, boolean>
approval_boundaries: Record<string, false>
agent_roles: Array<{
agent: string
role: string
responsibility: string
}>
host_inventory: Array<{
host_id: string
display_name: string
known_addresses: string[]
primary_surfaces: string[]
version_observation_status: string
readonly_only: boolean
host_update_authorized: boolean
reboot_authorized: boolean
maintenance_window_required: boolean
next_evidence_needed: string[]
blocked_actions: string[]
}>
k3s_inventory: {
cluster_id: string
api_endpoint: string
version_observation_status: string
skew_policy_required: boolean
upgrade_authorized: boolean
nodes: Array<{
node_id: string
host_id: string
role: string
readonly_only: boolean
drain_authorized: boolean
kubelet_restart_authorized: boolean
version_observation_status: string
}>
required_pre_change_evidence: string[]
}
stateful_services: Array<{
service_id: string
display_name: string
host_id: string
endpoint_ref: string
version_observation_status: string
readonly_only: boolean
restart_authorized: boolean
upgrade_authorized: boolean
backup_required_before_change: boolean
}>
readonly_probe_plan: Array<{
step_id: string
display_name: string
planned_output: string
run_now_allowed: boolean
mutation_allowed: boolean
}>
maintenance_window_approval_package: {
package_id: string
approval_required_before_probe: boolean
approval_required_before_change: boolean
break_glass_record_required: boolean
required_fields: string[]
forbidden_fields: string[]
minimum_smoke_plan: string[]
}
telegram_policy: {
status: string
direct_send_allowed: boolean
gateway_queue_write_allowed: boolean
allowed_digest_types_after_gate: string[]
success_noise_suppression: boolean
}
display_redaction_contract: {
conversation_transcript_display_allowed: false
redaction_required: true
allowed_frontend_fields: string[]
forbidden_frontend_content: string[]
}
rollups: {
host_count: number
k3s_node_count: number
stateful_service_count: number
readonly_probe_step_count: number
maintenance_required_field_count: number
host_ids: string[]
stateful_service_ids: string[]
ssh_login_allowed_count: number
kubectl_command_execution_allowed_count: number
apt_upgrade_allowed_count: number
k3s_upgrade_allowed_count: number
node_drain_allowed_count: number
reboot_allowed_count: number
stateful_service_restart_allowed_count: number
telegram_direct_send_allowed_count: number
conversation_transcript_allowed_count: number
}
next_actions: Array<{
task_id: string
priority: 'P0' | 'P1' | 'P2' | 'P3'
summary: string
gate: string
}>
}
export interface RuntimeSurfaceInventorySnapshot {
schema_version: 'runtime_surface_inventory_v1'
generated_at: string