From eef1db0f0abc7195e08ecdbc4a3c9bf32cf65594 Mon Sep 17 00:00:00 2001 From: shankar0123 Date: Sat, 18 Apr 2026 13:02:04 +0000 Subject: [PATCH] fix(policies): stop 400ing the "+ New Policy" button + add per-rule severity (D-005, D-006) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Coverage Gap Audit findings D-005 (P0) + D-006 (P1) fixed together in a single commit because they share the same root cause — policy CRUD sending values the backend silently rejects — and splitting them would leave a half-working UI between commits. ## D-005 (P0): PoliciesPage dropdown 400s every Create Policy Root cause ---------- `web/src/pages/PoliciesPage.tsx` populated the Type ` setType(e.target.value)} + onChange={e => setType(e.target.value as PolicyType)} className="w-full bg-white border border-surface-border rounded px-3 py-2 text-sm text-ink focus:outline-none focus:border-brand-400" > - - - - - + {POLICY_TYPES.map(t => ( + + ))}
@@ -182,7 +197,7 @@ export default function PoliciesPage() {
), }, - { key: 'type', label: 'Type', render: (p) => {p.type.replace(/_/g, ' ')} }, + { key: 'type', label: 'Type', render: (p) => {humanize(p.type)} }, { key: 'severity', label: 'Severity', @@ -248,8 +263,8 @@ export default function PoliciesPage() { {Object.entries(bySeverity).map(([sev, count]) => (
-
- {sev} +
+ {sev} {count}
))}