PageSourceSearch

https://cresla.ai/assets/OperatingBrainPage-DB-RA1Eo.js

js cresla.ai collected 2026-10-05 11:58:56 UTC 30,981 bytes, 37 lines download raw bytes

1import{j as e,r as h,u as G}from"./vendor-query-J00DIBcE.js";import{c as v,w as W,y as K,z as Q,ah as J,H as Y,aa as N,B as y,a8 as X,ar as Z,C as ee,L as w,Y as re,p as te,S as L,l as T,m as D,n as V,o as P,x as se,E as ie}from"./index-B3ZlzEWD.js";import{S as ne,b as ae,d as oe,e as ce,f as de}from"./sheet-CPGi3j0-.js";import{B as le}from"./badge-DAUjQRt7.js";import{L as pe}from"./lock-keyhole-CzPHFWzU.js";import{C as ue}from"./copy-DvOYicAs.js";import{W as me}from"./wrench-BmmqG_uq.js";import{B as he}from"./book-open-CnTRDQ3Q.js";import{a as xe}from"./AdminSupport-BRCSrXg1.js";import{C as O}from"./chevron-right-QJOe4PqW.js";import{A as fe}from"./arrow-right-MMG-Gi6q.js";import{P as ge}from"./play-BX-IPSOD.js";import{P as ve}from"./pause-CK-IWgnD.js";import"./vendor-ui-CVP04gIJ.js";import"./MessageBubble-tJWTTQ7_.js";import"./banknote-Cckfb_BE.js";import"./credit-card-B98_EQGf.js";import"./clock-CaV97cIf.js";import"./DmAvatar-BfpY3G4L.js";import"./dropdown-menu-DQHyBtjf.js";import"./useSupportAlertEngine-B2bgekHO.js";import"./pencil-CPZ8HiTP.js";import"./trash-2-939pZxih.js";import"./devIssues-BR_EfDVi.js";import"./owners-DUns8uu5.js";import"./supportDrafts-D-RLpCNY.js";import"./messages-square-BWcIJ2JV.js";import"./bureauDisplayOrder-ChaMCVuH.js";import"./link-2-CupeNNao.js";import"./skeleton-BGoMwMsw.js";import"./formatDistanceToNow-CnAMXL8F.js";import"./format-Cjmg7hXF.js";import"./differenceInMilliseconds-D3SHoG6j.js";import"./chevron-left-gQsUbxpu.js";import"./send-8r23B0TE.js";import"./search-1peXtAyN.js";import"./arrow-up-BZZgn7ki.js";import"./user-check-BYVwbTl6.js";import"./flame-cg7EZvq7.js";import"./undo-2-CiQWAX3v.js";import"./star-CCdmtuFi.js";import"./zap-QJ2tPuy-.js";import"./plus-Cls1xk49.js";import"./phone-BTPAY6WR.js";import"./gauge-CpCIh41f.js";/**
2 * @license lucide-react v0.453.0 - ISC
3 *
4 * This source code is licensed under the ISC license.
5 * See the LICENSE file in the root directory of this source tree.
6 */const be=v("CircleDashed",[["path",{d:"M10.1 2.182a10 10 0 0 1 3.8 0",key:"5ilxe3"}],["path",{d:"M13.9 21.818a10 10 0 0 1-3.8 0",key:"11zvb9"}],["path",{d:"M17.609 3.721a10 10 0 0 1 2.69 2.7",key:"1iw5b2"}],["path",{d:"M2.182 13.9a10 10 0 0 1 0-3.8",key:"c0bmvh"}],["path",{d:"M20.279 17.609a10 10 0 0 1-2.7 2.69",key:"1ruxm7"}],["path",{d:"M21.818 10.1a10 10 0 0 1 0 3.8",key:"qkgqxc"}],["path",{d:"M3.721 6.391a10 10 0 0 1 2.7-2.69",key:"1mcia2"}],["path",{d:"M6.391 20.279a10 10 0 0 1-2.69-2.7",key:"1fvljs"}]]);/**
7 * @license lucide-react v0.453.0 - ISC
8 *
9 * This source code is licensed under the ISC license.
10 * See the LICENSE file in the root directory of this source tree.
11 */const ye=v("Clipboard",[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}]]);/**
12 * @license lucide-react v0.453.0 - ISC
13 *
14 * This source code is licensed under the ISC license.
15 * See the LICENSE file in the root directory of this source tree.
16 */const je=v("Cpu",[["rect",{width:"16",height:"16",x:"4",y:"4",rx:"2",key:"14l7u7"}],["rect",{width:"6",height:"6",x:"9",y:"9",rx:"1",key:"5aljv4"}],["path",{d:"M15 2v2",key:"13l42r"}],["path",{d:"M15 20v2",key:"15mkzm"}],["path",{d:"M2 15h2",key:"1gxd5l"}],["path",{d:"M2 9h2",key:"1bbxkp"}],["path",{d:"M20 15h2",key:"19e6y8"}],["path",{d:"M20 9h2",key:"19tzq7"}
16],["path",{d:"M9 2v2",key:"165o2o"}],["path",{d:"M9 20v2",key:"i2bqo8"}]]);/**
17 * @license lucide-react v0.453.0 - ISC
18 *
19 * This source code is licensed under the ISC license.
20 * See the LICENSE file in the root directory of this source tree.
21 */const we=v("GitBranch",[["line",{x1:"6",x2:"6",y1:"3",y2:"15",key:"17qcm7"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M18 9a9 9 0 0 1-9 9",key:"n2h4wq"}]]);/**
22 * @license lucide-react v0.453.0 - ISC
23 *
24 * This source code is licensed under the ISC license.
25 * See the LICENSE file in the root directory of this source tree.
26 */const ke=v("ListTodo",[["rect",{x:"3",y:"5",width:"6",height:"6",rx:"1",key:"1defrl"}],["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["path",{d:"M13 6h8",key:"15sg57"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 18h8",key:"oe0vm4"}]]);/**
27 * @license lucide-react v0.453.0 - ISC
28 *
29 * This source code is licensed under the ISC license.
30 * See the LICENSE file in the root directory of this source tree.
31 */const Ne=v("Power",[["path",{d:"M12 2v10",key:"mnfbl"}],["path",{d:"M18.4 6.6a9 9 0 1 1-12.77.04",key:"obofu9"}]]);/**
32 * @license lucide-react v0.453.0 - ISC
33 *
34 * This source code is licensed under the ISC license.
35 * See the LICENSE file in the root directory of this source tree.
36 */const Ce=v("RefreshCcw",[["path",{d:"M21 12a9 9 0 0 0-9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"14sxne"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M3 12a9 9 0 0 0 9 9 9.75 9.75 0 0 0 6.74-2.74L21 16",key:"1hlbsb"}],["path",{d:"M16 16h5v5",key:"ccwih5"}]]),F=[{id:"github",name:"GitHub",purpose:"Authoritative source and proposed changes.",requiredAccess:["Authorized access to the exact repository","Verified workflow permissions"],verificationSteps:["Confirm repository identity and read access","Verify least-privilege proposal workflow access"],blockedReason:"Application-specific repository access and workflow permissions have not been verified.",setupInstructions:"Authorize the correct repository, then verify its identity and least-privilege workflow permissions. A GitHub account connected to Replit does not prove that the Cresla application can access the required repository or workflows."},{id:"staging",name:"Isolated staging",purpose:"A safe, isolated execution target.",requiredAccess:["Staging application","Isolated database and storage","Controlled outbound services, schedules, and analytics"],verificationSteps:["Prove isolation from production resources","Confirm outbound calls are deny-by-default or safely redirected"],blockedReason:"No isolated staging target has been verified.",setupInstructions:"Provide non-secret resource aliases and prove database, storage, outbound service, schedule, and analytics isolation."},{id:"runner",name:"Test runner and CI",purpose:"Repeatable browser and code checks with fresh artifacts.",requiredAccess:["Isolated CI runner","Artifact storage scoped to test runs"],verificationSteps:["Run a harmless fixture check","Verify fresh, attributable, sanitized artifacts"],blockedReason:"No test runner or CI execution boundary is configured.",setupInstructions:"Evaluate Playwright and GitHub Actions as candidates, connect an isolated runner and artifact store, then verify a harmless fixture run."},{id:"browsers",name:"Chrome and Safari coverage",purpose:"Record truthful browser, device, and emulation evidence.",requiredAccess:["Chrome test target","Safari or clearly labeled WebKit target","Device identity metadata"],verificationSteps:["Record browser, OS, version, and device identity","Distinguish real devices from emulation"],blockedReason:"No browser evidence provider has been verified.",setupInstructions:"Connect browser targets and preserve exact browser, OS, version, device, and emulation metadata."},{id:"repair",name:"AI repair service",purpose:"Investigate failures and prepare reviewable patches.",requiredAccess:["Approved model service","Isolated proposal branch permissions"],verificationSteps:["Verify model identity where available","Prove proposals cannot publish or self-approve"],blockedReason:"No repair service or patch authority boundary is configured; a model connection is not a worker controller.",setupInstructions:"Evaluate the chosen Codex/OpenAI integration as a candidate and constrain it to isolated, review-only patch proposals. Verify orchestration and controller authority separately from model access."},{id:"controller",name:"Worker controller",purpose:"Schedule work and enforce retries, concurrency, cancellation, and budgets.",requiredAccess:["Independent controller","Cancellation and budget enforcement"],verificationSteps:["Verify durable scheduling and freshness reporting","Test independent cancellation without customer effects"],blockedReason:"No independent controller or enforcement path exists.",setupInstructions:"Connect a controller with independently enforced limits, cancellation, and an emergency path."},{id:"sentry",name:"Sentry",purpose:"Receive diagnostic signals; Seer remains a separate optional capability.",requiredAccess:["Read-only sanitized diagnostic project access"],verificationSteps:["Confirm project identity","Verify data minimization and read-only permissions"],blockedReason:"No diagnostic project access has been configured or verified.",setupInstructions:"Grant read-only access to the intended project and verify identity and sanitization."},{id:"memory",name:"Memory and private artifacts",purpose:"Store approved knowledge and sanitized run evidence durably.",requiredAccess:["Access-controlled durable storage","Retention and deletion policy"],verificationSteps:["Verify access controls and resource identity","Verify retention, provenance, and sanitization"],blockedReason:"No durable memory or private artifact store is configured.",setupInstructions:"Choose access-controlled storage and approve retention, provenance, sanitization, and deletion rules."}],Se=r=>({not_configured:"Not configured",verification_pending:"Configured — verification pending",verified:"Verified",error:"Error"})[r];function I({state:r}){return e.jsx(le,{variant:"outline",className:N("font-medium",r==="verified"&&"border-primary/40 bg-primary/10 text-primary",r==="error"&&"border-red-500/40 text-red-400"),children:Se(r)})}
36function p({title:r,description:t,children:i,className:a}){return e.jsxs(W,{className:N("led-card rounded-2xl",a),children:[e.jsxs(K,{className:"pb-3",children:[e.jsx(Q,{className:"text-base",children:r}),t&&e.jsx(J,{children:t})]}),e.jsx(Y,{children:i})]})}function Re({value:r,label:t="Copy instructions"}){const[i,a]=h.useState("idle"),n=async()=>{try{await navigator.clipboard.writeText(r),a("ok")}catch{a("failed")}window.setTimeout(()=>a("idle"),2200)};return e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs(y,{type:"button",size:"sm",variant:"outline",onClick:n,children:[e.jsx(ue,{className:"mr-2 h-3.5 w-3.5"}),i==="ok"?"Copied":t]}),e.jsx("span",{className:"text-xs text-muted-foreground",role:"status","aria-live":"polite",children:i==="ok"?"Copied to clipboard.":i==="failed"?"Could not copy. Select the text manually.":""})]})}function z({children:r}){return e.jsxs("p",{className:"flex gap-2 rounded-lg border border-border/70 bg-muted/30 p-3 text-sm text-muted-foreground",children:[e.jsx(pe,{className:"mt-0.5 h-4 w-4 shrink-0 text-primary"}),r]})}function B({kind:r}){const t=r==="run"?["Candidate code / build identity","Browser / device identity","Steps","Screenshots","Logs","Expected result","Actual result","Effective prompt pack","Added runtime instructions","Approved business rules","Model identity","Schema / backfill state","Fixture version","Independent verification outcome"]:["Issue source","Reproduction evidence","Failure classification","Diagnosis","Proposed code change","Exact tested candidate","Verification results","Release state","Rollback evidence"];return e.jsxs("div",{className:"rounded-xl border border-dashed border-primary/30 bg-primary/[.035] p-4",children:[e.jsxs("div",{className:"mb-3 flex items-center gap-2 text-sm font-medium",children:[e.jsx(ye,{className:"h-4 w-4 text-primary"}),"Evidence requirements"]}),e.jsx("dl",{className:"grid gap-x-6 gap-y-2 text-sm sm:grid-cols-2",children:t.map(i=>e.jsxs("div",{className:"flex items-baseline justify-between gap-3 border-b border-border/40 pb-1",children:[e.jsx("dt",{className:"text-muted-foreground",children:i}),e.jsx("dd",{className:"text-xs font-medium",children:"Unknown"})]},i))})]})}const Ae={name:"Release controls",purpose:"Authorize only an exact, independently verified candidate for release.",requiredAccess:["Exact candidate identity and immutable evidence","Independent approval separate from repair work","Protected tests and screenshot baselines","Publisher policy enforcement and rollback authority"],verificationSteps:["Prove release approval is tied to the exact tested candidate.","Prove repair workers cannot weaken protected tests or replace baselines.","Verify publisher enforcement and rollback across code, prompts, and configuration."],blockedReason:"No release-specific evidence or publisher enforcement has been attached.",setupInstructions:"Define exact-candidate approval, independent verification, protected test and baseline controls, publisher enforcement, and rollback for code, prompts, and configuration."};function Ie({target:r,status:t,open:i,onOpenChange:a,restoreFocus:n}){var l,d;
36const c=r==="release-controls"?Ae:F.find(o=>o.id===r)??null;return c?e.jsx(ne,{open:i,onOpenChange:a,children:e.jsxs(ae,{onCloseAutoFocus:o=>{o.preventDefault(),n()},className:"w-full overflow-y-auto sm:max-w-lg",children:[e.jsxs(oe,{children:[e.jsxs(ce,{children:[c.name," setup"]}),e.jsx(de,{children:c.purpose})]}),e.jsxs("div",{className:"mt-6 space-y-6",children:[e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[e.jsx("span",{className:"text-sm text-muted-foreground",children:"Observed state"}),e.jsx(I,{state:(t==null?void 0:t.state)??"not_configured"})]}),e.jsxs("div",{children:[e.jsx("h3",{className:"mb-2 text-sm font-semibold",children:"What has actually been checked"}),e.jsx("p",{className:"text-sm leading-6 text-muted-foreground",children:((l=t==null?void 0:t.evidence)==null?void 0:l.summary)||"No verification has been performed for this application connection."}),e.jsxs("p",{className:"mt-1 text-xs text-muted-foreground",children:["Checked: ",(d=t==null?void 0:t.evidence)!=null&&d.checkedAt?new Date(t.evidence.checkedAt).toLocaleString():"Unknown"]})]}),(t==null?void 0:t.verifiedAt)&&e.jsxs("p",{className:"text-sm text-muted-foreground",children:["Verified ",new Date(t.verifiedAt).toLocaleString()]}),e.jsxs("div",{children:[e.jsx("h3",{className:"mb-2 text-sm font-semibold",children:"Required access"}),e.jsx("ul",{className:"space-y-2 text-sm text-muted-foreground",children:c.requiredAccess.map(o=>e.jsxs("li",{children:["• ",o]},o))})]}),e.jsxs("div",{children:[e.jsx("h3",{className:"mb-2 text-sm font-semibold",children:"Future verification"}),e.jsx("ol",{className:"space-y-2 text-sm text-muted-foreground",children:c.verificationSteps.map((o,m)=>e.jsxs("li",{children:[m+1,". ",o]},o))})]}),e.jsx(z,{children:(t==null?void 0:t.reason)||c.blockedReason}),e.jsxs("div",{children:[e.jsx("h3",{className:"mb-2 text-sm font-semibold",children:"Non-secret setup instructions"}),e.jsx("p",{className:"mb-3 text-sm leading-6 text-muted-foreground",children:c.setupInstructions}),e.jsx(Re,{value:c.setupInstructions})]})]})]})}):null}const g=[{id:"overview",label:"Overview",icon:je},{id:"tasks",label:"Tasks & Runs",icon:ke},{id:"issues",label:"Issues & Fixes",icon:me},{id:"connections",label:"Connections",icon:we},{id:"memory",label:"Memory",icon:he},{id:"settings",label:"Settings",icon:xe}],Me=r=>!!r&&g.some(t=>t.id===r);function k({label:r,explanation:t,icon:i}){return e.jsxs("div",{className:"space-y-2",children:[e.jsxs(y,{disabled:!0,variant:"outline",className:"w-full sm:w-auto",title:t,children:[i&&e.jsx(i,{className:"mr-2 h-4 w-4"}),r]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:t})]})}function Ar({ownerSessionKey:r}){var q;const[,t]=X(),i=Z(),a=new URLSearchParams(i).get("brain"),n=Me(a)?a:"overview",[c,l]=h.useState(null),d=h.useRef(null),[o,m]=h.useState({title:"",description:""}),[R,f]=h.useState(!1),x=G({queryKey:["/api/owner/operating-brain/status",r],queryFn:async()=>{const s=await fetch("/api/owner/operating-brain/status",{credentials:"include"});if(!s.ok){const u=new Error("Operating Brain status is unavailable.");throw u.status=s.status,u}return s.json()},retry:!1,staleTime:0});h.useEffect(()=>()=>{m({title:"",description:""}),l(null)},[r]),h.useEffect(()=>{var u;const s=(u=x.error)==null?void 0:u.status;(s===401||s===403)&&(m({title:"",description:""}),f(!1),l(null))},[x.error]);const C=h.useMemo(()=>{var s;return new Map((x.isError?[]:((s=x.data)==null?void 0:s.connections)??[]).map(u=>[u.id,u]))},[(q=x.data)==null?void 0:q.connections,x.isError]),A=s=>t(`/admin?tab=operating-brain&brain=${s}`),M=s=>{d.current=document.activeElement instanceof HTMLElement?document.activeElement:null,l(s)},H=()=>{var s;return(s=d.current)==null?void 0:s.focus()},U=(s,u)=>{var E;const b=s.key;if(!["ArrowLeft","ArrowRight","Home","End"].includes(b))return;s.preventDefault();const S=b==="Home"?0:b==="End"?g.length-1:(u+(b==="ArrowRight"?1:-1)+g.length)%g.length,j=(E=s.currentTarget.parentElement)==null?void 0:E.querySelector(`#brain-tab-${g[S].id}`);j==null||j.focus(),A(g[S].id)},_=![...C.values()].some(s=>s.state==="verified"),$=x.isLoading?e.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[e.jsx("div",{className:"h-40 animate-pulse rounded-2xl bg-muted"}),e.jsx("div",{className:"h-40 animate-pulse rounded-2xl bg-muted"})]}):x.isError?e.jsx(p,{title:"Status unavailable",description:"The secure Operating Brain status could not be read. No automation is assumed to be running.",children:e.jsxs(y,{variant:"outline",onClick:()=>x.refetch(),children:[e.jsx(Ce,{className:"mr-2 h-4 w-4"}),"Retry status"]})}):n==="overview"?e.jsx(qe,{statuses:C,noVerified:_,onSetup:M,onReview:()=>A("connections")}):n==="tasks"?e.jsx(Ee,{draft:o,setDraft:m,tried:R,setTried:f}):n==="issues"?e.jsx(Le,{}):n==="connections"?e.jsx(Te,{statuses:C,onOpen:M}):n==="memory"?e.jsx(De,{}):e.jsx(Ve,{});return e.jsxs("div",{className:"mx-auto w-full max-w-6xl space-y-6 pb-10","data-testid":"operating-brain-page",children:[e.jsxs("header",{className:"flex min-w-0 flex-col gap-3 border-b border-border/70 pb-5 sm:flex-row sm:items-end sm:justify-between",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"led-label text-xs font-medium text-primary",children:"Engineering controls"}),e.jsx("h1",{className:"mt-1 text-2xl font-semibold tracking-tight sm:text-3xl",children:"Operating Brain"}),e.jsx("p",{className:"mt-2 max-w-2xl text-sm leading-6 text-muted-foreground",children:"Continuous testing and repair controls will live here after services and safeguards are connected and verified."})]}),e.jsxs("div",{className:"inline-flex min-w-0 items-start gap-2 self
36-start rounded-full border border-primary/30 bg-primary/5 px-3 py-2 text-sm font-medium leading-5 text-primary sm:self-auto",children:[e.jsx(be,{className:"mt-0.5 h-4 w-4 shrink-0"}),e.jsx("span",{children:"Setup in progress — automation is not running"})]})]}),e.jsx("nav",{"aria-label":"Operating Brain sections",className:"overflow-x-auto border-b border-border/70",children:e.jsx("div",{role:"tablist","aria-label":"Operating Brain sections",className:"flex min-w-max gap-1 pb-2",children:g.map(({id:s,label:u,icon:b},S)=>e.jsxs("button",{id:`brain-tab-${s}`,role:"tab","aria-selected":n===s,"aria-controls":`brain-panel-${s}`,tabIndex:n===s?0:-1,onClick:()=>A(s),onKeyDown:j=>U(j,S),className:N("flex items-center gap-2 rounded-md px-3 py-2 text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",n===s?"bg-primary/10 text-primary":"text-muted-foreground hover:bg-muted hover:text-foreground"),children:[e.jsx(b,{className:"h-4 w-4"}),u]},s))})}),e.jsx("div",{id:`brain-panel-${n}`,role:"tabpanel","aria-labelledby":`brain-tab-${n}`,children:$}
36),e.jsx(Ie,{target:c,status:c&&c!=="release-controls"?C.get(c):void 0,open:!!c,onOpenChange:s=>{s||l(null)},restoreFocus:H})]})}function qe({statuses:r,noVerified:t,onSetup:i,onReview:a}){const n=[["Testing","Not configured; no current test evidence."],["Repairs","Not activated; no repair workers connected."],["Connections",t?"Not verified.":"Verified connection evidence is available."],["Last verified run","No verified runs yet."]],c=[["Repository access","github"],["Isolated staging","staging"],["Testing and evidence","runner"],["Repair workers","repair"],["Approved memory","memory"],["Release controls","release-controls"]];return e.jsxs("div",{className:"space-y-5",children:[e.jsx("div",{className:"grid gap-3 sm:grid-cols-2 lg:grid-cols-4",children:n.map(([l,d])=>e.jsx(p,{title:l,children:e.jsx("p",{className:"text-sm leading-6 text-muted-foreground",children:d})},l))}),e.jsxs("div",{className:"grid gap-5 lg:grid-cols-[1.35fr_.85fr]",children:[e.jsxs(p,{title:"Setup checklist",description:"Completion comes from evidence, not a local checkbox.",children:[e.jsx("div",{className:"divide-y divide-border/60",children:c.map(([l,d])=>{var m;
36const o=d==="release-controls"?"not_configured":((m=r.get(d))==null?void 0:m.state)??"not_configured";return e.jsxs("button",{onClick:()=>i(d),className:"flex w-full min-w-0 items-center justify-between gap-2 py-3 text-left hover:text-primary focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",children:[e.jsxs("span",{className:"flex min-w-0 items-center gap-2",children:[e.jsx(ee,{className:N("h-4 w-4 shrink-0",o==="verified"?"text-primary":"text-muted-foreground")}),e.jsx("span",{className:"min-w-0 break-words",children:l})]}),e.jsxs("span",{className:"flex shrink-0 items-center gap-1",children:[e.jsx(I,{state:o}),e.jsx(O,{className:"h-4 w-4 text-muted-foreground"})]})]},d)})}),e.jsxs(y,{className:"mt-5",onClick:a,children:["Review setup",e.jsx(fe,{className:"ml-2 h-4 w-4"})]})]}),e.jsx(p,{title:"How it will work",description:"This phase only establishes the control panel.",children:e.jsxs("ol",{className:"space-y-3 text-sm leading-6 text-muted-foreground",children:[e.jsx("li",{children:"1. A verified target and evidence plan define a task."}),e.jsx("li",{children:"2. Independent runners record artifacts for a candidate."}),e.jsx("li",{children:"3. Proposed repairs receive separate verification."}),e.jsx("li",{children:"4. Release decisions remain tied to the exact tested candidate."})]})})]})]})}function Ee({draft:r,setDraft:t,tried:i,setTried:a}){const n=!r.title.trim()||!r.description.trim(),[c,l]=h.useState({status:"all",journey:"all",browser:"all",date:"all"}),d=o=>/^(all|any)/i.test(o)?"all":o.toLowerCase().replaceAll(" ","-");return e.jsxs("div",{className:"grid gap-5 lg:grid-cols-[1.05fr_.95fr]",children:[e.jsx(p,{title:"Task draft",description:"Draft only — not saved or submitted. This draft clears when the authorized session ends.",children:e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx(w,{htmlFor:"brain-task-title",children:"Title"}),e.jsx(re,{id:"brain-task-title",maxLength:160,"aria-invalid":i&&!r.title.trim(),"aria-describedby":"brain-task-guidance brain-task-error",className:"mt-2",value:r.title,onChange:o=>t({...r,title:o.target.value}),placeholder:"Check report upload through letter generation on desktop and phone web."})]}),e.jsxs("div",{children:[e.jsx(w,{htmlFor:"brain-task-description",children:"Description"}),e.jsx(te,{id:"brain-task-description",maxLength:2e3,"aria-invalid":i&&!r.description.trim(),"aria-describedby":"brain-task-guidance brain-task-error",className:"mt-2 min-h-28",value:r.description,onChange:o=>t({...r,description:o.target.value}),placeholder:"Describe the expected journey and evidence needed."})]}),e.jsx("p",{id:"brain-task-guidance",className:"text-xs text-muted-foreground",children:"Use non-sensitive journey details only. Do not enter customer data, private documents, credentials, or secrets."}),e.jsxs("div",{children:[e.jsx(w,{children:"Target environment"}),e.jsx("div",{className:"mt-2 rounded-md border border-border bg-muted/30 px-3 py-2 text-sm text-muted-foreground",children:"Staging — not connected"})]}),i&&n&&e.jsx("p",{id:"brain-task-error",role:"alert",className:"text-sm text-red-400",children:"Add a title and description to complete this local draft."}),i&&!n&&e.jsx("p",{role:"status",className:"text-sm text-primary",children:"Draft is complete locally — not saved or submitted."}),e.jsx(k,{label:"Start task",icon:ge,explanation:"Unavailable until a real controller and a verified staging target are connected."}),e.jsx(y,{variant:"ghost",onClick:()=>a(!0),className:"text-muted-foreground",children:"Validate draft"})]})}),e.jsxs(p,{title:"Run history",description:"No runs are shown because no verified runner is connected.",children:[e.jsx("div",{className:"mb-4 grid gap-3 sm:grid-cols-2",children:[["status","Run status",["All statuses","Queued","Running","Passed","Failed"]],["journey","Journey",["All journeys","Report to letter"]],["browser","Browser",["All browsers","Chrome","Safari"]],["date","Date",["Any date","Last 7 days","Last 30 days"]]].map(([o,m,R])=>e.jsxs("div",{children:[e.jsx(w,{htmlFor:`run-filter-${o}`,className:"text-xs",children:m}),e.jsxs(L,{value:c[o],onValueChange:f=>l({...c,[o]:f}),children:[e.jsx(T,{id:`run-filter-${o}`,className:"mt-1",children:e.jsx(D,{})}),e.jsx(V,{children:R.map(f=>e.jsx(P,{value:d(f),children:f},f))})]})]},o))}),e.jsx("p",{className:"py-5 text-sm text-muted-foreground",children:"Run history will appear here after a verified runner records evidence."}),e.jsx(B,{kind:"run"})]})]})}function Le(){const[r,t]=h.useState({source:"all",classification:"all",date:"all"}),i=[["source","Issue source",["All sources","Proactive testing","Monitoring","Support intake","Manual task"]],["classification","Classification",["All classifications","Application","Harness","Fixture","Cache","Environment","Provider","Permission","Incomplete evidence"]],["date","Date",["Any date","Last 7 days","Last 30 days"]]],a=n=>/^(all|any)/i.test(n)?"all":n.toLowerCase().replaceAll(" ","-");return e.jsxs("div",{className:"space-y-5",children:[e.jsxs(p,{title:"Issue queue",description:"No issue source connected. An empty queue does not mean Cresla has no problems.",children:[e.jsx("div",{className:"mb-4 grid gap-3 sm:grid-cols-3",children:i.map(([n,c,l])=>e.jsxs("div",{children:[e.jsx(w,{htmlFor:`issue-filter-${n}`,className:"text-xs",children:c}),e.jsxs(L,{value:r[n],onValueChange:d=>t({...r,[n]:d}),children:[e.jsx(T,{id:`issue-filter-${n}`,className:"mt-1",children:e.jsx(D,{})}),e.jsx(V,{children:l.map(d=>e.jsx(P,{value:a(d),children:d},d))})]})]},n))}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Connect proactive testing, monitoring, support intake, or manual tasks before issues can be assessed."})]}),e.jsxs(p,{title:"Future issue detail",description:"A failed test is not automatically an application bug.",children:[e.jsxs("div",{className:"grid gap-3 text-sm text-muted-foreground sm:grid-cols-2",children:[e.jsx("p",{children:"Reproduction evidence and source"}),e.jsx("p",{children:"Classification: application, harness, fixture, cache, environment, provider, permission, or incomplete evidence"}),e.jsx("p",{children:"Proposed code change and diagnosis"}),e.jsx("p",{children:"Verification results and release state"})]}),e.jsx("div",{className:"mt-5",children:e.jsx(B,{kind:"issue"})}),e.jsx(z,{children:"Creating issues, contacting support, running repairs, release, and rollback require verified source, controller, and release controls."})]})]})}function Te({statuses:r,onOpen:t}){return e.jsx("div",{className:"grid gap-4 md:grid-cols-2",children:F.map(i=>{const a=r.get(i.id);return e.jsx(p,{title:i.name,description:i.purpose,children:e.jsxs("div",{className:"space-y-4",children:[e.jsx(I,{state:(a==null?void 0:a.state)??"not_configured"}),(a==null?void 0:a.verifiedAt)&&e.jsxs("p",{className:"text-xs text-muted-foreground",children:["Verified ",new Date(a.verifiedAt).toLocaleStr
36ing()]}),e.jsx("p",{className:"text-sm text-muted-foreground",children:(a==null?void 0:a.reason)||i.blockedReason}),e.jsxs(y,{variant:"outline",size:"sm",onClick:()=>t(i.id),children:["View setup",e.jsx(O,{className:"ml-2 h-4 w-4"})]})]})},i.id)})})}function De(){return e.jsxs("div",{className:"grid gap-5 lg:grid-cols-2",children:[e.jsxs(p,{title:"Approved instructions",description:"Owner-approved journeys, expected behavior, design references, and business rules.",children:[e.jsx("p",{className:"py-6 text-sm text-muted-foreground",children:"Durable storage is disconnected. Frontend state is not a persistent memory bank."}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Future metadata: source, approval state, version, author, and superseded status."})]}),e.jsxs(p,{title:"Verified lessons",description:"Reproduced failures linked to accepted fixes and regression tests.",children:[e.jsx("p",{className:"py-6 text-sm text-muted-foreground",children:"No verified lessons are available. Model suggestions, old reports, and unverified diagnoses are not imported."}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Future metadata: source, verification evidence, author, version, and superseded status."})]})]})}function Ve(){return e.jsxs("div",{className:"space-y-5",children:[e.jsx(p,{title:"Operating permissions",description:"Setup is the only active mode. These are requirements for later enforcement, not local controls.",children:e.jsx("div",{className:"grid gap-3 md:grid-cols-3",children:[["Setup","Active; automation is not running."],["Monitor","Requires verified signal sources and controller."],["Repair in staging","Requires isolated staging, runner, and review boundary."],["Release under policy","Requires exact-candidate verification and release controls."]].map(([r,t])=>e.jsxs("div",{className:N("rounded-xl border p-4",r==="Setup"&&"border-primary/35 bg-primary/5"),children:[e.jsx("h3",{className:"font-medium",children:r}),e.jsx("p",{className:"mt-2 text-sm text-muted-foreground",children:t})]},r))})}),e.jsx(p,{title:"Unavailable execution controls",description:"No local action can claim to cancel remote workers or release a candidate.",children:e.jsxs("div",{className:"flex flex-col gap-5 sm:flex-row sm:flex-wrap",children:[e.jsx(k,{label:"Pause new work",icon:ve,explanation:"Unavailable until a controller can enforce a remote pause."}),e.jsx(k,{label:"Emergency stop",icon:Ne,explanation:"Unavailable until an independently hosted controller exposes an emergency control path."}),e.jsx(k,{label:"Release candidate",icon:se,explanation:"Unavailable until exact-candidate verification and policy enforcement exist."}),e.jsx(k,{label:"Rollback",icon:ie,explanation:"Unavailable until rollback can account for code, prompts, and configuration."})]})}),e.jsx(p,{title:"Later setup requirements",children:e.jsxs("ul",{className:"space-y-2 text-sm text-muted-foreground",children:[e.jsx("li",{children:"Task scope, schedules, and approved instructions"}),e.jsx("li",{children:"Spending limits enforced by the controller"}),e.jsx("li",{children:"Release permissions separate from repair verification"})]})})]})}export{Ar as default};
37//# sourceMappingURL=OperatingBrainPage-DB-RA1Eo.js.map

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.