feat: surface audit risk score in update API and UI

Return auditRiskScore and auditRiskLabel in update results so the
dashboard can show security posture after both tracked-repo and
regular-skill updates. auditGateTrackedRepo now returns the audit
result alongside the blocked indicator.
This commit is contained in:
Willie
2026-02-23 04:18:01 +08:00
parent b93d8f103a
commit bd76ec9aa5
4 changed files with 49 additions and 24 deletions
+2
View File
@@ -298,6 +298,8 @@ export interface UpdateResultItem {
action: string; // "updated", "up-to-date", "skipped", "error", "blocked"
message?: string;
isRepo: boolean;
auditRiskScore?: number;
auditRiskLabel?: string;
}
export interface AvailableTarget {
+4 -1
View File
@@ -219,7 +219,10 @@ export default function SkillDetailPage() {
const res = await api.update({ name: skillName, skipAudit });
const item = res.results[0];
if (item?.action === 'updated') {
toast(`Updated: ${item.name} — ${item.message}`, 'success');
const auditInfo = item.auditRiskLabel
? ` · Security: ${item.auditRiskLabel.toUpperCase()}${item.auditRiskScore ? ` (${item.auditRiskScore}/100)` : ''}`
: '';
toast(`Updated: ${item.name} — ${item.message}${auditInfo}`, 'success');
refetch();
} else if (item?.action === 'up-to-date') {
toast(`${item.name} is already up to date.`, 'info');