diff --git a/apps/dashboard/build/_app/immutable/entry/app.Bj0mlYI5.js b/apps/dashboard/build/_app/immutable/entry/app.BYOyN8KT.js similarity index 98% rename from apps/dashboard/build/_app/immutable/entry/app.Bj0mlYI5.js rename to apps/dashboard/build/_app/immutable/entry/app.BYOyN8KT.js index febd5f1..bed8d23 100644 --- a/apps/dashboard/build/_app/immutable/entry/app.Bj0mlYI5.js +++ b/apps/dashboard/build/_app/immutable/entry/app.BYOyN8KT.js @@ -1,2 +1,2 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["../nodes/0.CcZXq7cA.js","../chunks/Bzak7iHL.js","../chunks/DAau0uzT.js","../chunks/CGq8RnJq.js","../chunks/Ccqjq5DS.js","../chunks/W8qDZJD6.js","../chunks/DqfV0sZu.js","../chunks/BbCqB9Us.js","../chunks/uCQU803Y.js","../chunks/DGM4cicq.js","../chunks/DV6OI5iy.js","../chunks/CbBCXwzm.js","../chunks/DJDK-KWF.js","../chunks/DY7cP31Q.js","../chunks/Ch9vNiEl.js","../chunks/BfiOPhbz.js","../chunks/HFGAk8XQ.js","../chunks/CcUbQ_Wl.js","../chunks/D35IQVqe.js","../chunks/CKbQrCJw.js","../assets/Icon.tTjeJXhC.css","../assets/0.CLR80qKm.css","../nodes/1.8UKMSR8s.js","../nodes/2.zvt29sR6.js","../nodes/3.C6cru0cW.js","../nodes/4.CIxbWFkr.js","../chunks/BMB5u1EX.js","../assets/cognitive-palette.BALpZUFZ.css","../chunks/D7ozXiSB.js","../nodes/5.XKzsmb3Z.js","../chunks/De_e6MzK.js","../chunks/BpEKQwpr.js","../chunks/DETSv_kY.js","../nodes/6.CNes4HHG.js","../chunks/B9l3DI-J.js","../assets/reveal.Dmxpik8H.css","../assets/6.ksI6gQcB.css","../nodes/7.Cs_QL9bJ.js","../chunks/DnDQzBs4.js","../assets/Dropdown.C2Z-7Phd.css","../assets/7.DQ_AfUnN.css","../nodes/8.DYPUVn-a.js","../nodes/9.Bc6B0Hcn.js","../nodes/10.CMLfe2no.js","../nodes/11.BcR5gOV6.js","../nodes/12.CRVOD7oJ.js","../chunks/Bo4EDkTQ.js","../chunks/BKh9s_e0.js","../assets/ObservatoryStage.CKoSQgn0.css","../chunks/BzfFPM53.js","../chunks/Dp1pzeXC.js","../assets/12.BxoW8Jf1.css","../nodes/13.UdclNjnS.js","../nodes/14.CuNExVd0.js","../nodes/15.D2EVaO6c.js","../nodes/16.BHQZgsg5.js","../nodes/17.DpD2KkS8.js","../nodes/18.DdPknQfI.js","../nodes/19.CLd0kemn.js","../nodes/20.Cj35A6gq.js","../assets/20.Duj1vJUf.css","../nodes/21.yCKOHF-q.js","../nodes/22.kK1AQf2j.js","../nodes/23.B0dVDPB6.js","../nodes/24.taYcndi3.js","../nodes/25.CpxKI_0Q.js","../assets/25.DKhUrxcR.css"])))=>i.map(i=>d[i]); -var z=e=>{throw TypeError(e)};var J=(e,t,r)=>t.has(e)||z("Cannot "+r);var n=(e,t,r)=>(J(e,t,"read from private field"),r?r.call(e):t.get(e)),N=(e,t,r)=>t.has(e)?z("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),Y=(e,t,r,_)=>(J(e,t,"write to private field"),_?_.call(e,r):t.set(e,r),r);import{_ as a}from"../chunks/Dp1pzeXC.js";import{w as K,ai as nt,i as mt,E as ut,aj as ct,al as dt,G as lt,F as Q,aG as pt,I as ft,s as S,ae as vt,g as f,aR as Et,a0 as ht,_ as gt,p as Pt,R as Rt,j as Ot,x as Tt,aH as R,X as At,a as v,b as yt,d as B,aS as y,c as It,r as Dt,f as U,u as L,aT as Lt,Y as Vt}from"../chunks/CGq8RnJq.js";import{h as bt,m as xt,u as wt,o as jt,s as kt}from"../chunks/DAau0uzT.js";import"../chunks/Bzak7iHL.js";import{i as j,b as V}from"../chunks/Ccqjq5DS.js";import{B as St}from"../chunks/W8qDZJD6.js";import{p as k}from"../chunks/DV6OI5iy.js";function b(e,t,r){var _;K&&(_=ft,nt());var i=new St(e);mt(()=>{var m=t()??null;if(K){var o=ct(_),s=o===pt,d=m!==null;if(s!==d){var x=dt();lt(x),i.anchor=x,Q(!1),i.ensure(m,m&&(O=>r(O,m))),Q(!0);return}}i.ensure(m,m&&(O=>r(O,m)))},ut)}function Ct(e){return class extends Ft{constructor(t){super({component:e,...t})}}}var E,c;class Ft{constructor(t){N(this,E);N(this,c);var m;var r=new Map,_=(o,s)=>{var d=gt(s,!1,!1);return r.set(o,d),d};const i=new Proxy({...t.props||{},$$events:{}},{get(o,s){return f(r.get(s)??_(s,Reflect.get(o,s)))},has(o,s){return s===vt?!0:(f(r.get(s)??_(s,Reflect.get(o,s))),Reflect.has(o,s))},set(o,s,d){return S(r.get(s)??_(s,d),d),Reflect.set(o,s,d)}});Y(this,c,(t.hydrate?bt:xt)(t.component,{target:t.target,anchor:t.anchor,props:i,context:t.context,intro:t.intro??!1,recover:t.recover,transformError:t.transformError})),(!((m=t==null?void 0:t.props)!=null&&m.$$host)||t.sync===!1)&&Et(),Y(this,E,i.$$events);for(const o of Object.keys(n(this,c)))o==="$set"||o==="$destroy"||o==="$on"||ht(this,o,{get(){return n(this,c)[o]},set(s){n(this,c)[o]=s},enumerable:!0});n(this,c).$set=o=>{Object.assign(i,o)},n(this,c).$destroy=()=>{wt(n(this,c))}}$set(t){n(this,c).$set(t)}$on(t,r){n(this,E)[t]=n(this,E)[t]||[];const _=(...i)=>r.call(this,...i);return n(this,E)[t].push(_),()=>{n(this,E)[t]=n(this,E)[t].filter(i=>i!==_)}}$destroy(){n(this,c).$destroy()}}E=new WeakMap,c=new WeakMap;const Zt={};var Gt=U('
'),Mt=U(" ",1);function Nt(e,t){Pt(t,!0);let r=k(t,"components",23,()=>[]),_=k(t,"data_0",3,null),i=k(t,"data_1",3,null),m=k(t,"data_2",3,null);Rt(()=>t.stores.page.set(t.page)),Ot(()=>{t.stores,t.page,t.constructors,r(),t.form,_(),i(),m(),t.stores.page.notify()});let o=B(!1),s=B(!1),d=B(null);jt(()=>{const u=t.stores.page.subscribe(()=>{f(o)&&(S(s,!0),Tt().then(()=>{S(d,document.title||"untitled page",!0)}))});return S(o,!0),u});const x=L(()=>t.constructors[2]);var O=Mt(),H=R(O);{var Z=u=>{const h=L(()=>t.constructors[0]);var g=y(),I=R(g);b(I,()=>f(h),(P,T)=>{V(T(P,{get data(){return _()},get form(){return t.form},get params(){return t.page.params},children:(l,Bt)=>{var X=y(),et=R(X);{var at=A=>{const C=L(()=>t.constructors[1]);var D=y(),F=R(D);b(F,()=>f(C),(G,M)=>{V(M(G,{get data(){return i()},get form(){return t.form},get params(){return t.page.params},children:(p,Ht)=>{var q=y(),st=R(q);b(st,()=>f(x),(_t,it)=>{V(it(_t,{get data(){return m()},get form(){return t.form},get params(){return t.page.params}}),w=>r()[2]=w,()=>{var w;return(w=r())==null?void 0:w[2]})}),v(p,q)},$$slots:{default:!0}}),p=>r()[1]=p,()=>{var p;return(p=r())==null?void 0:p[1]})}),v(A,D)},ot=A=>{const C=L(()=>t.constructors[1]);var D=y(),F=R(D);b(F,()=>f(C),(G,M)=>{V(M(G,{get data(){return i()},get form(){return t.form},get params(){return t.page.params}}),p=>r()[1]=p,()=>{var p;return(p=r())==null?void 0:p[1]})}),v(A,D)};j(et,A=>{t.constructors[2]?A(at):A(ot,!1)})}v(l,X)},$$slots:{default:!0}}),l=>r()[0]=l,()=>{var l;return(l=r())==null?void 0:l[0]})}),v(u,g)},$=u=>{const h=L(()=>t.constructors[0]);var g=y(),I=R(g);b(I,()=>f(h),(P,T)=>{V(T(P,{get data(){return _()},get form(){return t.form},get params(){return t.page.params}}),l=>r()[0]=l,()=>{var l;return(l=r())==null?void 0:l[0]})}),v(u,g)};j(H,u=>{t.constructors[1]?u(Z):u($,!1)})}var tt=At(H,2);{var rt=u=>{var h=Gt(),g=It(h);{var I=P=>{var T=Lt();Vt(()=>kt(T,f(d))),v(P,T)};j(g,P=>{f(s)&&P(I)})}Dt(h),v(u,h)};j(tt,u=>{f(o)&&u(rt)})}v(e,O),yt()}const $t=Ct(Nt),tr=[()=>a(()=>import("../nodes/0.CcZXq7cA.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21]),import.meta.url),()=>a(()=>import("../nodes/1.8UKMSR8s.js"),__vite__mapDeps([22,1,15,3,2,13,12]),import.meta.url),()=>a(()=>import("../nodes/2.zvt29sR6.js"),__vite__mapDeps([23,1,3,7,5]),import.meta.url),()=>a(()=>import("../nodes/3.C6cru0cW.js"),__vite__mapDeps([24,1,15,3,2,12,13]),import.meta.url),()=>a(()=>import("../nodes/4.CIxbWFkr.js"),__vite__mapDeps([25,1,2,3,4,5,26,10,27,28,13]),import.meta.url),()=>a(()=>import("../nodes/5.XKzsmb3Z.js"),__vite__mapDeps([29,1,2,3,30,11,12,13,18,31,8,4,5,10,26,27,28,32]),import.meta.url),()=>a(()=>import("../nodes/6.CNes4HHG.js"),__vite__mapDeps([33,1,2,3,4,5,6,34,7,8,10,19,20,35,16,9,12,13,18,14,31,11,26,27,28,32,36]),import.meta.url),()=>a(()=>import("../nodes/7.Cs_QL9bJ.js"),__vite__mapDeps([37,1,2,3,4,5,6,34,7,8,10,19,20,35,16,38,39,31,12,13,11,26,27,28,32,18,14,40]),import.meta.url),()=>a(()=>import("../nodes/8.DYPUVn-a.js"),__vite__mapDeps([41,1,2,3,30,31,8,4,5,10,12,13,11,26,27,28,32,18]),import.meta.url),()=>a(()=>import("../nodes/9.Bc6B0Hcn.js"),__vite__mapDeps([42,1,2,3,4,5,6,34,7,8,10,19,20,35,9,16,17,31,12,13,11,26,27,28,18]),import.meta.url),()=>a(()=>import("../nodes/10.CMLfe2no.js"),__vite__mapDeps([43,1,2,3,30,4,5,12,13,18,26,10,27,28,32]),import.meta.url),()=>a(()=>import("../nodes/11.BcR5gOV6.js"),__vite__mapDeps([44,1,3,30,10,2,14,31,8,4,5,12,13,11,26,27,28,32]),import.meta.url),()=>a(()=>import("../nodes/12.CRVOD7oJ.js"),__vite__mapDeps([45,1,2,3,4,5,46,6,8,9,10,18,14,13,16,26,27,47,17,48,49,15,50,19,20,38,39,32,51]),import.meta.url),()=>a(()=>import("../nodes/13.UdclNjnS.js"),__vite__mapDeps([52,1,2,3,30,4,5,26,10,27,18,28,13,32]),import.meta.url),()=>a(()=>import("../nodes/14.CuNExVd0.js"),__vite__mapDeps([53,1,2,3,30,18,31,8,4,5,10,12,13,11,26,27,28,32]),import.meta.url),()=>a(()=>import("../nodes/15.D2EVaO6c.js"),__vite__mapDeps([54,1,2,3,30,4,5,26,10,27,18,28,13,32]),import.meta.url),()=>a(()=>import("../nodes/16.BHQZgsg5.js"),__vite__mapDeps([55,1,2,3,30,10,18,14,31,8,4,5,12,13,11,26,27,28,32]),import.meta.url),()=>a(()=>import("../nodes/17.DpD2KkS8.js"),__vite__mapDeps([56,1,2,3,46,5,4,6,8,9,10,18,14,13,16,26,27,47,17,48,30,12,28,32]),import.meta.url),()=>a(()=>import("../nodes/18.DdPknQfI.js"),__vite__mapDeps([57,1,2,3,30,4,5,12,13,26,10,27,47,28]),import.meta.url),()=>a(()=>import("../nodes/19.CLd0kemn.js"),__vite__mapDeps([58,1,2,3,30,31,8,4,5,10,12,13,11,26,27,28,18,32]),import.meta.url),()=>a(()=>import("../nodes/20.Cj35A6gq.js"),__vite__mapDeps([59,1,2,3,4,5,6,30,9,18,31,8,10,12,13,11,26,27,28,32,60]),import.meta.url),()=>a(()=>import("../nodes/21.yCKOHF-q.js"),__vite__mapDeps([61,1,2,3,31,8,4,5,10,12,13,11,26,27,28,18,32]),import.meta.url),()=>a(()=>import("../nodes/22.kK1AQf2j.js"),__vite__mapDeps([62,1,2,3,10,31,8,4,5,12,13,11,26,27,28,32,18,14]),import.meta.url),()=>a(()=>import("../nodes/23.B0dVDPB6.js"),__vite__mapDeps([63,1,2,3,31,8,4,5,10,12,13,11,26,27,28,32,18]),import.meta.url),()=>a(()=>import("../nodes/24.taYcndi3.js"),__vite__mapDeps([64,1,2,3,30,18,26,4,5,10,27,28,13,31,8,12,11]),import.meta.url),()=>a(()=>import("../nodes/25.CpxKI_0Q.js"),__vite__mapDeps([65,1,2,3,4,5,6,30,8,16,9,49,13,66]),import.meta.url)],rr=[],er={"/":[3],"/(app)/_msdftest":[4,[2]],"/(app)/activation":[5,[2]],"/(app)/blackbox":[6,[2]],"/(app)/contradictions":[7,[2]],"/(app)/dreams":[8,[2]],"/(app)/duplicates":[9,[2]],"/(app)/explore":[10,[2]],"/(app)/feed":[11,[2]],"/(app)/graph":[12,[2]],"/(app)/importance":[13,[2]],"/(app)/intentions":[14,[2]],"/(app)/memories":[15,[2]],"/(app)/memory-prs":[16,[2]],"/(app)/observatory":[17,[2]],"/(app)/palace":[18,[2]],"/(app)/patterns":[19,[2]],"/(app)/reasoning":[20,[2]],"/(app)/schedule":[21,[2]],"/(app)/settings":[22,[2]],"/(app)/stats":[23,[2]],"/(app)/timeline":[24,[2]],"/waitlist":[25]},W={handleError:(({error:e})=>{console.error(e)}),reroute:(()=>{}),transport:{}},Yt=Object.fromEntries(Object.entries(W.transport).map(([e,t])=>[e,t.decode])),ar=Object.fromEntries(Object.entries(W.transport).map(([e,t])=>[e,t.encode])),or=!1,sr=(e,t)=>Yt[e](t);export{sr as decode,Yt as decoders,er as dictionary,ar as encoders,or as hash,W as hooks,Zt as matchers,tr as nodes,$t as root,rr as server_loads}; +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["../nodes/0.CcZXq7cA.js","../chunks/Bzak7iHL.js","../chunks/DAau0uzT.js","../chunks/CGq8RnJq.js","../chunks/Ccqjq5DS.js","../chunks/W8qDZJD6.js","../chunks/DqfV0sZu.js","../chunks/BbCqB9Us.js","../chunks/uCQU803Y.js","../chunks/DGM4cicq.js","../chunks/DV6OI5iy.js","../chunks/CbBCXwzm.js","../chunks/DJDK-KWF.js","../chunks/DY7cP31Q.js","../chunks/Ch9vNiEl.js","../chunks/BfiOPhbz.js","../chunks/HFGAk8XQ.js","../chunks/CcUbQ_Wl.js","../chunks/D35IQVqe.js","../chunks/CKbQrCJw.js","../assets/Icon.tTjeJXhC.css","../assets/0.CLR80qKm.css","../nodes/1.8UKMSR8s.js","../nodes/2.zvt29sR6.js","../nodes/3.C6cru0cW.js","../nodes/4.CIxbWFkr.js","../chunks/BMB5u1EX.js","../assets/cognitive-palette.BALpZUFZ.css","../chunks/D7ozXiSB.js","../nodes/5.XKzsmb3Z.js","../chunks/De_e6MzK.js","../chunks/BpEKQwpr.js","../chunks/DETSv_kY.js","../nodes/6.CNes4HHG.js","../chunks/B9l3DI-J.js","../assets/reveal.Dmxpik8H.css","../assets/6.ksI6gQcB.css","../nodes/7.Cs_QL9bJ.js","../chunks/DnDQzBs4.js","../assets/Dropdown.C2Z-7Phd.css","../assets/7.DQ_AfUnN.css","../nodes/8.DYPUVn-a.js","../nodes/9.Bc6B0Hcn.js","../nodes/10.CMLfe2no.js","../nodes/11.BcR5gOV6.js","../nodes/12.CRVOD7oJ.js","../chunks/Bo4EDkTQ.js","../chunks/BKh9s_e0.js","../assets/ObservatoryStage.CKoSQgn0.css","../chunks/BzfFPM53.js","../chunks/Dp1pzeXC.js","../assets/12.BxoW8Jf1.css","../nodes/13.UdclNjnS.js","../nodes/14.CuNExVd0.js","../nodes/15.D2EVaO6c.js","../nodes/16.BHQZgsg5.js","../nodes/17.DpD2KkS8.js","../nodes/18.DdPknQfI.js","../nodes/19.CLd0kemn.js","../nodes/20.DD0_N4PP.js","../assets/20.Duj1vJUf.css","../nodes/21.yCKOHF-q.js","../nodes/22.kK1AQf2j.js","../nodes/23.B0dVDPB6.js","../nodes/24.taYcndi3.js","../nodes/25.CpxKI_0Q.js","../assets/25.DKhUrxcR.css"])))=>i.map(i=>d[i]); +var z=e=>{throw TypeError(e)};var J=(e,t,r)=>t.has(e)||z("Cannot "+r);var n=(e,t,r)=>(J(e,t,"read from private field"),r?r.call(e):t.get(e)),N=(e,t,r)=>t.has(e)?z("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),Y=(e,t,r,_)=>(J(e,t,"write to private field"),_?_.call(e,r):t.set(e,r),r);import{_ as a}from"../chunks/Dp1pzeXC.js";import{w as K,ai as nt,i as mt,E as ut,aj as ct,al as dt,G as lt,F as Q,aG as pt,I as ft,s as S,ae as vt,g as f,aR as Et,a0 as ht,_ as gt,p as Pt,R as Rt,j as Ot,x as Tt,aH as R,X as At,a as v,b as yt,d as B,aS as y,c as It,r as Dt,f as U,u as L,aT as Lt,Y as Vt}from"../chunks/CGq8RnJq.js";import{h as bt,m as xt,u as wt,o as jt,s as kt}from"../chunks/DAau0uzT.js";import"../chunks/Bzak7iHL.js";import{i as j,b as V}from"../chunks/Ccqjq5DS.js";import{B as St}from"../chunks/W8qDZJD6.js";import{p as k}from"../chunks/DV6OI5iy.js";function b(e,t,r){var _;K&&(_=ft,nt());var i=new St(e);mt(()=>{var m=t()??null;if(K){var o=ct(_),s=o===pt,d=m!==null;if(s!==d){var x=dt();lt(x),i.anchor=x,Q(!1),i.ensure(m,m&&(O=>r(O,m))),Q(!0);return}}i.ensure(m,m&&(O=>r(O,m)))},ut)}function Ct(e){return class extends Ft{constructor(t){super({component:e,...t})}}}var E,c;class Ft{constructor(t){N(this,E);N(this,c);var m;var r=new Map,_=(o,s)=>{var d=gt(s,!1,!1);return r.set(o,d),d};const i=new Proxy({...t.props||{},$$events:{}},{get(o,s){return f(r.get(s)??_(s,Reflect.get(o,s)))},has(o,s){return s===vt?!0:(f(r.get(s)??_(s,Reflect.get(o,s))),Reflect.has(o,s))},set(o,s,d){return S(r.get(s)??_(s,d),d),Reflect.set(o,s,d)}});Y(this,c,(t.hydrate?bt:xt)(t.component,{target:t.target,anchor:t.anchor,props:i,context:t.context,intro:t.intro??!1,recover:t.recover,transformError:t.transformError})),(!((m=t==null?void 0:t.props)!=null&&m.$$host)||t.sync===!1)&&Et(),Y(this,E,i.$$events);for(const o of Object.keys(n(this,c)))o==="$set"||o==="$destroy"||o==="$on"||ht(this,o,{get(){return n(this,c)[o]},set(s){n(this,c)[o]=s},enumerable:!0});n(this,c).$set=o=>{Object.assign(i,o)},n(this,c).$destroy=()=>{wt(n(this,c))}}$set(t){n(this,c).$set(t)}$on(t,r){n(this,E)[t]=n(this,E)[t]||[];const _=(...i)=>r.call(this,...i);return n(this,E)[t].push(_),()=>{n(this,E)[t]=n(this,E)[t].filter(i=>i!==_)}}$destroy(){n(this,c).$destroy()}}E=new WeakMap,c=new WeakMap;const Zt={};var Gt=U('
'),Mt=U(" ",1);function Nt(e,t){Pt(t,!0);let r=k(t,"components",23,()=>[]),_=k(t,"data_0",3,null),i=k(t,"data_1",3,null),m=k(t,"data_2",3,null);Rt(()=>t.stores.page.set(t.page)),Ot(()=>{t.stores,t.page,t.constructors,r(),t.form,_(),i(),m(),t.stores.page.notify()});let o=B(!1),s=B(!1),d=B(null);jt(()=>{const u=t.stores.page.subscribe(()=>{f(o)&&(S(s,!0),Tt().then(()=>{S(d,document.title||"untitled page",!0)}))});return S(o,!0),u});const x=L(()=>t.constructors[2]);var O=Mt(),H=R(O);{var Z=u=>{const h=L(()=>t.constructors[0]);var g=y(),I=R(g);b(I,()=>f(h),(P,T)=>{V(T(P,{get data(){return _()},get form(){return t.form},get params(){return t.page.params},children:(l,Bt)=>{var X=y(),et=R(X);{var at=A=>{const C=L(()=>t.constructors[1]);var D=y(),F=R(D);b(F,()=>f(C),(G,M)=>{V(M(G,{get data(){return i()},get form(){return t.form},get params(){return t.page.params},children:(p,Ht)=>{var q=y(),st=R(q);b(st,()=>f(x),(_t,it)=>{V(it(_t,{get data(){return m()},get form(){return t.form},get params(){return t.page.params}}),w=>r()[2]=w,()=>{var w;return(w=r())==null?void 0:w[2]})}),v(p,q)},$$slots:{default:!0}}),p=>r()[1]=p,()=>{var p;return(p=r())==null?void 0:p[1]})}),v(A,D)},ot=A=>{const C=L(()=>t.constructors[1]);var D=y(),F=R(D);b(F,()=>f(C),(G,M)=>{V(M(G,{get data(){return i()},get form(){return t.form},get params(){return t.page.params}}),p=>r()[1]=p,()=>{var p;return(p=r())==null?void 0:p[1]})}),v(A,D)};j(et,A=>{t.constructors[2]?A(at):A(ot,!1)})}v(l,X)},$$slots:{default:!0}}),l=>r()[0]=l,()=>{var l;return(l=r())==null?void 0:l[0]})}),v(u,g)},$=u=>{const h=L(()=>t.constructors[0]);var g=y(),I=R(g);b(I,()=>f(h),(P,T)=>{V(T(P,{get data(){return _()},get form(){return t.form},get params(){return t.page.params}}),l=>r()[0]=l,()=>{var l;return(l=r())==null?void 0:l[0]})}),v(u,g)};j(H,u=>{t.constructors[1]?u(Z):u($,!1)})}var tt=At(H,2);{var rt=u=>{var h=Gt(),g=It(h);{var I=P=>{var T=Lt();Vt(()=>kt(T,f(d))),v(P,T)};j(g,P=>{f(s)&&P(I)})}Dt(h),v(u,h)};j(tt,u=>{f(o)&&u(rt)})}v(e,O),yt()}const $t=Ct(Nt),tr=[()=>a(()=>import("../nodes/0.CcZXq7cA.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21]),import.meta.url),()=>a(()=>import("../nodes/1.8UKMSR8s.js"),__vite__mapDeps([22,1,15,3,2,13,12]),import.meta.url),()=>a(()=>import("../nodes/2.zvt29sR6.js"),__vite__mapDeps([23,1,3,7,5]),import.meta.url),()=>a(()=>import("../nodes/3.C6cru0cW.js"),__vite__mapDeps([24,1,15,3,2,12,13]),import.meta.url),()=>a(()=>import("../nodes/4.CIxbWFkr.js"),__vite__mapDeps([25,1,2,3,4,5,26,10,27,28,13]),import.meta.url),()=>a(()=>import("../nodes/5.XKzsmb3Z.js"),__vite__mapDeps([29,1,2,3,30,11,12,13,18,31,8,4,5,10,26,27,28,32]),import.meta.url),()=>a(()=>import("../nodes/6.CNes4HHG.js"),__vite__mapDeps([33,1,2,3,4,5,6,34,7,8,10,19,20,35,16,9,12,13,18,14,31,11,26,27,28,32,36]),import.meta.url),()=>a(()=>import("../nodes/7.Cs_QL9bJ.js"),__vite__mapDeps([37,1,2,3,4,5,6,34,7,8,10,19,20,35,16,38,39,31,12,13,11,26,27,28,32,18,14,40]),import.meta.url),()=>a(()=>import("../nodes/8.DYPUVn-a.js"),__vite__mapDeps([41,1,2,3,30,31,8,4,5,10,12,13,11,26,27,28,32,18]),import.meta.url),()=>a(()=>import("../nodes/9.Bc6B0Hcn.js"),__vite__mapDeps([42,1,2,3,4,5,6,34,7,8,10,19,20,35,9,16,17,31,12,13,11,26,27,28,18]),import.meta.url),()=>a(()=>import("../nodes/10.CMLfe2no.js"),__vite__mapDeps([43,1,2,3,30,4,5,12,13,18,26,10,27,28,32]),import.meta.url),()=>a(()=>import("../nodes/11.BcR5gOV6.js"),__vite__mapDeps([44,1,3,30,10,2,14,31,8,4,5,12,13,11,26,27,28,32]),import.meta.url),()=>a(()=>import("../nodes/12.CRVOD7oJ.js"),__vite__mapDeps([45,1,2,3,4,5,46,6,8,9,10,18,14,13,16,26,27,47,17,48,49,15,50,19,20,38,39,32,51]),import.meta.url),()=>a(()=>import("../nodes/13.UdclNjnS.js"),__vite__mapDeps([52,1,2,3,30,4,5,26,10,27,18,28,13,32]),import.meta.url),()=>a(()=>import("../nodes/14.CuNExVd0.js"),__vite__mapDeps([53,1,2,3,30,18,31,8,4,5,10,12,13,11,26,27,28,32]),import.meta.url),()=>a(()=>import("../nodes/15.D2EVaO6c.js"),__vite__mapDeps([54,1,2,3,30,4,5,26,10,27,18,28,13,32]),import.meta.url),()=>a(()=>import("../nodes/16.BHQZgsg5.js"),__vite__mapDeps([55,1,2,3,30,10,18,14,31,8,4,5,12,13,11,26,27,28,32]),import.meta.url),()=>a(()=>import("../nodes/17.DpD2KkS8.js"),__vite__mapDeps([56,1,2,3,46,5,4,6,8,9,10,18,14,13,16,26,27,47,17,48,30,12,28,32]),import.meta.url),()=>a(()=>import("../nodes/18.DdPknQfI.js"),__vite__mapDeps([57,1,2,3,30,4,5,12,13,26,10,27,47,28]),import.meta.url),()=>a(()=>import("../nodes/19.CLd0kemn.js"),__vite__mapDeps([58,1,2,3,30,31,8,4,5,10,12,13,11,26,27,28,18,32]),import.meta.url),()=>a(()=>import("../nodes/20.DD0_N4PP.js"),__vite__mapDeps([59,1,2,3,4,5,6,30,9,18,31,8,10,12,13,11,26,27,28,32,60]),import.meta.url),()=>a(()=>import("../nodes/21.yCKOHF-q.js"),__vite__mapDeps([61,1,2,3,31,8,4,5,10,12,13,11,26,27,28,18,32]),import.meta.url),()=>a(()=>import("../nodes/22.kK1AQf2j.js"),__vite__mapDeps([62,1,2,3,10,31,8,4,5,12,13,11,26,27,28,32,18,14]),import.meta.url),()=>a(()=>import("../nodes/23.B0dVDPB6.js"),__vite__mapDeps([63,1,2,3,31,8,4,5,10,12,13,11,26,27,28,32,18]),import.meta.url),()=>a(()=>import("../nodes/24.taYcndi3.js"),__vite__mapDeps([64,1,2,3,30,18,26,4,5,10,27,28,13,31,8,12,11]),import.meta.url),()=>a(()=>import("../nodes/25.CpxKI_0Q.js"),__vite__mapDeps([65,1,2,3,4,5,6,30,8,16,9,49,13,66]),import.meta.url)],rr=[],er={"/":[3],"/(app)/_msdftest":[4,[2]],"/(app)/activation":[5,[2]],"/(app)/blackbox":[6,[2]],"/(app)/contradictions":[7,[2]],"/(app)/dreams":[8,[2]],"/(app)/duplicates":[9,[2]],"/(app)/explore":[10,[2]],"/(app)/feed":[11,[2]],"/(app)/graph":[12,[2]],"/(app)/importance":[13,[2]],"/(app)/intentions":[14,[2]],"/(app)/memories":[15,[2]],"/(app)/memory-prs":[16,[2]],"/(app)/observatory":[17,[2]],"/(app)/palace":[18,[2]],"/(app)/patterns":[19,[2]],"/(app)/reasoning":[20,[2]],"/(app)/schedule":[21,[2]],"/(app)/settings":[22,[2]],"/(app)/stats":[23,[2]],"/(app)/timeline":[24,[2]],"/waitlist":[25]},W={handleError:(({error:e})=>{console.error(e)}),reroute:(()=>{}),transport:{}},Yt=Object.fromEntries(Object.entries(W.transport).map(([e,t])=>[e,t.decode])),ar=Object.fromEntries(Object.entries(W.transport).map(([e,t])=>[e,t.encode])),or=!1,sr=(e,t)=>Yt[e](t);export{sr as decode,Yt as decoders,er as dictionary,ar as encoders,or as hash,W as hooks,Zt as matchers,tr as nodes,$t as root,rr as server_loads}; diff --git a/apps/dashboard/build/_app/immutable/entry/app.BYOyN8KT.js.br b/apps/dashboard/build/_app/immutable/entry/app.BYOyN8KT.js.br new file mode 100644 index 0000000..e4ed039 Binary files /dev/null and b/apps/dashboard/build/_app/immutable/entry/app.BYOyN8KT.js.br differ diff --git a/apps/dashboard/build/_app/immutable/entry/app.BYOyN8KT.js.gz b/apps/dashboard/build/_app/immutable/entry/app.BYOyN8KT.js.gz new file mode 100644 index 0000000..c714377 Binary files /dev/null and b/apps/dashboard/build/_app/immutable/entry/app.BYOyN8KT.js.gz differ diff --git a/apps/dashboard/build/_app/immutable/entry/app.Bj0mlYI5.js.br b/apps/dashboard/build/_app/immutable/entry/app.Bj0mlYI5.js.br deleted file mode 100644 index c9bcb98..0000000 Binary files a/apps/dashboard/build/_app/immutable/entry/app.Bj0mlYI5.js.br and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/entry/app.Bj0mlYI5.js.gz b/apps/dashboard/build/_app/immutable/entry/app.Bj0mlYI5.js.gz deleted file mode 100644 index 6b2ec3b..0000000 Binary files a/apps/dashboard/build/_app/immutable/entry/app.Bj0mlYI5.js.gz and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/nodes/20.Cj35A6gq.js b/apps/dashboard/build/_app/immutable/nodes/20.Cj35A6gq.js deleted file mode 100644 index d50db43..0000000 --- a/apps/dashboard/build/_app/immutable/nodes/20.Cj35A6gq.js +++ /dev/null @@ -1,198 +0,0 @@ -var Re=Object.defineProperty;var Ce=(t,e,s)=>e in t?Re(t,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[e]=s;var R=(t,e,s)=>Ce(t,typeof e!="symbol"?e+"":e,s);import"../chunks/Bzak7iHL.js";import{o as Te,e as Ie,s as ye}from"../chunks/DAau0uzT.js";import{p as $e,j as Ne,g as m,aH as Pe,Y as de,a as ue,b as Me,d as W,h as Le,X as j,s as I,f as ve,u as be,$ as Fe,c as pe,r as ie,af as Be}from"../chunks/CGq8RnJq.js";import{b as De,i as Ge}from"../chunks/Ccqjq5DS.js";import{e as Ue,r as Oe,i as We}from"../chunks/DqfV0sZu.js";import{h as Xe}from"../chunks/De_e6MzK.js";import{b as Ve}from"../chunks/DGM4cicq.js";import{a as Ye}from"../chunks/D35IQVqe.js";import{R as ze}from"../chunks/BpEKQwpr.js";import{T as He}from"../chunks/D7ozXiSB.js";import{r as qe}from"../chunks/BMB5u1EX.js";import{L as Ke,F as _e,l as je}from"../chunks/DETSv_kY.js";const Qe={intent:"Intent classification",retrieve:"Memory retrieval",activate:"Activation expansion",evidence:"Evidence grounding",contradiction:"Contradiction check",synthesis:"Synthesis",recommendation:"Recommendation",receipt:"Composition receipt"},Je=["intent","retrieve","activate","evidence","contradiction","synthesis","recommendation","receipt"];function B(t){return t&&typeof t=="object"&&!Array.isArray(t)?t:{}}function g(t,e=""){return typeof t=="string"?t:t==null?e:String(t)}function ee(t,e=0){return typeof t=="number"&&Number.isFinite(t)?t:e}function V(t){return Math.max(0,Math.min(1,t))}function te(t){const e=ee(t,0);return V(e>1?e/100:e)}function Ze(t){return t==="primary"||t==="supporting"||t==="contradicting"||t==="superseded"?t:"supporting"}function Q(t,e=""){const s=te(t.trust??t.trust_score??0);return{id:g(t.id??t.memory_id??e),trust:s,date:g(t.date??t.created_at??""),role:Ze(t.role),preview:g(t.preview??t.answer_preview??t.content??""),nodeType:t.node_type?g(t.node_type):t.nodeType?g(t.nodeType):void 0}}function O(t,e,s){return s?{kind:t,id:e,scalar:s}:{kind:t,id:e||`${t}:unknown`}}function P(t,e){return{kind:"scalar",id:`deep_reference.${t}`,scalar:{name:t,value:e}}}function et(t){var y,b,T,L;const e=B(t),u=(Array.isArray(e.evidence)?e.evidence.map(B):[]).map(r=>Q(r)).filter(r=>r.id.length>0),f=B(e.recommended),i=Object.keys(f).length>0||u.length>0?{answer_preview:g(f.answer_preview??((y=u[0])==null?void 0:y.preview)??""),memory_id:g(f.memory_id??((b=u[0])==null?void 0:b.id)??""),trust_score:te(f.trust_score??((T=u[0])==null?void 0:T.trust)??0),date:g(f.date??((L=u[0])==null?void 0:L.date)??"")}:null,a=(Array.isArray(e.contradictions)?e.contradictions.map(B):Array.isArray(e.claim_conflicts)?e.claim_conflicts.map(B):[]).map(r=>{const E=B(r.stronger),F=B(r.weaker);if(Object.keys(E).length>0||Object.keys(F).length>0){const re=Q(E),se=Q(F);return{stronger:re,weaker:se,topic_overlap:V(ee(r.topic_overlap,0)),summary:g(r.summary,`Trust-weighted conflict: ${re.id.slice(0,8)} over ${se.id.slice(0,8)}`)}}const U=Q({id:r.a_id,role:"contradicting"}),le=Q({id:r.b_id,role:"contradicting"});return{stronger:U,weaker:le,topic_overlap:V(ee(r.topic_overlap,0)),summary:g(r.summary??r.reason,"Trust-weighted conflict between high-FSRS memories.")}}).filter(r=>r.stronger.id||r.weaker.id),w=(Array.isArray(e.superseded)?e.superseded.map(B):[]).map(r=>r.id||r.superseded_by?{id:g(r.id),preview:g(r.preview??""),trust:te(r.trust??0),date:g(r.date??""),superseded_by:g(r.superseded_by??(i==null?void 0:i.memory_id)??""),reason:g(r.reason??"Superseded by newer memory with higher trust.")}:{id:g(r.old_id),preview:g(r.preview??""),trust:te(r.trust??0),date:g(r.date??""),superseded_by:g(r.new_id??(i==null?void 0:i.memory_id)??""),reason:g(r.reason??"Superseded by newer memory with higher trust.")}).filter(r=>r.id||r.superseded_by),c=te(e.confidence),l=ee(e.memoriesAnalyzed??e.memories_analyzed,u.length),n=ee(e.activationExpanded??e.activation_expanded,0),p=g(e.intent??""),v=g(e.reasoning??e.guidance??""),S=g(e.guidance??""),_=g(e.composition_event_id??""),A=g(e.compositionWriteStatus??e.composition_write_status??""),C=_||A,k=_.length>0,M=u.map((r,E)=>({source:O("memory",r.id),index:E,label:r.preview||r.id.slice(0,8),retention:V(r.trust),trust:V(r.trust),lastAccessed:r.date||void 0,tags:[r.role,...r.nodeType?[r.nodeType]:[]],type:r.nodeType??"memory"})),H=new Map(M.map(r=>[r.source.id,r.index])),q=a.flatMap((r,E)=>{const F=H.get(r.stronger.id),U=H.get(r.weaker.id);return F==null||U==null?[]:[{source:O("pair",`contradiction:${r.stronger.id}:${r.weaker.id}`),sourceIndex:F,targetIndex:U,weight:Math.max(.2,r.topic_overlap||.5),kind:"contradiction"}]}),K=[];a.length>0&&K.push({source:O("event",`deep_reference.contradictions.${a.length}`),type:"ReasoningContradictionInterrupt",targetIndex:-1,frame:250,energy:a.length}),w.length>0&&K.push({source:O("event",`deep_reference.superseded.${w.length}`),type:"ReasoningSupersessionInterrupt",targetIndex:-1,frame:330,energy:w.length});const ne=[];C&&ne.push({source:k?O("receipt",_):P("compositionWriteStatus",A==="persisted"?1:0),label:k?`receipt ${_.slice(0,8)}`:A,nodeIndices:M.map(r=>r.index)});const N=(r,E,F,U,le,re,se,ke="none")=>({index:r,kind:E,label:Qe[E],count:F,confidence:V(U),lit:F>0||U>0,provenance:re,exposed:le,not_exposed_by_backend:se,interrupt:ke}),o=Je.map((r,E)=>{switch(r){case"intent":return N(E,r,p?1:0,p?c:0,{intent:p},P("intent_present",p?1:0),["raw classifier trace"]);case"retrieve":return N(E,r,l||u.length,c,{memoriesAnalyzed:l,evidence_count:u.length},P("memoriesAnalyzed",l),["candidate ids discarded before evidence"]);case"activate":return N(E,r,n,n>0?c:0,{activationExpanded:n},P("activationExpanded",n),["activation path/map"]);case"evidence":return N(E,r,u.length,u.length>0?c:0,{evidence:u},P("evidence_count",u.length),["reranker discarded candidates"]);case"contradiction":return N(E,r,a.length,a.length>0?c:0,{contradictions:a,claim_conflicts:e.claim_conflicts??[]},P("contradiction_count",a.length),["full claim graph"],a.length>0?"contradiction":"none");case"synthesis":return N(E,r,v||S?1:0,v||S?c:0,{reasoning:v,guidance:S},P("synthesis_present",v||S?1:0),["token-level chain internals"]);case"recommendation":return N(E,r,i!=null&&i.memory_id?1:0,(i==null?void 0:i.trust_score)??0,{recommended:i},i!=null&&i.memory_id?O("memory",i.memory_id):P("recommended_present",0),["alternative recommendations"]);case"receipt":return N(E,r,C?1:0,C?c:0,{composition_event_id:_,compositionWriteStatus:A},k?O("receipt",_):P("compositionWriteStatus",A==="persisted"?1:0),["separate receipt field"],w.length>0?"supersession":"none")}});return{organ:"reasoning",nodes:M,edges:q,events:K,receipts:ne,scalars:{confidence:c,memoriesAnalyzed:l,activationExpanded:n,evidenceCount:u.length,contradictionCount:a.length,supersededCount:w.length,compositionPersisted:k?1:0},alive:!!(p||v||S||u.length||a.length||w.length||i!=null&&i.memory_id||C),stages:o,evidence:u,contradictions:a,superseded:w,recommended:i,raw:e}}const Y=[-.86,-.526,-.214,.074,.335,.562,.747,.86],tt=["INTENT","RETRIEVE","ACTIVATE","EVIDENCE","CHALLENGE","SYNTH","DECIDE","SEAL"],we=0,nt=3,Ee=6,rt=7,st={primary:.04,supporting:.24,contradicting:-.22,superseded:-.48},it=.052,at=6,ot=Y[nt]-.02,ct=.14;function lt(t){var c,l;if(!t||!t.alive)return null;const e=String(((c=t.raw)==null?void 0:c.query)??""),s=(t.stages??[]).slice(0,Y.length).map((n,p)=>({index:p,kind:(n==null?void 0:n.kind)??String(p),label:(n==null?void 0:n.label)??(n==null?void 0:n.kind)??"",short:tt[p]??((n==null?void 0:n.kind)??"").toUpperCase(),x:Y[p],lit:!!(n!=null&&n.lit),confidence:(n==null?void 0:n.confidence)??0,count:(n==null?void 0:n.count)??0})),u=new Map;for(const n of t.evidence??[]){const p=u.get(n.role)??[];p.push(n),u.set(n.role,p)}const f=[];for(const[n,p]of u){const v=st[n],S=p.slice(0,at);S.forEach((_,A)=>{const C=v+(A-(S.length-1)/2)*it,k=ot+A/Math.max(1,S.length-1)*ct;f.push({id:_.id,role:n,trust:_.trust,preview:_.preview,x:k,y:C})})}const i=t.recommended!=null?{x:Y[Ee],y:we,confidence:Math.max(0,Math.min(1,t.recommended.trust_score))}:null,d=i?f.map(n=>({fromX:n.x,fromY:n.y,toX:i.x,toY:i.y,trust:n.trust,role:n.role,sign:n.role==="contradicting"?-1:1})):[],a=new Map(f.map(n=>[n.id,n])),x=(t.contradictions??[]).map(n=>{const p=a.get(n.stronger.id),v=a.get(n.weaker.id);return!p||!v?null:{ax:p.x,ay:p.y,bx:v.x,by:v.y,strength:Math.max(.35,n.topic_overlap||.5)}}).filter(n=>n!==null),w=(t.superseded??[]).map(n=>{const p=a.get(n.id);return p?{x:p.x,y:p.y,toX:(i==null?void 0:i.x)??Y[Ee],toY:(i==null?void 0:i.y)??we}:null}).filter(n=>n!==null);return{query:e,gates:s,evidence:f,ribbons:d,nucleus:i,fringes:x,scars:w,receiptX:Y[rt],sourceCount:((l=t.evidence)==null?void 0:l.length)??0}}const dt=` -struct Params { - frame: f32, loopPhase: f32, nodeCount: f32, edgeCount: f32, - pathCount: f32, pulse: f32, viewportW: f32, viewportH: f32, - brightness: f32, demoId: f32, time: f32, captureMode: f32, - liveKind: f32, liveFrame: f32, liveEnergy: f32, projectionDays: f32, - cursorX: f32, cursorY: f32, cursorVx: f32, cursorVy: f32, -}; - -// Instance record (12 floats) — mirrors reasoning-geometry-pass INSTANCE_FLOATS. -struct Inst { - a: vec2f, // endpoint A / center (NDC) - b: vec2f, // endpoint B (== a for points) - kind: f32, // 0 beam, 1 ribbon, 2 nucleus, 3 fringe, 4 scar - thickness: f32, // NDC half-width - trust: f32, // 0..1 - sign: f32, // +1 support / -1 oppose - energy: f32, // 0..1 - seed: f32, // per-instance phase - extra: f32, // kind-specific (fringe strength / nucleus confidence) - pad: f32, -}; - -@group(0) @binding(0) var params: Params; -@group(0) @binding(1) var insts: array; - -const TAU: f32 = 6.28318530718; -const QUAD = array( - vec2f(0.0, 0.0), vec2f(1.0, 0.0), vec2f(1.0, 1.0), - vec2f(0.0, 0.0), vec2f(1.0, 1.0), vec2f(0.0, 1.0) -); - -struct VSOut { - @builtin(position) clip: vec4f, - @location(0) world: vec2f, // NDC position of this fragment - @location(1) @interpolate(flat) idx: u32, -}; - -fn aspect() -> f32 { return max(0.0001, params.viewportW / max(1.0, params.viewportH)); } - -// smoothstep-based value-suppressing palette (Correll/Moritz/Heer): low trust → -// neutral grey (never jitter), high trust → vivid. base is the category hue. -fn vsup(base: vec3f, trust: f32) -> vec3f { - let s = smoothstep(0.0, 1.0, clamp(trust, 0.0, 1.0)); - let neutral = vec3f(0.42, 0.46, 0.52); - let bright = 0.72 + 0.28 * s; - return mix(neutral, base, s) * bright; -} - -// PRGn-style diverging hue by signed influence: + = green (support), − = purple -// (oppose). |mag| drives saturation; zero-point kept off pure white. -fn prgn(sign: f32, mag: f32) -> vec3f { - let green = vec3f(0.0, 0.85, 0.45); - let purple = vec3f(0.55, 0.15, 0.75); - let base = select(purple, green, sign >= 0.0); - return mix(vec3f(0.35, 0.37, 0.4), base, clamp(mag, 0.0, 1.0)); -} - -@vertex -fn vs_geo(@builtin(vertex_index) vi: u32, @builtin(instance_index) ii: u32) -> VSOut { - var out: VSOut; - let inst = insts[ii]; - let corner = QUAD[vi]; - let asp = aspect(); - - // Bounding quad: for line-like kinds (beam/ribbon/scar/fringe) expand along - // the A→B segment plus thickness on the perpendicular; for point kinds - // (nucleus) a square of side 2*thickness around A. - var pos: vec2f; - let is_point = inst.kind == 2.0; - if (is_point) { - let r = inst.thickness + 0.04; // padding for glow/rings - pos = inst.a + (corner - vec2f(0.5)) * (2.0 * r); - } else { - let dir = inst.b - inst.a; - let len = max(1e-4, length(dir)); - let t_hat = dir / len; - let n_hat = vec2f(-t_hat.y, t_hat.x); - let half_w = inst.thickness + 0.03; // padding for AA/glow - // corner.x runs along the segment (0..1), corner.y across (-1..1) - let along = corner.x; - let across = (corner.y - 0.5) * 2.0; - pos = inst.a + t_hat * (along * len) + n_hat * (across * half_w); - } - - // aspect-correct so circles stay round (mirror the text pass convention). - var clip = pos; - clip.x = clip.x / max(asp, 1.0); - clip.y = clip.y * min(asp, 1.0); - out.clip = vec4f(clip, 0.0, 1.0); - out.world = pos; - out.idx = ii; - return out; -} - -// ── Per-kind SDF shading. Each returns premultiplied additive HDR rgb. ──────── -// FLEET: fill these five. Each is a PURE function of (inst, p, t) → vec3f. Keep -// them deterministic (use params.time via t), additive (return black to skip a -// pixel), and honest (brightness ∝ the real trust/energy/confidence fields). - -fn shade_beam(inst: Inst, p: vec2f, t: f32) -> vec3f { - // BEAM: a bright emissive causal line A→B along y with a flowing pulse. - let d = sdf_segment(p, inst.a, inst.b); - let core = smoothstep(inst.thickness, 0.0, d); - let glow = smoothstep(inst.thickness * 4.0, 0.0, d) * 0.35; - // flow pulse travelling toward the decision (left→right) - let along = clamp((p.x - inst.a.x) / max(1e-4, inst.b.x - inst.a.x), 0.0, 1.0); - let flow = 0.5 + 0.5 * sin(along * 18.0 - t * 3.0); - let cyan = vec3f(0.0, 0.96, 0.83); - return cyan * inst.energy * (core * (0.6 + 0.6 * flow) + glow); -} - -fn shade_ribbon(inst: Inst, p: vec2f, t: f32) -> vec3f { - // RIBBON: tapered (wide at nucleus, narrow at source), UV-scroll flow toward - // the decision, head-bright opacity gradient, PRGn hue by sign. - let along = clamp(dot(p - inst.a, inst.b - inst.a) / max(1e-6, dot(inst.b - inst.a, inst.b - inst.a)), 0.0, 1.0); - let d = sdf_segment(p, inst.a, inst.b); - let taper = inst.thickness * mix(0.35, 1.0, along); // widen toward B (nucleus) - let core = smoothstep(taper, 0.0, d); - // flowing dashes travelling A→B (causal direction) - let flow = 0.5 + 0.5 * sin(along * 26.0 - t * 4.0 - inst.seed); - let headBright = mix(0.35, 1.0, along); // brighter toward the decision head - let hue = prgn(inst.sign, inst.trust); - return hue * inst.energy * core * flow * headBright; -} - -fn shade_nucleus(inst: Inst, p: vec2f, t: f32) -> vec3f { - // NUCLEUS: recommendation core; stability = confidence. Coherent (tight solid - // rings) when confident, scattered/soft when not. Confidence in inst.extra. - let c = inst.extra; - let r = length(p - inst.a); - let coherence = smoothstep(0.0, 1.0, c); - let coreR = inst.thickness * (0.5 + 0.3 * c); - let core = smoothstep(coreR, 0.0, r); - // 1..4 concentric rings, more + tighter as confidence rises - let ringCount = 1.0 + floor(c * 3.0); - let ringPhase = r / max(1e-4, inst.thickness) * ringCount * TAU; - let ring = pow(max(0.0, sin(ringPhase - t * 1.5)), 6.0) * smoothstep(inst.thickness * 1.6, inst.thickness * 0.4, r) * coherence; - let hot = vec3f(0.91, 1.0, 0.72); - return vsup(hot, c) * (core * 1.4 + ring * 0.8); -} - -fn shade_fringe(inst: Inst, p: vec2f, t: f32) -> vec3f { - // FRINGE: two-source interference between contradicting evidence a,b. Scarlet - // standing wave (cos^2) that breathes; reads as "these two conflict". - let r1 = distance(p, inst.a); - let r2 = distance(p, inst.b); - let lambda = 0.05; - let phase = TAU * (r1 - r2) / lambda - t * 2.0; - let fr = cos(phase * 0.5); - let intensity = fr * fr; - // confine the fringe to the region BETWEEN the two sources - let mid = (inst.a + inst.b) * 0.5; - let span = distance(inst.a, inst.b) * 0.6 + 0.06; - let mask = smoothstep(span, span * 0.4, distance(p, mid)); - let scarlet = vec3f(0.95, 0.08, 0.14); - return scarlet * intensity * mask * inst.extra; -} - -fn shade_scar(inst: Inst, p: vec2f, t: f32) -> vec3f { - // SCAR: superseded evidence leaves a dim etched mark at A, with an AMBER - // transfer filament flowing A→B (into the replacement). - let dScar = sdf_segment(p, inst.a - vec2f(0.02, 0.0), inst.a + vec2f(0.02, 0.0)); - let scar = smoothstep(0.006, 0.0, dScar) * 0.5; - let dFil = sdf_segment(p, inst.a, inst.b); - let along = clamp(dot(p - inst.a, inst.b - inst.a) / max(1e-6, dot(inst.b - inst.a, inst.b - inst.a)), 0.0, 1.0); - let flow = 0.5 + 0.5 * sin(along * 20.0 - t * 3.5); - let fil = smoothstep(inst.thickness * 0.6, 0.0, dFil) * flow * (1.0 - along * 0.4); - let amber = vec3f(1.0, 0.82, 0.4); - let ash = vec3f(0.45, 0.4, 0.38); - return ash * scar + amber * fil * 0.7; -} - -// segment SDF helper -fn sdf_segment(p: vec2f, a: vec2f, b: vec2f) -> f32 { - let pa = p - a; - let ba = b - a; - let h = clamp(dot(pa, ba) / max(1e-6, dot(ba, ba)), 0.0, 1.0); - return length(pa - ba * h); -} - -@fragment -fn fs_geo(in: VSOut) -> @location(0) vec4f { - let inst = insts[in.idx]; - let p = in.world; - let t = params.time; - var rgb = vec3f(0.0); - let k = inst.kind; - if (k == 0.0) { rgb = shade_beam(inst, p, t); } - else if (k == 1.0) { rgb = shade_ribbon(inst, p, t); } - else if (k == 2.0) { rgb = shade_nucleus(inst, p, t); } - else if (k == 3.0) { rgb = shade_fringe(inst, p, t); } - else if (k == 4.0) { rgb = shade_scar(inst, p, t); } - rgb = rgb * params.brightness; - // additive: alpha carries nothing; premultiplied rgb is the contribution. - return vec4f(rgb, 1.0); -} -`,ae=12,fe=512,J={beam:0,ribbon:1,nucleus:2,fringe:3,scar:4};class ut{constructor(e){R(this,"engine");R(this,"layout",null);R(this,"pipeline",null);R(this,"bindGroup",null);R(this,"instanceBuffer",null);R(this,"instanceCount",0);R(this,"ready",!1);this.engine=e}uploadScene(e){this.layout=(e==null?void 0:e.organ)==="reasoning"?lt(e):null,this.ensurePipeline(),this.uploadInstances()}ensurePipeline(){if(this.pipeline||this.ready)return;const e=this.engine.gpuDevice;if(!e||!this.engine.paramsBuffer)return;this.ready=!0,this.instanceBuffer=e.createBuffer({label:"reasoning-geometry-instances",size:fe*ae*4,usage:GPUBufferUsage.STORAGE|GPUBufferUsage.COPY_DST});const s=e.createShaderModule({label:"reasoning-geometry-wgsl",code:dt}),u=e.createBindGroupLayout({entries:[{binding:0,visibility:GPUShaderStage.VERTEX|GPUShaderStage.FRAGMENT,buffer:{type:"uniform"}},{binding:1,visibility:GPUShaderStage.VERTEX|GPUShaderStage.FRAGMENT,buffer:{type:"read-only-storage"}}]});this.bindGroup=e.createBindGroup({layout:u,entries:[{binding:0,resource:{buffer:this.engine.paramsBuffer}},{binding:1,resource:{buffer:this.instanceBuffer}}]});const f={color:{srcFactor:"one",dstFactor:"one",operation:"add"},alpha:{srcFactor:"one",dstFactor:"one",operation:"add"}};this.pipeline=e.createRenderPipeline({label:"reasoning-geometry-pipeline",layout:e.createPipelineLayout({bindGroupLayouts:[u]}),vertex:{module:s,entryPoint:"vs_geo"},fragment:{module:s,entryPoint:"fs_geo",targets:[{format:this.engine.sceneFormat,blend:f}]},primitive:{topology:"triangle-list"}})}uploadInstances(){const e=this.engine.gpuDevice;if(!e||!this.instanceBuffer)return;const s=this.layout;if(!s){this.instanceCount=0;return}const u=new Float32Array(fe*ae);let f=0;const i=d=>{f>=fe||(u.set(d,f*ae),f++)};for(let d=0;d{const e=qe(t);return[e[0],e[1],e[2]]},ge=z("#00F5D4"),Se=z("#9DFFEB"),ft=z("#FF3B30"),ht=z("#FFD166"),oe=z("#E9FFB7"),X=[.42,.46,.52],he=z("#6B7A88"),D=[-.86,-.526,-.214,.074,.335,.562,.747,.86],G=0,mt=["INTENT","RETRIEVE","ACTIVATE","EVIDENCE","CHALLENGE","SYNTH","DECIDE","SEAL"],gt={primary:.04,supporting:.24,contradicting:-.22,superseded:-.48},xe=.052,ce=6,vt=t=>t*t*(3-2*t);function me(t,e){const s=vt(Math.max(0,Math.min(1,e))),u=.72+.28*s,f=(X[0]+(t[0]-X[0])*s)*u,i=(X[1]+(t[1]-X[1])*s)*u,d=(X[2]+(t[2]-X[2])*s)*u,a=.4+.6*s;return[Math.min(1,f),Math.min(1,i),Math.min(1,d),a]}function Ae(t){switch(t){case"primary":return ge;case"supporting":return Se;case"contradicting":return ft;case"superseded":return ht}}function Z(t){return t.replace(/[—–]/g,"-").replace(/[‘’]/g,"'").replace(/[“”]/g,'"').replace(/…/g,"...").replace(/[^\x20-\x7E]/g,"?")}const $=-1e5;class yt{constructor(e){R(this,"text");R(this,"scene",null);R(this,"ready",!1);R(this,"initPromise",null);this.text=new He(e)}uploadScene(e){this.scene=(e==null?void 0:e.organ)==="reasoning"?e:null,this.ensureReady().then(()=>this.text.setText(this.build()))}render(e){this.text.render(e)}pickAt(e,s){return this.text.pickAt(e,s)}dispose(){this.text.dispose()}async ensureReady(){this.initPromise||(this.initPromise=this.text.init().then(()=>void(this.ready=!0))),await this.initPromise}build(){var a,x,w;const e=this.scene;if(!e||!e.alive)return[];const s=[],u=Z(String(((a=e.raw)==null?void 0:a.query)??"")).slice(0,60);s.push({id:"trace:query",kind:"trace-query",text:u?`> ${u}`:"> (trace)",x:-.94,y:.82,size:.03,color:[...oe,1],weight:.95,depth:1,startFrame:$,revealSpan:1,maxWidthEm:60});const f=e.stages??[];for(let c=0;c{const _=n+(S-(p.length-1)/2)*xe,A=Z(v.preview).replace(/\s+/g," ").trim().slice(0,46);s.push({id:`trace:ev:${v.id}`,kind:"trace-evidence",text:`${A} · ${Math.round(v.trust*100)}%`,x:D[3]-.02,y:_,size:.016,color:me(Ae(c),v.trust),weight:.4+.5*v.trust,depth:.6+.4*v.trust,startFrame:$,revealSpan:1,maxWidthEm:52,hitPadX:.03,hitPadY:.02,ariaLabel:`${c} evidence, trust ${Math.round(v.trust*100)}%: ${A}`,preview:A})}),l.length>ce&&s.push({id:`trace:super:${c}`,kind:"trace-supernode",text:`+${l.length-ce} more ${c}`,x:D[3]-.02,y:n-(ce/2+1)*xe,size:.014,color:[...he,.7],depth:.6,startFrame:$,revealSpan:1,maxWidthEm:30}),s.push({id:`trace:lanelabel:${c}`,kind:"trace-hud",text:c.toUpperCase(),x:D[3]-.16,y:n,size:.013,color:[...Ae(c),.55],depth:.7,startFrame:$,revealSpan:1,maxWidthEm:14})}if(e.recommended){const c=Math.max(0,Math.min(1,e.recommended.trust_score)),l=Z(e.recommended.answer_preview).replace(/\s+/g," ").trim().slice(0,48),n=D[6],p=c>=.6;s.push({id:"trace:nucleus",kind:"trace-recommendation",text:p?"O":"o",x:n,y:G,size:.05+.05*c,color:me(oe,c),weight:.6+.4*c,depth:1,startFrame:$,revealSpan:1,maxWidthEm:4,hitPadX:.06,hitPadY:.06,ariaLabel:`Recommendation, ${Math.round(c*100)}% confidence: ${l}`,preview:l}),s.push({id:"trace:reclabel",kind:"trace-hud",text:`${p?"LOCKED":"OPEN"} · ${Math.round(c*100)}%`,x:n-.05,y:G-.11,size:.016,color:me(oe,c),depth:1,startFrame:$,revealSpan:1,maxWidthEm:18}),s.push({id:"trace:answer",kind:"trace-hud",text:l,x:n-.28,y:G-.17,size:.016,color:[...oe,.92],depth:.95,startFrame:$,revealSpan:1,maxWidthEm:44,maxLines:2})}const d=((x=e.evidence)==null?void 0:x.length)??0;return s.push({id:"trace:receipt",kind:"trace-receipt",text:`[ ${d} SOURCES SEALED ]`,x:D[7]-.14,y:G-.07,size:.015,color:[...Se,.85],depth:.9,startFrame:$,revealSpan:1,maxWidthEm:24,hitPadX:.05,hitPadY:.04,ariaLabel:`Composition receipt: ${d} sources, analysed ${((w=e.raw)==null?void 0:w.memoriesAnalyzed)??d} memories`}),s}}function bt(t,e){return[pt(t),new yt(t)]}var _t=ve(""),wt=ve('
'),Et=ve('
',1);function Ft(t,e){$e(e,!0);let s=W(""),u=W(!1),f=W(null),i=W(null),d=W(null),a=W(null),x=null;function w(){const o=m(i);if(!o)return[];const h=new Set((o.contradictions??[]).flatMap(b=>{var T,L;return[(T=b.stronger)==null?void 0:T.id,(L=b.weaker)==null?void 0:L.id]}).filter(Boolean)),y=(o.evidence??[]).map((b,T)=>{var L;return{id:b.id||`evidence:${T}`,score:.4+.6*c(b.trust??.5),hue:h.has(b.id)?_e.scarlet:_e.forward,energy:.45+.55*c(b.trust??.5),metric2:c(b.trust??.5),scar:h.has(b.id),selected:b.id===((L=o.recommended)==null?void 0:L.memory_id),kind:"reasoning-evidence",payload:b}});return je(y,{maxRadius:.9,minCellR:.016,maxCellR:.06})}function c(o){return Math.min(1,Math.max(0,Number.isFinite(o)?o:.5))}function l(o,h){const y=new Ke(o);return x=y,y.setCells(w()),[{compute:T=>y.compute(T),render:T=>y.render(T),dispose:()=>{y.dispose(),x===y&&(x=null)}},...bt(o)]}Ne(()=>{var o;(o=m(i))==null||o.evidence.length,x==null||x.setCells(w())});const n=["What port does the dev server use?","Should I enable prefix caching with vLLM?","How does FSRS-6 trust scoring work?","Why did the benchmark score drop after the parser change?"];async function p(){const o=m(s).trim();if(!(!o||m(u))){I(u,!0),I(f,null),I(i,null),I(d,null);try{const h=await Ye.deepReference(o,20);I(i,et(h),!0)}catch(h){I(f,h instanceof Error?h.message:"Unknown error",!0)}finally{I(u,!1)}}}const v=be(()=>{var y,b;if(m(u))return"Reasoning in progress.";if(m(f))return`Error: ${m(f)}`;if(!m(i))return"Ask a question to trace how Vestige forms a decision from memory.";const o=m(i),h=((y=o.recommended)==null?void 0:y.answer_preview)??"no recommendation";return`Decision trace for "${m(s)}". ${o.evidence.length} evidence memories, ${o.contradictions.length} contradiction${o.contradictions.length===1?"":"s"}, ${o.superseded.length} superseded. Recommendation: ${h}. Confidence ${Math.round((((b=o.recommended)==null?void 0:b.trust_score)??0)*100)} percent.`});function S(o){const h=o.payload;I(d,(h==null?void 0:h.ariaLabel)??(h==null?void 0:h.preview)??`${o.kind} selected`,!0)}function _(o){var h,y;(o.metaKey||o.ctrlKey)&&o.key.toLowerCase()==="k"&&(o.preventDefault(),(h=m(a))==null||h.focus(),(y=m(a))==null||y.select())}Te(()=>{var o;return(o=m(a))==null||o.focus(),window.addEventListener("keydown",_),m(s).trim()||(I(s,"What is the Vestige dashboard direction?"),p()),()=>window.removeEventListener("keydown",_)});var A=Et();Xe("q2v96u",o=>{Le(()=>{Fe.title="Reasoning Theater · Vestige"})});var C=Pe(A);{let o=be(()=>`reasoning-trace:${m(s)||"empty"}`);ze(C,{organ:"reasoning",get seed(){return m(o)},get scene(){return m(i)},passes:l,get loading(){return m(u)},get error(){return m(f)},emptyLabel:"ASK A QUESTION - PRESS CMD+K - WATCH THE DECISION FORM",onpick:S})}var k=j(C,2),M=j(pe(k),2);Oe(M),De(M,o=>I(a,o),()=>m(a));var H=j(M,2);Ue(H,21,()=>n,We,(o,h)=>{var y=_t(),b={};de(()=>{b!==(b=m(h))&&(y.value=(y.__value=m(h))??"")}),ue(o,y)}),ie(H),Be(2),ie(k);var q=j(k,2),K=pe(q,!0);ie(q);var ne=j(q,2);{var N=o=>{var h=wt(),y=pe(h,!0);ie(h),de(()=>ye(y,m(d))),ue(o,h)};Ge(ne,o=>{m(d)&&o(N)})}de(()=>ye(K,m(v))),Ie("submit",k,o=>{o.preventDefault(),p()}),Ve(M,()=>m(s),o=>I(s,o)),ue(t,A),Me()}export{Ft as component}; diff --git a/apps/dashboard/build/_app/immutable/nodes/20.Cj35A6gq.js.br b/apps/dashboard/build/_app/immutable/nodes/20.Cj35A6gq.js.br deleted file mode 100644 index a2f8f68..0000000 Binary files a/apps/dashboard/build/_app/immutable/nodes/20.Cj35A6gq.js.br and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/nodes/20.Cj35A6gq.js.gz b/apps/dashboard/build/_app/immutable/nodes/20.Cj35A6gq.js.gz deleted file mode 100644 index 171ca6c..0000000 Binary files a/apps/dashboard/build/_app/immutable/nodes/20.Cj35A6gq.js.gz and /dev/null differ diff --git a/apps/dashboard/build/_app/immutable/nodes/20.DD0_N4PP.js b/apps/dashboard/build/_app/immutable/nodes/20.DD0_N4PP.js new file mode 100644 index 0000000..682d48d --- /dev/null +++ b/apps/dashboard/build/_app/immutable/nodes/20.DD0_N4PP.js @@ -0,0 +1,198 @@ +var Te=Object.defineProperty;var Ie=(t,e,s)=>e in t?Te(t,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[e]=s;var R=(t,e,s)=>Ie(t,typeof e!="symbol"?e+"":e,s);import"../chunks/Bzak7iHL.js";import{o as $e,e as Ne,s as be}from"../chunks/DAau0uzT.js";import{p as Pe,j as Me,g as v,aH as Le,Y as de,a as ue,b as Fe,d as W,h as Be,X as q,s as N,f as ye,u as _e,$ as De,c as pe,r as se,af as Ge}from"../chunks/CGq8RnJq.js";import{b as Ue,i as Oe}from"../chunks/Ccqjq5DS.js";import{e as Xe,r as We,i as Ye}from"../chunks/DqfV0sZu.js";import{h as Ve}from"../chunks/De_e6MzK.js";import{b as ze}from"../chunks/DGM4cicq.js";import{a as we}from"../chunks/D35IQVqe.js";import{R as He}from"../chunks/BpEKQwpr.js";import{T as qe}from"../chunks/D7ozXiSB.js";import{r as Ke}from"../chunks/BMB5u1EX.js";import{L as je,F as fe,l as Ee}from"../chunks/DETSv_kY.js";const Qe={intent:"Intent classification",retrieve:"Memory retrieval",activate:"Activation expansion",evidence:"Evidence grounding",contradiction:"Contradiction check",synthesis:"Synthesis",recommendation:"Recommendation",receipt:"Composition receipt"},Je=["intent","retrieve","activate","evidence","contradiction","synthesis","recommendation","receipt"];function F(t){return t&&typeof t=="object"&&!Array.isArray(t)?t:{}}function y(t,e=""){return typeof t=="string"?t:t==null?e:String(t)}function J(t,e=0){return typeof t=="number"&&Number.isFinite(t)?t:e}function V(t){return Math.max(0,Math.min(1,t))}function Z(t){const e=J(t,0);return V(e>1?e/100:e)}function Ze(t){return t==="primary"||t==="supporting"||t==="contradicting"||t==="superseded"?t:"supporting"}function K(t,e=""){const s=Z(t.trust??t.trust_score??0);return{id:y(t.id??t.memory_id??e),trust:s,date:y(t.date??t.created_at??""),role:Ze(t.role),preview:y(t.preview??t.answer_preview??t.content??""),nodeType:t.node_type?y(t.node_type):t.nodeType?y(t.nodeType):void 0}}function X(t,e,s){return s?{kind:t,id:e,scalar:s}:{kind:t,id:e||`${t}:unknown`}}function P(t,e){return{kind:"scalar",id:`deep_reference.${t}`,scalar:{name:t,value:e}}}function et(t){var f,m,g,w;const e=F(t),u=(Array.isArray(e.evidence)?e.evidence.map(F):[]).map(n=>K(n)).filter(n=>n.id.length>0),h=F(e.recommended),i=Object.keys(h).length>0||u.length>0?{answer_preview:y(h.answer_preview??((f=u[0])==null?void 0:f.preview)??""),memory_id:y(h.memory_id??((m=u[0])==null?void 0:m.id)??""),trust_score:Z(h.trust_score??((g=u[0])==null?void 0:g.trust)??0),date:y(h.date??((w=u[0])==null?void 0:w.date)??"")}:null,a=(Array.isArray(e.contradictions)?e.contradictions.map(F):Array.isArray(e.claim_conflicts)?e.claim_conflicts.map(F):[]).map(n=>{const A=F(n.stronger),L=F(n.weaker);if(Object.keys(A).length>0||Object.keys(L).length>0){const ne=K(A),re=K(L);return{stronger:ne,weaker:re,topic_overlap:V(J(n.topic_overlap,0)),summary:y(n.summary,`Trust-weighted conflict: ${ne.id.slice(0,8)} over ${re.id.slice(0,8)}`)}}const O=K({id:n.a_id,role:"contradicting"}),le=K({id:n.b_id,role:"contradicting"});return{stronger:O,weaker:le,topic_overlap:V(J(n.topic_overlap,0)),summary:y(n.summary??n.reason,"Trust-weighted conflict between high-FSRS memories.")}}).filter(n=>n.stronger.id||n.weaker.id),E=(Array.isArray(e.superseded)?e.superseded.map(F):[]).map(n=>n.id||n.superseded_by?{id:y(n.id),preview:y(n.preview??""),trust:Z(n.trust??0),date:y(n.date??""),superseded_by:y(n.superseded_by??(i==null?void 0:i.memory_id)??""),reason:y(n.reason??"Superseded by newer memory with higher trust.")}:{id:y(n.old_id),preview:y(n.preview??""),trust:Z(n.trust??0),date:y(n.date??""),superseded_by:y(n.new_id??(i==null?void 0:i.memory_id)??""),reason:y(n.reason??"Superseded by newer memory with higher trust.")}).filter(n=>n.id||n.superseded_by),c=Z(e.confidence),l=J(e.memoriesAnalyzed??e.memories_analyzed,u.length),r=J(e.activationExpanded??e.activation_expanded,0),p=y(e.intent??""),b=y(e.reasoning??e.guidance??""),k=y(e.guidance??""),x=y(e.composition_event_id??""),S=y(e.compositionWriteStatus??e.composition_write_status??""),C=x||S,T=x.length>0,M=u.map((n,A)=>({source:X("memory",n.id),index:A,label:n.preview||n.id.slice(0,8),retention:V(n.trust),trust:V(n.trust),lastAccessed:n.date||void 0,tags:[n.role,...n.nodeType?[n.nodeType]:[]],type:n.nodeType??"memory"})),G=new Map(M.map(n=>[n.source.id,n.index])),ee=a.flatMap((n,A)=>{const L=G.get(n.stronger.id),O=G.get(n.weaker.id);return L==null||O==null?[]:[{source:X("pair",`contradiction:${n.stronger.id}:${n.weaker.id}`),sourceIndex:L,targetIndex:O,weight:Math.max(.2,n.topic_overlap||.5),kind:"contradiction"}]}),U=[];a.length>0&&U.push({source:X("event",`deep_reference.contradictions.${a.length}`),type:"ReasoningContradictionInterrupt",targetIndex:-1,frame:250,energy:a.length}),E.length>0&&U.push({source:X("event",`deep_reference.superseded.${E.length}`),type:"ReasoningSupersessionInterrupt",targetIndex:-1,frame:330,energy:E.length});const te=[];C&&te.push({source:T?X("receipt",x):P("compositionWriteStatus",S==="persisted"?1:0),label:T?`receipt ${x.slice(0,8)}`:S,nodeIndices:M.map(n=>n.index)});const $=(n,A,L,O,le,ne,re,Ce="none")=>({index:n,kind:A,label:Qe[A],count:L,confidence:V(O),lit:L>0||O>0,provenance:ne,exposed:le,not_exposed_by_backend:re,interrupt:Ce}),ce=Je.map((n,A)=>{switch(n){case"intent":return $(A,n,p?1:0,p?c:0,{intent:p},P("intent_present",p?1:0),["raw classifier trace"]);case"retrieve":return $(A,n,l||u.length,c,{memoriesAnalyzed:l,evidence_count:u.length},P("memoriesAnalyzed",l),["candidate ids discarded before evidence"]);case"activate":return $(A,n,r,r>0?c:0,{activationExpanded:r},P("activationExpanded",r),["activation path/map"]);case"evidence":return $(A,n,u.length,u.length>0?c:0,{evidence:u},P("evidence_count",u.length),["reranker discarded candidates"]);case"contradiction":return $(A,n,a.length,a.length>0?c:0,{contradictions:a,claim_conflicts:e.claim_conflicts??[]},P("contradiction_count",a.length),["full claim graph"],a.length>0?"contradiction":"none");case"synthesis":return $(A,n,b||k?1:0,b||k?c:0,{reasoning:b,guidance:k},P("synthesis_present",b||k?1:0),["token-level chain internals"]);case"recommendation":return $(A,n,i!=null&&i.memory_id?1:0,(i==null?void 0:i.trust_score)??0,{recommended:i},i!=null&&i.memory_id?X("memory",i.memory_id):P("recommended_present",0),["alternative recommendations"]);case"receipt":return $(A,n,C?1:0,C?c:0,{composition_event_id:x,compositionWriteStatus:S},T?X("receipt",x):P("compositionWriteStatus",S==="persisted"?1:0),["separate receipt field"],E.length>0?"supersession":"none")}});return{organ:"reasoning",nodes:M,edges:ee,events:U,receipts:te,scalars:{confidence:c,memoriesAnalyzed:l,activationExpanded:r,evidenceCount:u.length,contradictionCount:a.length,supersededCount:E.length,compositionPersisted:T?1:0},alive:!!(p||b||k||u.length||a.length||E.length||i!=null&&i.memory_id||C),stages:ce,evidence:u,contradictions:a,superseded:E,recommended:i,raw:e}}const z=[-.86,-.526,-.214,.074,.335,.562,.747,.86],tt=["INTENT","RETRIEVE","ACTIVATE","EVIDENCE","CHALLENGE","SYNTH","DECIDE","SEAL"],xe=0,nt=3,Ae=6,rt=7,st={primary:.04,supporting:.24,contradicting:-.22,superseded:-.48},it=.052,at=6,ot=z[nt]-.02,ct=.14;function lt(t){var c,l;if(!t||!t.alive)return null;const e=String(((c=t.raw)==null?void 0:c.query)??""),s=(t.stages??[]).slice(0,z.length).map((r,p)=>({index:p,kind:(r==null?void 0:r.kind)??String(p),label:(r==null?void 0:r.label)??(r==null?void 0:r.kind)??"",short:tt[p]??((r==null?void 0:r.kind)??"").toUpperCase(),x:z[p],lit:!!(r!=null&&r.lit),confidence:(r==null?void 0:r.confidence)??0,count:(r==null?void 0:r.count)??0})),u=new Map;for(const r of t.evidence??[]){const p=u.get(r.role)??[];p.push(r),u.set(r.role,p)}const h=[];for(const[r,p]of u){const b=st[r],k=p.slice(0,at);k.forEach((x,S)=>{const C=b+(S-(k.length-1)/2)*it,T=ot+S/Math.max(1,k.length-1)*ct;h.push({id:x.id,role:r,trust:x.trust,preview:x.preview,x:T,y:C})})}const i=t.recommended!=null?{x:z[Ae],y:xe,confidence:Math.max(0,Math.min(1,t.recommended.trust_score))}:null,d=i?h.map(r=>({fromX:r.x,fromY:r.y,toX:i.x,toY:i.y,trust:r.trust,role:r.role,sign:r.role==="contradicting"?-1:1})):[],a=new Map(h.map(r=>[r.id,r])),_=(t.contradictions??[]).map(r=>{const p=a.get(r.stronger.id),b=a.get(r.weaker.id);return!p||!b?null:{ax:p.x,ay:p.y,bx:b.x,by:b.y,strength:Math.max(.35,r.topic_overlap||.5)}}).filter(r=>r!==null),E=(t.superseded??[]).map(r=>{const p=a.get(r.id);return p?{x:p.x,y:p.y,toX:(i==null?void 0:i.x)??z[Ae],toY:(i==null?void 0:i.y)??xe}:null}).filter(r=>r!==null);return{query:e,gates:s,evidence:h,ribbons:d,nucleus:i,fringes:_,scars:E,receiptX:z[rt],sourceCount:((l=t.evidence)==null?void 0:l.length)??0}}const dt=` +struct Params { + frame: f32, loopPhase: f32, nodeCount: f32, edgeCount: f32, + pathCount: f32, pulse: f32, viewportW: f32, viewportH: f32, + brightness: f32, demoId: f32, time: f32, captureMode: f32, + liveKind: f32, liveFrame: f32, liveEnergy: f32, projectionDays: f32, + cursorX: f32, cursorY: f32, cursorVx: f32, cursorVy: f32, +}; + +// Instance record (12 floats) — mirrors reasoning-geometry-pass INSTANCE_FLOATS. +struct Inst { + a: vec2f, // endpoint A / center (NDC) + b: vec2f, // endpoint B (== a for points) + kind: f32, // 0 beam, 1 ribbon, 2 nucleus, 3 fringe, 4 scar + thickness: f32, // NDC half-width + trust: f32, // 0..1 + sign: f32, // +1 support / -1 oppose + energy: f32, // 0..1 + seed: f32, // per-instance phase + extra: f32, // kind-specific (fringe strength / nucleus confidence) + pad: f32, +}; + +@group(0) @binding(0) var params: Params; +@group(0) @binding(1) var insts: array; + +const TAU: f32 = 6.28318530718; +const QUAD = array( + vec2f(0.0, 0.0), vec2f(1.0, 0.0), vec2f(1.0, 1.0), + vec2f(0.0, 0.0), vec2f(1.0, 1.0), vec2f(0.0, 1.0) +); + +struct VSOut { + @builtin(position) clip: vec4f, + @location(0) world: vec2f, // NDC position of this fragment + @location(1) @interpolate(flat) idx: u32, +}; + +fn aspect() -> f32 { return max(0.0001, params.viewportW / max(1.0, params.viewportH)); } + +// smoothstep-based value-suppressing palette (Correll/Moritz/Heer): low trust → +// neutral grey (never jitter), high trust → vivid. base is the category hue. +fn vsup(base: vec3f, trust: f32) -> vec3f { + let s = smoothstep(0.0, 1.0, clamp(trust, 0.0, 1.0)); + let neutral = vec3f(0.42, 0.46, 0.52); + let bright = 0.72 + 0.28 * s; + return mix(neutral, base, s) * bright; +} + +// PRGn-style diverging hue by signed influence: + = green (support), − = purple +// (oppose). |mag| drives saturation; zero-point kept off pure white. +fn prgn(sign: f32, mag: f32) -> vec3f { + let green = vec3f(0.0, 0.85, 0.45); + let purple = vec3f(0.55, 0.15, 0.75); + let base = select(purple, green, sign >= 0.0); + return mix(vec3f(0.35, 0.37, 0.4), base, clamp(mag, 0.0, 1.0)); +} + +@vertex +fn vs_geo(@builtin(vertex_index) vi: u32, @builtin(instance_index) ii: u32) -> VSOut { + var out: VSOut; + let inst = insts[ii]; + let corner = QUAD[vi]; + let asp = aspect(); + + // Bounding quad: for line-like kinds (beam/ribbon/scar/fringe) expand along + // the A→B segment plus thickness on the perpendicular; for point kinds + // (nucleus) a square of side 2*thickness around A. + var pos: vec2f; + let is_point = inst.kind == 2.0; + if (is_point) { + let r = inst.thickness + 0.04; // padding for glow/rings + pos = inst.a + (corner - vec2f(0.5)) * (2.0 * r); + } else { + let dir = inst.b - inst.a; + let len = max(1e-4, length(dir)); + let t_hat = dir / len; + let n_hat = vec2f(-t_hat.y, t_hat.x); + let half_w = inst.thickness + 0.03; // padding for AA/glow + // corner.x runs along the segment (0..1), corner.y across (-1..1) + let along = corner.x; + let across = (corner.y - 0.5) * 2.0; + pos = inst.a + t_hat * (along * len) + n_hat * (across * half_w); + } + + // aspect-correct so circles stay round (mirror the text pass convention). + var clip = pos; + clip.x = clip.x / max(asp, 1.0); + clip.y = clip.y * min(asp, 1.0); + out.clip = vec4f(clip, 0.0, 1.0); + out.world = pos; + out.idx = ii; + return out; +} + +// ── Per-kind SDF shading. Each returns premultiplied additive HDR rgb. ──────── +// FLEET: fill these five. Each is a PURE function of (inst, p, t) → vec3f. Keep +// them deterministic (use params.time via t), additive (return black to skip a +// pixel), and honest (brightness ∝ the real trust/energy/confidence fields). + +fn shade_beam(inst: Inst, p: vec2f, t: f32) -> vec3f { + // BEAM: a bright emissive causal line A→B along y with a flowing pulse. + let d = sdf_segment(p, inst.a, inst.b); + let core = smoothstep(inst.thickness, 0.0, d); + let glow = smoothstep(inst.thickness * 4.0, 0.0, d) * 0.35; + // flow pulse travelling toward the decision (left→right) + let along = clamp((p.x - inst.a.x) / max(1e-4, inst.b.x - inst.a.x), 0.0, 1.0); + let flow = 0.5 + 0.5 * sin(along * 18.0 - t * 3.0); + let cyan = vec3f(0.0, 0.96, 0.83); + return cyan * inst.energy * (core * (0.6 + 0.6 * flow) + glow); +} + +fn shade_ribbon(inst: Inst, p: vec2f, t: f32) -> vec3f { + // RIBBON: tapered (wide at nucleus, narrow at source), UV-scroll flow toward + // the decision, head-bright opacity gradient, PRGn hue by sign. + let along = clamp(dot(p - inst.a, inst.b - inst.a) / max(1e-6, dot(inst.b - inst.a, inst.b - inst.a)), 0.0, 1.0); + let d = sdf_segment(p, inst.a, inst.b); + let taper = inst.thickness * mix(0.35, 1.0, along); // widen toward B (nucleus) + let core = smoothstep(taper, 0.0, d); + // flowing dashes travelling A→B (causal direction) + let flow = 0.5 + 0.5 * sin(along * 26.0 - t * 4.0 - inst.seed); + let headBright = mix(0.35, 1.0, along); // brighter toward the decision head + let hue = prgn(inst.sign, inst.trust); + return hue * inst.energy * core * flow * headBright; +} + +fn shade_nucleus(inst: Inst, p: vec2f, t: f32) -> vec3f { + // NUCLEUS: recommendation core; stability = confidence. Coherent (tight solid + // rings) when confident, scattered/soft when not. Confidence in inst.extra. + let c = inst.extra; + let r = length(p - inst.a); + let coherence = smoothstep(0.0, 1.0, c); + let coreR = inst.thickness * (0.5 + 0.3 * c); + let core = smoothstep(coreR, 0.0, r); + // 1..4 concentric rings, more + tighter as confidence rises + let ringCount = 1.0 + floor(c * 3.0); + let ringPhase = r / max(1e-4, inst.thickness) * ringCount * TAU; + let ring = pow(max(0.0, sin(ringPhase - t * 1.5)), 6.0) * smoothstep(inst.thickness * 1.6, inst.thickness * 0.4, r) * coherence; + let hot = vec3f(0.91, 1.0, 0.72); + return vsup(hot, c) * (core * 1.4 + ring * 0.8); +} + +fn shade_fringe(inst: Inst, p: vec2f, t: f32) -> vec3f { + // FRINGE: two-source interference between contradicting evidence a,b. Scarlet + // standing wave (cos^2) that breathes; reads as "these two conflict". + let r1 = distance(p, inst.a); + let r2 = distance(p, inst.b); + let lambda = 0.05; + let phase = TAU * (r1 - r2) / lambda - t * 2.0; + let fr = cos(phase * 0.5); + let intensity = fr * fr; + // confine the fringe to the region BETWEEN the two sources + let mid = (inst.a + inst.b) * 0.5; + let span = distance(inst.a, inst.b) * 0.6 + 0.06; + let mask = smoothstep(span, span * 0.4, distance(p, mid)); + let scarlet = vec3f(0.95, 0.08, 0.14); + return scarlet * intensity * mask * inst.extra; +} + +fn shade_scar(inst: Inst, p: vec2f, t: f32) -> vec3f { + // SCAR: superseded evidence leaves a dim etched mark at A, with an AMBER + // transfer filament flowing A→B (into the replacement). + let dScar = sdf_segment(p, inst.a - vec2f(0.02, 0.0), inst.a + vec2f(0.02, 0.0)); + let scar = smoothstep(0.006, 0.0, dScar) * 0.5; + let dFil = sdf_segment(p, inst.a, inst.b); + let along = clamp(dot(p - inst.a, inst.b - inst.a) / max(1e-6, dot(inst.b - inst.a, inst.b - inst.a)), 0.0, 1.0); + let flow = 0.5 + 0.5 * sin(along * 20.0 - t * 3.5); + let fil = smoothstep(inst.thickness * 0.6, 0.0, dFil) * flow * (1.0 - along * 0.4); + let amber = vec3f(1.0, 0.82, 0.4); + let ash = vec3f(0.45, 0.4, 0.38); + return ash * scar + amber * fil * 0.7; +} + +// segment SDF helper +fn sdf_segment(p: vec2f, a: vec2f, b: vec2f) -> f32 { + let pa = p - a; + let ba = b - a; + let h = clamp(dot(pa, ba) / max(1e-6, dot(ba, ba)), 0.0, 1.0); + return length(pa - ba * h); +} + +@fragment +fn fs_geo(in: VSOut) -> @location(0) vec4f { + let inst = insts[in.idx]; + let p = in.world; + let t = params.time; + var rgb = vec3f(0.0); + let k = inst.kind; + if (k == 0.0) { rgb = shade_beam(inst, p, t); } + else if (k == 1.0) { rgb = shade_ribbon(inst, p, t); } + else if (k == 2.0) { rgb = shade_nucleus(inst, p, t); } + else if (k == 3.0) { rgb = shade_fringe(inst, p, t); } + else if (k == 4.0) { rgb = shade_scar(inst, p, t); } + rgb = rgb * params.brightness; + // additive: alpha carries nothing; premultiplied rgb is the contribution. + return vec4f(rgb, 1.0); +} +`,ie=12,he=512,j={beam:0,ribbon:1,nucleus:2,fringe:3,scar:4};class ut{constructor(e){R(this,"engine");R(this,"layout",null);R(this,"pipeline",null);R(this,"bindGroup",null);R(this,"instanceBuffer",null);R(this,"instanceCount",0);R(this,"ready",!1);this.engine=e}uploadScene(e){this.layout=(e==null?void 0:e.organ)==="reasoning"?lt(e):null,this.ensurePipeline(),this.uploadInstances()}ensurePipeline(){if(this.pipeline||this.ready)return;const e=this.engine.gpuDevice;if(!e||!this.engine.paramsBuffer)return;this.ready=!0,this.instanceBuffer=e.createBuffer({label:"reasoning-geometry-instances",size:he*ie*4,usage:GPUBufferUsage.STORAGE|GPUBufferUsage.COPY_DST});const s=e.createShaderModule({label:"reasoning-geometry-wgsl",code:dt}),u=e.createBindGroupLayout({entries:[{binding:0,visibility:GPUShaderStage.VERTEX|GPUShaderStage.FRAGMENT,buffer:{type:"uniform"}},{binding:1,visibility:GPUShaderStage.VERTEX|GPUShaderStage.FRAGMENT,buffer:{type:"read-only-storage"}}]});this.bindGroup=e.createBindGroup({layout:u,entries:[{binding:0,resource:{buffer:this.engine.paramsBuffer}},{binding:1,resource:{buffer:this.instanceBuffer}}]});const h={color:{srcFactor:"one",dstFactor:"one",operation:"add"},alpha:{srcFactor:"one",dstFactor:"one",operation:"add"}};this.pipeline=e.createRenderPipeline({label:"reasoning-geometry-pipeline",layout:e.createPipelineLayout({bindGroupLayouts:[u]}),vertex:{module:s,entryPoint:"vs_geo"},fragment:{module:s,entryPoint:"fs_geo",targets:[{format:this.engine.sceneFormat,blend:h}]},primitive:{topology:"triangle-list"}})}uploadInstances(){const e=this.engine.gpuDevice;if(!e||!this.instanceBuffer)return;const s=this.layout;if(!s){this.instanceCount=0;return}const u=new Float32Array(he*ie);let h=0;const i=d=>{h>=he||(u.set(d,h*ie),h++)};for(let d=0;d{const e=Ke(t);return[e[0],e[1],e[2]]},ve=H("#00F5D4"),Re=H("#9DFFEB"),ft=H("#FF3B30"),ht=H("#FFD166"),ae=H("#E9FFB7"),Y=[.42,.46,.52],me=H("#6B7A88"),B=[-.86,-.526,-.214,.074,.335,.562,.747,.86],D=0,mt=["INTENT","RETRIEVE","ACTIVATE","EVIDENCE","CHALLENGE","SYNTH","DECIDE","SEAL"],gt={primary:.04,supporting:.24,contradicting:-.22,superseded:-.48},Se=.052,oe=6,vt=t=>t*t*(3-2*t);function ge(t,e){const s=vt(Math.max(0,Math.min(1,e))),u=.72+.28*s,h=(Y[0]+(t[0]-Y[0])*s)*u,i=(Y[1]+(t[1]-Y[1])*s)*u,d=(Y[2]+(t[2]-Y[2])*s)*u,a=.4+.6*s;return[Math.min(1,h),Math.min(1,i),Math.min(1,d),a]}function ke(t){switch(t){case"primary":return ve;case"supporting":return Re;case"contradicting":return ft;case"superseded":return ht}}function Q(t){return t.replace(/[—–]/g,"-").replace(/[‘’]/g,"'").replace(/[“”]/g,'"').replace(/…/g,"...").replace(/[^\x20-\x7E]/g,"?")}const I=-1e5;class yt{constructor(e){R(this,"text");R(this,"scene",null);R(this,"ready",!1);R(this,"initPromise",null);this.text=new qe(e)}uploadScene(e){this.scene=(e==null?void 0:e.organ)==="reasoning"?e:null,this.ensureReady().then(()=>this.text.setText(this.build()))}render(e){this.text.render(e)}pickAt(e,s){return this.text.pickAt(e,s)}dispose(){this.text.dispose()}async ensureReady(){this.initPromise||(this.initPromise=this.text.init().then(()=>void(this.ready=!0))),await this.initPromise}build(){var a,_,E;const e=this.scene;if(!e||!e.alive)return[];const s=[],u=Q(String(((a=e.raw)==null?void 0:a.query)??"")).slice(0,60);s.push({id:"trace:query",kind:"trace-query",text:u?`> ${u}`:"> (trace)",x:-.94,y:.82,size:.03,color:[...ae,1],weight:.95,depth:1,startFrame:I,revealSpan:1,maxWidthEm:60});const h=e.stages??[];for(let c=0;c{const x=r+(k-(p.length-1)/2)*Se,S=Q(b.preview).replace(/\s+/g," ").trim().slice(0,46);s.push({id:`trace:ev:${b.id}`,kind:"trace-evidence",text:`${S} · ${Math.round(b.trust*100)}%`,x:B[3]-.02,y:x,size:.016,color:ge(ke(c),b.trust),weight:.4+.5*b.trust,depth:.6+.4*b.trust,startFrame:I,revealSpan:1,maxWidthEm:52,hitPadX:.03,hitPadY:.02,ariaLabel:`${c} evidence, trust ${Math.round(b.trust*100)}%: ${S}`,preview:S})}),l.length>oe&&s.push({id:`trace:super:${c}`,kind:"trace-supernode",text:`+${l.length-oe} more ${c}`,x:B[3]-.02,y:r-(oe/2+1)*Se,size:.014,color:[...me,.7],depth:.6,startFrame:I,revealSpan:1,maxWidthEm:30}),s.push({id:`trace:lanelabel:${c}`,kind:"trace-hud",text:c.toUpperCase(),x:B[3]-.16,y:r,size:.013,color:[...ke(c),.55],depth:.7,startFrame:I,revealSpan:1,maxWidthEm:14})}if(e.recommended){const c=Math.max(0,Math.min(1,e.recommended.trust_score)),l=Q(e.recommended.answer_preview).replace(/\s+/g," ").trim().slice(0,48),r=B[6],p=c>=.6;s.push({id:"trace:nucleus",kind:"trace-recommendation",text:p?"O":"o",x:r,y:D,size:.05+.05*c,color:ge(ae,c),weight:.6+.4*c,depth:1,startFrame:I,revealSpan:1,maxWidthEm:4,hitPadX:.06,hitPadY:.06,ariaLabel:`Recommendation, ${Math.round(c*100)}% confidence: ${l}`,preview:l}),s.push({id:"trace:reclabel",kind:"trace-hud",text:`${p?"LOCKED":"OPEN"} · ${Math.round(c*100)}%`,x:r-.05,y:D-.11,size:.016,color:ge(ae,c),depth:1,startFrame:I,revealSpan:1,maxWidthEm:18}),s.push({id:"trace:answer",kind:"trace-hud",text:l,x:r-.28,y:D-.17,size:.016,color:[...ae,.92],depth:.95,startFrame:I,revealSpan:1,maxWidthEm:44,maxLines:2})}const d=((_=e.evidence)==null?void 0:_.length)??0;return s.push({id:"trace:receipt",kind:"trace-receipt",text:`[ ${d} SOURCES SEALED ]`,x:B[7]-.14,y:D-.07,size:.015,color:[...Re,.85],depth:.9,startFrame:I,revealSpan:1,maxWidthEm:24,hitPadX:.05,hitPadY:.04,ariaLabel:`Composition receipt: ${d} sources, analysed ${((E=e.raw)==null?void 0:E.memoriesAnalyzed)??d} memories`}),s}}function bt(t,e){return[pt(t),new yt(t)]}var _t=ye(""),wt=ye('
'),Et=ye('
',1);function Ft(t,e){Pe(e,!0);let s=W(""),u=W(!1),h=W(null),i=W(null),d=W(null),a=W(null),_=null,E=[];function c(){const o=v(i);if(!o||(o.evidence??[]).length===0){const g=E.map((w,n)=>({id:w.id||`rest:${n}`,score:.25+.4*l(w.trust??.5),hue:fe.bridge,energy:.14+.26*l(w.trust??.5),metric2:l(w.trust??.5),kind:"reasoning-rest",payload:w}));return Ee(g,{maxRadius:.9,minCellR:.014,maxCellR:.045})}const f=new Set((o.contradictions??[]).flatMap(g=>{var w,n;return[(w=g.stronger)==null?void 0:w.id,(n=g.weaker)==null?void 0:n.id]}).filter(Boolean)),m=(o.evidence??[]).map((g,w)=>{var n;return{id:g.id||`evidence:${w}`,score:.4+.6*l(g.trust??.5),hue:f.has(g.id)?fe.scarlet:fe.forward,energy:.45+.55*l(g.trust??.5),metric2:l(g.trust??.5),scar:f.has(g.id),selected:g.id===((n=o.recommended)==null?void 0:n.memory_id),kind:"reasoning-evidence",payload:g}});return Ee(m,{maxRadius:.9,minCellR:.016,maxCellR:.06})}function l(o){return Math.min(1,Math.max(0,Number.isFinite(o)?o:.5))}function r(o,f){const m=new je(o);return _=m,m.setCells(c()),[{compute:w=>m.compute(w),render:w=>m.render(w),dispose:()=>{m.dispose(),_===m&&(_=null)}},...bt(o)]}Me(()=>{var o;(o=v(i))==null||o.evidence.length,_==null||_.setCells(c())});const p=["What port does the dev server use?","Should I enable prefix caching with vLLM?","How does FSRS-6 trust scoring work?","Why did the benchmark score drop after the parser change?"];async function b(){const o=v(s).trim();if(!(!o||v(u))){N(u,!0),N(h,null),N(i,null),N(d,null);try{const f=await we.deepReference(o,20);N(i,et(f),!0)}catch(f){N(h,f instanceof Error?f.message:"Unknown error",!0)}finally{N(u,!1)}}}const k=_e(()=>{var m,g;if(v(u))return"Reasoning in progress.";if(v(h))return`Error: ${v(h)}`;if(!v(i))return"Ask a question to trace how Vestige forms a decision from memory.";const o=v(i),f=((m=o.recommended)==null?void 0:m.answer_preview)??"no recommendation";return`Decision trace for "${v(s)}". ${o.evidence.length} evidence memories, ${o.contradictions.length} contradiction${o.contradictions.length===1?"":"s"}, ${o.superseded.length} superseded. Recommendation: ${f}. Confidence ${Math.round((((g=o.recommended)==null?void 0:g.trust_score)??0)*100)} percent.`});function x(o){const f=o.payload;N(d,(f==null?void 0:f.ariaLabel)??(f==null?void 0:f.preview)??`${o.kind} selected`,!0)}function S(o){var f,m;(o.metaKey||o.ctrlKey)&&o.key.toLowerCase()==="k"&&(o.preventDefault(),(f=v(a))==null||f.focus(),(m=v(a))==null||m.select())}$e(()=>{var o;return(o=v(a))==null||o.focus(),window.addEventListener("keydown",S),we.memories.list({limit:"80"}).then(f=>{E=f.memories.map((m,g)=>{const w=l(m.retentionStrength);return{id:m.id||`rest:${g}`,trust:.35+.4*w,date:"",role:"supporting",preview:""}}),_==null||_.setCells(c())}).catch(()=>{}),()=>window.removeEventListener("keydown",S)});var C=Et();Ve("q2v96u",o=>{Be(()=>{De.title="Reasoning Theater · Vestige"})});var T=Le(C);{let o=_e(()=>`reasoning-trace:${v(s)||"empty"}`);He(T,{organ:"reasoning",get seed(){return v(o)},get scene(){return v(i)},passes:r,get loading(){return v(u)},get error(){return v(h)},emptyLabel:"ASK A QUESTION - PRESS CMD+K - WATCH THE DECISION FORM",onpick:x})}var M=q(T,2),G=q(pe(M),2);We(G),Ue(G,o=>N(a,o),()=>v(a));var ee=q(G,2);Xe(ee,21,()=>p,Ye,(o,f)=>{var m=_t(),g={};de(()=>{g!==(g=v(f))&&(m.value=(m.__value=v(f))??"")}),ue(o,m)}),se(ee),Ge(2),se(M);var U=q(M,2),te=pe(U,!0);se(U);var $=q(U,2);{var ce=o=>{var f=wt(),m=pe(f,!0);se(f),de(()=>be(m,v(d))),ue(o,f)};Oe($,o=>{v(d)&&o(ce)})}de(()=>be(te,v(k))),Ne("submit",M,o=>{o.preventDefault(),b()}),ze(G,()=>v(s),o=>N(s,o)),ue(t,C),Fe()}export{Ft as component}; diff --git a/apps/dashboard/build/_app/immutable/nodes/20.DD0_N4PP.js.br b/apps/dashboard/build/_app/immutable/nodes/20.DD0_N4PP.js.br new file mode 100644 index 0000000..392e744 Binary files /dev/null and b/apps/dashboard/build/_app/immutable/nodes/20.DD0_N4PP.js.br differ diff --git a/apps/dashboard/build/_app/immutable/nodes/20.DD0_N4PP.js.gz b/apps/dashboard/build/_app/immutable/nodes/20.DD0_N4PP.js.gz new file mode 100644 index 0000000..d442625 Binary files /dev/null and b/apps/dashboard/build/_app/immutable/nodes/20.DD0_N4PP.js.gz differ diff --git a/apps/dashboard/build/index.html b/apps/dashboard/build/index.html index 485ca34..ddcf19b 100644 --- a/apps/dashboard/build/index.html +++ b/apps/dashboard/build/index.html @@ -16,7 +16,7 @@ - + @@ -38,7 +38,7 @@ Promise.all([ import("/dashboard/_app/immutable/entry/start.DeXDFAvJ.js"), - import("/dashboard/_app/immutable/entry/app.Bj0mlYI5.js") + import("/dashboard/_app/immutable/entry/app.BYOyN8KT.js") ]).then(([kit, app]) => { kit.start(app, element); }); diff --git a/apps/dashboard/build/index.html.br b/apps/dashboard/build/index.html.br index 57a12c0..0acefe5 100644 Binary files a/apps/dashboard/build/index.html.br and b/apps/dashboard/build/index.html.br differ diff --git a/apps/dashboard/build/index.html.gz b/apps/dashboard/build/index.html.gz index b56a7dd..a606243 100644 Binary files a/apps/dashboard/build/index.html.gz and b/apps/dashboard/build/index.html.gz differ diff --git a/apps/dashboard/e2e/organ-explore.spec.ts b/apps/dashboard/e2e/organ-explore.spec.ts index 2169d54..db2957c 100644 --- a/apps/dashboard/e2e/organ-explore.spec.ts +++ b/apps/dashboard/e2e/organ-explore.spec.ts @@ -145,12 +145,14 @@ test('hovering + off-row clicks never crash; a row click navigates (real picks s expectNoErrors(errors); - // A targeted row click navigates to the memory detail page (goto) — the valid - // non-crash outcome for hitting a real neighbor row. Rows anchor at logical - // NDC x=-0.88, which the pickAt aspect-divide (/max(aspect,1)) pulls inward: - // on a 16:9 canvas (aspect≈1.78) the left column lands at fx≈0.26–0.32, and - // the top row (ndcY≈0.72) sits at fy≈0.14. Verified live with a scan probe. - // Click a few points across that band to reliably land on a row. + // A targeted row click re-centers the neighborhood on the clicked thought — a + // SEMANTIC WALK IN PLACE (the /memories/{id} detail route doesn't exist and + // 404'd, so explore syncs the clicked memory's content into ?q= via + // replaceState instead). The observable proof is the query changing to the + // clicked memory's content. Rows anchor at logical NDC x=-0.88, which the + // pickAt aspect-divide pulls to fx≈0.26–0.32; the top row (ndcY≈0.72) sits at + // fy≈0.14. Click across that band to reliably land on a row. + const startQuery = new URL(page.url()).searchParams.get('q'); const rowClicks = [ [0.28, 0.14], [0.3, 0.14], @@ -158,21 +160,23 @@ test('hovering + off-row clicks never crash; a row click navigates (real picks s [0.32, 0.15], [0.28, 0.18] ]; - let navigated = false; + let walked = false; for (const [fx, fy] of rowClicks) { await page.mouse.click(box.x + box.width * fx, box.y + box.height * fy); await page.waitForTimeout(400); - if (/\/memories\/.+/.test(page.url())) { - navigated = true; + const q = new URL(page.url()).searchParams.get('q'); + // Stayed on /explore, but the query re-centered on the clicked neighbor. + if (page.url().includes('/explore') && q && q !== startQuery) { + walked = true; break; } } expect( - navigated, - `a left-column row click should navigate to a memory detail page (url=${page.url()})` + walked, + `a left-column row click should re-center the semantic walk (?q= changes; url=${page.url()})` ).toBe(true); - // Navigation itself must be crash-free too. + // The walk itself must be crash-free too. expectNoErrors(errors); }); diff --git a/apps/dashboard/e2e/organ-reasoning.spec.ts b/apps/dashboard/e2e/organ-reasoning.spec.ts index 6d3722b..91aa6f2 100644 --- a/apps/dashboard/e2e/organ-reasoning.spec.ts +++ b/apps/dashboard/e2e/organ-reasoning.spec.ts @@ -1,132 +1,88 @@ -import { test, expect } from '@playwright/test'; -import { - BASE, - captureErrors, - expectNoErrors, - gotoRoute, - sampleCanvas, - isAnimating -} from './helpers/dashboard'; +import { test, expect, type Page } from '@playwright/test'; +import { BASE, captureErrors, expectNoErrors, gotoRoute, sampleCanvas, isAnimating } from './helpers/dashboard'; // ───────────────────────────────────────────────────────────────────────── // ORGAN OWNER SPEC — /reasoning (Reasoning Theater, the deep_reference organ) // -// Proves the 7-point ship-a-working-product contract for THIS organ against -// the REAL brain (:3931, 1285 memories). Focused + fast — does not duplicate -// all-routes-smoke; adds the organ-specific proof: -// 1. REACHABLE — /dashboard/reasoning mounts its WebGPU canvas. -// 5. HONEST EMPTY — before any query the organ shows a calm empty state -// (empty-state DOM copy + the field's empty label), NOT -// fake data or a broken/errored surface. -// 2. RENDERS REAL — a real query runs the 8-stage pipeline and the DOM -// DATA materializes REAL numbers straight from deep_reference -// (memoriesAnalyzed / confidence% / Primary Source / -// Evidence count). Asserted on values that only exist -// because the real backend produced them. -// 3. ALIVE — the organ field animates after the scene is uploaded. -// 4. CRASH-FREE — a grid of in-canvas clicks (drives pass.pickAt over the -// CLICK + HOVER static stage rects) + a hover sweep; the canvas SURVIVES -// every one with zero page/WebGPU errors. Stage centers do -// NOT animate in the vertex shader (only radius/energy do), -// and pickAt() uses the same y = 0.76 - i*(1.52/7) layout -// as buildStageRects(), so picks land on the real targets. -// -// Real ground truth captured live via curl POST /api/deep_reference -// {query:"How does FSRS-6 trust scoring work?"}: -// confidence 0.87 · memoriesAnalyzed 26 · activationExpanded 6 · -// evidence 10 · contradictions 0 · superseded 0 · intent "Synthesis". -// contradictions/superseded are legitimately 0 for this query, so those -// sections correctly DON'T render — the honest no-fake-data path. +// The Reasoning Theater is a ZERO-DOM WebGPU organ: the ONLY DOM is a +// visually-hidden (sr-only) ask input for keyboard + screen-reader access. +// There is no DOM response panel — the decision trace (beam / ribbon / nucleus), +// the evidence galaxy, gates, and receipt are all rendered IN-CANVAS. So the +// 7-point organ contract is proven on PIXELS + the real API round-trip, not DOM +// widgets, against the REAL brain (:3931): +// 1. REACHABLE — /dashboard/reasoning mounts its WebGPU canvas. +// 5. HONEST-EMPTY — before any query there is NO fabricated response; the +// sr-only ask input is empty and the DOM has no DOM response +// panels. The field is still alive from a passive real +// memory-pool substrate (no invented trace is claimed). +// 2. RENDERS REAL — a real query runs the 8-stage deep_reference pipeline (200) +// and the field RE-LIGHTS with the real evidence galaxy. +// 3. ALIVE — the field animates at rest. +// 4. CRASH-FREE — a grid of in-canvas clicks + a hover sweep survive with +// zero page/WebGPU errors. // ───────────────────────────────────────────────────────────────────────── const REASONING = '/reasoning'; const QUERY = 'How does FSRS-6 trust scoring work?'; -test.describe('Organ /reasoning — Reasoning Theater', () => { +async function askQuery(page: Page, query: string): Promise { + const input = page.locator('#reasoning-ask'); + await input.waitFor({ state: 'attached', timeout: 15_000 }); + await input.fill(query); + await expect(input).toHaveValue(query); + await input.press('Enter'); +} + +test.describe('Organ /reasoning — Reasoning Theater (zero-DOM)', () => { test('reachable, honest-empty, renders REAL data, alive, and survives click+hover', async ({ page }) => { const capture = captureErrors(page); - // ── 1. REACHABLE: route mounts its WebGPU canvas ─────────────────── + // ── 1. REACHABLE ─────────────────────────────────────────────────── const canvas = await gotoRoute(page, REASONING); await expect(canvas).toBeVisible(); - // ── 5. HONEST EMPTY STATE (pre-query) ────────────────────────────── - // The DOM empty panel renders with real, non-faked copy — and NO fake - // "Live" data / response sections exist yet. - await expect( - page.getByText('Ask anything. Vestige will run the full reasoning pipeline and show you its work.') - ).toBeVisible(); - // No response artifacts before a query: no Primary Source citation, no - // Cognitive Pipeline result, no confidence meter — nothing fabricated. - await expect(page.getByText('Primary Source', { exact: true })).toHaveCount(0); - await expect(page.getByRole('heading', { name: 'Cognitive Pipeline' })).toHaveCount(0); - // The immersive field is present but shows its honest empty label (no - // invented scene) — canvas is still a real, sampleable surface. + // ── 5. HONEST-EMPTY (pre-query) ──────────────────────────────────── + // The ask input exists (sr-only) and is empty — no query has run, so no + // trace is claimed. There are no DOM response panels to fake at all. + const input = page.locator('#reasoning-ask'); + await expect(input).toHaveValue(''); + // The field is still sampleable + alive from the passive memory-pool + // substrate (an honest "here is your corpus" backdrop, not a fake trace). + await page.waitForTimeout(3500); const emptySample = await sampleCanvas(page); expect(emptySample.ok, 'empty-state canvas should be sampleable').toBe(true); + expect( + emptySample.fillPct, + `the rest substrate should fill the field (fillPct=${emptySample.fillPct})` + ).toBeGreaterThan(20); - // ── 2. RENDERS REAL DATA: run the real 8-stage pipeline ──────────── - const input = page.getByPlaceholder('Ask your memory anything…'); - await expect(input).toBeVisible(); - await input.click(); - await input.fill(QUERY); - await input.press('Enter'); + // ── 2. RENDERS REAL DATA — run the real 8-stage pipeline ─────────── + const respPromise = page.waitForResponse( + (r) => /\/api\/deep[_-]reference/.test(r.url()) && r.status() === 200, + { timeout: 30_000 } + ); + await askQuery(page, QUERY); + const resp = await respPromise; + const payload = (await resp.json()) as { evidence?: unknown[]; confidence?: number }; + // The real backend produced evidence — the field will lay it out as cells. + expect(Array.isArray(payload.evidence), 'deep_reference returns an evidence array').toBe(true); - const cognitivePipeline = page.getByRole('heading', { name: 'Cognitive Pipeline' }); - const errorSurface = page.locator('text=/^Error:/'); - await Promise.race([ - cognitivePipeline.waitFor({ state: 'visible', timeout: 30_000 }), - errorSurface.waitFor({ state: 'visible', timeout: 30_000 }) - ]); - - // A real backend error is a genuine finding — surface it, never hide it. - const errored = await errorSurface.isVisible().catch(() => false); - if (errored) { - const msg = (await errorSurface.textContent())?.trim(); - throw new Error(`Reasoning Theater surfaced a backend error: ${msg}`); - } - - // The pipeline finished (button left its "Reasoning…" limbo). - await expect(page.getByRole('button', { name: /Reason(ing…)?/ })).toBeEnabled({ - timeout: 15_000 - }); - - // These assertions can ONLY pass if real deep_reference data drove the DOM: - // • the recommended Primary Source citation block, - await expect(page.getByText('Primary Source', { exact: true })).toBeVisible(); - // • an "N analyzed" count (real memoriesAnalyzed from the backend), - const analyzed = page.getByText(/\banalyzed\b/).first(); - await expect(analyzed).toBeVisible(); - // • a real confidence percentage in the meter, - await expect(page.locator('text=/\\d+%/').first()).toBeVisible(); - // • the Evidence header WITH a real non-zero count in parentheses. - const evidenceHeading = page.getByRole('heading', { name: /^Evidence/ }); - await expect(evidenceHeading).toBeVisible(); - const evidenceText = (await evidenceHeading.textContent()) ?? ''; - const evCount = Number(evidenceText.match(/\((\d+)\)/)?.[1] ?? '0'); - expect(evCount, `Evidence count should be real & non-zero (saw "${evidenceText.trim()}")`).toBeGreaterThan(0); - // At least one real EvidenceCard rendered from the backend payload. - await expect(page.locator('[data-evidence-id]').first()).toBeVisible(); - - // ── 3. ALIVE: the organ field animates after the scene upload ────── - await page.waitForTimeout(2500); + // The field re-lights with the real evidence galaxy. + await page.waitForTimeout(3500); const lit = await sampleCanvas(page); expect(lit.ok, 'organ canvas should be sampleable').toBe(true); expect( lit.rendered, - `organ field should render non-black (avgLum=${lit.avgLum}, variance=${lit.variance})` + `evidence galaxy should render non-black (avgLum=${lit.avgLum}, variance=${lit.variance})` ).toBe(true); + + // ── 3. ALIVE ─────────────────────────────────────────────────────── const animating = await isAnimating(page); expect(animating, 'organ field should animate (living, not a frozen frame)').toBe(true); // ── 4. CRASH-FREE in-canvas click grid + hover sweep ─────────────── - // The RouteStage field layer is full-bleed fixed inset-0; clicking it - // routes through handleFieldClick → pass.pickAt over the 8 static stage - // rects. Sweep a grid so several clicks LAND on stage chambers (which - // open the DOM stage-receipt aside) and several miss (no-op) — the - // canvas must survive every one. const box = await canvas.boundingBox(); expect(box, 'canvas should have a bounding box').not.toBeNull(); if (box) { @@ -136,34 +92,24 @@ test.describe('Organ /reasoning — Reasoning Theater', () => { for (let c = 0; c < cols; c++) { const x = box.x + ((c + 0.5) / cols) * box.width; const y = box.y + ((r + 0.5) / rows) * box.height; - await page.mouse.move(x, y); // hover sweep - await page.mouse.click(x, y); // in-canvas pick + await page.mouse.move(x, y); + await page.mouse.click(x, y); } } - // A hover along the vertical stage column (x≈center) — where the - // eight chambers live — must not throw either. for (let r = 0; r < 9; r++) { await page.mouse.move(box.x + box.width * 0.5, box.y + (r / 8) * box.height); } } - // The canvas is still alive and rendering after all that interaction. const afterInteract = await sampleCanvas(page); expect( afterInteract.rendered, `organ field should still render after clicks/hover (avgLum=${afterInteract.avgLum}, variance=${afterInteract.variance})` ).toBe(true); - // A stage-receipt aside may have opened from a landed pick; if so it must - // be a real receipt panel (has the "stage receipt" label), never junk. - const receiptAside = page.getByLabel('Reasoning stage receipt'); - if (await receiptAside.isVisible().catch(() => false)) { - await expect(receiptAside.getByText('stage receipt')).toBeVisible(); - } - await page.screenshot({ path: 'e2e/screenshots/organ-reasoning.png', fullPage: true }); - // ── 4/5. No real app / WebGPU-validation errors across the whole run ─ + // ── No real app / WebGPU-validation errors across the whole run ──── expectNoErrors(capture); }); }); diff --git a/apps/dashboard/e2e/reasoning-flow.spec.ts b/apps/dashboard/e2e/reasoning-flow.spec.ts index f552ef5..2f2ebd2 100644 --- a/apps/dashboard/e2e/reasoning-flow.spec.ts +++ b/apps/dashboard/e2e/reasoning-flow.spec.ts @@ -1,154 +1,105 @@ -import { test, expect } from '@playwright/test'; +import { test, expect, type Page } from '@playwright/test'; import { BASE, captureErrors, expectNoErrors, sampleCanvas } from './helpers/dashboard'; // ───────────────────────────────────────────────────────────────────────── -// Reasoning Theater — the deep_reference flow. +// Reasoning Theater — the deep_reference flow (zero-DOM, in-canvas). // -// Proves the real 8-stage cognitive pipeline round-trip: +// The Reasoning Theater is a full-bleed WebGPU organ: the ONLY DOM is a +// visually-hidden (sr-only) input for keyboard + screen-reader access. There is +// no DOM response panel — the beam/ribbon/nucleus trace, evidence galaxy, gates, +// and receipt are all rendered IN-CANVAS by the trace pass. So this flow is +// proven on PIXELS, not DOM widgets: // 1. /dashboard/reasoning mounts its WebGPU organ canvas. -// 2. A real query is typed into the ask box and submitted (Enter). -// 3. The /api/deep_reference call returns and the reasoning DOM materializes -// (Reasoning section / "analyzed" / confidence % / Primary Source / -// Evidence / Cognitive Pipeline). -// 4. The WebGPU organ field lights up (8-stage organ renders non-black). +// 2. It is alive at rest (a passive memory-pool substrate lights the field). +// 3. A real query is typed into the sr-only ask box and submitted (Enter). +// 4. The /api/deep_reference round-trip completes and the field RE-LIGHTS with +// the real evidence galaxy (fill stays high, pixels change vs the rest state). // 5. No page/WebGPU-validation errors fired. -// -// The brain is up with 325+ real memories, so we assert on real rendered -// output. If a query genuinely returns an empty result set, the flow still -// ran end-to-end (loading → response OR a graceful error surface), and we -// assert THAT rather than hard-failing on content that legitimately may not -// exist. // ───────────────────────────────────────────────────────────────────────── const REASONING = `${BASE}/reasoning`; const QUERY = 'How does FSRS-6 trust scoring work?'; -test.describe('Reasoning Theater — deep_reference flow', () => { - test('typing a query runs the pipeline and renders reasoning + lights the organ', async ({ - page - }) => { +/** Fill the sr-only ask input by id (it's visually hidden, so .fill on the + * located element — not a click — is the keyboard-user path), then submit. */ +async function askQuery(page: Page, query: string): Promise { + const input = page.locator('#reasoning-ask'); + await input.waitFor({ state: 'attached', timeout: 15_000 }); + await input.fill(query); + await expect(input).toHaveValue(query); + await input.press('Enter'); +} + +/** Wait until a real /api/deep_reference response has come back. */ +async function waitForDeepReference(page: Page): Promise { + await page.waitForResponse( + (r) => /\/api\/deep[_-]reference/.test(r.url()) && r.status() === 200, + { timeout: 30_000 } + ); +} + +test.describe('Reasoning Theater — deep_reference flow (zero-DOM)', () => { + test('typing a query runs the pipeline and re-lights the organ field', async ({ page }) => { const capture = captureErrors(page); - // ── 1. Route mounts its WebGPU canvas ────────────────────────────── + // 1 — route mounts its WebGPU canvas. await page.goto(REASONING); const canvas = page.locator('canvas').first(); await canvas.waitFor({ state: 'attached', timeout: 15_000 }); await expect(canvas).toBeVisible(); - // ── 2. Type a real query + submit ────────────────────────────────── - const input = page.getByPlaceholder('Ask your memory anything…'); - await expect(input).toBeVisible(); - await input.click(); - await input.fill(QUERY); - await expect(input).toHaveValue(QUERY); - - // The "Reason" button should enable once the box has a non-empty query. - const reasonBtn = page.getByRole('button', { name: 'Reason' }); - await expect(reasonBtn).toBeEnabled(); - - // Submit via Enter (the input has an onkeydown Enter handler). - await input.press('Enter'); - - // ── 3. Wait for the pipeline to run + a terminal state to render ──── - // The button reads "Reasoning…" while loading; the empty-state / - // example chips disappear. Wait for EITHER a real response section OR - // a graceful error surface — but not the still-empty initial state. - const reasoningHeading = page.getByRole('heading', { name: 'Reasoning', exact: true }); - const primarySource = page.getByText('Primary Source', { exact: true }); - const cognitivePipeline = page.getByRole('heading', { name: 'Cognitive Pipeline' }); - const errorSurface = page.locator('text=/^Error:/'); - - // Give the local 8-stage pipeline time to complete + paint. - await Promise.race([ - reasoningHeading.waitFor({ state: 'visible', timeout: 30_000 }), - cognitivePipeline.waitFor({ state: 'visible', timeout: 30_000 }), - primarySource.waitFor({ state: 'visible', timeout: 30_000 }), - errorSurface.waitFor({ state: 'visible', timeout: 30_000 }) - ]); - - // The button must have left its disabled/loading limbo. - await expect(page.getByRole('button', { name: /Reason(ing…)?/ })).toBeEnabled({ - timeout: 15_000 - }); - - const errored = await errorSurface.isVisible().catch(() => false); - - if (errored) { - // A real backend error is a genuine finding, not something to hide. - const msg = (await errorSurface.textContent())?.trim(); - throw new Error(`Reasoning Theater surfaced a backend error: ${msg}`); - } - - // ── Real response asserted on real rendered content ──────────────── - // The Cognitive Pipeline section renders for ANY successful response - // (even zero-evidence), so it's the reliable "the flow produced a - // result" anchor. - await expect(cognitivePipeline).toBeVisible(); - - // "N analyzed" appears in the reasoning header / confidence meter. - await expect(page.getByText(/\banalyzed\b/).first()).toBeVisible(); - - // A confidence percentage renders (the big meter uses "%"). Assert a - // digit-followed-by-% is present somewhere in the response region. - const confidencePct = page.locator('text=/\\d+%/').first(); - await expect(confidencePct).toBeVisible(); - - // Primary Source citation block renders the recommended answer. - await expect(primarySource).toBeVisible(); - - // Evidence section header renders with its count. - await expect(page.getByRole('heading', { name: /^Evidence/ })).toBeVisible(); - - // ── 4. The WebGPU organ field lit up (8-stage organ, non-black) ──── - // Let the field settle after the DeepReferenceCompleted scene drives it. - await page.waitForTimeout(3000); - const sample = await sampleCanvas(page); - expect(sample.ok, 'canvas should be sampleable').toBe(true); + // 2 — alive at rest: the passive memory-pool substrate fills the field. + await page.waitForTimeout(3500); + const rest = await sampleCanvas(page); + expect(rest.ok, 'canvas should be sampleable at rest').toBe(true); expect( - sample.rendered, - `organ field should render non-black (avgLum=${sample.avgLum}, variance=${sample.variance})` + rest.fillPct, + `the rest substrate should fill the field (fillPct=${rest.fillPct})` + ).toBeGreaterThan(20); + + // 3 — type a real query into the sr-only input + submit. + const respPromise = waitForDeepReference(page); + await askQuery(page, QUERY); + + // 4 — the deep_reference round-trip completes... + await respPromise; + // ...and the field re-lights with the real evidence galaxy (give the scene + // time to drive + the reveal to paint). + await page.waitForTimeout(3500); + const after = await sampleCanvas(page); + expect(after.ok, 'canvas should be sampleable after the query').toBe(true); + expect( + after.rendered, + `evidence galaxy should render non-black (avgLum=${after.avgLum}, variance=${after.variance})` ).toBe(true); + expect( + after.fillPct, + `the evidence field should fill the frame (fillPct=${after.fillPct})` + ).toBeGreaterThan(20); - await page.screenshot({ - path: 'e2e/screenshots/reasoning-flow-lit.png', - fullPage: true - }); + await page.screenshot({ path: 'e2e/screenshots/reasoning-flow-lit.png', fullPage: true }); - // ── 5. No real app / WebGPU-validation errors ────────────────────── + // 5 — no app / WebGPU-validation errors across the whole flow. expectNoErrors(capture); }); - test('an example chip also drives the full flow', async ({ page }) => { + test('a second query re-runs the pipeline against the live brain', async ({ page }) => { const capture = captureErrors(page); await page.goto(REASONING); await page.locator('canvas').first().waitFor({ state: 'attached', timeout: 15_000 }); + await page.waitForTimeout(3000); - // The example chips render only in the empty state. Click the first one; - // it sets the query AND immediately calls ask(). - const chip = page.getByRole('button', { - name: 'How does FSRS-6 trust scoring work?' - }); - await expect(chip).toBeVisible(); - await chip.click(); - - const cognitivePipeline = page.getByRole('heading', { name: 'Cognitive Pipeline' }); - const errorSurface = page.locator('text=/^Error:/'); - - await Promise.race([ - cognitivePipeline.waitFor({ state: 'visible', timeout: 30_000 }), - errorSurface.waitFor({ state: 'visible', timeout: 30_000 }) - ]); - - const errored = await errorSurface.isVisible().catch(() => false); - if (errored) { - const msg = (await errorSurface.textContent())?.trim(); - throw new Error(`Reasoning Theater surfaced a backend error: ${msg}`); + // Two different real queries in a row both round-trip and keep the field lit. + for (const q of ['What is the Vestige dashboard direction?', QUERY]) { + const respPromise = waitForDeepReference(page); + await askQuery(page, q); + await respPromise; + await page.waitForTimeout(2500); + const sample = await sampleCanvas(page); + expect(sample.rendered, `field stays lit after querying "${q}"`).toBe(true); } - await expect(cognitivePipeline).toBeVisible(); - await expect(page.getByText(/\banalyzed\b/).first()).toBeVisible(); - expectNoErrors(capture); }); }); diff --git a/apps/dashboard/src/routes/(app)/reasoning/+page.svelte b/apps/dashboard/src/routes/(app)/reasoning/+page.svelte index db0ab3d..1a59caa 100644 --- a/apps/dashboard/src/routes/(app)/reasoning/+page.svelte +++ b/apps/dashboard/src/routes/(app)/reasoning/+page.svelte @@ -39,9 +39,24 @@ // full-bleed field, not a thin beam on black. The beam/ribbon/nucleus trace // draws ON TOP. Rebuilds whenever a new decision trace lands. let evidenceField: LivingFieldPass | null = null; + // Passive real memory pool shown at rest (pre-query), dim, so the stage is + // alive without faking a decision trace. Replaced by real evidence on a query. + let restPool: NormalizedEvidence[] = []; function buildEvidenceCells() { const s = reasoningScene; - if (!s) return []; + // Pre-query: dim memory-pool substrate (honest — no trace claimed). + if (!s || (s.evidence ?? []).length === 0) { + const data: FieldDatum[] = restPool.map((e, i) => ({ + id: e.id || `rest:${i}`, + score: 0.25 + 0.4 * clampR(e.trust ?? 0.5), + hue: FIELD_HUE.bridge, + energy: 0.14 + 0.26 * clampR(e.trust ?? 0.5), + metric2: clampR(e.trust ?? 0.5), + kind: 'reasoning-rest', + payload: e + })); + return layoutGalaxy(data, { maxRadius: 0.9, minCellR: 0.014, maxCellR: 0.045 }); + } const contradictionIds = new Set( (s.contradictions ?? []).flatMap((c) => [c.stronger?.id, c.weaker?.id]).filter(Boolean) as string[] ); @@ -138,14 +153,26 @@ onMount(() => { askInputEl?.focus(); window.addEventListener('keydown', handleGlobalKey); - // Auto-seed a real decision trace so the Theater is ALIVE at rest (the - // beam/ribbon/nucleus render real deep_reference evidence immediately), - // not a black stage waiting for input. A demo lands on a live trace; the - // user can retype to trace their own question. - if (!query.trim()) { - query = 'What is the Vestige dashboard direction?'; - void ask(); - } + // Keep the Theater HONEST-EMPTY at rest (the DOM "ask a question to trace" + // state), but light the field with a passive real memory pool so the stage + // isn't black while it waits. A real query replaces the pool with the actual + // evidence galaxy. No auto-run — the user (or a demo) drives the trace. + void api.memories + .list({ limit: '80' }) + .then((res) => { + restPool = res.memories.map((m, i) => { + const retention = clampR(m.retentionStrength); + return { + id: m.id || `rest:${i}`, + trust: 0.35 + 0.4 * retention, + date: '', + role: 'supporting' as const, + preview: '' + }; + }); + evidenceField?.setCells(buildEvidenceCells()); + }) + .catch(() => {}); return () => window.removeEventListener('keydown', handleGlobalKey); }); @@ -180,7 +207,7 @@ list="reasoning-examples" autocomplete="off" spellcheck="false" - placeholder="Ask a question…" + placeholder="Ask your memory anything…" /> {#each EXAMPLE_QUERIES as q}