1(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,223622,e=>{"use strict";let t=(0,e.i(475254).default)("ban",[["path",{d:"M4.929 4.929 19.07 19.071",key:"196cmz"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);e.s(["Ban",()=>t],223622)},556485,898491,e=>{"use strict";let t={module:"L1 Module",workflow:"L2 Workflow",presentation:"L3 Presentation",e2e:"L4 End-to-end",onboarding:"L0 Onboarding",compose:"L5 Compose",routing:"L0 Routing",variants:"L0 Variant contracts",memory:"L4 Memory",flow:"L0 Flow",collab:"L0 Collab / RLS",routine:"L3 Routine",gemba:"L3 Gemba",export:"L5 Export"};function s(e){return(t[e]??e).split(" ")[0]}function r(e,t){return t||(e.startsWith("modules/")?"module":"e2e")}let n={module:["func","coach"],workflow:["func","coach"],presentation:["func","artifact"],e2e:["func","coach"],onboarding:["func"],compose:["func","artifact"],routing:["func"],variants:["func"],memory:["func","artifact"],flow:["func"],collab:["func"],routine:["func","coach"],gemba:["func","coach"],export:["func","artifact"]};function a(e){return n[e]??["func"]}e.s(["DIMENSION_KEYS",0,["A1","A2","A3","A4","A5","A6","A7","A8","A9","A10"],"DIMENSION_LABELS",0,{A1:"Frames before solving",A2:"Elicits missing data",A3:"Method correctness",A4:"Tests the evidential basis of a claim",A5:"Domain fidelity (GMP)",A6:"Actionable output",A7:"Discriminates signal from noise",A8:"Proportionality",A9:"Pragmatic testing",A10:"Gate discipline"},"LEVEL_LABEL",0,t,"LEVEL_RUBRIC_SUBSET",0,{module:["A2","A3","A5","A6"],workflow:["A2","A3","A4","A5","A6","A7","A9","A10"],presentation:["A6"],e2e:null,routine:null,gemba:null},"LEVEL_TESTS",0,{module:"One pinned skill, router bypassed â does the module elicit, apply its method, and complete without leaks or fabrication?",workflow:"A pinned multi-node plan â does every node traverse and does context flow node to node (gates enforced)?",presentation:"A workflow driven into storyline + export â does a real deck artifact come out, and is it faithful to the analysis?",e2e:"The whole stack, nothing pinned â the full front-door routing + composition, judged on the complete A1âA10 rubric.",onboarding:"The new-user entry path â capture â problem detection â does it propose the right module and create a session?",compose:"Workflow-on-the-fly composition â is the composed plan phase-correct, right-sized, and a good plan?",routing:"A labelled problem classified once â did it land on the expected skill (route == label)?",variants:"Per-variant rendering contracts â does each UX-variant data blob render within its contract?",memory:"Multi-session drive â close â re-open â are the right facts extracted, isolated per box, and do they ground coaching?",flow:"A deterministic feature flow â did the flow do the right thing (DOM-checked, no rubric)?",collab:"Two users in different orgs â is the cross-org read blocked (RLS isolation holds)?",routine:"Daily-management coaching â direction + KPIs persisted and cascaded, plus coaching quality.",gemba:"A gemba walk â photo captured and a finding persisted, plus coaching quality.",export:"A produced export (PDF / Word / Excel) opened and content-graded per format."},"deriveLevel",()=>r,"levelCode",()=>s,"levelModes",()=>a],556485);var l=e.i(843476),o=e.i(522016),d=e.i(463059),i=e.i(975157);function c({value:e,disagree:t,className:s,title:r}){return(0,l.jsxs)("span",{title:r,className:(0,i.cn)("relative inline-flex h-7 w-7 items-center justify-center rounded text-xs font-semibold tabular-nums",null==e?"bg-muted text-muted-foreground":e>=2?"bg-emerald-100 text-emerald-800 dark:bg-emerald-900/40 dark:text-emerald-300":e>=1?"bg-amber-100 text-amber-800 dark:bg-amber-900/40 dark:text-amber-300":"bg-red-100 text-red-800 dark:bg-red-900/40 dark:text-red-300",s),children:[null==e?"·":e,t&&(0,l.jsx)("span",{className:"absolute -right-1 -top-1 text-[9px] leading-none text-amber-600 dark:text-amber-400","aria-label":"grader split",title:"grader split",children:"â "})]})}function m({values:e,disagree:t}){return(0,l.jsx)("span",{className:"inline-flex gap-0.5",children:e.map((e,s)=>(0,l.jsx)(c,{value:e,disagree:t?.[s],className:"h-6 w-6"},s))})}function x({items:e}){return(0,l.jsx)("nav",{className:"flex flex-wrap items-center gap-1 text-sm text-muted-foreground","aria-label":"Breadcrumb",children:e.map((e,t)=>(0,l.jsxs)("span",{className:"flex items-center gap-1",children:[t>
10&&(0,l.jsx)(d.ChevronRight,{className:"h-3.5 w-3.5 opacity-50"}),e.href?(0,l.jsx)(o.default,{href:e.href,className:"hover:text-foreground hover:underline",children:e.label}):(0,l.jsx)("span",{className:"text-foreground font-medium",children:e.label})]},t))})}function u({title:e,points:t,suffix:s="",max:r,colorClass:n="text-primary"}){let a=e=>Number.isFinite(e)?e:0,o=t.map(e=>({...e,value:a(e.value)})),d=Math.max(r??0,...o.map(e=>e.value),1),c=o.length,m=e=>c<=1?110:6+208*e/(c-1),x=e=>50-a(e)/d*44,u=o[o.length-1],p=o.map((e,t)=>`${m(t)},${x(e.value)}`).join(" ");return(0,l.jsxs)("div",{className:"rounded-lg border bg-card p-3",children:[(0,l.jsxs)("div",{className:"mb-1 flex items-baseline justify-between",children:[(0,l.jsx)("span",{className:"text-xs font-medium text-muted-foreground",children:e}),u&&(0,l.jsxs)("span",{className:(0,i.cn)("text-sm font-semibold tabular-nums",n),children:[u.value,s]})]}),0===c?(0,l.jsx)("div",{className:"flex h-14 items-center justify-center text-xs text-muted-foreground",children:"no data"}):(0,l.jsxs)("svg",{viewBox:"0 0 220 56",className:"h-14 w-full overflow-visible",role:"img","aria-label":e,children:[c>1&&(0,l.jsx)("polyline",{points:p,fill:"none",className:n,stroke:"currentColor",strokeWidth:1.5,strokeLinejoin:"round",strokeLinecap:"round"}),o.map((e,t)=>(0,l.jsx)("g",{children:(0,l.jsx)("circle",{cx:m(t),cy:x(e.value),r:2.5,className:n,fill:"currentColor",children:(0,l.jsx)("title",{children:e.title??`${e.label}: ${e.value}${s}`})})},t))]})]})}function p(e){if(!e)return"";let t=new Date(e);return Number.isNaN(t.getTime())?e:t.toLocaleString(void 0,{year:"numeric",month:"short",day:"2-digit",hour:"2-digit",minute:"2-digit"})}function h(e){if(!e)return"";let t=new Date(e);return Number.isNaN(t.getTime())?e:t.toLocaleDateString(void 0,{month:"short",day:"2-digit"})}function f(e,t){let s=Number(e);return Number.isInteger(s)&&t.includes(s)?s:t[0]??1}function g({text:e,label:t="copy promote cmd"}){return(0,l.jsxs)("button",{type:"button",onClick:()=>{navigator.clipboard?.writeText(e)},className:"inline-flex items-center gap-1 rounded border border-border px-2 py-1 text-xs font-medium text-muted-foreground hover:bg-accent hover:text-foreground transition-colors",title:e,children:["â ",t]})}e.s(["Breadcrumbs",()=>x,"CopyButton",()=>g,"MedianStrip",()=>m,"ScoreCell",()=>c,"Sparkline",()=>u,"formatDate",()=>h,"formatTimestamp",()=>p,"parseRunFromSearch",()=>f],898491)},843279,e=>{"use strict";function t(e){return e.routeLoaded&&e.reachedExecution&&(e.notableErrorCount??e.consoleErrorCount??0)===0&&!e.routingFailed}function s(e){return e.routedIntoWorkflow?!!e.workflowCompleted&&(e.nodesForceClosed??0)===0:!!e.completionProposed}function r(e){let t=e.nodeReports;if(!t||0===t.length)return null;let s=t.filter(e=>e.index>1),r=s.filter(e=>!1===e.contextLoaded).map(e=>e.skillId??"?"),n=s.filter(e=>!0===e.contextLoaded).length,a=t.filter(e=>!1===e.isOptional&&"force-api"===e.closeMethod).map(e=>e.skillId??"?");return{ctxExpected:s.length,ctxLoaded:n,ctxMisses:r,gateViolations:a,pass:0===r.length&&0===a.length}}e.i(556485),e.s(["completionDone",()=>s,"infraPass",()=>t,"l2Assertions",()=>r])},63209,e=>{"use strict";let t=(0,e.i(475254).default)("circle-alert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);e.s(["AlertCircle",()=>t],63209)},382039,e=>{"use strict";let t=(0,e.i(475254).default)("file-search",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["circle",{cx:"11.5",cy:"14.5",r:"2.5",key:"1bq0ko"}],["path",{d:"M13.3 16.3 15 18",key:"2quom7"}]]);e.s(["FileSearch",()=>t],382039)},503116,e=>{"use strict";let t=(0,e.i(475254).default)("clock",[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);e.s(["Clock",()=>t],503116)},784529,e=>{"use strict";let t=(0,e.i(475254).default)("circle-dot",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}]]);e.s(["CircleDot",()=>t],784529)},626912,e=>{"use strict";let t=(0,e.i(475254).default)("file-check",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"m9 15 2 2 4-4",key:"1grp1n"}]]);e.s(["FileCheck",()=>t],626912)},511306,e=>{"use strict";var t=e.i(63209),s=e.i(595468),r=e.i(503116),n=e.i(784529),a=e.i(223622),l=e.i(382039),o=e.i(626912),d=e.i(475254);let i=(0,d.default)("code-xml",[["path",{d:"m18 16 4-4-4-4",key:"1inbqp"}],["path",{d:"m6 8-4 4 4 4",key:"15zrgr"}],["path",{d:"m14.5 4-5 16",key:"e7oirm"}]]),c=(0,d.default)("test-tube",[["path",{d:"M14.5 2v17.5c0 1.4-1.1 2.5-2.5 2.5c-1.4 0-2.5-1.1-2.5-2.5V2",key:"125lnx"}],["path",{d:"M8.5 2h7",key:"csnxdl"}],["path",{d:"M14.5 16h-5",key:"1ox875"}]]),m={detected_by_eval:{label:"Detected by eval",shortLabel:"Eval",color:"bg-indigo-500/15 text-indigo-700 border-indigo-200",icon:e.i(38982).FlaskConical},new:{label:"New",shortLabel:"New",color:"bg-blue-500/15 text-blue-700 border-blue-200",icon:n.CircleDot},open:{label:"Open",shortLabel:"Open",color:"bg-red-500/15 text-red-700 border-red-200",icon:t.AlertCircle},in_progress:{label:"In Progress",shortLabel:"In Prog.",color:"bg-
1amber-500/15 text-amber-700 border-amber-200",icon:r.Clock},implemented_pending_testing:{label:"Pending Testing",shortLabel:"Testing",color:"bg-purple-500/15 text-purple-700 border-purple-200",icon:r.Clock},resolved:{label:"Resolved",shortLabel:"Resolved",color:"bg-green-500/15 text-green-700 border-green-200",icon:s.CheckCircle2},wont_fix:{label:"Won't Fix",shortLabel:"Won't Fix",color:"bg-gray-500/15 text-gray-600 border-gray-200",icon:a.Ban},declined_eval:{label:"Declined (eval)",shortLabel:"Declined",color:"bg-gray-500/15 text-gray-600 border-gray-200",icon:a.Ban},clarified:{label:"Clarified",shortLabel:"Clarified",color:"bg-cyan-500/15 text-cyan-700 border-cyan-200",icon:l.FileSearch},story_ready:{label:"Story Ready",shortLabel:"Ready",color:"bg-emerald-500/15 text-emerald-700 border-emerald-200",icon:o.FileCheck},in_dev:{label:"In Development",shortLabel:"In Dev",color:"bg-violet-500/15 text-violet-700 border-violet-200",icon:i},testing:{label:"Testing",shortLabel:"Testing",color:"bg-purple-500/15 text-purple-700 border-purple-200",icon:c}};e.s(["EFFORT_CONFIG",0,{low:{label:"Low",color:"bg-green-500/15 text-green-700 border-green-200"},medium:{label:"Medium",color:"bg-amber-500/15 text-amber-700 border-amber-200"},high:{label:"High",color:"bg-red-500/15 text-red-700 border-red-200"}},"EFFORT_LEVELS",0,["low","medium","high"],"IMPACT_CONFIG",0,{low:{label:"Low",color:"bg-gray-500/15 text-gray-600 border-gray-200"},medium:{label:"Medium",color:"bg-blue-500/15 text-blue-700 border-blue-200"},high:{label:"High",color:"bg-emerald-500/15 text-emerald-700 border-emerald-200"}},"IMPACT_LEVELS",0,["low","medium","high"],"PRIORITIES",0,["low","medium","high","critical"],"PRIORITY_CONFIG",0,{low:{label:"Low",color:"bg-gray-500/15 text-gray-600 border-gray-200"},medium:{label:"Medium",color:"bg-blue-500/15 text-blue-700 border-blue-200"},high:{label:"High",color:"bg-orange-500/15 text-orange-700 border-orange-200"},critical:{label:"Critical",color:"bg-red-500/15 text-red-700 border-red-200"}},"PRIORITY_ROWS",0,["critical","high","medium","low","unset"],"PRIORITY_ROW_LABELS",0,{critical:"Critical",high:"High",medium:"Medium",low:"Low",unset:"Unset"},"REPORT_TYPES",0,["bug","feature_request"],"STATUSES",0,["detected_by_eval","new","in_progress","implemented_pending_testing","resolved","wont_fix","declined_eval"],"STATUS_CONFIG",0,m,"STORY_STATUSES",0,["draft","ready"],"STORY_STATUS_CONFIG",0,{draft:{label:"Draft",color:"bg-amber-500/15 text-amber-700 border-amber-200"},ready:{label:"Ready",color:"bg-green-500/15 text-green-700 border-green-200"}},"VALID_FEATURE_TRANSITIONS",0,{new:["clarified","story_ready","in_dev","testing","resolved","wont_fix"],clarified:["new","story_ready","in_dev","testing","resolved","wont_fix"],story_ready:["new","clarified","in_dev","testing","resolved","wont_fix"],in_dev:["new","clarified","story_ready","testing","resolved","wont_fix"],testing:["new","clarified","story_ready","in_dev","resolved","wont_fix"],resolved:["new","clarified","story_ready","in_dev","testing","wont_fix"],wont_fix:["new","clarified","story_ready","in_dev","testing","resolved"]}],511306)},392478,e=>{"use strict";var t=e.i(843476),s=e.i(271645),r=e.i(522016),n=e.i(846696),a=e.i(223622),l=e.i(643531),o=e.i(519455),d=e.i(511306),i=e.i(556485),c=e.i(898491);function m({runKey:e}
1){let[n,a]=(0,s.useState)(null),[l,o]=(0,s.useState)(null),[d,m]=(0,s.useState)(null),p=(0,s.useCallback)(t=>{let s=t?`?base=${encodeURIComponent(t)}`:"";fetch(`/api/admin/evals/${encodeURIComponent(e)}${s}`).then(e=>e.ok?e.json():Promise.reject(Error(`HTTP ${e.status}`))).then(e=>{a(e),m(e.baseRunKey)}).catch(e=>o(String(e)))},[e]);if((0,s.useEffect)(()=>{p(null)},[p]),l)return(0,t.jsxs)("div",{className:"p-4 text-sm text-destructive",children:["Failed to load run: ",l]});if(!n)return(0,t.jsx)("div",{className:"p-4 text-sm text-muted-foreground",children:"Loading runâ¦"});let{meta:f,report:g,allRuns:b,difficulties:j,models:y,compare:N}=n,v=Object.keys(g.cases??{}),k=v.flatMap(e=>g.cases[e].defects??[]);return(0,t.jsxs)("div",{className:"space-y-5",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,t.jsx)(c.Breadcrumbs,{items:[{label:"Evals",href:"/admin/evals"},{label:f.sha}]}),(0,t.jsx)(r.default,{href:"/admin/evals",className:"text-sm text-muted-foreground hover:text-foreground",children:"â all runs"})]}),(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsxs)("h1",{className:"text-lg font-semibold",children:["Run ",(0,t.jsx)("span",{className:"font-mono",children:f.sha})," ",(0,t.jsx)("span",{className:"text-sm font-normal text-muted-foreground",children:(0,c.formatTimestamp)(f.iso)})]}),f.subject&&(0,t.jsxs)("p",{className:"text-sm text-muted-foreground",children:["git ",f.sha,' "',f.subject,'"']}),(0,t.jsxs)("p",{className:"text-sm text-muted-foreground",children:["app model ",y.app??"â"," · sim ",y.sim??"â"," · graders ",y.graders.join(", ")||"â"," ·"," ",v.length," case",1===v.length?"":"s"," · generated ",(0,c.formatTimestamp)(g.generatedAt)]}),(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-x-6 gap-y-1 text-sm",children:[(0,t.jsxs)("span",{children:["Func ",(0,t.jsxs)("b",{className:"tabular-nums",children:[g.functionalPassRate,"%"]})]}),(0,t.jsxs)("span",{children:["Completed ",(0,t.jsxs)("b",{className:"tabular-nums",children:[g.completionPassRate,"%"]})]}),(0,t.jsxs)("span",{children:[g.defectCount," defect",1===g.defectCount?"":"s"]})]}),g.byLevel&&Object.keys(g.byLevel).length>0&&(0,t.jsx)(x,{byLevel:g.byLevel})]}),g.skippedRuns?.length>0&&(0,t.jsxs)("div",{className:"rounded-lg border border-amber-300 bg-amber-50 px-4 py-2 text-sm text-amber-900 dark:border-amber-800 dark:bg-amber-950/40 dark:text-amber-200",children:[(0,t.jsxs)("b",{children:[g.skippedRuns.length," run(s) not graded"]})," (no usable transcript â not a quiet coach):"," ",g.skippedRuns.map(e=>`${e.caseId} run-${e.runIndex}${e.reason?` (${e.reason})`:""}`).join("; ")]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)("h2",{className:"text-sm font-semibold",children:"Cases"}),(0,t.jsx)("div",{className:"overflow-x-auto rounded-lg border",children:(0,t.jsxs)("table",{className:"w-full border-collapse text-sm",children:[(0,t.jsx)("thead",{children:(0,t.jsxs)("tr",{className:"border-b bg-muted/40 text-xs text-muted-foreground",children:[(0,t.jsx)("th",{className:"px-3 py-2 text-left font-medium",children:"case"}),(0,t.jsx)("th",{className:"px-2 py-2 text-center font-medium",children:"diff"}),(0,t.jsx)("th",{className:"px-2 py-2 text-center font-medium",children:"runs"}),(0,t.jsx)("th",{className:"px-2 py-2 text-center font-medium",children:"func"}),(0,t.jsx)("th",{className:"px-3 py-2 text-left font-medium",children:"A1..A10 medians"}),(0,t.jsx)("th",{className:"px-2 py-2 text-center font-medium",children:"defects"}),(0,t.jsx)("th",{className:"px-3 py-2 text-left font-medium",children:"sessions"}),(0,t.jsx)("th",{className:"px-2 py-2"})]})}),(0,t.jsx)("tbody",{children:v.map(s=>{let a=g.cases[s],l=i.DIMENSION_KEYS.map(e=>a.dimensions[e]?.median??null),o=i.DIMENSION_KEYS.map(e=>(a.dimensions[e]?.disagreeCount??0)>0),d=a.runs.length,m=a.runs.every(e=>e.functional.routeLoaded&&e.functional.reachedExecution&&(e.functional.notableErrorCount??e.functional.consoleErrorCount)===0&&!e.functional.routingFailed),[x,u]=s.split("/"),p=`/admin/evals/${encodeURIComponent(e)}/${encodeURIComponent(x)}/${encodeURIComponent(u)}`,h=(0,i.deriveLevel)(s,a.runs[0]?.functional?.evaluationLevel);return(0,t.jsxs)("tr",{className:"border-b last:border-0 align-top hover:bg-accent/30",children:[(0,t.jsxs)("td",{className:"px-3 py-2 whitespace-nowrap",children:[(0,t.jsx)("span",{className:"font-mono text-xs",children:s}),(0,t.jsx)("span",{className:"ml-1.5 rounded bg-muted px-1 py-0.5 text-[10px] text-muted-foreground",children:i.LEVEL_LABEL[h].split(" ")[0]})]}),(0,t.jsx)("td",{className:"px-2 py-2 text-center tabular-nums",children:j[s]??"â"}),(0,t.jsxs)("td",{className:"px-2 py-2 text-center tabular-nums",children:[d,"/",d]}),(0,t.jsx)("td",{className:"px-2 py-2 text-center",children:(0,t.jsx)("span",{className:m?"text-emerald-600":"text-red-600",children:m?"â":"â"})}),(0,t.jsx)("td",{className:"px-3 py-2",children:(0,t.jsx)(c.MedianStrip,{values:l,disagree:o})}),(0,t.jsx)("td",{className:"px-2 py-2 text-center tabular-nums",children:a.defects?.length??0}),(0,t.jsx)("td",{className:"px-3 py-2",children:(0,t.jsx)("div",{className:"flex flex-wrap gap-1.5",children:a.runs.map(e=>{let a=n.replay?.[s]?.[e.n],l=!!(a?.hasVideo||a?.hasTranscript),o=l?`${p}?run=${e.n}&replay=1`:`${p}?run=${e.n}`;return(0,t.jsxs)(r.default,{href:o,title:l?`Replay run ${e.n}`:`Run ${e.n} â recording not on this host; opens scores only`,className:l?"inline-flex items-center gap-0.5 rounded border border-primary/40 px-1.5 py-0.5 text-xs text-primary hover:bg-primary/10":"inl
1ine-flex items-center gap-0.5 rounded border border-border px-1.5 py-0.5 text-xs text-muted-foreground hover:bg-accent",children:[l?"â¶":""," r",e.n]},e.n)})})}),(0,t.jsx)("td",{className:"px-2 py-2 text-right whitespace-nowrap",children:(0,t.jsx)(r.default,{href:p,className:"text-primary hover:underline",children:"open â"})})]},s)})})]})})]}),(0,t.jsxs)("div",{className:"grid gap-4 lg:grid-cols-2",children:[(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("h2",{className:"text-sm font-semibold",children:"Compare vs"}),(0,t.jsxs)("select",{value:d??"",onChange:e=>{let t=e.target.value||null;m(t),p(t)},className:"rounded-md border border-border bg-background px-2 py-1 text-xs",children:[(0,t.jsx)("option",{value:"",children:"(none)"}),b.filter(t=>t.runKey!==e).map(e=>(0,t.jsxs)("option",{value:e.runKey,children:[e.sha," · ",(0,c.formatTimestamp)(e.iso)]},e.runKey))]})]}),(0,t.jsx)(u,{compare:N}),(0,t.jsxs)("p",{className:"text-xs text-muted-foreground",children:["A move flags only when the median shifts by ⥠1 ",(0,t.jsx)("b",{children:"and"})," exceeds the run-to-run spread (the exact ",(0,t.jsx)("code",{children:"compare.ts"})," rule) â otherwise it is likely sampling noise."]})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)("h2",{className:"text-sm font-semibold",children:["Defects (",k.length,")"]}),(0,t.jsx)(h,{runKey:e,defects:k})]})]})]})}function x({byLevel:e}){let s=Object.entries(e).filter(([,e])=>e.checks>0);return s.length?(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-x-4 gap-y-1 text-xs text-muted-foreground",children:[(0,t.jsx)("span",{className:"font-medium",children:"By tier:"}),s.map(([e,s])=>(0,t.jsxs)("span",{className:"tabular-nums",children:[(0,t.jsx)("span",{className:"font-medium text-foreground",children:i.LEVEL_LABEL[e].split(" ")[0]})," ",s.infra,"/",s.checks," infra, ",s.completion,"/",s.checks," done",s.assertTotal>0&&(0,t.jsxs)(t.Fragment,{children:[", ",s.assertPass,"/",s.assertTotal," ctx+gate"]})]},e))]}):null}function u({compare:e}){return e?(0,t.jsx)("div",{className:"space-y-3",children:e.map(e=>{if("new-in-head"===e.status)return(0,t.jsxs)("div",{className:"rounded-lg border p-3 text-sm",children:[(0,t.jsx)("span",{className:"font-mono text-xs",children:e.caseId})," â new in this run (not in base)."]},e.caseId);if("missing-in-head"===e.status)return(0,t.jsxs)("div",{className:"rounded-lg border p-3 text-sm",children:[(0,t.jsx)("span",{className:"font-mono text-xs",children:e.caseId})," â present in base, missing here."]},e.caseId);let s=e.rows.filter(e=>"â REGRESSION"===e.flag||"â
improvement"===e.flag);return(0,t.jsxs)("div",{className:"rounded-lg border p-3",children:[(0,t.jsx)("div",{className:"mb-1 font-mono text-xs",children:e.caseId}),0===s.length?(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:"No flagged regressions or improvements."}):(0,t.jsx)("ul",{className:"space-y-0.5 text-sm",children:s.map(e=>(0,t.jsxs)("li",{className:"flex items-center gap-2",children:[(0,t.jsx)("span",{className:"font-mono text-xs w-8",children:e.key}),(0,t.jsxs)("span",{className:"tabular-nums",children:[e.base??"·"," â ",e.head??"·"]}),(0,t.jsx)("span",{className:"â REGRESSION"===e.flag?"text-red-600 font-medium":"text-emerald-600 font-medium",children:e.flag})]},e.key))}),e.rows.some(e=>"~ within noise"===e.flag)&&(0,t.jsxs)("p",{className:"mt-1 text-xs text-muted-foreground",children:["within noise:"," ",e.rows.filter(e=>"~ within noise"===e.flag).map(e=>`${e.key} ${e.base}â${e.head}`).join(", ")]})]},e.caseId)})}):(0,t.jsx)("div",{className:"rounded-lg border border-dashed p-4 text-sm text-muted-foreground",children:"No base run selected (or base has no report)."})}let p={high:"bg-red-100 text-red-800 dark:bg-red-900/40 dark:text-red-300",medium:"bg-amber-100 text-amber-800 dark:bg-amber-900/40 dark:text-amber-300",low:"bg-slate-100 text-slate-700 dark:bg-slate-800 dark:text-slate-300"};function h({runKey:e,defects:r}
1){let[i,m]=(0,s.useState)(null),[x,u]=(0,s.useState)(null);async function h(e,t,s){u(e),m(t=>t?{...t,[e]:{...t[e],status:s}}:t);try{if(!(await fetch(`/api/admin/bugs/${t}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({status:s})})).ok)throw Error("Update failed");n.toast.success("new"===s?"Promoted to New":"Declined as a false positive")}catch{m(i),n.toast.error("Failed to update the bug report")}finally{u(null)}}return((0,s.useEffect)(()=>{let t=!1;return fetch(`/api/admin/evals/${encodeURIComponent(e)}/defect-bugs`).then(e=>e.ok?e.json():Promise.reject(Error(`HTTP ${e.status}`))).then(e=>{t||m(e.bugs??{})}).catch(()=>{t||m({})}),()=>{t=!0}},[e]),r.length)?(0,t.jsxs)("div",{className:"space-y-2",children:[r.map(s=>(0,t.jsxs)("div",{className:"rounded-lg border p-3",children:[(0,t.jsxs)("div",{className:"flex items-start gap-2",children:[(0,t.jsx)("span",{className:`rounded px-1.5 py-0.5 text-[10px] font-bold uppercase ${p[s.severity]}`,children:s.severity}),(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsx)("p",{className:"text-sm font-medium",children:s.title}),(0,t.jsxs)("p",{className:"text-xs text-muted-foreground",children:[s.category,s.module?` \xb7 ${s.module}`:"",s.runIndex?` \xb7 r${s.runIndex}`:""," · ",(0,t.jsx)("span",{className:"font-mono",children:s.id})]}),(0,t.jsxs)("details",{className:"mt-1",children:[(0,t.jsx)("summary",{className:"cursor-pointer text-xs text-primary",children:"details"}),(0,t.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:s.description}),s.evidenceQuote&&(0,t.jsxs)("p",{className:"mt-1 border-l-2 border-border pl-2 text-xs italic text-muted-foreground",children:['"',s.evidenceQuote.replace(/\s+/g," ").trim().slice(0,400),'"']})]})]})]}),(0,t.jsxs)("div",{className:"mt-2 flex flex-wrap items-center gap-2",children:[i?.[s.id]?.status==="detected_by_eval"&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(o.Button,{size:"sm",variant:"default",disabled:x===s.id,onClick:()=>h(s.id,i[s.id].id,"new"),children:[(0,t.jsx)(l.Check,{className:"mr-1 h-3 w-3"})," Promote to New"]}),(0,t.jsxs)(o.Button,{size:"sm",variant:"outline",disabled:x===s.id,onClick:()=>h(s.id,i[s.id].id,"declined_eval"),children:[(0,t.jsx)(a.Ban,{className:"mr-1 h-3 w-3"})," Decline"]})]}),i?.[s.id]&&"detected_by_eval"!==i[s.id].status&&(0,t.jsx)("span",{className:`inline-flex items-center rounded border px-2 py-0.5 text-xs font-medium ${d.STATUS_CONFIG[i[s.id].status]?.color??"bg-muted text-muted-foreground"}`,children:d.STATUS_CONFIG[i[s.id].status]?.label??i[s.id].status}),i&&!i[s.id]&&(0,t.jsx)("span",{className:"text-xs text-muted-foreground",children:"not filed in the tracker"}),(0,t.jsx)(c.CopyButton,{text:`npx tsx evals/promote-defects.ts --runKey ${e} --approve ${s.id}`})]})]},s.id)),(0,t.jsxs)("p",{className:"text-xs text-muted-foreground",children:["Auto-filed into the bug tracker as ",(0,t.jsx)("b",{children:"Detected by eval"})," â triage here, or in"," ",(0,t.jsx)("a",{href:"/admin/bugs",className:"text-primary underline",children:"/admin/bugs"})," (promote to New, or decline). The copy button re-files a single candidate manually."]})]}):(0,t.jsx)("div",{className:"rounded-lg border border-dashed p-4 text-sm text-muted-foreground",children:"No product defects detected in this run."})}e.s(["DefectsPanel",()=>h,"EvalsRunDetail",()=>m])},630801,e=>{"use strict";var t=e.i(843476),s=e.i(271645),r=e.i(618566),n=e.i(556485),a=e.i(898491),l=e.i(392478),o=e.i(37727);function d({runKey:e,caseId:r,run:l,merged:d,onClose:c}
1){let[m,x]=(0,s.useState)(null),[u,p]=(0,s.useState)("loading"),[h,f]=(0,s.useState)(0),[g,b]=(0,s.useState)(!1),j=(0,s.useRef)(null),y=(0,s.useRef)([]),N=`/api/admin/evals/${encodeURIComponent(e)}/video?case=${encodeURIComponent(r)}&run=${l}`;(0,s.useEffect)(()=>{fetch(`/api/admin/evals/${encodeURIComponent(e)}/transcript?case=${encodeURIComponent(r)}&run=${l}`).then(e=>{if(404===e.status)return e.json().then(()=>({absent:!0}));if(!e.ok)throw Error(`HTTP ${e.status}`);return e.json()}).then(e=>{"absent"in e?p("absent"):(x(e),p("ready"))}).catch(()=>p("error"))},[e,r,l]),(0,s.useEffect)(()=>{let e=e=>{"Escape"===e.key&&c()};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[c]);let v=(0,s.useMemo)(()=>{let e;if(!m)return[];let t=new Date(m.startedAt).getTime();return m.turns.map((s,r)=>{let n,a=Math.max(0,(new Date(s.ts).getTime()-t)/1e3);return s.moduleSkillId&&s.moduleSkillId!==e&&(n=e=s.moduleSkillId),{...s,offset:a,index:r,stepBoundary:n}})},[m]),k=(0,s.useMemo)(()=>{let e=-1;for(let t=0;t<v.length;t++)if(v[t].offset<=h+.25)e=t;else break;return e},[h,v]);(0,s.useEffect)(()=>{k<0||y.current[k]?.scrollIntoView({block:"center",behavior:"smooth"})},[k]);let w=(0,s.useMemo)(()=>{let e=(m?.turns??[]).filter(e=>"assistant"===e.role&&"number"==typeof e.latencyMs).map(e=>e.latencyMs).sort((e,t)=>e-t);if(!e.length)return null;let t=t=>e[Math.min(e.length-1,Math.floor(t/100*e.length))];return{p50:(t(50)/1e3).toFixed(1),p95:(t(95)/1e3).toFixed(1)}},[m]),C=m?.signals;return(0,t.jsxs)("div",{className:"fixed inset-0 z-50 flex flex-col bg-background/95 backdrop-blur-sm",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between border-b px-4 py-2",children:[(0,t.jsxs)("h2",{className:"text-sm font-semibold",children:["Replay · ",(0,t.jsx)("span",{className:"font-mono",children:r})," · run ",l," ·"," ",(0,t.jsx)("span",{className:"font-mono",children:e.split("_")[0]})]}),(0,t.jsxs)("button",{type:"button",onClick:c,className:"inline-flex items-center gap-1 rounded-md px-2 py-1 text-sm text-muted-foreground hover:bg-accent hover:text-foreground","aria-label":"Close replay",children:[(0,t.jsx)(o.X,{className:"h-4 w-4"})," close"]})]}),"loading"===u&&(0,t.jsx)("div",{className:"flex flex-1 items-center justify-center text-sm text-muted-foreground",children:"Loading replayâ¦"}),"error"===u&&(0,t.jsx)("div",{className:"flex flex-1 items-center justify-center text-sm text-destructive",children:"Failed to load transcript."}),"absent"===u&&(0,t.jsxs)("div",{className:"flex flex-1 flex-col items-center justify-center gap-2 text-center",children:[(0,t.jsx)("p",{className:"text-sm font-medium",children:"Recording not present on this host"}),(0,t.jsxs)("p",{className:"max-w-md text-xs text-muted-foreground",children:["The transcript and video live under the gitignored ",(0,t.jsx)("code",{children:"evals/runs/"})," folder, which exists only on the machine that ran the harness. Open this dashboard there to replay the session."]})]}),"ready"===u&&m&&(0,t.jsxs)("div",{className:"grid flex-1 grid-cols-1 gap-0 overflow-hidden lg:grid-cols-2",children:[(0,t.jsxs)("div",{className:"flex flex-col gap-3 overflow-y-auto border-r p-4",children:[(0,t.jsx)("div",{className:"overflow-hidden rounded-lg border bg-black",children:g?(0,t.jsx)("div",{className:"flex aspect-video items-center justify-center p-4 text-center text-xs text-muted-foreground",children:"Video recording not present on this host (transcript still available below)."}):(0,t.jsx)("video",{ref:j,src:N,controls:!0,className:"aspect-video w-full bg-black",onTimeUpdate:e=>f(e.currentTarget.currentTime),onError:()=>b(!0)})}),(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2 text-xs",children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:"speed"}),[.5,1,2].map(e=>(0,t.jsxs)("button",{type:"button",onClick:()=>{j.current&&(j.current.playbackRate=e)},className:"rounded border border-border px-2 py-0.5 hover:bg-accent",children:[e,"Ã"]},e)),(0,t.jsx)("button",{type:"button",onClick:()=>j.current?.requestFullscreen?.(),className:"rounded border border-border px-2 py-0.5 hover:bg-accent",children:"⤢ fullscreen"})]}),(0,t.jsxs)("div",{className:"space-y-1 text-xs text-muted-foreground",children:[(0,t.jsxs)("p",{children:["turns ",m.turns.length,w&&(0,t.jsxs)(t.Fragment,{children:[" · latency p50 ",w.p50,"s / p95 ",w.p95,"s"]})]}),C&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("p",{children:["routed ",C.routedVia??"â",C.routedIntoWorkflow?` \xb7 wrapper ${C.routedLabel??"workflow"}`:""]}),(0,t.jsxs)("p",{children:["console ",C.notableErrorCount??C.consoleErrorCount??0," notable ·"," ",C.benignErrorCount??0," benign"]})]})]}),d&&(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)("p",{className:"text-xs font-medium",children:"Scores this run"}),(0,t.jsx)("div",{className:"flex flex-wrap gap-1",children:n.DIMENSION_KEYS.map(e=>{let s=d.dimensions[e];return(0,t.jsxs)("span",{className:"flex items-center gap-0.5",title:e,children:[(0,t.jsx)("span",{className:"text-[10px] text-muted-foreground",children:e}),(0,t.jsx)(a.ScoreCell,{value:s?.conservative??null,disagree:s?.agreed===!1,className:"h-5 w-5 text-[10px]"})]},e)})})]})]}),(0,t.jsxs)("div",{className:"flex flex-col overflow-hidden",children:[(0,t.jsx)("div",{className:"border-b px-4 py-2 text-xs font-medium text-muted-foreground",children:"Transcript (scroll-synced to video · click a turn to
1seek)"}),(0,t.jsx)("div",{className:"flex-1 space-y-2 overflow-y-auto p-4",children:v.map(e=>(0,t.jsxs)("div",{children:[e.stepBoundary&&(0,t.jsxs)("div",{className:"my-2 flex items-center gap-2 text-[11px] uppercase tracking-wide text-muted-foreground",children:[(0,t.jsx)("span",{className:"h-px flex-1 bg-border"}),"step: ",e.stepBoundary,(0,t.jsx)("span",{className:"h-px flex-1 bg-border"})]}),(0,t.jsxs)("div",{ref:t=>{y.current[e.index]=t},onClick:()=>{var t;let s;return t=e.offset,void((s=j.current)&&(s.currentTime=t,s.play().catch(()=>{})))},className:`cursor-pointer rounded-lg border p-2 text-sm transition-colors ${e.index===k?"border-primary bg-primary/10":"border-transparent hover:bg-accent/40"}`,title:`seek to ${i(e.offset)}`,children:[(0,t.jsxs)("div",{className:"mb-0.5 flex items-center gap-2",children:[(0,t.jsx)("span",{className:`text-[10px] font-bold uppercase ${"user"===e.role?"text-sky-600":"text-emerald-600"}`,children:"user"===e.role?"USER":"COACH"}),(0,t.jsx)("span",{className:"text-[10px] tabular-nums text-muted-foreground",children:i(e.offset)}),"assistant"===e.role&&"number"==typeof e.latencyMs&&(0,t.jsxs)("span",{className:"text-[10px] text-muted-foreground",children:["· ",(e.latencyMs/1e3).toFixed(1),"s"]})]}),(0,t.jsx)("p",{className:"whitespace-pre-wrap text-foreground/90",children:e.text})]})]},e.index))})]})]})]})}function i(e){let t=Math.floor(e/60),s=Math.floor(e%60);return`${t}:${String(s).padStart(2,"0")}`}var c=e.i(843279);function m({runKey:e,suite:o,caseSeg:i}){let c=(0,r.useRouter)(),m=(0,r.useSearchParams)(),j=`${o}/${i}`,[N,v]=(0,s.useState)(null),[k,w]=(0,s.useState)(null);(0,s.useEffect)(()=>{fetch(`/api/admin/evals/${encodeURIComponent(e)}/${encodeURIComponent(o)}/${encodeURIComponent(i)}`).then(e=>e.ok?e.json():Promise.reject(Error(`HTTP ${e.status}`))).then(e=>v(e)).catch(e=>w(String(e)))},[e,o,i]);let C=(0,s.useCallback)((e,t=!1)=>{let s=new URLSearchParams(m.toString());s.set("run",String(e)),t?s.set("replay","1"):s.delete("replay"),c.replace(`?${s.toString()}`,{scroll:!1})},[c,m]),S=(0,s.useCallback)(t=>{t!==e&&c.push(`/admin/evals/${encodeURIComponent(t)}/${encodeURIComponent(o)}/${encodeURIComponent(i)}`)},[c,e,o,i]);if(k)return(0,t.jsxs)("div",{className:"p-4 text-sm text-destructive",children:["Failed to load case: ",k]});if(!N)return(0,t.jsx)("div",{className:"p-4 text-sm text-muted-foreground",children:"Loading caseâ¦"});let E=N.caseReport.runs.map(e=>e.n),L=(0,a.parseRunFromSearch)(m.get("run"),E),A=N.merged.find(e=>e.runIndex===L)??N.merged[0]??null,I=N.assessments.find(e=>e.runIndex===L)??N.assessments[0]??null,R=A?.functional??N.caseReport.runs.find(e=>e.n===L)?.functional??null,$=N.runsAvailable.find(e=>e.run===L),_=m.has("replay"),T=(0,n.deriveLevel)(j,R?.evaluationLevel),M=N.evalsForCase??[],O=M.length>1&&M.some(t=>t.runKey===e),F=M.find(t=>t.runKey===e);return(0,t.jsxs)("div",{className:"space-y-5",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,t.jsx)(a.Breadcrumbs,{items:[{label:"Evals",href:"/admin/evals"},{label:e.split("_")[0],href:`/admin/evals/${encodeURIComponent(e)}`},{label:j}]}),(0,t.jsx)("button",{type:"button",disabled:!$?.hasVideo&&!$?.hasTranscript,onClick:()=>C(L,!0),className:"rounded-md border border-primary bg-primary/10 px-3 py-1.5 text-sm font-medium text-primary hover:bg-primary/20 disabled:cursor-not-allowed disabled:opacity-40",title:$?.hasVideo||$?.hasTranscript?"Open session replay":"Recording not present on this host",children:"â¶ Replay session"})]}),(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-x-4 gap-y-1",children:[(0,t.jsxs)("h1",{className:"text-lg font-semibold",children:[(0,t.jsx)("span",{className:"font-mono",children:j})," ",(0,t.jsx)("span",{className:"text-sm font-normal text-muted-foreground font-mono",children:e.split("_")[0]})]}),(0,t.jsx)(p,{level:T}),O&&(0,t.jsxs)("label",{className:"flex items-center gap-1 text-sm text-muted-foreground",children:["eval",(0,t.jsx)("select",{value:e,onChange:e=>S(e.target.value),title:F?.subject?`${F.sha} â ${F.subject}`:"Switch to another eval run that exercised this case",className:"max-w-[20rem] rounded-md border border-border bg-background px-2 py-0.5 font-mono text-sm",children:M.map(e=>(0,t.jsxs)("option",{value:e.runKey,children:[e.sha," · ",(0,a.formatTimestamp)(e.iso),e.runCount>1?` \xb7 ${e.runCount} runs`:""]},e.runKey))})]}),(0,t.jsxs)("label",{className:"flex items-center gap-1 text-sm text-muted-foreground",children:["run",(0,t.jsx)("select",{value:L,onChange:e=>C(Number(e.target.value)),className:"rounded-md border border-border bg-background px-2 py-0.5 text-sm",children:E.map(e=>(0,t.jsx)("option",{value:e,children:e},e))})]})]}),R&&(0,t.jsxs)("p",{className:"text-sm text-muted-foreground",children:["Difficulty ",N.difficulty??"â"," · routed ",R.routedVia??"â"," · module path"," ",(0,t.jsx)("span",{className:"font-mono",children:I?.modulePath??"â"})]}),(0,t.jsx)(x,{title:`Assessment (run ${L})`,children:I?(0,t.jsx)(f,{a:I}):(0,t.jsx)(u,{children:"No assessment for this run."})}),(0,t.jsx)(x,{title:"Functional (checklist C, deterministic)",children:R?(0,t.jsx)(b,{f:R}):(0,t.jsx)(u,{children:"No functional signals."})}),R?.nodeReports&&R.nodeReports.length>0&&(0,t.jsx)(x,{title:"Workflow assertions (context-carry + gate-enforcement, deterministic)",children:(0,t.jsx)(h,{f:R})}),(0,t.jsx)(x,{title:"Relevance (rubric A1âA10)",children:A?(0,t.jsx)(y,{merged:A,level:T}):(0,t.jsx)(u,{children:"No graded rubric for this run (skipped or not graded)."})}),(0,t.jsx)(x,{title:"Defects (benchmark candidates, NOT the bug tracker)",children:(0,t.jsx)(l.DefectsPanel,{runKey:e,defects:N.defects})}),(0,t.jsx)(x,{title:"Adjudication (human score of record)",children:(0,t.jsx)(g,{adjudications:N.adjudications??[],defectVerdicts:N.defectVerdicts??[],standing:N.standingAgreement??null,defectPrecision:N.defectPrecision??null,runKey:e})}),_&&(0,t.jsx)(d,{runKey:e,caseId:j,run:L,merged:A,onClose:()=>C(L,!1)})]})}function x({title:e,children:s}){return(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)("h2",{className:"border-b pb-1 text-sm font-semibold",children:e}),s]})}function u({children:e}){return(0,t.jsx)("div",{className:"rounded-lg border border-dashed p-4 text-sm text-muted-foreground",children:e})}function p({level:e}){return(0,t.jsx)("span",{className:"rounded-full border border-primary/40 bg-primary/10 px-2.5 py-0.5 text-xs font-medium text-primary",title:n.LEVEL_TESTS[e],children:n.LEVEL_LABEL[e]})}function h({f:e}){let s=(0,c.l2Assertions)(e),r=e.nodeReports??[];return(0,t.jsxs)("div",{className:"space-y-3 text-sm",children:[s&&(0,t.jsxs)("div",{className:"flex flex-wrap gap-x-4 gap-y-1",children:[(0,t.jsxs)("span",{className:0===s.ctxMisses.length?"text-emerald-700 dark:text-emerald-400":"text-red-700 dark:text-red-400",children:["context-carry ",s.ctxLoaded,"/",s.ctxExpected," ",0===s.ctxMisses.length?"â":`â (no handoff into: ${s.ctxMisses.join(", ")})`]}),(0,t.jsxs)("span",{className:0===s.gateViolations.length?"text-emerald-700 dark:text-emerald-400":"text-red-700 dark:text-red-400",children:["gates ",0===s.gateViolations.length?"â":`â (unenforced: ${s.gateViolations.join(", ")})`]})]}),(0,t.jsx)("div",{className:"overflow-x-auto rounded-lg border",children:(0,t.jsxs)("table",{className:"w-full border-collapse text-sm",children:[(0,t.jsx)("thead",{children:(0,t.jsxs)("tr",{className:"border-b bg-muted/40 text-xs text-muted-foreground",children:[(0,t.jsx)("th",{className:"px-3 py-2 text-left font-medium",children:"#"}),(0,t.jsx)("th",{className:"px-3 py-2 text-left font-medium",children:"node"}),(0,t.jsx)("th",{className:"px-2 py-2 text-center font-medium",children:"mandatory"}),(0,t.jsx)("th",{className:"px-2 py-2 text-center font-medium",children:"turns"}),(0,t.jsx)("th",{className:"px-2 py-2 text-center font-medium",children:"closed via"}),(0,t.jsx)("th",{className:"px-2 py-2 text-center font-medium",children:"context in"})]})}),(0,t.jsx)("tbody",{children:r.map(e=>{let s=!1===e.isOptional&&"force-api"===e.closeMethod,r=e.index>1&&!1===e.contextLoaded;return(0,t.jsxs)("tr",{className:"border-b last:border-0",children:[(0,t.jsx)("td",{className:"px-3 py-1.5 tabular-nums text-xs text-muted-foreground",children:e.index}),(0,t.jsx)("td",{className:"px-3 py-1.5 font-mono text-xs",children:e.skillId??"â"}),(0,t.jsx)("td",{className:"px-2 py-1.5 text-center text-xs",children:null===e.isOptional?"â":e.isOptional?"optional":"yes"}),(0,t.jsx)("td",{className:"px-2 py-1.5 text-center tabular-nums text-xs",children:e.turnCount}),(0,t.jsx)("td",{className:`px-2 py-1.5 text-center text-xs ${s?"font-semibold text-red-600 dark:text-red-400":""}`,children:e.closeMethod??"â"}),(0,t.jsx)("td",{className:"px-2 py-1.5 text-center text-xs",children:1===e.index?(0,t.jsx)("span",{className:"text-muted-foreground",children:"n/a (entry)"}):null===e.contextLoaded?"â":(0,t.jsx)("span",{className:r?"font-semibold text-red-600 dark:text-red-400":"text-emerald-600 dark:text-emerald-400",children:e.contextLoaded?"â":"â"})})]},e.index)})})]})})]})}function f({a:e}){return e.skipped?(0,t.jsxs)("div",{className:"rounded-lg border border-amber-300 bg-amber-50 p-3 text-sm text-amber-900 dark:border-amber-800 dark:bg-amber-950/40 dark:text-amber-200",children:[(0,t.jsxs)("b",{children:["Not graded â ",e.skipReason,"."]})," The relevance rubric was skipped (no coach transcript to grade); only the functional checklist applies."]}):(0,t.jsxs)("div",{className:"space-y-3 text-sm",children:[(0,t.jsxs)("p",{children:[(0,t.jsx)("span",{className:"font-medium text-emerald-700 dark:text-emerald-400",children:"Strong:"})," ",e.strongKeys.length?e.strongKeys.join(" "):"â",(0,t.jsx)("span",{className:"mx-3 text-muted-foreground",children:"|"}),(0,t.jsx)("span",{className:"font-medium text-amber-700 dark:text-amber-400",children:"Weak:"})," ",e.gaps.length?e.gaps.map(e=>`${e.key} (${e.score}/2)`).join(", "):"â",e.naKeys.length>0&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{className:"mx-3 text-muted-foreground",children:"|"}),(0,t.jsxs)("span",{className:"text-muted-foreground",children:["Not exercised: ",e.naKeys.join(" ")]})]})]}),e.gaps.length>0&&(0,t.jsx)("div",{className:"space-y-1",children:e.gaps.map(e=>(0,t.jsxs)("p",{className:"text-muted-foreground",children:[(0,t.jsxs)("b",{className:"text-foreground",children:[e.key," ",e.label]})," capped: ",e.justification]},e.key))}),e.splits.length>0&&(0,t.jsxs)("p",{className:"text-amber-700 dark:text-amber-400",children:["â grader split: ",e.splits.map(e=>`${e.key} (${e.detail})`).join("; "),". A split cell is the highest-value thing a human can rule on â see ",(0,t.jsx)("b",{children:"Adjudication"})," below."]})]})}function g({adjudications:e,defectVerdicts:s,standing:r,defectPrecision:a,runKey:l}){let o=new Map;for(let t of e){let e=o.get(t.dimension);(!e||t.date>=e.date)&&o.set(t.dimension,t)}let d=[...o.values()].sort((e,t)=>
1Number(e.dimension.slice(1))-Number(t.dimension.slice(1))),i=(e,t)=>t?Math.round(e/t*100):0;return(0,t.jsxs)("div",{className:"space-y-3 text-sm",children:[0===d.length&&0===s.length?(0,t.jsxs)(u,{children:["No human has ruled on this case yet, so every score above is a machine call. Both graders sit in the coach's own model family â the rubric makes them consistent, not independent, and a blind spot they share with the coach is invisible here.",(0,t.jsx)("br",{}),(0,t.jsxs)("code",{className:"mt-2 inline-block rounded bg-muted px-1.5 py-0.5 text-[11px]",children:["npx tsx evals/report/calibration.ts --runKey ",l," --emit"]})]}):null,d.length>0&&(0,t.jsx)("div",{className:"overflow-x-auto",children:(0,t.jsxs)("table",{className:"w-full text-left text-sm",children:[(0,t.jsx)("thead",{className:"text-xs text-muted-foreground",children:(0,t.jsxs)("tr",{children:[(0,t.jsx)("th",{className:"py-1 pr-3 font-medium",children:"Dim"}),(0,t.jsx)("th",{className:"py-1 pr-3 font-medium",children:"Human"}),(0,t.jsx)("th",{className:"py-1 pr-3 font-medium",children:"Graders said"}),(0,t.jsx)("th",{className:"py-1 pr-3 font-medium",children:"Reason (fed back to the graders)"}),(0,t.jsx)("th",{className:"py-1 font-medium",children:"By"})]})}),(0,t.jsx)("tbody",{children:d.map(e=>{let s=Object.values(e.graderScores).some(t=>t!==e.verdict);return(0,t.jsxs)("tr",{className:"border-t align-top",children:[(0,t.jsxs)("td",{className:"py-1.5 pr-3 font-medium",children:[e.dimension," ",(0,t.jsx)("span",{className:"text-muted-foreground",children:n.DIMENSION_LABELS[e.dimension]??""})]}),(0,t.jsx)("td",{className:"py-1.5 pr-3 font-semibold",children:e.verdict}),(0,t.jsx)("td",{className:`py-1.5 pr-3 ${s?"text-amber-700 dark:text-amber-400":"text-muted-foreground"}`,children:Object.entries(e.graderScores).map(([e,t])=>`${e} ${t}`).join("; ")||"â"}),(0,t.jsxs)("td",{className:"py-1.5 pr-3 text-muted-foreground",children:[e.reasoning,e.quote?(0,t.jsxs)("em",{className:"block opacity-80",children:["â",e.quote,"â"]}):null]}),(0,t.jsxs)("td",{className:"py-1.5 text-muted-foreground",children:[e.by,(0,t.jsx)("span",{className:"block text-[11px] opacity-70",children:e.date})]})]},e.dimension)})})]})}),s.length>0&&(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)("p",{className:"text-xs font-medium text-muted-foreground",children:"Defect candidates ruled on"}),s.map((e,s)=>(0,t.jsxs)("p",{className:"text-muted-foreground",children:[(0,t.jsx)("b",{className:e.verdict.startsWith("real")?"text-red-600 dark:text-red-400":"text-emerald-700 dark:text-emerald-400",children:e.verdict.startsWith("real")?"REAL":"FALSE"})," ",(0,t.jsxs)("span",{className:"text-foreground",children:["[",e.severity,"] ",e.category]})," â ",e.title,". ",e.reasoning]},`${e.category}-${e.date}-${s}`))]}),(0,t.jsxs)("div",{className:"rounded-md border bg-muted/40 p-2.5 text-xs text-muted-foreground",children:[(0,t.jsxs)("p",{children:[(0,t.jsx)("b",{className:"text-foreground",children:"Standing agreement:"})," ",r&&r.totalCells>0?(0,t.jsxs)(t.Fragment,{children:[r.totalCells," adjudicated cell(s) across ",r.casesAdjudicated," case(s) â"," ",Object.entries(r.perGrader).map(([e,t])=>`${e} exact ${t.exact}/${t.n} (${i(t.exact,t.n)}%), lean ${t.lean>=0?"+":""}${t.lean.toFixed(2)}`).join(" · ")||"â"]}):(0,t.jsx)(t.Fragment,{children:"never validated by a human â the grader-independence caveat is unquantified."})]}),(0,t.jsxs)("p",{className:"mt-1",children:[(0,t.jsx)("b",{className:"text-foreground",children:"Defect precision:"})," ",a&&a.total>0?(0,t.jsxs)(t.Fragment,{children:[a.real,"/",a.total," (",i(a.real,a.total),"%) of adjudicated candidates were real, across ",a.casesAdjudicated," case(s)."]}):(0,t.jsx)(t.Fragment,{children:"never validated â MEDIUM+ candidates auto-file into the bug tracker unmeasured."})]}),(0,t.jsxs)("p",{className:"mt-2 border-t pt-2",children:[(0,t.jsx)("b",{className:"text-foreground",children:"What a ruling does, and does not, fix."})," An adjudication sharpens ",(0,t.jsx)("em",{children:"this case's that dimension"})," â it is fed back into the grader prompt for this case only. It does ",(0,t.jsx)("em",{children:"not"})," generalise. When the same misreading shows up across several cases, the correct fix is to promote it into ",(0,t.jsx)("code",{children:"RUBRIC.md"})," as an anchor clarification, which fixes it everywhere at once. Nothing automates that promotion, and nothing should: spotting that three rulings are the same ruling is a judgement, and an auto-promoter would turn a run of coincidences into a permanent rubric change."]})]})]})}function b({f:e}){let s=e.notableErrorCount??e.consoleErrorCount??0,r=e.benignErrorCount??0,n=e.routedIntoWorkflow;return(0,t.jsxs)("div",{className:"space-y-2 text-sm",children:[(0,t.jsxs)("div",{className:"flex flex-wrap gap-x-4 gap-y-1",children:[(0,t.jsx)(j,{ok:e.routeLoaded,label:"route"}),(0,t.jsx)(j,{ok:e.reachedExecution,label:"execution"}),e.executionId&&(0,t.jsx)("a",{href:`/execution/${e.executionId}`,target:"_blank",rel:"noopener noreferrer",className:"text-primary underline underline-offset-2 hover:no-underline",title:"Open the module execution this run drove",children:"open session â"}),(0,t.jsx)(j,{ok:e.componentRendered,label:"component rendered"}),(0,t.jsxs)("span",{className:"text-muted-foreground",children:["notable errors ",(0,t.jsx)("b",{className:s>0?"text-red-600":"text-foreground",children:s}),r>0&&(0,t.jsxs)("span",{children:[" (",r," benign)"]})]}),(0,t.jsxs)("span",{className:"text-muted-foreground",children:["turns ",(0,t.jsx)("b",{className:"text-foreground",children:e.turnCount})]})]}),(0,t.jsxs)("p",{className:"text-muted-foreground",children:["completion:"," ",n?e.workflowCompleted?`workflow ${e.workflowCompletionMethod??"traversed"}`:`partial â ${e.workflowStopReason??"stopped"}`:e.completionProposed?"proposed":"none",n&&(0,t.jsxs)(t.Fragment,{children:[" · ","wrapper â ",e.routedLabel??"workflow",", ",e.nodesVisited??1," node(s) driven",e.nodesRejected?`, ${e.nodesRejected} pruned`:"",e.nodesForceClosed?`, ${e.nodesForceClosed} force-closed`:""]})]}),e.notableErrorSamples?.length||e.warningErrorSamples?.length?(0,t.jsxs)("details",{children:[(0,t.jsx)("summary",{className:"cursor-pointer text-xs text-primary",children:"error log"}),(0,t.jsx)("pre",{className:"mt-1 max-h-64 overflow-auto rounded bg-muted p-2 text-[11px] leading-snug whitespace-pre-wrap",children:[...e.notableErrorSamples??[],...e.warningErrorSamples??[]].join("\n\n")})]}):null]})}function j({ok:e,label:s}){return(0,t.jsxs)("span",{className:"text-muted-foreground",children:[s," ",(0,t.jsx)("span",{className:e?"text-emerald-600":"text-red-600",children:e?"ok":"â"})]})}function y({merged:e,level:r}
1){let[l,o]=(0,s.useState)(null),d=n.LEVEL_RUBRIC_SUBSET[r];return(0,t.jsxs)("div",{className:"space-y-2",children:[d&&(0,t.jsxs)("p",{className:"text-xs text-muted-foreground",children:["At ",n.LEVEL_LABEL[r]," the harness grades only ",d.join(", ")," (the tier-appropriate subset); other dimensions are ",(0,t.jsx)("span",{className:"italic",children:"N/A at this tier"}),", not weaknesses. The full A1âA10 rubric is judged at L4 e2e."]}),(0,t.jsx)("div",{className:"overflow-hidden rounded-lg border",children:(0,t.jsxs)("table",{className:"w-full border-collapse text-sm",children:[(0,t.jsx)("thead",{children:(0,t.jsxs)("tr",{className:"border-b bg-muted/40 text-xs text-muted-foreground",children:[(0,t.jsx)("th",{className:"px-3 py-2 text-left font-medium",children:"dim"}),(0,t.jsx)("th",{className:"px-3 py-2 text-left font-medium",children:"dimension"}),(0,t.jsx)("th",{className:"px-2 py-2 text-center font-medium",children:"score"}),(0,t.jsx)("th",{className:"px-2 py-2 text-center font-medium",children:"graders"}),(0,t.jsx)("th",{className:"px-3 py-2 text-left font-medium",children:"evidence"})]})}),(0,t.jsx)("tbody",{children:n.DIMENSION_KEYS.map(s=>{let r=e.dimensions[s];if(d&&!d.includes(s)&&(!r||null===r.conservative))return(0,t.jsxs)("tr",{className:"border-b align-top text-muted-foreground",children:[(0,t.jsx)("td",{className:"px-3 py-2 font-mono text-xs",children:s}),(0,t.jsx)("td",{className:"px-3 py-2",children:n.DIMENSION_LABELS[s]}),(0,t.jsx)("td",{className:"px-2 py-2 text-center",children:(0,t.jsx)(a.ScoreCell,{value:null})}),(0,t.jsx)("td",{className:"px-2 py-2 text-center text-xs",colSpan:2,children:"N/A at this tier"})]},s);if(!r)return null;let i=Object.entries(r.perGrader??{}),c=!1===r.agreed,m=l===s,x=i.reduce((e,[t,s])=>("NA"===s.score?99:Number(s.score))<(e?"NA"===e[1].score?99:Number(e[1].score):100)?[t,s]:e,null);return(0,t.jsx)(v,{dimKey:s,cell:r,graders:i,split:c,isOpen:m,onToggle:()=>o(m?null:s),limitingQuote:x?.[1].evidenceQuote??""},s)})})]})})]})}function N(e){return e.includes("sonnet")?"sonnet":e.includes("gemini")?"gemini":e.split("/").pop()??e}function v({dimKey:e,cell:s,graders:r,split:l,isOpen:o,onToggle:d,limitingQuote:i}){return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("tr",{className:"cursor-pointer border-b align-top hover:bg-accent/30",onClick:d,children:[(0,t.jsx)("td",{className:"px-3 py-2 font-mono text-xs",children:e}),(0,t.jsx)("td",{className:"px-3 py-2",children:n.DIMENSION_LABELS[e]}),(0,t.jsx)("td",{className:"px-2 py-2 text-center",children:(0,t.jsx)(a.ScoreCell,{value:s.conservative,disagree:l})}),(0,t.jsxs)("td",{className:"px-2 py-2 text-center text-xs tabular-nums",children:[r.map(([e,t])=>`${N(e)} ${t.score}`).join(" / "),l&&(0,t.jsx)("span",{className:"ml-1 text-amber-600",children:"split"})]}),(0,t.jsx)("td",{className:"px-3 py-2 text-xs text-muted-foreground",children:i?`"${i.replace(/\s+/g," ").trim().slice(0,80)}â¦"`:"â"})]}),o&&(0,t.jsx)("tr",{className:"border-b bg-muted/20",children:(0,t.jsx)("td",{colSpan:5,className:"px-4 py-3",children:(0,t.jsx)("div",{className:"grid gap-3 md:grid-cols-2",children:r.map(([e,s])=>(0,t.jsxs)("div",{className:"rounded border bg-card p-2",children:[(0,t.jsxs)("p",{className:"mb-1 text-xs font-semibold",children:[N(e)," · score ",s.score]}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:s.justification}),s.evidenceQuote&&(0,t.jsxs)("p",{className:"mt-1 border-l-2 border-border pl-2 text-xs italic text-muted-foreground",children:['"',s.evidenceQuote.replace(/\s+/g," ").trim().slice(0,300),'"']})]},e))})})})]})}e.s(["EvalsCaseDetail",()=>m],630801)}]);
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.