import{r as f,k as e}from"./index-BVfpSx5Q.js";import{L as g}from"./layout-NiehYZnq.js";import{P as j,K as t,C as i,S as c,b as y,A as m,I as d,f as v}from"./ui-DGkmnhL-.js";import{l,m as o,A as N}from"./hatunDoctrine-Cq1LMtli.js";function L(){const[r,u]=f.useState(l[0].id),[n,b]=f.useState(o[0].id),[p,h]=f.useState(!1),x=l.find(s=>s.id===r)??l[0],a=o.find(s=>s.id===n)??o[0];return e.jsxs(g,{children:[e.jsx(j,{label:"DOCTRINE · DSL",title:"Constitution-as-Code",subtitle:"Author surface for Constitutions. Linter is suggest-only; simulator shows structured diff against existing audit findings. Pre-Deployment Alignment Review Gate is unchanged.",status:"LIVE"}),e.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-3 mb-6",children:[e.jsx(t,{label:"EXAMPLES",value:l.length,accent:"#c9b787"}),e.jsx(t,{label:"SIM CASES",value:o.length,accent:"#c9b787"}),e.jsx(t,{label:"LINTER",value:"SUGGEST",sub:"never blocks",accent:"#c9b787"}),e.jsx(t,{label:"REVIEW GATE",value:"REQUIRED",sub:"not bypassable",accent:"#c9b787"})]}),e.jsxs(i,{className:"mb-4",children:[e.jsx(c,{children:"Examples"}),e.jsx("div",{className:"flex gap-2 flex-wrap",children:l.map(s=>e.jsx("button",{onClick:()=>u(s.id),className:"px-3 py-1.5 rounded text-xs font-mono",style:{backgroundColor:r===s.id?"rgba(201,183,135,0.12)":"transparent",color:r===s.id?"#c9b787":"var(--color-a11oy-text-sub)",border:`1px solid ${r===s.id?"rgba(201,183,135,0.3)":"var(--color-a11oy-border)"}`,cursor:"pointer"},children:N[s.agentId]},s.id))})]}),e.jsxs("div",{className:"grid lg:grid-cols-2 gap-4 mb-4",children:[e.jsxs(i,{children:[e.jsx(c,{children:x.title}),e.jsx("p",{className:"text-xs mb-3",style:{color:"var(--color-a11oy-text-sub)"},children:x.description}),e.jsx(y,{language:"constitution",children:x.source}),e.jsxs("div",{className:"mt-3 flex gap-2",children:[e.jsx(m,{variant:"ghost",size:"sm",onClick:()=>h(!0),children:"Run linter"}),e.jsx(m,{variant:"primary",size:"sm",children:"Submit to Review Gate"})]}),p&&e.jsxs("div",{className:"mt-3 p-3 rounded text-xs",style:{backgroundColor:"rgba(201,183,135,0.06)",border:"1px solid rgba(201,183,135,0.2)"},children:[e.jsx("div",{className:"font-mono mb-1",style:{color:"#c9b787"},children:"LINTER · 2 SUGGESTIONS · 0 BLOCKING"}),e.jsxs("ul",{className:"list-disc list-inside",style:{color:"var(--color-a11oy-text-sub)"},children:[e.jsxs("li",{children:["Consider adding a ",e.jsx("span",{className:"font-mono",children:"test"})," reference for clause C3.SCOPE."]}),e.jsxs("li",{children:[e.jsx("span",{className:"font-mono",children:"scope.tools"})," includes a connector with no recent welfare telemetry."]})]})]})]}),e.jsxs(i,{children:[e.jsx(c,{children:'"What would change if…" simulator'}),e.jsx("div",{className:"flex gap-2 flex-wrap mb-3",children:o.map(s=>e.jsx("button",{onClick:()=>b(s.id),className:"px-3 py-1.5 rounded text-xs font-mono",style:{backgroundColor:n===s.id?"rgba(201,183,135,0.12)":"transparent",color:n===s.id?"#c9b787":"var(--color-a11oy-text-sub)",border:`1px solid ${n===s.id?"rgba(201,183,135,0.3)":"var(--color-a11oy-border)"}`,cursor:"pointer"},children:s.baselineClauseId},s.id))}),e.jsx(d,{label:"baseline",value:e.jsx("span",{className:"font-mono",children:a.baselineClauseId})}),e.jsx(d,{label:"proposed",value:a.proposedChange}),e.jsx(d,{label:"diff",value:e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"font-mono",style:{color:"var(--color-a11oy-text)"},children:a.affectedFindingsBefore}),e.jsx("span",{style:{color:"var(--color-a11oy-text-ghost)"},children:"→"}),e.jsx("span",{className:"font-mono",style:{color:a.affectedFindingsAfter>a.affectedFindingsBefore?"#f5f5f5":"#c9b787"},children:a.affectedFindingsAfter}),e.jsx(v,{status:a.affectedFindingsAfter>a.affectedFindingsBefore?"warn":"ok",label:`${a.affectedFindingsAfter>a.affectedFindingsBefore?"+":""}${a.affectedFindingsAfter-a.affectedFindingsBefore} findings`})]})}),e.jsx(d,{label:"new probes needed",value:e.jsx("span",{className:"font-mono",children:a.newProbesNeeded.join(", ")})}),e.jsx("div",{className:"mt-3 p-3 rounded text-xs",style:{backgroundColor:"rgba(255,255,255,0.02)",border:"1px solid var(--color-a11oy-border)",color:"var(--color-a11oy-text-sub)",lineHeight:1.7},children:a.riskNarrative})]})]}),e.jsxs(i,{children:[e.jsx(c,{children:"Doctrine guarantees"}),e.jsxs("ul",{className:"text-xs flex flex-col gap-1.5",children:[e.jsxs("li",{className:"flex gap-2",style:{color:"var(--color-a11oy-text-sub)"},children:[e.jsx("span",{style:{color:"#c9b787"},children:"✓"}),e.jsx("span",{children:"The DSL is the author surface only. Runtime enforcement remains in the Covenant Layer."})]}),e.jsxs("li",{className:"flex gap-2",style:{color:"var(--color-a11oy-text-sub)"},children:[e.jsx("span",{style:{color:"#c9b787"},children:"✓"}),e.jsx("span",{children:"The linter is suggest-only and never blocks a Constitution from reaching the Review Gate."})]}),e.jsxs("li",{className:"flex gap-2",style:{color:"var(--color-a11oy-text-sub)"},children:[e.jsx("span",{style:{color:"#c9b787"},children:"✓"}),e.jsx("span",{children:"The simulator runs against existing behavioral-audit findings and reports a structured diff plus a narrative."})]}),e.jsxs("li",{className:"flex gap-2",style:{color:"var(--color-a11oy-text-sub)"},children:[e.jsx("span",{style:{color:"#c9b787"},children:"✓"}),e.jsx("span",{children:"No path bypasses the Pre-Deployment Alignment Review Gate."})]})]})]})]})}export{L as ConstitutionDSL};