a11oy / console /assets /CareEngine-5acRZA8K.js
betterwithage's picture
deploy(hf): sync szl-holdings/a11oy@main derived COPY set
da2854c verified
Raw
History Blame
11 kB
import{o as e}from"./chunk-CMxvf4Kt.js";import{t}from"./react-DrNXigiH.js";import{C as n}from"./index-Caa1r77e.js";import{t as r}from"./layout-BtJ5ShnN.js";import{c as i,r as a,s as o,u as s}from"./ui-Ddu9t0Or.js";import{a as c,i as l,n as u,s as d}from"./complianceFabric-Ckztkxyv.js";var f=e(t(),1),p=n(),m=`#c9b787`,h={fresh:`#22c55e`,warning:`#f97316`,stale:`#ef4444`,critical:`#ef4444`};function g(e){return new Date(e).toLocaleDateString(`en-US`,{month:`short`,day:`numeric`,year:`numeric`})}function _({daysStale:e,thresholdDays:t,status:n}){let r=Math.min(e/t*100,100),i=h[n];return(0,p.jsx)(`div`,{className:`h-1.5 rounded-full w-full`,style:{backgroundColor:`rgba(255,255,255,0.06)`},children:(0,p.jsx)(`div`,{className:`h-1.5 rounded-full transition-all`,style:{width:`${r}%`,backgroundColor:i}})})}var v=[{title:`System Description`,source:`System Cards`,desc:`Intended purpose, capabilities, limitations, deployment context, and risk classification for each agent.`},{title:`Affected Populations`,source:`Agent Registry`,desc:`Identification of groups affected by agent decisions — employees, customers, partners, regulated entities.`},{title:`Risk Assessment`,source:`Risk Reports + Behavioral Audit`,desc:`Known risks, residual risks, mitigation measures, and ongoing monitoring commitments per agent.`},{title:`Oversight Mechanisms`,source:`Covenant Layer + Approval Queue`,desc:`Human oversight structure — approval tiers, named approvers, escalation paths, override protections.`},{title:`Data Protection`,source:`Connector Firewall + Data Handling`,desc:`PII handling, data minimization, consent gating, retention policies, and privacy impact.`},{title:`Bias and Fairness`,source:`MirrorEval + Code Behaviors`,desc:`Bias detection scoring, demographic fairness checks, sycophancy resistance, and fairness-relevant eval dimensions.`},{title:`Transparency Measures`,source:`Glasswing Mode + Public Trust Portal`,desc:`Public disclosure commitments — transparency reports, CAVD, constitution publication, robustness wall.`},{title:`Remediation Plan`,source:`CARE Engine + ARG`,desc:`Procedures for addressing identified risks, updating constitutions, and re-evaluating agents post-remediation.`}];function y(){let[e,t]=(0,f.useState)(`all`),[n,y]=(0,f.useState)(!1),b=d(),x=e===`all`?b:b.filter(t=>t.framework===e),S=b.filter(e=>e.status===`fresh`).length,C=b.filter(e=>e.status===`warning`).length,w=b.filter(e=>e.status===`stale`||e.status===`critical`).length;return(0,p.jsxs)(r,{children:[(0,p.jsx)(i,{label:`CARE — CONTINUOUS AUDIT READINESS`,title:`Continuous Audit Readiness Engine`,subtitle:`Always-on monitoring that tracks evidence freshness for every mapped regulatory control. Auto-flags stale evidence, verifies 6-month log retention per EU AI Act Article 12, and generates on-demand audit packages.`,status:`LIVE`}),(0,p.jsxs)(`div`,{className:`grid grid-cols-2 md:grid-cols-3 lg:grid-cols-6 gap-3 mb-8`,children:[(0,p.jsx)(o,{label:`CONTROLS MONITORED`,value:String(u.length),sub:`across 4 frameworks`,accent:m}),(0,p.jsx)(o,{label:`FRESH`,value:String(S),sub:`evidence current`,accent:`#22c55e`}),(0,p.jsx)(o,{label:`WARNING`,value:String(C),sub:`approaching threshold`,accent:`#f97316`}),(0,p.jsx)(o,{label:`STALE`,value:String(w),sub:`needs refresh`,accent:`#ef4444`}),(0,p.jsx)(o,{label:`LOG RETENTION`,value:`${c.currentRetentionMonths}mo`,sub:`required: ${c.requiredMonths}mo`,accent:`#22c55e`}),(0,p.jsx)(o,{label:`ART. 12 COMPLIANT`,value:c.compliant?`YES`:`NO`,sub:`6-month retention`,accent:c.compliant?`#22c55e`:`#ef4444`})]}),(0,p.jsxs)(`div`,{className:`grid lg:grid-cols-3 gap-6 mb-8`,children:[(0,p.jsxs)(`div`,{className:`lg:col-span-2`,children:[(0,p.jsxs)(`div`,{className:`flex items-center justify-between mb-4`,children:[(0,p.jsx)(s,{children:`Control Freshness Timeline`}),(0,p.jsxs)(`div`,{className:`flex gap-1`,children:[(0,p.jsx)(`button`,{onClick:()=>t(`all`),className:`text-xs px-2 py-0.5 rounded font-mono`,style:{backgroundColor:e===`all`?`rgba(201,183,135,0.15)`:`var(--color-a11oy-muted)`,color:e===`all`?m:`var(--color-a11oy-text-ghost)`,border:`none`,cursor:`pointer`},children:`All`}),l.map(n=>(0,p.jsx)(`button`,{onClick:()=>t(n.id),className:`text-xs px-2 py-0.5 rounded font-mono`,style:{backgroundColor:e===n.id?`${n.color}18`:`var(--color-a11oy-muted)`,color:e===n.id?n.color:`var(--color-a11oy-text-ghost)`,border:`none`,cursor:`pointer`},children:n.shortName},n.id))]})]}),(0,p.jsx)(`div`,{className:`rounded-lg border overflow-hidden`,style:{borderColor:`var(--color-a11oy-border)`},children:(0,p.jsxs)(`table`,{className:`w-full text-xs`,children:[(0,p.jsx)(`thead`,{children:(0,p.jsx)(`tr`,{style:{backgroundColor:`var(--color-a11oy-deep)`},children:[`Control`,`Framework`,`Last Refreshed`,`Days`,`Threshold`,`Freshness`,`Status`].map(e=>(0,p.jsx)(`th`,{className:`text-left px-3 py-2 font-mono uppercase tracking-wide`,style:{color:`var(--color-a11oy-text-ghost)`,fontSize:`10px`},children:e},e))})}),(0,p.jsx)(`tbody`,{children:x.map((e,t)=>{let n=l.find(t=>t.id===e.framework),r=h[e.status];return(0,p.jsxs)(`tr`,{style:{backgroundColor:t%2==0?`var(--color-a11oy-card)`:`var(--color-a11oy-deep)`,borderBottom:`1px solid var(--color-a11oy-border)`},children:[(0,p.jsx)(`td`,{className:`px-3 py-2 font-mono`,style:{color:`var(--color-a11oy-text)`},children:e.controlRef}),(0,p.jsx)(`td`,{className:`px-3 py-2 font-mono`,style:{color:n?.color??m},children:n?.shortName}),(0,p.jsx)(`td`,{className:`px-3 py-2`,style:{color:`var(--color-a11oy-text-sub)`},children:g(e.lastRefreshedAt)}),(0,p.jsxs)(`td`,{className:`px-3 py-2 font-mono`,style:{color:r},children:[e.daysStale,`d`]}),(0,p.jsxs)(`td`,{className:`px-3 py-2 font-mono`,style:{color:`var(--color-a11oy-text-ghost)`},children:[e.thresholdDays,`d`]}),(0,p.jsx)(`td`,{className:`px-3 py-2 w-24`,children:(0,p.jsx)(_,{daysStale:e.daysStale,thresholdDays:e.thresholdDays,status:e.status})}),(0,p.jsx)(`td`,{className:`px-3 py-2`,children:(0,p.jsx)(`span`,{className:`text-xs font-mono px-1.5 py-0.5 rounded`,style:{backgroundColor:`${r}15`,color:r},children:e.status.toUpperCase()})})]},e.controlId)})})]})})]}),(0,p.jsxs)(`div`,{children:[(0,p.jsx)(s,{children:`EU AI Act Article 12 — Log Retention`}),(0,p.jsx)(a,{children:(0,p.jsxs)(`div`,{className:`space-y-3 text-xs`,children:[(0,p.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,p.jsx)(`span`,{style:{color:`var(--color-a11oy-text-ghost)`},children:`Required Retention`}),(0,p.jsxs)(`span`,{className:`font-mono font-bold`,style:{color:`var(--color-a11oy-text)`},children:[c.requiredMonths,` months`]})]}),(0,p.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,p.jsx)(`span`,{style:{color:`var(--color-a11oy-text-ghost)`},children:`Current Retention`}),(0,p.jsxs)(`span`,{className:`font-mono font-bold`,style:{color:`#22c55e`},children:[c.currentRetentionMonths,` months`]})]}),(0,p.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,p.jsx)(`span`,{style:{color:`var(--color-a11oy-text-ghost)`},children:`Oldest Log`}),(0,p.jsx)(`span`,{className:`font-mono`,style:{color:`var(--color-a11oy-text-sub)`},children:g(c.oldestLogDate)})]}),(0,p.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,p.jsx)(`span`,{style:{color:`var(--color-a11oy-text-ghost)`},children:`Next Purge`}),(0,p.jsx)(`span`,{className:`font-mono`,style:{color:`var(--color-a11oy-text-sub)`},children:g(c.nextPurgeDate)})]}),(0,p.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,p.jsx)(`span`,{style:{color:`var(--color-a11oy-text-ghost)`},children:`Compliance`}),(0,p.jsx)(`span`,{className:`font-mono font-bold`,style:{color:c.compliant?`#22c55e`:`#ef4444`},children:c.compliant?`COMPLIANT`:`NON-COMPLIANT`})]}),(0,p.jsxs)(`div`,{className:`pt-2 border-t`,style:{borderColor:`var(--color-a11oy-border)`},children:[(0,p.jsxs)(`div`,{className:`font-mono mb-1`,style:{color:`var(--color-a11oy-text-ghost)`},children:[`HIGH-RISK AGENTS (`,c.highRiskAgents.length,`)`]}),(0,p.jsx)(`div`,{className:`flex flex-wrap gap-1`,children:c.highRiskAgents.map(e=>(0,p.jsx)(`span`,{className:`text-xs font-mono px-1.5 py-0.5 rounded`,style:{backgroundColor:`var(--color-a11oy-deep)`,border:`1px solid var(--color-a11oy-border)`,color:m},children:e},e))})]})]})}),(0,p.jsxs)(`div`,{className:`mt-4`,children:[(0,p.jsx)(s,{children:`FRIA Generator`}),(0,p.jsxs)(a,{children:[(0,p.jsx)(`p`,{className:`text-xs mb-3`,style:{color:`var(--color-a11oy-text-sub)`},children:`Generate a pre-populated Fundamental Rights Impact Assessment drawing from System Cards, Risk Reports, Behavioral Audit history, and agent constitutions.`}),(0,p.jsx)(`button`,{onClick:()=>y(!n),className:`w-full text-xs font-medium py-2 rounded-lg mb-3`,style:{backgroundColor:`rgba(201,183,135,0.12)`,color:m,border:`1px solid rgba(201,183,135,0.25)`,cursor:`pointer`},children:n?`Hide FRIA Template`:`Generate FRIA Template`}),n&&(0,p.jsx)(`div`,{className:`space-y-2`,children:v.map(e=>(0,p.jsxs)(`div`,{className:`p-2 rounded`,style:{backgroundColor:`var(--color-a11oy-deep)`,border:`1px solid var(--color-a11oy-border)`},children:[(0,p.jsxs)(`div`,{className:`flex items-center justify-between mb-1`,children:[(0,p.jsx)(`span`,{className:`text-xs font-semibold`,style:{color:`var(--color-a11oy-text)`},children:e.title}),(0,p.jsx)(`span`,{className:`text-xs font-mono`,style:{color:m},children:e.source})]}),(0,p.jsx)(`p`,{className:`text-xs`,style:{color:`var(--color-a11oy-text-ghost)`},children:e.desc})]},e.title))})]})]}),(0,p.jsxs)(`div`,{className:`mt-4`,children:[(0,p.jsx)(s,{children:`Auto-Remediation`}),(0,p.jsx)(a,{children:(0,p.jsx)(`div`,{className:`space-y-2 text-xs`,children:[{trigger:`Evidence > 80% of threshold`,action:`Warning notification sent to control owner`},{trigger:`Evidence exceeds threshold`,action:`Remediation task auto-created`},{trigger:`Log retention < 6 months`,action:`Alert sent to compliance team`},{trigger:`New control mapping added`,action:`Evidence collection initiated`}].map(e=>(0,p.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,p.jsx)(`span`,{style:{color:m,flexShrink:0},children:`→`}),(0,p.jsxs)(`div`,{children:[(0,p.jsx)(`span`,{style:{color:`var(--color-a11oy-text)`},children:e.trigger}),(0,p.jsx)(`br`,{}),(0,p.jsx)(`span`,{style:{color:`var(--color-a11oy-text-ghost)`},children:e.action})]})]},e.trigger))})})]})]})]}),(0,p.jsxs)(`div`,{className:`p-3 rounded-lg text-xs flex items-center gap-2`,style:{backgroundColor:`rgba(201,183,135,0.06)`,border:`1px solid rgba(201,183,135,0.15)`,color:`var(--color-a11oy-text-ghost)`},children:[(0,p.jsx)(`span`,{className:`w-1.5 h-1.5 rounded-full bg-[var(--color-a11oy-blue)] flex-shrink-0`}),` CARE Engine — continuous audit readiness monitoring. Evidence freshness is tracked per control. FRIA templates are pre-populated from live governance data. EU AI Act Article 12 retention is verified.`]})]})}export{y as CareEngine};