mirror of
https://github.com/samvallad33/vestige.git
synced 2026-05-29 19:35:15 +02:00
Bundled release: Reasoning Theater wired to the 8-stage deep_reference cognitive pipeline, Pulse InsightToast, Memory Birth Ritual (v2.3 Terrarium), 7 new dashboard surfaces (/duplicates, /dreams, /schedule, /importance, /activation, /contradictions, /patterns), 3D graph brightness system with auto distance-compensation + user slider, and contradiction-detection + primary-selection hardening in the cross_reference tool. Intel Mac (x86_64-apple-darwin) also flows through to the release matrix from PR #43. Added: - POST /api/deep_reference — HTTP surface for the 8-stage pipeline - DeepReferenceCompleted WebSocket event (primary + supporting + contradicting memory IDs for downstream graph animation) - /reasoning route, full UI + Cmd+K Ask palette - 7 new dashboard surfaces exposing the cognitive engine - Graph brightness slider + localStorage persistence + distance-based emissive compensation so nodes don't disappear into fog at zoom-out Fixed: - Contradiction-detection false positives: adjacent-domain memories no longer flagged as conflicts (NEGATION_PAIRS wildcards removed, shared-words floor 2 → 4, topic-sim floor 0.15 → 0.55, STAGE 5 overlap floor 0.15 → 0.4) - Primary-memory selection: unified composite 0.5 × relevance + 0.2 × trust + 0.3 × term_presence with hard topic-term filter, closing the class of bug where off-topic high-trust memories won queries about specific subjects - Graph default-load fallback from sort=recent to sort=connected when the newest memory is isolated, both backend and client Changed: - Reasoning page information hierarchy: chain renders first as hero, confidence meter + Primary Source citation footer below - Cargo feature split: embeddings code-only + ort-download | ort-dynamic backends; defaults preserve identical behavior for existing consumers - CI release-build now gates PRs too so multi-platform regressions surface pre-merge
5 lines
14 KiB
JavaScript
5 lines
14 KiB
JavaScript
import"../chunks/Bzak7iHL.js";import{o as Ce,a as Le}from"../chunks/CNjeV5xa.js";import{p as _e,f as we,g as e,a as Te,u as P,e as r,r as s,d as o,t as S,h as w,s as j,c as xe,n as he}from"../chunks/CvjSAYrz.js";import{d as Ae,s as g,a as z}from"../chunks/FzvEaXMa.js";import{i as G}from"../chunks/ciN1mm2W.js";import{e as oe,i as ke}from"../chunks/DTnG8poT.js";import{c as Re,a as v,f as m}from"../chunks/BsvCUYx-.js";import{s as ne,r as Fe}from"../chunks/CNfQDikv.js";import{b as Ne}from"../chunks/CVpUe0w3.js";import{s as pe}from"../chunks/DPl3NjBv.js";import{s as re}from"../chunks/Bhad70Ss.js";import{N as Ie}from"../chunks/DzfRjky4.js";function Me(n){return n>=.92?"near-identical":n>=.8?"strong":"weak"}function ge(n){const i=Me(n);return i==="near-identical"?"var(--color-decay)":i==="strong"?"var(--color-warning)":"#fde047"}function Ze(n){const i=Me(n);return i==="near-identical"?"Near-identical":i==="strong"?"Strong match":"Weak match"}function Ee(n){return n>.7?"#10b981":n>.4?"#f59e0b":"#ef4444"}function Oe(n){if(!n||n.length===0)return null;let i=n[0],d=Number.isFinite(i.retention)?i.retention:-1/0;for(let u=1;u<n.length;u++){const b=n[u],_=Number.isFinite(b.retention)?b.retention:-1/0;_>d&&(i=b,d=_)}return i}function Pe(n,i){return n.filter(d=>d.similarity>=i)}function be(n){return n.map(i=>i.id).slice().sort().join("|")}function Be(n,i=80){if(!n)return"";const d=n.trim().replace(/\s+/g," ");return d.length<=i?d:d.slice(0,i)+"…"}function ye(n){if(!n||typeof n!="string")return"";const i=new Date(n);return Number.isNaN(i.getTime())?"":i.toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"})}function He(n,i=4){return Array.isArray(n)?n.slice(0,i):[]}var Ke=m('<span class="rounded bg-recall/15 px-1.5 py-0.5 text-[10px] font-medium text-recall">WINNER</span>'),Ue=m('<span class="rounded bg-white/[0.04] px-1.5 py-0.5 text-[10px] text-muted"> </span>'),We=m('<div class="text-[11px] text-muted"> </div>'),je=m('<div><span class="mt-1.5 h-2 w-2 flex-shrink-0 rounded-full"></span> <div class="flex-1 min-w-0 space-y-1.5"><div class="flex flex-wrap items-center gap-1.5"><span class="text-xs text-dim"> </span> <!> <!></div> <p> </p> <!></div> <div class="flex flex-shrink-0 flex-col items-end gap-1"><div class="h-1.5 w-12 overflow-hidden rounded-full bg-deep"><div class="h-full rounded-full"></div></div> <span class="text-[11px] text-muted"> </span></div></div>'),ze=m('<div class="glass-panel rounded-2xl p-5 space-y-4 transition-all duration-300 hover:border-synapse/20"><div class="flex items-start justify-between gap-4"><div class="flex-1 min-w-0 space-y-1.5"><div class="flex items-center gap-3"><span class="text-sm font-semibold"> </span> <span class="text-xs text-dim"> </span> <span class="text-xs text-muted"> </span></div> <div class="h-2 w-full overflow-hidden rounded-full bg-deep/60" role="progressbar" aria-label="Cosine similarity" aria-valuemin="0" aria-valuemax="100"><div class="h-full rounded-full transition-all duration-500"></div></div></div> <span> </span></div> <div class="space-y-2"></div> <div class="flex flex-wrap items-center gap-2 pt-1"><button type="button" aria-label="Merge all memories into the highest-retention winner" class="rounded-lg bg-recall/20 px-3 py-1.5 text-xs font-medium text-recall transition hover:bg-recall/30 focus:outline-none focus-visible:ring-2 focus-visible:ring-recall/60">Merge all → winner</button> <button type="button" class="rounded-lg bg-dream/20 px-3 py-1.5 text-xs font-medium text-dream-glow transition hover:bg-dream/30 focus:outline-none focus-visible:ring-2 focus-visible:ring-dream-glow/60"> </button> <button type="button" aria-label="Dismiss cluster for this session" class="ml-auto rounded-lg bg-white/[0.04] px-3 py-1.5 text-xs text-dim transition hover:bg-white/[0.08] hover:text-text focus:outline-none focus-visible:ring-2 focus-visible:ring-synapse/60">Dismiss cluster</button></div></div>');function Ge(n,i){_e(i,!0);let d=j(!1);const u=P(()=>Oe(i.memories)),b=P(()=>e(u)?i.memories.filter(x=>x.id!==e(u).id).map(x=>x.id):[]);function _(){i.onMerge&&e(u)&&i.onMerge(e(u).id,e(b))}var k=Re(),V=we(k);{var le=x=>{var X=ze(),B=r(X),Y=r(B),h=r(Y),C=r(h),ee=r(C);s(C);var H=o(C,2),de=r(H,!0);s(H);var K=o(H,2),q=r(K);s(K),s(h);var L=o(h,2),U=r(L);s(L),s(Y);var W=o(Y,2),ce=r(W);s(W),s(B);var R=o(B,2);oe(R,21,()=>i.memories,T=>T.id,(T,c)=>{var M=je(),N=r(M),I=o(N,2),t=r(I),a=r(t),l=r(a,!0);s(a);var p=o(a,2);{var Z=y=>{var A=Ke();v(y,A)};G(p,y=>{e(c).id===e(u).id&&y(Z)})}var D=o(p,2);oe(D,17,()=>He(e(c).tags,4),ke,(y,A)=>{var O=Ue(),me=r(O,!0);s(O),S(()=>g(me,e(A))),v(y,O)}),s(t);var f=o(t,2),E=r(f,!0);s(f);var ae=o(f,2);{var Q=y=>{var A=We(),O=r(A,!0);s(A),S(me=>g(O,me),[()=>ye(e(c).createdAt)]),v(y,A)},ve=P(()=>ye(e(c).createdAt));G(ae,y=>{e(ve)&&y(Q)})}s(I);var se=o(I,2),$=r(se),De=r($);s($);var fe=o($,2),Se=r(fe);s(fe),s(se),s(M),S((y,A,O)=>{pe(M,1,`group flex items-start gap-3 rounded-xl border border-synapse/5 bg-white/[0.02] p-3 transition-all duration-200 hover:border-synapse/20 hover:bg-white/[0.04] ${e(c).id===e(u).id?"ring-1 ring-recall/30":""}`),re(N,`background: ${(Ie[e(c).nodeType]||"#8B95A5")??""}`),ne(N,"title",e(c).nodeType),g(l,e(c).nodeType),pe(f,1,`text-sm text-text leading-relaxed ${e(d)?"whitespace-pre-wrap":""}`),g(E,y),re(De,`width: ${e(c).retention*100}%; background: ${A??""}`),g(Se,`${O??""}%`)},[()=>e(d)?e(c).content:Be(e(c).content),()=>Ee(e(c).retention),()=>(e(c).retention*100).toFixed(0)]),v(T,M)}),s(R);var te=o(R,2),J=r(te),F=o(J,2),ue=r(F,!0);s(F);var ie=o(F,2);s(te),s(X),S((T,c,M,N,I,t,a,l)=>{re(C,`color: ${T??""}`),g(ee,`${c??""}%`),g(de,M),g(q,`· ${i.memories.length??""} memories`),ne(L,"aria-valuenow",N),re(U,`width: ${I??""}%; background: ${t??""}; box-shadow: 0 0 12px ${a??""}66`),pe(W,1,`flex-shrink-0 rounded-full border px-3 py-1 text-xs font-medium ${i.suggestedAction==="merge"?"border-recall/40 bg-recall/10 text-recall":"border-dream-glow/40 bg-dream/10 text-dream-glow"}`),g(ce,`Suggested: ${i.suggestedAction==="merge"?"Merge":"Review"}`),ne(J,"title",`Merge all into highest-retention memory (${l??""}%)`),ne(F,"aria-expanded",e(d)),g(ue,e(d)?"Collapse":"Review")},[()=>ge(i.similarity),()=>(i.similarity*100).toFixed(1),()=>Ze(i.similarity),()=>Math.round(i.similarity*100),()=>(i.similarity*100).toFixed(1),()=>ge(i.similarity),()=>ge(i.similarity),()=>(e(u).retention*100).toFixed(0)]),z("click",J,_),z("click",F,()=>w(d,!e(d))),z("click",ie,function(...T){var c;(c=i.onDismiss)==null||c.apply(this,T)}),v(x,X)};G(V,x=>{i.memories.length>0&&e(u)&&x(le)})}v(n,k),Te()}Ae(["click"]);var Ve=m('<span class="h-2 w-2 animate-pulse rounded-full bg-synapse-glow"></span> <span>Detecting…</span>',1),Xe=m('<span class="h-2 w-2 rounded-full bg-decay"></span> <span class="text-decay">Error</span>',1),Ye=m('<span class="h-2 w-2 rounded-full bg-synapse-glow"></span> <span> </span>',1),qe=m(`<div class="glass-panel flex flex-col items-center gap-3 rounded-2xl p-10 text-center"><div class="text-sm text-decay">Couldn't detect duplicates</div> <div class="max-w-md text-xs text-muted"> </div> <button type="button" class="mt-2 rounded-lg bg-synapse/20 px-4 py-2 text-xs font-medium text-synapse-glow transition hover:bg-synapse/30 focus:outline-none focus-visible:ring-2 focus-visible:ring-synapse/60">Retry</button></div>`),Je=m('<div class="glass-subtle h-40 animate-pulse rounded-2xl"></div>'),Qe=m('<div class="space-y-3"></div>'),$e=m('<div class="glass-panel flex flex-col items-center gap-2 rounded-2xl p-12 text-center"><div class="text-3xl">·</div> <div class="text-sm font-medium text-bright">No duplicates found above threshold.</div> <div class="text-xs text-muted">Memory is clean.</div></div>'),et=m('<div class="glass-subtle rounded-xl border border-warning/30 bg-warning/5 px-4 py-2 text-xs text-dim"> </div>'),tt=m('<div class="animate-[fadeSlide_0.35s_ease-out_both]"><!></div>'),it=m('<div class="space-y-4"><!> <!></div>'),at=m(`<div class="relative mx-auto max-w-5xl space-y-6 p-6"><header class="space-y-2"><h1 class="text-xl font-semibold text-bright">Memory Hygiene — Duplicate Detection</h1> <p class="text-sm text-dim">Cosine-similarity clustering over embeddings. Merges reinforce the winner's FSRS state;
|
|
losers inherit into the merged node. Dismissed clusters are hidden for this session only.</p></header> <div class="glass-panel flex flex-wrap items-center gap-5 rounded-2xl p-4"><label class="flex flex-1 min-w-64 items-center gap-3 text-xs text-dim"><span class="whitespace-nowrap">Similarity threshold</span> <input type="range" min="0.70" max="0.95" step="0.01" class="flex-1 accent-synapse" aria-label="Similarity threshold"/> <span class="w-14 text-right font-mono text-sm text-bright"> </span></label> <div class="flex items-center gap-2 rounded-full border border-synapse/20 bg-synapse/10 px-3 py-1.5 text-xs text-text" role="status" aria-live="polite"><!></div> <button type="button" class="rounded-lg bg-white/[0.04] px-3 py-1.5 text-xs text-dim transition hover:bg-white/[0.08] hover:text-text disabled:opacity-40 focus:outline-none focus-visible:ring-2 focus-visible:ring-synapse/60">Rerun</button></div> <!></div>`);function ft(n,i){_e(i,!0);let d=j(.8),u=j(xe([])),b=j(xe(new Set)),_=j(!0),k=j(null),V;async function le(t){return await new Promise(l=>setTimeout(l,450)),{clusters:Pe([{similarity:.96,suggestedAction:"merge",memories:[{id:"m-001",content:"BUG FIX: Harmony parser dropped `final` channel tokens when tool call followed. Root cause: 5-layer fallback missed the final channel marker when channel switched mid-stream. Solution: added final-channel detector before tool-call pop. Files: src/parser/harmony.rs",nodeType:"fact",tags:["bug-fix","aimo3","parser"],retention:.91,createdAt:"2026-04-12T14:22:00Z"},{id:"m-002",content:"Fixed Harmony parser final-channel bug — 5-layer fallback was missing the final channel marker when a tool call followed. Added detector before tool pop.",nodeType:"fact",tags:["bug-fix","aimo3"],retention:.64,createdAt:"2026-04-13T09:15:00Z"},{id:"m-003",content:"Harmony parser: final channel dropped on tool-call. Patched the fallback stack.",nodeType:"note",tags:["parser"],retention:.38,createdAt:"2026-04-14T11:02:00Z"}]},{similarity:.88,suggestedAction:"merge",memories:[{id:"m-004",content:"DECISION: Use vLLM prefix caching at 0.35 gpu_memory_utilization for AIMO3 submissions. Alternatives considered: sglang (slower cold start), TensorRT-LLM (deployment friction).",nodeType:"decision",tags:["vllm","aimo3","inference"],retention:.84,createdAt:"2026-04-05T18:44:00Z"},{id:"m-005",content:"Chose vLLM with prefix caching (0.35 mem util) over sglang and TensorRT-LLM for AIMO3 inference.",nodeType:"decision",tags:["vllm","aimo3"],retention:.72,createdAt:"2026-04-06T10:30:00Z"}]},{similarity:.83,suggestedAction:"review",memories:[{id:"m-006",content:"Sam prefers to ship one change per Kaggle submission — stacking changes destroyed signal at AIMO3 (30/50 regression from 12 stacked variables).",nodeType:"pattern",tags:["kaggle","methodology","aimo3"],retention:.88,createdAt:"2026-04-04T22:10:00Z"},{id:"m-007",content:"One-variable-at-a-time rule: never stack multiple changes per submission. Paper 2603.27844 proves +/-2 points is noise.",nodeType:"pattern",tags:["kaggle","methodology"],retention:.67,createdAt:"2026-04-08T16:20:00Z"},{id:"m-008",content:"Lesson: stacking 12 changes at AIMO3 cost a submission. Always isolate variables.",nodeType:"note",tags:["methodology"],retention:.42,createdAt:"2026-04-15T08:55:00Z"}]},{similarity:.78,suggestedAction:"review",memories:[{id:"m-009",content:"Dimensional Illusion performance: 7-minute flow poi set, LED config Parthenos overcook preset, tempo 128 BPM.",nodeType:"event",tags:["dimensional-illusion","poi","performance"],retention:.76,createdAt:"2026-03-28T19:45:00Z"},{id:"m-010",content:"Dimensional Illusion set: 7 min, Parthenos LED overcook, 128 BPM.",nodeType:"event",tags:["dimensional-illusion","poi"],retention:.51,createdAt:"2026-04-02T12:12:00Z"}]},{similarity:.76,suggestedAction:"review",memories:[{id:"m-011",content:"Vestige v2.0.7 shipped active forgetting via Anderson 2025 top-down inhibition + Davis Rac1 cascade. Suppress compounds, reversible 24h.",nodeType:"fact",tags:["vestige","release","active-forgetting"],retention:.93,createdAt:"2026-04-17T03:22:00Z"},{id:"m-012",content:"Active Forgetting feature: compounds on each suppress, 24h reversible labile window, violet implosion animation in graph view.",nodeType:"concept",tags:["vestige","active-forgetting"],retention:.81,createdAt:"2026-04-18T09:07:00Z"}]}],t)}}async function x(){w(_,!0),w(k,null);try{const t=await le(e(d));w(u,t.clusters,!0);const a=new Set(e(u).map(p=>be(p.memories))),l=new Set;for(const p of e(b))a.has(p)&&l.add(p);w(b,l,!0)}catch(t){w(k,t instanceof Error?t.message:"Failed to detect duplicates",!0),w(u,[],!0)}finally{w(_,!1)}}function X(){clearTimeout(V),V=setTimeout(x,250)}function B(t){const a=new Set(e(b));a.add(t),w(b,a,!0)}function Y(t,a,l){console.log("Merge cluster",t,{winnerId:a,loserIds:l}),B(t)}const h=P(()=>e(u).map(t=>({c:t,key:be(t.memories)})).filter(({key:t})=>!e(b).has(t))),C=P(()=>e(h).reduce((t,{c:a})=>t+a.memories.length,0)),ee=50,H=P(()=>e(h).length>ee),de=P(()=>e(H)?e(h).slice(0,ee):e(h));Ce(()=>x()),Le(()=>clearTimeout(V));var K=at(),q=o(r(K),2),L=r(q),U=o(r(L),2);Fe(U);var W=o(U,2),ce=r(W);s(W),s(L);var R=o(L,2),te=r(R);{var J=t=>{var a=Ve();he(2),v(t,a)},F=t=>{var a=Xe();he(2),v(t,a)},ue=t=>{var a=Ye(),l=o(we(a),2),p=r(l);s(l),S(()=>g(p,`${e(h).length??""}
|
|
${e(h).length===1?"cluster":"clusters"},
|
|
${e(C)??""} potential duplicate${e(C)===1?"":"s"}`)),v(t,a)};G(te,t=>{e(_)?t(J):e(k)?t(F,1):t(ue,!1)})}s(R);var ie=o(R,2);s(q);var T=o(q,2);{var c=t=>{var a=qe(),l=o(r(a),2),p=r(l,!0);s(l);var Z=o(l,2);s(a),S(()=>g(p,e(k))),z("click",Z,x),v(t,a)},M=t=>{var a=Qe();oe(a,20,()=>Array(3),ke,(l,p)=>{var Z=Je();v(l,Z)}),s(a),v(t,a)},N=t=>{var a=$e();v(t,a)},I=t=>{var a=it(),l=r(a);{var p=D=>{var f=et(),E=r(f);s(f),S(()=>g(E,`Showing first 50 of ${e(h).length??""} clusters. Raise the
|
|
threshold to narrow results.`)),v(D,f)};G(l,D=>{e(H)&&D(p)})}var Z=o(l,2);oe(Z,17,()=>e(de),({c:D,key:f})=>f,(D,f)=>{let E=()=>e(f).c,ae=()=>e(f).key;var Q=tt(),ve=r(Q);Ge(ve,{get similarity(){return E().similarity},get memories(){return E().memories},get suggestedAction(){return E().suggestedAction},onDismiss:()=>B(ae()),onMerge:(se,$)=>Y(ae(),se,$)}),s(Q),v(D,Q)}),s(a),v(t,a)};G(T,t=>{e(k)?t(c):e(_)?t(M,1):e(h).length===0?t(N,2):t(I,!1)})}s(K),S(t=>{g(ce,`${t??""}%`),ie.disabled=e(_)},[()=>(e(d)*100).toFixed(0)]),z("input",U,X),Ne(U,()=>e(d),t=>w(d,t)),z("click",ie,x),v(n,K),Te()}Ae(["input","click"]);export{ft as component};
|