1import{j as e,r as i}from"./entry-BCe1jibU.js";import{A as P,a as j}from"./adminView-DkbsldBq.js";import{A as F}from"./adminLayout-OU-AekOj.js";import{u as q,g as Q}from"./graphql-CbYyICyY.js";import{m as V,a as k}from"./types-CLw4uLQj.js";import{t as _}from"./bundle-mjs-CSqCgoPn.js";import"./pathPrefix-DU8I2oCO.js";import"./types-CjJu7saM.js";import"./auth-CgkXDIO7.js";import"./EvalCloneMarker-DeoTUGFR.js";import"./graphql-4Y3Cu4kt.js";import"./operations-Dn0xY-u2.js";import"./session-C75oaowB.js";import"./identity-X0DTFeA9.js";import"./Identity-QN8NXWkM.js";import"./billing-XWNTP5pu.js";import"./speechToText-BOPKEWM6.js";import"./shellCache-Br8NUPQk.js";import"./icons-B6i7AQrN.js";import"./index-pNUg2pyP.js";const B=Q` 2 query OperationsSelfImprovementDashboardQuery( 3 $startDate: String! 4 $endDate: String! 5 $limit: Int! 6 $offset: Int! 7 $signalSource: String 8 $classification: String 9 $outcome: String 10 $managedAgentType: String 11 ) { 12 admin { 13 selfImprovementDashboard( 14 startDate: $startDate 15 endDate: $endDate 16 limit: $limit 17 offset: $offset 18 signalSource: $signalSource 19 classification: $classification 20 outcome: $outcome 21 managedAgentType: $managedAgentType 22 ) { 23 pipelineEnabled 24 sandboxEnabled 25 summary { 26 total 27 failedTasks 28 failedCriticalTasks 29 onlineQualityFailures 30 duplicate 31 promptBehavior 32 } 33 rows { 34 id 35 signalSource 36 sourceSubTaskId 37 managedAgentType 38 qualityFailureCount 39 outcome 40 classification 41 classifierSuggestedClassification 42 classificationConfidence 43 classificationDecisionReason 44 classificationEvidenceEventIndexes 45 classificationMissingEvidenceCodes 46 classifierEvidenceEventCount 47 classifierVersion 48 classifierModel 49 classifierProvider 50 classificationOrigin 51 classifierRepresentativeSignalId 52 createdAt 53 } 54 hasMore 55 } 56 } 57 } 58`,b=[{key:"24h",label:"24h",hours:24},{key:"7d",label:"7d",hours:7*24},{key:"30d",label:"30d",hours:30*24}],f=25,C={prompt_behavior:"Prompt behavior",settings_or_auth:"Settings or auth",provider_or_infra:"Provider or infra",code_bug:"Code bug",insufficient_evidence:"Insufficient evidence"},W={received:"Received",duplicate:"Duplicate",classified:"Classified",scheduled:"Scheduled"},H={accepted:"High-confidence classification with indexed supporting evidence.",classifier_abstained:"The classifier abstained because the evidence was inconclusive.",low_confidence:"The proposed cause was downgraded because confidence was not high.",missing_supporting_event:"The proposed cause was downgraded because no valid supporting event was cited.",missing_supporting_llm_decision:"Prompt behavior was downgraded because no supporting LLM decision was cited.",no_llm_decision:"The execution contained no relevant LLM decision to classify."},K={direct_supporting_event:"A direct supporting event",llm_decision:"The relevant LLM decision",relevant_tool_result:"The relevant tool result",tool_availability:"Tool availability or health",credential_or_permission_state:"Credential or permission state",configuration_state:"Relevant configuration state",provider_or_infrastru
58cture_status:"Provider or infrastructure status",application_error_details:"Application error details",task_context:"Task context needed to judge the decision",single_dominant_cause:"Evidence for one dominant cause"};function U(s){return new Date(s).toLocaleString("en-US",{month:"short",day:"numeric",hour:"numeric",minute:"2-digit"})}function o({label:s,value:l,detail:n}){return e.jsxs("div",{className:"rounded-xl border border-slate-5 bg-slate-2 px-4 py-4",children:[e.jsx("div",{className:"text-[11px] font-semibold uppercase tracking-[0.12em] text-slate-9",children:s}),e.jsx("div",{className:"mt-2 text-2xl font-semibold tabular-nums text-slate-12",children:l}),e.jsx("div",{className:"mt-1 text-xs text-slate-10",children:n})]})}function N({label:s,enabled:l}){return e.jsxs("div",{className:"flex items-center gap-2 text-xs text-slate-11",children:[e.jsx("span",{className:_("size-2 rounded-full",l?"bg-green-9":"bg-slate-7"),"aria-hidden":!0}),e.jsx("span",{children:s}),e.jsx("span",{className:"text-slate-9",children:l?"On":"Off"})]})}function z(){return e.jsxs("details",{className:"group rounded-xl border border-slate-5 bg-slate-2",children:[e.jsxs("summary",{className:"cursor-pointer list-none px-4 py-3.5 text-sm font-semibold text-slate-12 [&::-webkit-details-marker]:hidden",children:["How classification works",e.jsx("span",{className:"ml-2 text-xs font-normal text-slate-9 group-open:hidden",children:"View decision policy"}),e.jsx("span",{className:"ml-2 hidden text-xs font-normal text-slate-9 group-open:inline",children:"Hide decision policy"})]}),e.jsxs("div",{className:"grid gap-4 border-t border-slate-5 px-4 py-4 text-xs leading-relaxed text-slate-11 md:grid-cols-2",children:[e.jsxs("div",{children:[e.jsx("div",{className:"font-semibold text-slate-12",children:"Evidence"}),e.jsx("p",{className:"mt-1",children:"Up to 40 recent task events, the latest LLM decision, structured tool and framework errors, and any failed quality-scorer verdicts."})]}),e.jsxs("div",{children:[e.jsx("div",{className:"font-semibold text-slate-12",children:"Decision order"}),e.jsx("p",{className:"mt-1",children:"Direct settings, authentication, provider, infrastructure, validation, and code evidence takes priority over an inferred prompt problem."})]}),e.jsxs("div",{children:[e.jsx("div",{className:"font-semibold text-slate-12",children:"Admission threshold"}),e.jsx("p",{className:"mt-1",children:"Every cause requires high confidence and an indexed supporting event. Prompt behavior must specifically cite an LLM decision. Otherwise the effective result is insufficient evidence."})]}),e.jsxs("div",{children:[e.jsx("div",{className:"font-semibold text-slate-12",children:"Reuse"}),e.jsx("p",{className:"mt-1",children:"A verdict is reused only when the bounded evidence is identical. Each row shows the effective result, structured rationale, model, version, and evidence indexes."})]})]})]})}function h({label:s,value:l,onChange:n,children:m}){return e.jsxs("label",{className:"flex min-w-0 flex-1 flex-col gap-1 text-[11px] font-semibold uppercase tracking-[0.1em] text-slate-9 sm:min-w-44 sm:flex-none",children:[s,e.jsx("select",{value:l,onChange:n,className:"h-9 rounded-md border border-slate-5 bg-slate-2 px-3 text-sm font-normal normal-case tracking-normal text-slate-12 outline-none focus:border-slate-7",children:m})]})}function y(s){return s?C[s]??s:"Not recorded"}function S(s){return s?H[s]??"The classifier recorded an unknown decision code.":"No structured decision rationale was retained for this signal."}function G({row:s}){const l=s.classificationOrigin==="cache",n=l?"Reused identical evidence":s.classificationOrigin==="fresh"?"Fresh judgment":"Not recorded",m=s.classifierSuggestedClassification!=null&&s.classifierSuggestedClassification!==s.classification,x=s.classificationEvidenceEventIndexes.length?s.classificationEvidenceEventIndexes.map(u=>`#${u}`).join(", "):"No supporting event indexes recorded";return e.jsxs("details",{className:"group",children:[e.jsxs("summary",{className:"grid cursor-pointer list-none grid-cols-1 gap-2 px-4 py-3.5 transition-colors hover:bg-slate-3/60 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-[-2px] focus-visible:outline-slate-7 md:grid-cols-[150px_150px_140px_minmax(0,1fr)_120px] md:items-center md:gap-4 [&::-webkit-details-marker]:hidden",children:[e.jsx("span",{className:"text-xs tabular-nums text-slate-9",children:U(s.createdAt)}),e.jsx("span",{className:"text-xs font-medium text-slate-11",children:s.signalSource==="task_failure"?"Task failure":`Quality failure · ${s.qualityFailureCount}`}),e.jsx("span",{className:"truncate text-xs text-slate-10",children:k[s.managedAgentType]??s.managedAgentType}),e.jsxs("span",{className:"min-w-0",children:[e.jsx("span",{className:"block text-xs font-medium text-slate-12",children:s.classification?y(s.classification):"Awaiting classification"}),s.classificationDecisionReason?e.jsx("span",{className:"mt-0.5 block truncate text-xs text-slate-9",children:S(s.classificationDecisionReason)}):null]}),e.jsxs("span",{className:"text-xs capitalize text-slate-10",children:[s.outcome.replace("_"," "),e.jsx("span",{className:"mt-0.5 block text-[11px] normal-case text-slate-9 group-open:hidden",children:"View details"}),e.jsx("span",{className:"mt-0.5 hidden text-[11px] normal-case text-slate-9 group-open:block",children:"Hide details"})]})]}),e.jsxs("div",{className:"border-t border-slate-5 bg-slate-1/40 px-4 py-4",children:[e.jsxs("dl",{className:"grid grid-cols-1 gap-x-6 gap-y-4 text-xs sm:grid-cols-2 lg:grid-cols-4",children:[e.jsxs("div",{className:"sm:col-span-2 lg:col-span-4",children:[e.jsx("dt",{className:"font-semibold text-slate-10",children:"Decision rationale"}),e.jsx("dd",{className:"mt-1 leading-relaxed text-slate-12",children:S(s.classificationDecisionReason)})]}),e.jsxs("div",{children:[e.jsx("dt",{className:"font-semibold text-slate-10",children:"Model confidence"}),e.jsx("dd",{className:"mt-1 capitalize text-slate-12",children:s.classificationConfidence??"Not recorded"})]}),e.jsxs("div",{children:[e.jsx("dt",{className:"font-semibold text-slate-10",children:"Classifier"}),e.jsxs("dd",{className:"mt-1 text-slate-12",children:[s.classifierModel??"Not recorded",s.classifierProvider?` · ${s.classifierProvider}`:"",s.classifierVersion?` · v${s.classifierVersion}`:""]})]}),e.jsxs("div",{children:[e.jsx("dt",{className:"font-semibold text-slate-10",children:"Decision source"}),e.jsx("dd",{className:"mt-1 text-slate-12",children:n})]}),e.jsxs("div",{children:[e.jsx("dt",{className:"font-semibold text-slate-10",children:"Evidence window"}),e.jsx("dd",{className:"mt-1 text-slate-12",children:s.classifierEvidenceEventCount==null?"Not recorded":`${s.classifierEvidenceEventCount} events`})]}),e.jsxs("div",{className:"sm:col-span-2",children:[e.jsx("dt",{className:"font-semibold text-slate-10",children:"Supporting events"}),e.jsx("dd",{className:"mt-1 text-slate-12",children:x})]}),e.jsxs("div",{className:"sm:col-span-2",children:[e.jsx("dt",{className:"font-semibold text-slate-10",children:"Missing evidence"}),e.jsx("dd",{className:"mt-1 text-slate-12",children:s.classificationMissingEvidenceCodes.length?s.classificationMissingEvidenceCodes.map(u=>K[u]??"Unknown evidence requirement").join(" · "):"None reported"})]}),m?e.jsxs("div",{className:"sm:col-span-2 lg:col-span-4",children:[e.jsx("dt",{className:"font-semibold text-slate-10",children:"Conservative downgrade"}),e.jsxs("dd",{className:"mt-1 text-slate-12",children:["The model suggested"," ",y(s.classifierSuggestedClassification),", but the evidence did not meet the threshold for an automatic prompt investigation."]})]}):null,l&&s.classifierRepresentativeSignalId?e.jsxs("div",{className:"sm:col-span-2 lg:col-span-4",children:[e.jsx("dt",{className:"font-semibold text-slate-10",children:"Representative signal"}),e.jsx("dd",{className:"mt-1 break-all font-mono text-slate-12",children:s.classifierRepresentativeSignalId})]}):null]}),e.jsx("div",{className:"mt-4 border-t border-slate-5 pt-3",children:e.jsx("a",{href:`/admin/subtask/${s.sourceSubTaskId}`,className:"text-xs font-medium text-blue-10 hover:underline",children:"Open source subtask"})})]})]})}function Z(){const[s,l]=i.useState("7d"),[n,m]=i.useState(""),[x,u]=i.useState(""),[g,E]=i.useState(""),[v,A]=i.useState(""),[p,r]=i.useState(0),T=i.useMemo(()=>{const t=b.find(R=>R.key===s)??b[1],d=new Date;return{startDate:new Date(d.getTime()-t.hours*60*60*1e3).toISOString(),endDate:d.toISOString(),limit:f,offset:p,signalSource:n||null,classification:x||null,outcome:g||null,managedAgentType:v||null}},[x,v,p,g,n,s]),c=q(B,T),D=i.useCallback(t=>{l(t.currentTarget.dataset.windowKey),r(0)},[]),w=i.useCallback(t=>{m(t.currentTarget.value),r(0)},[]),I=i.useCallback(t=>{u(t.currentTarget.value),r(0)},[]),L=i.useCallback(t=>{A(t.currentTarget.value),r(0)},[]),$=i.useCallback(t=>{E(t.currentTarget.value),r(0)},[]),O=i.useCallback(()=>r(t=>Math.max(0,t-f)),[]),M=i.useCallback(()=>r(t=>t+f),[]);if(c.loading&&!c.data)return e.jsx(P,{});if(c.error&&!c.data)return e.jsx(j,{message:c.error,onRetry:c.refetch});const a=c.data?.admin.selfImprovementDashboard;return a?e.jsxs("div",{className:"mx-auto flex w-full max-w-[1240px] flex-col gap-7",children:[e.jsxs("header",{className:"flex flex-col gap-4 border-b border-slate-4 pb-5 sm:flex-row sm:items-start sm:justify-between",children:[e.jsxs("div",{children:[e.jsx("div",{className:"text-[11px] font-semibold uppercase tracking-[0.14em] text-slate-9",children:"Reliability"}),e.jsx("h1",{className:"mt-1 text-[26px] font-semibold tracking-tight text-slate-12",children:"Failed task signals"}),e.jsx("p",{className:"mt-1 max-w-xl text-sm leading-relaxed text-slate-10",children:"Track failed task and online-quality signals from detection through classification and investigation."})]}),e.jsxs("div",{className:"flex flex-col gap-2 rounded-lg border border-slate-4 bg-slate-2 px-3.5 py-3",children:[e.jsx(N,{label:"Signal processing",enabled:a.pipelineEnabled}),e.jsx(N,{label:"Automatic investigations",enabled:a.sandboxEnabled})]})]}),e.jsx(z,{}),e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsx("h2",{className:"text-sm font-semibold text-slate-12",children:"Signal overview"}),e.jsx("div",{className:"flex rounded-md border border-slate-4 bg-slate-2 p-0.5",children:b.map(t=>e.jsx("button",{type:"button","data-window-key":t.key,onClick:D,className:_("rounded px-2.5 py-1 text-xs font-medium",s===t.key?"bg-slate-4 text-slate-12":"text-slate-9 hover:text-slate-12"),children:t.label},t.key))})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-3 lg:grid-cols-6",children:[e.jsx(o,{label:"All signals",value:a.summary.total,detail:"Eligible receipts"}),e.jsx(o,{label:"Failed",value:a.summary.failedTasks,detail:"Task failure signals"}),e.jsx(o,{label:"Failed critical",value:a.summary.failedCriticalTasks,detail:"Critical task signals"}),e.jsx(o,{label:"Quality failures",value:a.summary.onlineQualityFailures,detail:"Failed scorer verdicts"}),e.jsx(o,{label:"Prompt behavior",value:a.summary.promptBehavior,detail
58:"Classified for prompts"}),e.jsx(o,{label:"Duplicates",value:a.summary.duplicate,detail:"Known failure shapes"})]}),e.jsxs("section",{className:"flex flex-col gap-4",children:[e.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-end sm:justify-between",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-sm font-semibold text-slate-12",children:"Signal inbox"}),e.jsx("p",{className:"mt-1 text-xs text-slate-9",children:"Each row is a retained 90-day processing receipt."})]}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.jsxs(h,{label:"Source",value:n,onChange:w,children:[e.jsx("option",{value:"",children:"All sources"}),e.jsx("option",{value:"task_failure",children:"Task failure"}),e.jsx("option",{value:"online_quality",children:"Online quality"})]}),e.jsxs(h,{label:"Classification",value:x,onChange:I,children:[e.jsx("option",{value:"",children:"All classifications"}),Object.entries(C).map(([t,d])=>e.jsx("option",{value:t,children:d},t))]}),e.jsxs(h,{label:"Outcome",value:g,onChange:$,children:[e.jsx("option",{value:"",children:"All outcomes"}),Object.entries(W).map(([t,d])=>e.jsx("option",{value:t,children:d},t))]}),e.jsxs(h,{label:"Agent",value:v,onChange:L,children:[e.jsx("option",{value:"",children:"All agents"}),V.map(t=>e.jsx("option",{value:t,children:k[t]},t))]})]})]}),e.jsxs("div",{className:"overflow-hidden rounded-xl border border-slate-5 bg-slate-2",children:[e.jsxs("div",{className:"hidden grid-cols-[150px_150px_140px_minmax(0,1fr)_120px] gap-4 border-b border-slate-5 px-4 py-2.5 text-[11px] font-semibold uppercase tracking-[0.1em] text-slate-9 md:grid",children:[e.jsx("span",{children:"Detected"}),e.jsx("span",{children:"Source"}),e.jsx("span",{children:"Agent"}),e.jsx("span",{children:"Classification"}),e.jsx("span",{children:"Outcome"})]}),a.rows.length===0?e.jsx("div",{className:"px-4 py-12 text-center text-sm text-slate-9",children:"No self-improvement signals match this view."}):e.jsx("div",{className:"divide-y divide-slate-5",children:a.rows.map(t=>e.jsx(G,{row:t},t.id))})]}),e.jsxs("div",{className:"flex items-center justify-between text-xs text-slate-9",children:[e.jsx("span",{children:a.summary.total===0?"0 signals":`${p+1}â${Math.min(p+f,a.summary.total)} of ${a.summary.total}`}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx("button",{type:"button",disabled:p===0,onClick:O,className:"rounded-md border border-slate-5 px-3 py-1.5 text-slate-11 disabled:opacity-40",children:"Previous"}),e.jsx("button",{type:"button",disabled:!a.hasMore,onClick:M,className:"rounded-md border border-slate-5 px-3 py-1.5 text-slate-11 disabled:opacity-40",children:"Next"})]})]})]})]}):e.jsx(j,{message:"Failed task signal data is unavailable."})}function ve(){return e.jsx(F,{title:"Failed task signals",hideTitle:!0,children:e.jsx(Z,{})})}export{ve as View};
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.