feat(governance): persist remediation dry run history
All checks were successful
Code Review / ai-code-review (push) Successful in 12s
CD Pipeline / tests (push) Successful in 1m4s
CD Pipeline / build-and-deploy (push) Successful in 3m44s
CD Pipeline / post-deploy-checks (push) Successful in 1m24s

This commit is contained in:
Your Name
2026-05-14 22:38:42 +08:00
parent 36cb9d6aeb
commit 6aaaf87ade
6 changed files with 253 additions and 24 deletions

View File

@@ -159,6 +159,9 @@ interface RemediationDryRunResponse {
tool_name?: string
required_scope?: string
} | null
history?: {
recorded?: boolean
}
}
interface RemediationActionState {
@@ -490,27 +493,40 @@ function VerificationCoveragePanel({ coverage }: { coverage?: Adr100Verification
<span>{actionState[item.work_item_id]?.status === 'loading' ? t('dryRunLoading') : t('dryRunButton')}</span>
</button>
{actionState[item.work_item_id]?.status === 'done' && (
<div style={{
display: 'flex',
alignItems: 'flex-start',
gap: 5,
fontFamily: "'DM Mono', monospace",
fontSize: 9,
color: actionState[item.work_item_id].data?.allowed === false ? '#7c5a10' : '#166534',
lineHeight: 1.4,
overflowWrap: 'anywhere',
}}>
<SearchCheck size={12} style={{ flexShrink: 0, marginTop: 1 }} />
<span>
{actionState[item.work_item_id].data?.allowed === false
? t('dryRunBlocked')
: t('dryRunResult', {
mode: actionState[item.work_item_id].data?.mode ?? '--',
result: actionState[item.work_item_id].data?.verification_result_preview ?? '--',
tools: actionState[item.work_item_id].data?.post_state_summary?.tool_count ?? 0,
})}
</span>
</div>
<>
<div style={{
display: 'flex',
alignItems: 'flex-start',
gap: 5,
fontFamily: "'DM Mono', monospace",
fontSize: 9,
color: actionState[item.work_item_id].data?.allowed === false ? '#7c5a10' : '#166534',
lineHeight: 1.4,
overflowWrap: 'anywhere',
}}>
<SearchCheck size={12} style={{ flexShrink: 0, marginTop: 1 }} />
<span>
{actionState[item.work_item_id].data?.allowed === false
? t('dryRunBlocked')
: t('dryRunResult', {
mode: actionState[item.work_item_id].data?.mode ?? '--',
result: actionState[item.work_item_id].data?.verification_result_preview ?? '--',
tools: actionState[item.work_item_id].data?.post_state_summary?.tool_count ?? 0,
})}
</span>
</div>
{actionState[item.work_item_id].data?.history?.recorded && (
<div style={{
fontFamily: "'DM Mono', monospace",
fontSize: 9,
color: '#166534',
lineHeight: 1.4,
overflowWrap: 'anywhere',
}}>
{t('dryRunHistoryRecorded')}
</div>
)}
</>
)}
{actionState[item.work_item_id]?.status === 'error' && (
<div style={{ fontFamily: "'DM Mono', monospace", fontSize: 9, color: '#FF3300', lineHeight: 1.4 }}>