vestige/apps/dashboard/build/_app/immutable/nodes/17.3ASmJvJ6.js
Sam Valladares f7530af3db
release: v2.2.1 — Windows embeddings fix + backfill safety + first-run guide (#105)
* patch(backfill-safety): VESTIGE_BACKFILL_AUTOFIRE gate (default OFF) + bounded promote_memory_backfill

Off-by-default env gate around step-8.5 auto-fire in run_consolidation (decouples
backfill from consolidation cadence). New promote_memory_backfill caps stability at
MIN(stability*1.5, stability+365.0) (the bound retroactive_backfill.rs:300 already
computes but discarded); both backfill entry points use it. Fixes the false 'capped'
comment. Cloud-sync excluded at build (--no-default-features). Pending upstream PR to
samvallad33/vestige. omega-backfill-safety-v2.2.0 off tag v2.2.0 (3bcd4667).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* release: v2.2.1 — Windows embeddings fix + backfill safety + first-run guide

Board-clearing patch release.

Fixes:
- #101 Windows embeddings: release.yml already restores vector-search on the
  x86_64-pc-windows-msvc target (merged in #102); this release rebuilds the
  Windows binary so users actually get working embeddings.
- #103 Retroactive Salience Backfill safety (from community PR #104, adjusted):
  * promote_memory_backfill bounds the stability multiply to
    MIN(stability*1.5, stability+365.0) on both auto-fire and manual paths.
  * VESTIGE_BACKFILL_AUTOFIRE gate — default ON (preserves the shipped/documented
    v2.2.0 behavior), disable with 0/false/off/no. Env value is trimmed.
  * Corrected the false "capped" comment and the promote_memory_backfill doc.
  * Added 3 tests: +365 cap binds, *1.5 multiply below crossover, gate parsing.

Docs:
- #83 First-Run: new docs/GETTING-STARTED.md + README pointer.
- Consolidated roadmap issues #82,#84-#92 into docs/ROADMAP.md (Tracked Issues).
- Documented VESTIGE_BACKFILL_AUTOFIRE in docs/CONFIGURATION.md.
- CHANGELOG v2.2.1 entry.

Version bumped to 2.2.1 across all manifests + Cargo.lock + dashboard build.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Peter Lauzon <inbijiburu@protonmail.com>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-02 12:02:42 -05:00

2 lines
27 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import"../chunks/Bzak7iHL.js";import{o as Gt}from"../chunks/TZu9D97Z.js";import{p as tt,e as s,g as e,h as a,r as t,n as Z,t as C,a as g,b as st,j as f,u as re,s as he,d as Ht,x as Wt,i as L,ar as Kt,f as ft,au as wt}from"../chunks/wpu9U-D0.js";import{s as o,d as Vt,a as Ye}from"../chunks/D8mhvFt8.js";import{i as D}from"../chunks/DKve45Wd.js";import{e as ce,s as at,a as Y,r as Qt,i as Ae}from"../chunks/60_R_Vbt.js";import{h as Ut}from"../chunks/DzesjbbJ.js";import{a as Xe,r as Yt}from"../chunks/P1-U_Xsj.js";import{s as w}from"../chunks/EqHb-9AZ.js";import{b as Xt}from"../chunks/CnZzd20v.js";import{b as _t}from"../chunks/g5OnrUYZ.js";import{a as Zt}from"../chunks/CZfHMhLI.js";import{p as ue}from"../chunks/ByYB047u.js";import{N as Jt}from"../chunks/CcUbQ_Wl.js";import{P as es}from"../chunks/BHDZZvku.js";import{I as be}from"../chunks/D7A-gG4Z.js";import{A as Ze}from"../chunks/DcKTNC6e.js";import{m as ts,s as ss}from"../chunks/DPdYG9yN.js";var as=f('<div class="connector svelte-9hm057"></div>'),ns=f('<div class="stage glass-subtle rounded-xl p-3 flex items-start gap-3 relative svelte-9hm057"><!> <div class="stage-orb flex-shrink-0 svelte-9hm057"><span class="text-xs text-synapse-glow svelte-9hm057"> </span></div> <div class="flex-1 min-w-0 svelte-9hm057"><div class="flex items-center gap-2 mb-0.5 svelte-9hm057"><span class="text-[10px] font-mono text-muted svelte-9hm057"> </span> <span class="text-sm text-bright font-medium svelte-9hm057"> </span></div> <p class="text-xs text-dim leading-snug svelte-9hm057"> </p></div> <span class="stage-pulse svelte-9hm057" aria-hidden="true"></span></div>'),rs=f("<div></div>");function yt(l,v){tt(v,!0);let J=ue(v,"intent",3,"Synthesis"),B=ue(v,"memoriesAnalyzed",3,0),R=ue(v,"evidenceCount",3,0),i=ue(v,"contradictionCount",3,0),G=ue(v,"supersededCount",3,0),E=ue(v,"running",3,!1),H=ue(v,"stageHints",19,()=>({}));const I=[{key:"broad",icon:"◎",label:"Broad Retrieval",base:"Hybrid BM25 + semantic (3x overfetch) then cross-encoder rerank"},{key:"spreading",icon:"⟿",label:"Spreading Activation",base:"Collins & Loftus — expand via graph edges to surface what search missed"},{key:"fsrs",icon:"▲",label:"FSRS Trust Scoring",base:"retention × stability × reps ÷ lapses — which memories have earned trust"},{key:"intent",icon:"◆",label:"Intent Classification",base:"FactCheck / Timeline / RootCause / Comparison / Synthesis"},{key:"supersession",icon:"↗",label:"Temporal Supersession",base:"Newer high-trust memories replace older ones on the same fact"},{key:"contradiction",icon:"⚡",label:"Contradiction Analysis",base:"Only flag conflicts between memories where BOTH have trust > 0.3"},{key:"relation",icon:"⬡",label:"Relation Assessment",base:"Per pair: Supports / Contradicts / Supersedes / Irrelevant"},{key:"template",icon:"❖",label:"Template Reasoning",base:"Build the natural-language reasoning chain you validate"}],ee=re(()=>({broad:B()?`Analyzed ${B()} memories · ${R()} survived ranking`:void 0,intent:J()?`Classified as ${J()}`:void 0,supersession:G()?`${G()} outdated memor${G()===1?"y":"ies"} superseded`:void 0,contradiction:i()?`${i()} real conflict${i()===1?"":"s"} between trusted memories`:"No conflicts between trusted memories"}));function te($,K){return H()[$]??e(ee)[$]??K}var W=rs();let qe;ce(W,23,()=>I,$=>$.key,($,K,V)=>{var O=ns(),se=s(O);{var pe=N=>{var oe=as();C(()=>w(oe,`animation-delay: ${e(V)*140+120}ms;`)),g(N,oe)};D(se,N=>{e(V)<I.length-1&&N(pe)})}var M=a(se,2),P=s(M),me=s(P,!0);t(P),t(M);var ie=a(M,2),xe=s(ie),ae=s(xe),Ee=s(ae);t(ae);var le=a(ae,2),we=s(le,!0);t(le),t(xe);var ge=a(xe,2),ne=s(ge,!0);t(ge),t(ie),Z(2),t(O),C(N=>{w(O,`animation-delay: ${e(V)*140}ms;`),w(M,`animation-delay: ${e(V)*140}ms;`),o(me,e(K).icon),o(Ee,`0${e(V)+1}`),o(we,e(K).label),o(ne,N)},[()=>te(e(K).key,e(K).base)]),g($,O)}),t(W),C(()=>qe=at(W,1,"reasoning-chain space-y-2 svelte-9hm057",null,qe,{running:E()})),g(l,W),st()}const is="#10b981",ls="#f59e0b",et="#ef4444",ht="#8B95A5",bt={primary:{label:"Primary",accent:"synapse",icon:"◈"},supporting:{label:"Supporting",accent:"recall",icon:"◇"},contradicting:{label:"Contradicting",accent:"decay",icon:"⚠"},superseded:{label:"Superseded",accent:"muted",icon:"⊘"}};function os(l){return bt[l]??bt.supporting}function Oe(l){return Number.isFinite(l)?l>75?is:l>=40?ls:et:et}function qt(l){return Number.isFinite(l)?l>75?"HIGH CONFIDENCE":l>=40?"MIXED SIGNAL":"LOW CONFIDENCE":"LOW CONFIDENCE"}function Je(l){return Number.isFinite(l)?Oe(l*100):et}function vs(l){return!Number.isFinite(l)||l<0?0:l>1?1:l}function ds(l){return vs(l)*100}function cs(l){return l?Jt[l]??ht:ht}function us(l,v){if(l==null||typeof l!="string"||l.trim()==="")return"—";const J=new Date(l);if(Number.isNaN(J.getTime()))return l;try{return J.toLocaleDateString(v,{month:"short",day:"numeric",year:"numeric"})}catch{return l}}function ps(l,v=8){return l?l.length>v?l.slice(0,v):l:""}var ms=f('<span class="px-1.5 py-0.5 rounded bg-white/[0.04] svelte-ksja6x"> </span>'),xs=f('<div><div class="flex items-center justify-between text-[10px] uppercase tracking-wider svelte-ksja6x"><div class="flex items-center gap-2 svelte-ksja6x"><span class="role-pill px-2 py-0.5 rounded text-[10px] svelte-ksja6x"><span class="mr-1 svelte-ksja6x"> </span> </span> <!></div> <span class="text-muted font-mono text-[10px] svelte-ksja6x"> </span></div> <p class="text-sm text-text leading-relaxed line-clamp-4 svelte-ksja6x"> </p> <div class="space-y-1.5 svelte-ksja6x"><div class="flex items-center justify-between text-[10px] svelte-ksja6x"><span class="text-dim uppercase tracking-wider svelte-ksja6x">Trust</span> <span class="font-mono svelte-ksja6x"> </span></div> <div class="h-1.5 bg-deep rounded-full overflow-hidden svelte-ksja6x"><div class="h-full rounded-full transition-all duration-700 trust-fill svelte-ksja6x"></div></div></div> <div class="flex items-center justify-between text-[10px] text-muted pt-1 svelte-ksja6x"><span class="svelte-ksja6x"> </span> <span class="font-mono opacity-60 svelte-ksja6x">FSRS · reps × retention</span></div></div>');function gs(l,v){tt(v,!0);let J=ue(v,"index",3,0);const B=re(()=>ds(v.trust)),R=re(()=>os(v.role)),i=re(()=>ps(v.id)),G=re(()=>cs(v.nodeType));var E=xs();let H;var I=s(E),ee=s(I),te=s(ee),W=s(te),qe=s(W,!0);t(W);var $=a(W,1,!0);t(te);var K=a(te,2);{var V=ne=>{var N=ms(),oe=s(N,!0);t(N),C(()=>{w(N,`color: ${e(G)??""}`),o(oe,v.nodeType)}),g(ne,N)};D(K,ne=>{v.nodeType&&ne(V)})}t(ee);var O=a(ee,2),se=s(O);t(O),t(I);var pe=a(I,2),M=s(pe,!0);t(pe);var P=a(pe,2),me=s(P),ie=a(s(me),2),xe=s(ie);t(ie),t(me);var ae=a(me,2),Ee=s(ae);t(ae),t(P);var le=a(P,2),we=s(le),ge=s(we,!0);t(we),Z(2),t(le),t(E),C((ne,N,oe,r,n)=>{H=at(E,1,"evidence-card glass rounded-xl p-4 space-y-3 transition relative svelte-ksja6x",null,H,{contradicting:v.role==="contradicting",primary:v.role==="primary",superseded:v.role==="superseded"}),w(E,`animation-delay: ${J()*80}ms;`),Y(E,"data-evidence-id",v.id),o(qe,e(R).icon),o($,e(R).label),Y(O,"title",v.id),o(se,`#${e(i)??""}`),o(M,v.preview),w(ie,`color: ${ne??""}`),o(xe,`${N??""}%`),w(Ee,`width: ${e(B)??""}%; background: ${oe??""}; box-shadow: 0 0 8px ${r??""}80;`),o(ge,n)},[()=>Je(v.trust),()=>e(B).toFixed(0),()=>Je(v.trust),()=>Je(v.trust),()=>us(v.date)]),g(l,E),st()}var fs=f('<span class="inline-flex items-center gap-1.5 px-2.5 py-1 rounded-full bg-dream/15 border border-dream/30 text-[10px] text-dream-glow uppercase tracking-wider font-mono svelte-q2v96u"><span class="ping-host w-1.5 h-1.5 rounded-full svelte-q2v96u" style="color: var(--color-dream); background: var(--color-dream)"></span> deep_reference</span>'),_s=f('<button class="px-2.5 py-1 rounded-full glass-subtle text-[11px] text-dim hover:text-synapse-glow hover:!border-synapse/30 transition svelte-q2v96u"> </button>'),ys=f('<div class="flex flex-wrap gap-2 pt-1 svelte-q2v96u"><span class="text-[10px] uppercase tracking-wider text-muted mr-1 self-center svelte-q2v96u">Try</span> <!></div>'),hs=f('<div class="glass rounded-xl p-4 !border-decay/40 text-decay text-sm svelte-q2v96u"><span class="font-medium svelte-q2v96u">Error:</span> </div>'),bs=f('<div class="glass-panel rounded-2xl p-6 space-y-4 svelte-q2v96u"><div class="flex items-center gap-2 text-xs text-dream-glow uppercase tracking-wider svelte-q2v96u"><span class="animate-pulse-glow svelte-q2v96u">●</span> <span class="svelte-q2v96u">Running cognitive pipeline</span></div> <!></div>'),qs=f('<div class="space-y-3 svelte-q2v96u"><div class="flex items-center justify-between svelte-q2v96u"><h2 class="text-sm text-bright font-semibold flex items-center gap-2 svelte-q2v96u"><span class="text-dream-glow svelte-q2v96u"><!></span> Reasoning</h2> <div class="flex items-center gap-3 text-[10px] text-muted font-mono svelte-q2v96u"><span class="svelte-q2v96u">intent: <span class="text-dim svelte-q2v96u"> </span></span> <span class="svelte-q2v96u">·</span> <span class="svelte-q2v96u"><!> analyzed</span> <span class="svelte-q2v96u">·</span> <span class="svelte-q2v96u"> </span></div></div> <div class="spotlight-surface glass-panel rounded-2xl p-6 font-mono text-sm text-bright whitespace-pre-wrap leading-relaxed svelte-q2v96u"><span class="relative z-[1] svelte-q2v96u"> </span></div></div>'),ws=wt('<path fill="none" stroke="url(#arcGrad)" stroke-width="1.5" stroke-dasharray="4 4" class="arc-path svelte-q2v96u"></path><circle r="4" fill="#ef4444" opacity="0.8" class="arc-dot svelte-q2v96u"></circle><circle r="4" fill="#ef4444" opacity="0.8" class="arc-dot svelte-q2v96u"></circle>',1),ks=wt('<svg class="contradiction-arcs pointer-events-none absolute inset-0 w-full h-full svelte-q2v96u" aria-hidden="true"><defs class="svelte-q2v96u"><linearGradient id="arcGrad" x1="0" y1="0" x2="1" y2="0" class="svelte-q2v96u"><stop offset="0%" stop-color="#ef4444" stop-opacity="0.9" class="svelte-q2v96u"></stop><stop offset="50%" stop-color="#ef4444" stop-opacity="0.4" class="svelte-q2v96u"></stop><stop offset="100%" stop-color="#ef4444" stop-opacity="0.9" class="svelte-q2v96u"></stop></linearGradient></defs><!></svg>'),Ss=f('<div class="flex items-start gap-3 p-3 rounded-xl bg-decay/[0.05] border border-decay/20 svelte-q2v96u"><span class="text-decay text-lg svelte-q2v96u">⚠</span> <div class="flex-1 space-y-1 svelte-q2v96u"><div class="flex items-center gap-2 text-[10px] font-mono text-muted svelte-q2v96u"><span class="svelte-q2v96u"> </span> <span class="text-decay svelte-q2v96u">↔</span> <span class="svelte-q2v96u"> </span></div> <p class="text-sm text-text svelte-q2v96u"> </p></div> <span class="text-[10px] font-mono text-muted svelte-q2v96u"></span></div>'),Cs=f('<div class="space-y-3 svelte-q2v96u"><h2 class="text-sm font-semibold flex items-center gap-2 svelte-q2v96u" style="color: #fca5a5;"><span class="svelte-q2v96u"><!></span> Contradictions Detected <span class="font-normal text-muted svelte-q2v96u">(<!>)</span></h2> <div class="glass rounded-2xl p-4 space-y-3 !border-decay/30 svelte-q2v96u"></div></div>'),Rs=f('<div class="flex items-center gap-3 text-xs text-dim svelte-q2v96u"><span class="font-mono text-muted svelte-q2v96u"> </span> <span class="text-dream-glow svelte-q2v96u">⟶</span> <span class="font-mono text-synapse-glow svelte-q2v96u"> </span> <span class="text-muted svelte-q2v96u"> </span></div>'),As=f('<div class="space-y-3 svelte-q2v96u"><h2 class="text-sm text-dim font-semibold flex items-center gap-2 svelte-q2v96u"><span class="svelte-q2v96u">⊘</span> Superseded <span class="font-normal text-muted svelte-q2v96u"> </span></h2> <div class="glass-subtle rounded-2xl p-4 space-y-2 svelte-q2v96u"></div></div>'),Es=f('<div class="flex items-start gap-3 text-xs svelte-q2v96u"><span class="text-muted font-mono whitespace-nowrap svelte-q2v96u"> </span> <span class="mt-1 w-1.5 h-1.5 rounded-full flex-shrink-0 svelte-q2v96u"></span> <span class="text-dim flex-1 svelte-q2v96u"> </span></div>'),Ns=f('<div class="space-y-3 svelte-q2v96u"><h2 class="text-sm text-bright font-semibold flex items-center gap-2 svelte-q2v96u"><span class="text-dream-glow svelte-q2v96u">↗</span> Evolution</h2> <div class="glass rounded-2xl p-4 space-y-2 svelte-q2v96u"></div></div>'),Ts=f('<p class="text-xs text-dim leading-relaxed svelte-q2v96u"><span class="text-synapse-glow mr-2 svelte-q2v96u"></span> </p>'),js=f('<div class="space-y-3 svelte-q2v96u"><h2 class="text-sm text-bright font-semibold flex items-center gap-2 svelte-q2v96u"><span class="text-dream-glow svelte-q2v96u"><!></span> Related Insights</h2> <div class="glass rounded-2xl p-4 space-y-2 svelte-q2v96u"></div></div>'),Fs=f('<!> <div class="grid md:grid-cols-[280px_1fr] gap-4 svelte-q2v96u"><div class="glass-panel rounded-2xl p-5 flex flex-col items-center justify-center text-center space-y-2 svelte-q2v96u"><span class="text-[10px] uppercase tracking-wider text-dim svelte-q2v96u">Confidence</span> <div class="relative svelte-q2v96u"><span class="block text-6xl font-bold font-mono conf-number svelte-q2v96u"><!><span class="text-2xl align-top opacity-60 svelte-q2v96u">%</span></span></div> <span class="text-[10px] font-mono tracking-wider svelte-q2v96u"> </span> <svg width="220" height="14" viewBox="0 0 220 14" class="mt-1 svelte-q2v96u"><rect x="0" y="5" width="220" height="4" rx="2" fill="rgba(255,255,255,0.05)" class="svelte-q2v96u"></rect><rect x="0" y="5" height="4" rx="2" class="svelte-q2v96u"><animate attributeName="width" from="0" dur="0.9s" fill="freeze" class="svelte-q2v96u"></animate></rect></svg> <div class="flex gap-3 pt-2 text-[10px] text-muted font-mono svelte-q2v96u"><span class="svelte-q2v96u">intent: <span class="text-dim svelte-q2v96u"> </span></span> <span class="svelte-q2v96u">·</span> <span class="svelte-q2v96u"> </span></div></div> <div class="glass-panel rounded-2xl p-5 space-y-3 !border-synapse/25 svelte-q2v96u"><div class="flex items-center justify-between svelte-q2v96u"><span class="text-[10px] uppercase tracking-wider text-synapse-glow svelte-q2v96u">Primary Source</span> <span class="text-[10px] font-mono text-muted svelte-q2v96u"> </span></div> <p class="text-base text-bright leading-relaxed svelte-q2v96u"> </p> <div class="flex items-center gap-4 text-[11px] text-muted pt-1 border-t border-synapse/10 svelte-q2v96u"><span class="flex items-center gap-1.5 svelte-q2v96u"><span class="w-2 h-2 rounded-full svelte-q2v96u"></span> </span> <span class="svelte-q2v96u">·</span> <span class="svelte-q2v96u"> </span></div></div></div> <div class="space-y-3 svelte-q2v96u"><h2 class="text-sm text-bright font-semibold flex items-center gap-2 svelte-q2v96u"><span class="text-dream-glow svelte-q2v96u"><!></span> Cognitive Pipeline</h2> <div class="glass-panel rounded-2xl p-5 svelte-q2v96u"><!></div></div> <div class="space-y-3 svelte-q2v96u"><div class="flex items-center justify-between svelte-q2v96u"><h2 class="text-sm text-bright font-semibold flex items-center gap-2 svelte-q2v96u"><span class="text-synapse-glow svelte-q2v96u"><!></span> Evidence <span class="text-muted font-normal svelte-q2v96u"> </span></h2> <div class="flex items-center gap-3 text-[10px] text-muted svelte-q2v96u"><span class="flex items-center gap-1 svelte-q2v96u"><span class="w-2 h-2 rounded-full bg-synapse-glow svelte-q2v96u"></span>primary</span> <span class="flex items-center gap-1 svelte-q2v96u"><span class="w-2 h-2 rounded-full bg-recall svelte-q2v96u"></span>supporting</span> <span class="flex items-center gap-1 svelte-q2v96u"><span class="w-2 h-2 rounded-full bg-decay svelte-q2v96u"></span>contradicting</span> <span class="flex items-center gap-1 svelte-q2v96u"><span class="w-2 h-2 rounded-full bg-muted svelte-q2v96u"></span>superseded</span></div></div> <div class="evidence-grid relative grid sm:grid-cols-2 lg:grid-cols-3 gap-3 svelte-q2v96u"><!> <!></div></div> <!> <!> <div class="grid md:grid-cols-2 gap-4 svelte-q2v96u"><!> <!></div>',1),zs=f(`<div class="glass-subtle rounded-2xl p-12 text-center space-y-3 enter svelte-q2v96u"><div class="mx-auto w-fit text-dream-glow opacity-40 breathe svelte-q2v96u"><!></div> <p class="text-sm text-dim svelte-q2v96u">Ask anything. Vestige will run the full reasoning pipeline and show you its work.</p> <p class="text-[10px] text-muted font-mono svelte-q2v96u">8-stage pipeline: retrieval → rerank → activation → trust-score → supersession →
contradiction → relations → chain. Zero LLM calls, 100% local.</p></div>`),Ls=f('<div class="p-6 max-w-6xl mx-auto space-y-8 enter svelte-q2v96u"><!> <div class="glass-panel rounded-2xl p-5 space-y-4 svelte-q2v96u"><div class="flex items-center gap-3 svelte-q2v96u"><span><!></span> <input type="text" placeholder="Ask your memory anything…" class="flex-1 bg-transparent text-bright text-lg placeholder:text-muted focus:outline-none font-mono svelte-q2v96u"/> <kbd class="hidden sm:inline-flex items-center gap-1 px-2 py-1 rounded bg-white/[0.04] border border-synapse/15 text-[10px] text-dim font-mono svelte-q2v96u"><span class="svelte-q2v96u">⌘</span>K</kbd> <button class="px-4 py-2 rounded-xl bg-synapse/20 border border-synapse/40 text-synapse-glow text-sm hover:bg-synapse/30 transition disabled:opacity-40 disabled:cursor-not-allowed svelte-q2v96u"> </button></div> <!></div> <!> <!> <!> <!></div>');function ea(l,v){tt(v,!0);async function J(r){var je,$e,Fe;const n=await Zt.deepReference(r,20),k=(Array.isArray(n.evidence)?n.evidence:[]).map(c=>{const j=typeof c.trust=="number"?c.trust:0,ze=j>1?j/100:j,Le=c.role||"supporting";return{id:String(c.id??""),trust:Math.max(0,Math.min(1,ze)),date:String(c.date??""),role:Le,preview:String(c.preview??""),nodeType:c.node_type?String(c.node_type):c.nodeType?String(c.nodeType):void 0}}),_=n.recommended,T={answer_preview:String((_==null?void 0:_.answer_preview)??((je=k[0])==null?void 0:je.preview)??""),memory_id:String((_==null?void 0:_.memory_id)??(($e=k[0])==null?void 0:$e.id)??""),trust_score:(()=>{var j;const c=_==null?void 0:_.trust_score;return typeof c=="number"?c>1?c/100:c:((j=k[0])==null?void 0:j.trust)??0})(),date:String((_==null?void 0:_.date)??((Fe=k[0])==null?void 0:Fe.date)??"")},ke=(Array.isArray(n.contradictions)?n.contradictions:[]).map(c=>({a_id:String(c.a_id??""),b_id:String(c.b_id??""),summary:String(c.summary??c.reason??"Trust-weighted conflict between high-FSRS memories.")})),Ne=(Array.isArray(n.superseded)?n.superseded:[]).map(c=>({old_id:String(c.old_id??""),new_id:String(c.new_id??T.memory_id??""),reason:String(c.reason??"Superseded by newer memory with higher FSRS trust.")})),Se=(Array.isArray(n.evolution)?n.evolution:[]).map(c=>({date:String(c.date??""),summary:String(c.summary??c.preview??""),trust:(()=>{const j=c.trust;return typeof j=="number"?j>1?j/100:j:0})()})),Me=Array.isArray(n.related_insights)?n.related_insights:[],fe=typeof n.confidence=="number"?n.confidence:0,_e=fe>1?Math.round(fe):Math.round(fe*100),Pe=String(n.intent??"Synthesis"),Ie=String(n.reasoning??n.guidance??""),Te=typeof n.memoriesAnalyzed=="number"?n.memoriesAnalyzed:k.length;return{intent:Pe,reasoning:Ie,recommended:T,evidence:k,contradictions:ke,superseded:Ne,evolution:Se,related_insights:Me,confidence:_e,memoriesAnalyzed:Te}}let B=he(""),R=he(!1),i=he(null),G=he(null),E=he(null),H=he(null),I=he(Ht([]));async function ee(){const r=e(B).trim();if(!(!r||e(R))){L(R,!0),L(G,null),L(i,null),L(I,[],!0);try{L(i,await J(r),!0),requestAnimationFrame(()=>requestAnimationFrame(te))}catch(n){L(G,n instanceof Error?n.message:"Unknown error",!0)}finally{L(R,!1)}}}function te(){if(!e(i)||!e(H)||e(i).contradictions.length===0){L(I,[],!0);return}const r=e(H).getBoundingClientRect(),n=[];for(const p of e(i).contradictions){const k=e(H).querySelector(`[data-evidence-id="${p.a_id}"]`),_=e(H).querySelector(`[data-evidence-id="${p.b_id}"]`);if(!k||!_)continue;const T=k.getBoundingClientRect(),Q=_.getBoundingClientRect();n.push({x1:T.left-r.left+T.width/2,y1:T.top-r.top+T.height/2,x2:Q.left-r.left+Q.width/2,y2:Q.top-r.top+Q.height/2})}L(I,n,!0)}function W(r){var n,p;(r.metaKey||r.ctrlKey)&&r.key.toLowerCase()==="k"&&(r.preventDefault(),(n=e(E))==null||n.focus(),(p=e(E))==null||p.select())}Gt(()=>{var r;return(r=e(E))==null||r.focus(),window.addEventListener("keydown",W),window.addEventListener("resize",te),()=>{window.removeEventListener("keydown",W),window.removeEventListener("resize",te)}});const qe=["What port does the dev server use?","Should I enable prefix caching with vLLM?","Why did the benchmark score drop after the parser change?","How does FSRS-6 trust scoring work?"];var $=Ls();Ut("q2v96u",r=>{Wt(()=>{Kt.title="Reasoning Theater · Vestige"})});var K=s($);es(K,{icon:"reasoning",title:"Reasoning Theater",subtitle:"Watch Vestige reason — the 8-stage cognitive pipeline runs locally and returns a pre-built answer with trust-scored evidence.",accent:"dream",children:(r,n)=>{var p=fs();g(r,p)},$$slots:{default:!0}});var V=a(K,2),O=s(V),se=s(O),pe=s(se);be(pe,{name:"reasoning",size:20}),t(se);var M=a(se,2);Qt(M),_t(M,r=>L(E,r),()=>e(E));var P=a(M,4),me=s(P,!0);t(P),Xe(P,r=>{var n;return(n=ts)==null?void 0:n(r)}),t(O);var ie=a(O,2);{var xe=r=>{var n=ys(),p=a(s(n),2);ce(p,17,()=>qe,Ae,(k,_)=>{var T=_s(),Q=s(T,!0);t(T),C(()=>o(Q,e(_))),Ye("click",T,()=>{L(B,e(_),!0),ee()}),g(k,T)}),t(n),g(r,n)};D(ie,r=>{!e(i)&&!e(R)&&r(xe)})}t(V);var ae=a(V,2);{var Ee=r=>{var n=hs(),p=a(s(n));t(n),C(()=>o(p,` ${e(G)??""}`)),g(r,n)};D(ae,r=>{e(G)&&r(Ee)})}var le=a(ae,2);{var we=r=>{var n=bs(),p=a(s(n),2);yt(p,{running:!0}),t(n),g(r,n)};D(le,r=>{e(R)&&r(we)})}var ge=a(le,2);{var ne=r=>{const n=re(()=>e(i).confidence),p=re(()=>Oe(e(n)));var k=Fs(),_=ft(k);{var T=u=>{var d=qs(),x=s(d),y=s(x),m=s(y),h=s(m);be(h,{name:"reasoning",size:16}),t(m),Z(),t(y);var F=a(y,2),S=s(F),b=a(s(S)),q=s(b,!0);t(b),t(S);var z=a(S,4),A=s(z);Ze(A,{get value(){return e(i).memoriesAnalyzed}}),Z(),t(z);var U=a(z,4),ve=s(U);t(U),t(F),t(x);var X=a(x,2),Ce=s(X),Re=s(Ce,!0);t(Ce),t(X),Xe(X,ye=>{var de;return(de=ss)==null?void 0:de(ye)}),t(d),Xe(d,ye=>{var de;return(de=Yt)==null?void 0:de(ye)}),C(ye=>{o(q,e(i).intent),w(U,`color: ${e(p)??""}`),o(ve,`${e(n)??""}% ${ye??""}`),w(X,`box-shadow: inset 0 1px 0 0 rgba(255,255,255,0.03), 0 0 32px ${e(p)??""}20, 0 8px 32px rgba(0,0,0,0.4); border-color: ${e(p)??""}35;`),o(Re,e(i).reasoning)},[()=>qt(e(n))]),g(u,d)};D(_,u=>{e(i).reasoning&&u(T)})}var Q=a(_,2),ke=s(Q),De=a(s(ke),2),Ne=s(De),nt=s(Ne);Ze(nt,{get value(){return e(n)}}),Z(),t(Ne),t(De);var Se=a(De,2),Me=s(Se,!0);t(Se);var fe=a(Se,2),_e=a(s(fe)),Pe=s(_e);t(_e),t(fe);var Ie=a(fe,2),Te=s(Ie),je=a(s(Te)),$e=s(je,!0);t(je),t(Te);var Fe=a(Te,4),c=s(Fe);t(Fe),t(Ie),t(ke);var j=a(ke,2),ze=s(j),Le=a(s(ze),2),kt=s(Le);t(Le),t(ze);var Be=a(ze,2),St=s(Be,!0);t(Be);var rt=a(Be,2),Ge=s(rt),it=s(Ge),Ct=a(it);t(Ge);var lt=a(Ge,4),Rt=s(lt,!0);t(lt),t(rt),t(j),t(Q);var He=a(Q,2),We=s(He),ot=s(We),At=s(ot);be(At,{name:"activation",size:15}),t(ot),Z(),t(We);var vt=a(We,2),Et=s(vt);yt(Et,{get intent(){return e(i).intent},get memoriesAnalyzed(){return e(i).memoriesAnalyzed},get evidenceCount(){return e(i).evidence.length},get contradictionCount(){return e(i).contradictions.length},get supersededCount(){return e(i).superseded.length}}),t(vt),t(He);var Ke=a(He,2),Ve=s(Ke),dt=s(Ve),Qe=s(dt),Nt=s(Qe);be(Nt,{name:"memories",size:15}),t(Qe);var ct=a(Qe,2),Tt=s(ct);t(ct),t(dt),Z(2),t(Ve);var Ue=a(Ve,2),ut=s(Ue);ce(ut,19,()=>e(i).evidence,u=>u.id,(u,d,x)=>{gs(u,{get id(){return e(d).id},get trust(){return e(d).trust},get date(){return e(d).date},get role(){return e(d).role},get preview(){return e(d).preview},get nodeType(){return e(d).nodeType},get index(){return e(x)}})});var jt=a(ut,2);{var Ft=u=>{var d=ks(),x=a(s(d));ce(x,17,()=>e(I),Ae,(y,m,h)=>{const F=re(()=>(e(m).x1+e(m).x2)/2),S=re(()=>Math.min(e(m).y1,e(m).y2)-28);var b=ws(),q=ft(b);w(q,`animation-delay: ${h*120+600}ms;`);var z=a(q);w(z,`animation-delay: ${h*120+600}ms;`);var A=a(z);w(A,`animation-delay: ${h*120+700}ms;`),C(()=>{Y(q,"d",`M ${e(m).x1??""} ${e(m).y1??""} Q ${e(F)??""} ${e(S)??""} ${e(m).x2??""} ${e(m).y2??""}`),Y(z,"cx",e(m).x1),Y(z,"cy",e(m).y1),Y(A,"cx",e(m).x2),Y(A,"cy",e(m).y2)}),g(y,b)}),t(d),g(u,d)};D(jt,u=>{e(I).length>0&&u(Ft)})}t(Ue),_t(Ue,u=>L(H,u),()=>e(H)),t(Ke);var pt=a(Ke,2);{var zt=u=>{var d=Cs(),x=s(d),y=s(x),m=s(y);be(m,{name:"contradictions",size:15}),t(y);var h=a(y,2),F=a(s(h));Ze(F,{get value(){return e(i).contradictions.length}}),Z(),t(h),t(x);var S=a(x,2);ce(S,21,()=>e(i).contradictions,Ae,(b,q,z)=>{var A=Ss(),U=a(s(A),2),ve=s(U),X=s(ve),Ce=s(X);t(X);var Re=a(X,4),ye=s(Re);t(Re),t(ve);var de=a(ve,2),Ot=s(de,!0);t(de),t(U);var Mt=a(U,2);Mt.textContent=`pair ${z+1}`,t(A),C((Pt,Bt)=>{o(Ce,`#${Pt??""}`),o(ye,`#${Bt??""}`),o(Ot,e(q).summary)},[()=>e(q).a_id.slice(0,8),()=>e(q).b_id.slice(0,8)]),g(b,A)}),t(S),t(d),g(u,d)};D(pt,u=>{e(i).contradictions.length>0&&u(zt)})}var mt=a(pt,2);{var Lt=u=>{var d=As(),x=s(d),y=a(s(x),2),m=s(y);t(y),t(x);var h=a(x,2);ce(h,21,()=>e(i).superseded,Ae,(F,S)=>{var b=Rs(),q=s(b),z=s(q);t(q);var A=a(q,4),U=s(A);t(A);var ve=a(A,2),X=s(ve,!0);t(ve),t(b),C((Ce,Re)=>{o(z,`#${Ce??""}`),o(U,`#${Re??""}`),o(X,e(S).reason)},[()=>e(S).old_id.slice(0,8),()=>e(S).new_id.slice(0,8)]),g(F,b)}),t(h),t(d),C(()=>o(m,`(${e(i).superseded.length??""})`)),g(u,d)};D(mt,u=>{e(i).superseded.length>0&&u(Lt)})}var xt=a(mt,2),gt=s(xt);{var Dt=u=>{var d=Ns(),x=a(s(d),2);ce(x,21,()=>e(i).evolution,Ae,(y,m)=>{var h=Es(),F=s(h),S=s(F,!0);t(F);var b=a(F,2),q=a(b,2),z=s(q,!0);t(q),t(h),C((A,U)=>{o(S,A),w(b,`background: ${U??""}`),o(z,e(m).summary)},[()=>new Date(e(m).date).toLocaleDateString(void 0,{month:"short",day:"numeric"}),()=>Oe(e(m).trust*100)]),g(y,h)}),t(x),t(d),g(u,d)};D(gt,u=>{e(i).evolution.length>0&&u(Dt)})}var It=a(gt,2);{var $t=u=>{var d=js(),x=s(d),y=s(x),m=s(y);be(m,{name:"sparkle",size:15}),t(y),Z(),t(x);var h=a(x,2);ce(h,21,()=>e(i).related_insights,Ae,(F,S)=>{var b=Ts(),q=a(s(b),1,!0);t(b),C(()=>o(q,e(S))),g(F,b)}),t(h),t(d),g(u,d)};D(It,u=>{e(i).related_insights.length>0&&u($t)})}t(xt),C((u,d,x,y,m)=>{w(ke,`box-shadow: inset 0 1px 0 0 rgba(255,255,255,0.03), 0 0 32px ${e(p)??""}30, 0 8px 32px rgba(0,0,0,0.4); border-color: ${e(p)??""}40;`),w(Ne,`color: ${e(p)??""}; text-shadow: 0 0 24px ${e(p)??""}80;`),w(Se,`color: ${e(p)??""}`),o(Me,u),Y(_e,"width",e(n)/100*220),Y(_e,"fill",e(p)),w(_e,`filter: drop-shadow(0 0 6px ${e(p)??""});`),Y(Pe,"to",e(n)/100*220),o($e,e(i).intent),o(c,`${e(i).memoriesAnalyzed??""} analyzed`),Y(Le,"title",e(i).recommended.memory_id),o(kt,`#${d??""}`),o(St,e(i).recommended.answer_preview),w(it,`background: ${x??""}`),o(Ct,` Trust ${y??""}%`),o(Rt,m),o(Tt,`(${e(i).evidence.length??""})`)},[()=>qt(e(n)),()=>e(i).recommended.memory_id.slice(0,8),()=>Oe(e(i).recommended.trust_score*100),()=>(e(i).recommended.trust_score*100).toFixed(0),()=>new Date(e(i).recommended.date).toLocaleDateString()]),g(r,k)};D(ge,r=>{e(i)&&!e(R)&&r(ne)})}var N=a(ge,2);{var oe=r=>{var n=zs(),p=s(n),k=s(p);be(k,{name:"reasoning",size:44,strokeWidth:1.2}),t(p),Z(4),t(n),g(r,n)};D(N,r=>{!e(i)&&!e(R)&&!e(G)&&r(oe)})}t($),C(r=>{at(se,1,`text-synapse-glow ${e(R)?"breathe":""}`,"svelte-q2v96u"),P.disabled=r,o(me,e(R)?"Reasoning…":"Reason")},[()=>!e(B).trim()||e(R)]),Ye("keydown",M,r=>r.key==="Enter"&&ee()),Xt(M,()=>e(B),r=>L(B,r)),Ye("click",P,ee),g(l,$),st()}Vt(["keydown","click"]);export{ea as component};