PageSourceSearch

https://savorai.ai/assets/R0Certification-Ce6WTzb5.js

js savorai.ai collected 2026-10-05 15:51:25 UTC 5,568 bytes, 1 lines download raw bytes

1import{bI as R,r as p,j as e,m as c,q as n,ar as C,B as o,L as w,n as h,o as u,J as j,G as S,s as k,u as f}from"./index-C7pw77Xk.js";import{B as L}from"./badge-DSmCHSpi.js";import{S as O}from"./SectionHeader-ja9Lpzm4.js";import{A}from"./arrow-left-vRCdrRM7.js";import{S as N}from"./shield-check-B2BiEyoO.js";import{C as P}from"./circle-play-D7Ks2LVi.js";const F=()=>{var x;const{hasStateAccess:y,loading:v}=R(),[i,d]=p.useState(!1),[a,g]=p.useState(null),m=async s=>{d(!0);try{const{data:t,error:l}=await k.functions.invoke(`programops-r0-certify${s?"?persist=true":""}`,{body:{}});if(l)throw l;g(t),f.success("R0 certification run complete")}catch(t){f.error(t instanceof Error?t.message:"Certification run failed")}finally{d(!1)}},b=()=>{if(!a)return;const s=new Blob([JSON.stringify(a,null,2)],{type:"application/json"}),t=URL.createObjectURL(s),l=document.createElement("a");l.href=t,l.download=`PROGRAMOPS_R0_CERTIFICATION_${new Date().toISOString().slice(0,19)}.json`,l.click(),URL.revokeObjectURL(t)};if(v)return e.jsx("div",{className:"p-6 text-sm text-muted-foreground",children:"Loading…"});if(!y)return e.jsx("div",{className:"flex min-h-[40vh] items-center justify-center",children:e.jsx(c,{className:"max-w-md",children:e.jsxs(n,{className:"space-y-3 pt-6 text-center",children:[e.jsx(C,{className:"mx-auto h-6 w-6 text-primary"}),e.jsx("h2",{className:"text-lg font-semibold",children:"State admin only"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Runtime certification is restricted to state-level roles."})]})})});const r=a==null?void 0:a.totals;return e.jsxs("div",{className:"space-y-6",children:[e.jsx(o,{asChild:!0,variant:"ghost",size:"sm",className:"-ml-2",children:e.jsxs(w,{to:"/platform/programops/admin",children:[e.jsx(A,{className:"mr-2 h-4 w-4"})," Back to ProgramOps admin"]})}),e.jsx(O,{eyebrow:"Certification",title:"R0 foundation runtime certification",description:"Executes 21 governed journeys against the live database: rate governance and fail-closed calculation, the activity ledger and its integrity checkpoints, scheduled jobs, eligibility privacy, and payment separation of duties, idempotency and reconciliation."}),e.jsxs(c,{className:"border-border/60 shadow-soft",children:[e.jsxs(h,{className:"flex flex-row items-center justify-between gap-4",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(N,{className:"h-5 w-5 text-primary"}),e.jsx(u,{className:"text-base",children:"Run certification"})]}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.jsxs(o,{variant:"outline",onClick:()=>m(!1),disabled:i,children:[i?e.jsx(j,{className:"mr-2 h-4 w-4 animate-spin"}):e.jsx(P,{className:"mr-2 h-4 w-4"}),"Run journeys"]}),e.jsxs(o,{onClick:()=>m(!0),disabled:i,children:[i?e.jsx(j,{className:"mr-2 h-4 w-4 animate-spin"}):e.jsx(N,{className:"mr-2 h-4 w-4"}),"Run & archive evidence"]}),a&&e.jsxs(o,{variant:"secondary",onClick:b,children:[e.jsx(S,{className:"mr-2 h-4 w-4"})," Download JSON"]})]})]}),e.jsxs(n,{className:"text-sm text-muted-foreground",children:["Archive mode stores the report under ",e.jsx("code",{children:"programops-docs/r0-certification/"})," as permanent evidence. A run writes real ledger events; it never edits historical records."]})]}),a&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"grid grid-cols-2 gap-3 md:grid-cols-5",children:[{label:"Verdict",value:a.verdict??"—"},{label:"Total",value:(r==null?void 0:r.total)??0},{label:"Passed",value:(r==null?void 0:r.passed)??0},{label:"Failed",value:(r==null?void 0:r.failed)??0},{label:"Skipped",value:(r==null?void 0:r.skipped)??0}].map(s=>e.jsx(c,{className:"border-border/60",children:e.jsxs(n,{className:"pt-4",children:[e.jsx("div",{className:"text-xs uppercase text-muted-foreground",children:s.label}),e.jsx("div",{className:"text-lg font-semibold",children:s.value})]})},s.label))}),e.jsxs(c,{className:"border-border/60 shadow-soft",children:[e.jsx(h,{children:e.jsxs(u,{className:"text-sm",children:["Journeys · v",a.version??"—"," · ",((x=a.generated_at)==null?void 0:x.slice(0,19))??"",a.persisted_path&&e.jsxs("span",{className:"ml-2 text-xs text-muted-foreground",children:["archived: ",a.persisted_path]})]})}),e.jsx(n,{children:e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full text-xs",children:[e.jsx("thead",{className:"text-left text-muted-foreground",children:e.jsxs("tr",{children:[e.jsx("th",{scope:"col",className:"py-2 pr-3",children:"Journey"}),e.jsx("th",{scope:"col",className:"py-2 pr-3",children:"Control"}),e.jsx("th",{scope:"col",className:"py-2 pr-3",children:"Role"}),e.jsx("th",{scope:"col",className:"py-2 pr-3",children:"Result"}),e.jsx("th",{scope:"col",className:"py-2 pr-3",children:"Duration"}),e.jsx("th",{scope:"col",className:"py-2 pr-3",children:"What was observed"})]})}),e.jsx("tbody",{children:a.journeys.map(s=>e.jsxs("tr",{className:"border-t border-border/50 align-top",children:[e.jsx("td",{className:"py-2 pr-3 font-medium",children:s.journey}),e.jsx("td",{className:"py-2 pr-3",children:s.control}),e.jsx("td",{className:"py-2 pr-3",children:s.role??"—"}),e.jsx("td",{className:"py-2 pr-3",children:e.jsx(L,{variant:s.result==="PASS"?"default":s.result==="FAIL"?"destructive":"secondary",children:s.result})}),e.jsxs("td",{className:"py-2 pr-3",children:[s.duration_ms??0," ms"]}),e.jsxs("td",{className:"py-2 pr-3 text-muted-foreground",children:[s.detail,s.error&&e.jsx("div",{className:"mt-1 text-destructive",children:s.error})]})]},s.journey))})]})})})]})]})]})};export{F as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.