From a60021fd3c5f51c1e04441d2986dfec53963b023 Mon Sep 17 00:00:00 2001 From: Your Name Date: Thu, 25 Jun 2026 15:42:06 +0800 Subject: [PATCH] =?UTF-8?q?feat(governance):=20=E9=A1=AF=E7=A4=BA=20runtim?= =?UTF-8?q?e=20readback=20fixture=20=E6=89=B9=E5=87=86=E5=8C=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/web/messages/en.json | 17 + apps/web/messages/zh-TW.json | 17 + .../governance/tabs/agent-market-tab.tsx | 294 +++++++++++++++++- 3 files changed, 318 insertions(+), 10 deletions(-) diff --git a/apps/web/messages/en.json b/apps/web/messages/en.json index 88949768..6a2b8c61 100644 --- a/apps/web/messages/en.json +++ b/apps/web/messages/en.json @@ -3339,6 +3339,8 @@ "analysisTitle": "報告後 AI 解法與風險邊界", "deliveryTitle": "Telegram 報告實發批准包", "deliveryGuardTitle": "路由鎖 / 無發送回執保護", + "runtimeFixtureTitle": "Runtime readback fixture 批准包", + "runtimeFixtureGuardTitle": "Adapter / Verifier / Blocker 無寫入保護", "metrics": { "reports": "報告完成", "charts": "圖表區塊", @@ -3360,6 +3362,21 @@ "botApi": "Bot API", "receiptWrite": "回執寫入", "note": "真相註記" + }, + "runtimeFixtureMetrics": { + "cards": "Fixture 卡", + "adapters": "Adapter 合約", + "verifiers": "Verifier 檢查", + "blockers": "Blocker 映射", + "liveQuery": "Live query 次數" + }, + "runtimeFixtureTruth": { + "targetRead": "Target 讀取", + "runtimeReadback": "Runtime readback", + "resultCapture": "Result capture 寫入", + "productionWrite": "Production 寫入", + "ownerApproval": "Owner 批准", + "note": "真相註記" } }, "metrics": { diff --git a/apps/web/messages/zh-TW.json b/apps/web/messages/zh-TW.json index 88949768..6a2b8c61 100644 --- a/apps/web/messages/zh-TW.json +++ b/apps/web/messages/zh-TW.json @@ -3339,6 +3339,8 @@ "analysisTitle": "報告後 AI 解法與風險邊界", "deliveryTitle": "Telegram 報告實發批准包", "deliveryGuardTitle": "路由鎖 / 無發送回執保護", + "runtimeFixtureTitle": "Runtime readback fixture 批准包", + "runtimeFixtureGuardTitle": "Adapter / Verifier / Blocker 無寫入保護", "metrics": { "reports": "報告完成", "charts": "圖表區塊", @@ -3360,6 +3362,21 @@ "botApi": "Bot API", "receiptWrite": "回執寫入", "note": "真相註記" + }, + "runtimeFixtureMetrics": { + "cards": "Fixture 卡", + "adapters": "Adapter 合約", + "verifiers": "Verifier 檢查", + "blockers": "Blocker 映射", + "liveQuery": "Live query 次數" + }, + "runtimeFixtureTruth": { + "targetRead": "Target 讀取", + "runtimeReadback": "Runtime readback", + "resultCapture": "Result capture 寫入", + "productionWrite": "Production 寫入", + "ownerApproval": "Owner 批准", + "note": "真相註記" } }, "metrics": { diff --git a/apps/web/src/app/[locale]/governance/tabs/agent-market-tab.tsx b/apps/web/src/app/[locale]/governance/tabs/agent-market-tab.tsx index 6b473e3f..bbfa0d4b 100644 --- a/apps/web/src/app/[locale]/governance/tabs/agent-market-tab.tsx +++ b/apps/web/src/app/[locale]/governance/tabs/agent-market-tab.tsx @@ -18,6 +18,7 @@ import { apiClient, type AgentMarketGovernanceSnapshot, type AiAgentReportLiveDeliveryApprovalPackageSnapshot, + type AiAgentRuntimeReadbackFixtureApprovalSnapshot, type AiTechnologyRadarReadback, type AiTechnologyReportCadenceReadback, } from '@/lib/api-client' @@ -42,12 +43,12 @@ function formatPercent(value: number): string { } const TECHNOLOGY_AREA_LABELS: Record = { - agent_frameworks: 'Agent Frameworks', - evaluation_and_observability: 'Eval / Observability', + agent_frameworks: 'Agent 框架', + evaluation_and_observability: '評測 / 可觀測性', mcp_and_a2a: 'MCP / A2A', - model_providers: 'Model Providers', - model_serving: 'Model Serving', - rag_and_vector: 'RAG / Vector', + model_providers: '模型 Provider', + model_serving: '模型服務', + rag_and_vector: 'RAG / 向量', } function formatTechnologyArea(value: string): string { @@ -425,13 +426,13 @@ function PostReportAnalysisCard({ packet }: { packet: AiTechnologyReportCadenceR {packet.risk_tier} - + {packet.key_finding} - + {packet.proposed_solution} - + {packet.execution_boundary} @@ -564,6 +565,166 @@ function DryRunReceiptCard({ receipt }: { receipt: AiAgentReportLiveDeliveryAppr ) } +function RuntimeFixtureApprovalCard({ card }: { card: AiAgentRuntimeReadbackFixtureApprovalSnapshot['fixture_approval_cards'][number] }) { + const tone = card.risk_tier === 'critical' ? '#DC2626' : card.risk_tier === 'high' ? '#F59E0B' : '#d97757' + return ( +
+
+
+ + {card.display_name} + +
+ + + + +
+
+ + {card.risk_tier} + +
+ +
+ {card.required_fixture_fields.map(field => ( + + ))} +
+
+ +
+ {card.blocked_runtime_actions.map(action => ( + + ))} +
+
+ + {card.operator_guidance} + +
+ ) +} + +function AdapterContractCard({ contract }: { contract: AiAgentRuntimeReadbackFixtureApprovalSnapshot['adapter_contracts'][number] }) { + return ( +
+
+ + {contract.display_name} + + +
+ +
+ + +
+
+ +
+ {contract.required_evidence.map(evidence => ( + + ))} +
+
+
+ + +
+
+ ) +} + +function VerifierFixtureCheckCard({ check }: { check: AiAgentRuntimeReadbackFixtureApprovalSnapshot['verifier_fixture_checks'][number] }) { + return ( +
+
+ + {check.display_name} + + +
+ + {check.required_fixture} + + + {check.failure_if_missing} + + +
+ ) +} + +function RuntimeBlockerMappingCard({ blocker }: { blocker: AiAgentRuntimeReadbackFixtureApprovalSnapshot['blocker_mappings'][number] }) { + const tone = blocker.severity === 'critical' ? '#DC2626' : blocker.severity === 'high' ? '#F59E0B' : '#d97757' + return ( +
+
+ + {blocker.display_name} + + + {blocker.severity} + +
+
+ + +
+ + {blocker.source_blocker} + + + {blocker.blocked_until} + +
+ ) +} + // ============================================================================= // Component // ============================================================================= @@ -574,6 +735,7 @@ export function AgentMarketTab() { const [technologyRadar, setTechnologyRadar] = useState(null) const [technologyReportCadence, setTechnologyReportCadence] = useState(null) const [reportDeliveryApproval, setReportDeliveryApproval] = useState(null) + const [runtimeFixtureApproval, setRuntimeFixtureApproval] = useState(null) const [loading, setLoading] = useState(true) const [error, setError] = useState(false) @@ -584,12 +746,14 @@ export function AgentMarketTab() { apiClient.getAiTechnologyRadarReadback(), apiClient.getAiTechnologyReportCadenceReadback(), apiClient.getAiAgentReportLiveDeliveryApprovalPackage(), + apiClient.getAiAgentRuntimeReadbackFixtureApproval(), ]) - .then(([marketSnapshot, radarReadback, reportCadenceReadback, deliveryApprovalPackage]) => { + .then(([marketSnapshot, radarReadback, reportCadenceReadback, deliveryApprovalPackage, runtimeFixtureApprovalPackage]) => { setSnapshot(marketSnapshot) setTechnologyRadar(radarReadback) setTechnologyReportCadence(reportCadenceReadback) setReportDeliveryApproval(deliveryApprovalPackage) + setRuntimeFixtureApproval(runtimeFixtureApprovalPackage) setError(false) }) .catch(() => setError(true)) @@ -614,7 +778,7 @@ export function AgentMarketTab() { ) } - if (error || !snapshot || !technologyRadar || !technologyReportCadence || !reportDeliveryApproval) { + if (error || !snapshot || !technologyRadar || !technologyReportCadence || !reportDeliveryApproval || !runtimeFixtureApproval) { return (
@@ -652,6 +816,7 @@ export function AgentMarketTab() { const radarSummary = technologyRadar.summary const reportSummary = technologyReportCadence.summary const deliveryRollups = reportDeliveryApproval.rollups + const fixtureRollups = runtimeFixtureApproval.rollups const allApprovals = summary.priority_upgrades_approved + summary.market_scorecard_updates_approved + @@ -772,6 +937,109 @@ export function AgentMarketTab() {
+ +
+
+
+ + + {t('technologyReports.runtimeFixtureTitle')} + +
+
+ + +
+
+ +
+ + + + + +
+ +
+ + + + + + + + + + + + + + + +
+ + + {runtimeFixtureApproval.fixture_approval_truth.truth_note} + + +
+ {runtimeFixtureApproval.fixture_approval_cards.map(card => ( + + ))} +
+
+
+ + +
+
+ + + {t('technologyReports.runtimeFixtureGuardTitle')} + +
+
+ {runtimeFixtureApproval.adapter_contracts.map(contract => ( + + ))} +
+
+ {runtimeFixtureApproval.verifier_fixture_checks.map(check => ( + + ))} +
+
+ {runtimeFixtureApproval.blocker_mappings.map(blocker => ( + + ))} +
+
+
+
@@ -1430,6 +1698,12 @@ export function AgentMarketTab() { .agent-market-delivery-packet-grid, .agent-market-delivery-guard-grid, .agent-market-delivery-receipt-grid, + .agent-market-runtime-fixture-metrics-grid, + .agent-market-runtime-fixture-truth-grid, + .agent-market-runtime-fixture-card-grid, + .agent-market-runtime-adapter-grid, + .agent-market-runtime-verifier-grid, + .agent-market-runtime-blocker-grid, .agent-market-health-grid, .agent-market-cadence-grid, .agent-market-decision-grid,