From be7b236cb52d366201af71369b19eced75c28cd0 Mon Sep 17 00:00:00 2001 From: matevip Date: Thu, 23 Jul 2026 11:46:09 +0800 Subject: [PATCH] feat(ui): surface the auto-approve outcome on audit rows with a create-grant shortcut --- mateclaw-ui/src/i18n/locales/en-US.ts | 10 ++ mateclaw-ui/src/i18n/locales/zh-CN.ts | 10 ++ .../src/views/Security/AuditLogs/index.vue | 91 ++++++++++++++++++- .../Security/AutoApproveGrants/index.vue | 32 ++++++- 4 files changed, 141 insertions(+), 2 deletions(-) diff --git a/mateclaw-ui/src/i18n/locales/en-US.ts b/mateclaw-ui/src/i18n/locales/en-US.ts index 0e4cd306..a10dd973 100644 --- a/mateclaw-ui/src/i18n/locales/en-US.ts +++ b/mateclaw-ui/src/i18n/locales/en-US.ts @@ -1861,6 +1861,16 @@ export default { }, noLogs: 'No audit logs yet', expandFindings: 'Expand Details', + outcome: { + AUTO_GRANT: 'Auto-approved', + HARD_BLOCK: 'Blocked by safety floor', + FORCE_HUMAN: 'Dangerous pattern, human approval forced', + SEVERITY_CRITICAL: 'Not auto-approved: CRITICAL always requires a human', + SEVERITY_CEILING: 'Not auto-approved: grant ceiling below this finding ({ceiling} < {actual})', + UNKNOWN_WORKSPACE: 'Not auto-approved: conversation workspace unknown', + NO_GRANT: 'Not auto-approved: no matching grant', + createGrant: 'Create a grant', + }, }, severity: { CRITICAL: 'Critical', diff --git a/mateclaw-ui/src/i18n/locales/zh-CN.ts b/mateclaw-ui/src/i18n/locales/zh-CN.ts index a126a20d..0a01d598 100644 --- a/mateclaw-ui/src/i18n/locales/zh-CN.ts +++ b/mateclaw-ui/src/i18n/locales/zh-CN.ts @@ -1735,6 +1735,16 @@ export default { }, noLogs: '暂无审计记录', expandFindings: '展开详情', + outcome: { + AUTO_GRANT: '已自动放行', + HARD_BLOCK: '安全地板阻断', + FORCE_HUMAN: '高危模式,强制人审', + SEVERITY_CRITICAL: '未自动放行:CRITICAL 永远人审', + SEVERITY_CEILING: '未自动放行:策略严重度上限低于本次命中({ceiling} < {actual})', + UNKNOWN_WORKSPACE: '未自动放行:无法确定会话所属工作区', + NO_GRANT: '未自动放行:无匹配的自动批准策略', + createGrant: '去创建策略', + }, }, severity: { CRITICAL: '严重', diff --git a/mateclaw-ui/src/views/Security/AuditLogs/index.vue b/mateclaw-ui/src/views/Security/AuditLogs/index.vue index 5efd9c71..4a6ef5d8 100644 --- a/mateclaw-ui/src/views/Security/AuditLogs/index.vue +++ b/mateclaw-ui/src/views/Security/AuditLogs/index.vue @@ -110,6 +110,17 @@ {{ t('security.decision.' + log.decision) || log.decision }} + +
+ {{ outcomeText(log.autoApproveOutcome) }} +
@@ -119,7 +130,7 @@ {{ truncateConvId(log.conversationId) }} + @@ -174,11 +193,13 @@