vestige/apps/dashboard/build/_app/immutable/nodes/14.CuNExVd0.js
Sam Valladares e60e568160 fix(dashboard): audit pass — clickable field cells, empty-data substrate, reduced-motion
Full multi-team audit of the living-field work (adversarial fleet + fresh-eyes
pass + foundation deep-dive). 11 real bugs found and fixed; 7 false positives
adversarially refuted. All re-verified live on the real brain.

Pick contract: field cells were unclickable in intentions/schedule/memory-prs/
importance — the click handlers read the old text-item id off a node payload.
Read the id from either shape; importance now also picks the field pass;
intentions gets a dedicated filter toggle instead of flipping the filter on every
click. RouteStage now picks passes top-down (front-rendered text before
back-rendered field) so a background cell can't steal a foreground control's
click. Proven live: cell clicks fire real promote/act with real memory ids.

Empty data: /patterns went black when the cross-project set is empty (it is
recomputed). Seeded a real memory-pool substrate it falls back to, like
contradictions — alive at zero patterns.

Correctness: memories unsuppress now honors UnsuppressResult.stillSuppressed
(compounded suppression stays scarred). LivingFieldPass no longer writes the
shared params[2] node_count lane (was corrupting the co-resident scene renderer
on graph/observatory/memories). Finite-guard every value reaching the GPU buffer
so a bad mapper can't NaN-out the field. blackbox selected-cell highlight tracks
selectedRunId. graph nulls its field handle when leaving field mode.

Accessibility: /memories and /importance (direct ObservatoryCanvas mounts) now
honor prefers-reduced-motion via engine.setPaused — the field freezes for
reduce-motion users. Gate pins reducedMotion:'no-preference' so the motion
assertion is stable.

Gates green: check 0/0, build ok, palace-launch-gate 22/22 + curated tour,
all-routes-smoke 20/20, ChangelogResponse gains totalEvents.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-12 06:57:19 +07:00

1 line
5.1 KiB
JavaScript

var Q=Object.defineProperty;var Z=(p,c,m)=>c in p?Q(p,c,{enumerable:!0,configurable:!0,writable:!0,value:m}):p[c]=m;var P=(p,c,m)=>Z(p,typeof c!="symbol"?c+"":c,m);import"../chunks/Bzak7iHL.js";import{o as ee,a as te}from"../chunks/DAau0uzT.js";import{p as re,d as g,e as D,b as ne,h as ie,g as r,s as o,u as v,$ as se}from"../chunks/CGq8RnJq.js";import{h as oe}from"../chunks/De_e6MzK.js";import{a as U}from"../chunks/D35IQVqe.js";import{R as ae}from"../chunks/BpEKQwpr.js";import{r as y,C as ce,R as W,I as z}from"../chunks/BMB5u1EX.js";import{T as le}from"../chunks/D7ozXiSB.js";import{L as ue,F as de,l as pe}from"../chunks/DETSv_kY.js";function Ce(p,c){re(c,!0);const m=[...y(ce.forward),1],Y=[...y(W.luciferin),.88],G=[...y(z.veto),.92],F=[...y(W.recall),.62],H=[...y(z.caution),.9],_=36,h="active",O="all";let a=g(D([])),E=g(D([])),T=g(0),u=g(h),L=g(!0),I=g(null),C=g(null),d=null;ee(()=>{b(h)}),te(()=>{d==null||d.dispose(),d=null});async function b(e=r(u)){o(u,e,!0),o(L,!0),o(I,null),R();try{const[t,n]=await Promise.all([U.intentions(e),U.predict()]);o(a,t.intentions||[],!0),o(E,n.predictions??[],!0),o(T,t.total??r(a).length,!0)}catch(t){o(a,[],!0),o(E,[],!0),o(T,0),o(I,t instanceof Error?t.message:"UNKNOWN INTENTION FETCH ERROR",!0)}finally{o(L,!1),R()}}function V(e,t){const n=new K(e);n.uploadScene(t);const i=new le(e);return d=i,i.init().then(()=>R()),i.setText(w()),[n,i]}class K{constructor(t){P(this,"field");this.field=new ue(t)}uploadScene(t){const n=t.nodes.map(s=>({id:s.source.id,score:s.activation??s.retention,hue:de.forward,energy:s.activation,metric2:s.retention,selected:s.source.id===r(C),kind:"intention",payload:s})),i=n.length<4;this.field.setCells(pe(n,{maxRadius:.82,minCellR:i?.22:.025,maxCellR:i?.3:.075}))}compute(t){this.field.compute(t)}render(t){this.field.render(t)}pickAt(t,n){return this.field.pickAt(t,n)}dispose(){this.field.dispose()}}function R(){d==null||d.setText(w())}function l(e){return e.replace(/[\u2014\u2013]/g,"-").replace(/[\u2018\u2019]/g,"'").replace(/[\u201C\u201D]/g,'"').replace(/\u2026/g,"...").replace(/[^\x20-\x7E]/g,"?")}function N(e){return Math.min(1,Math.max(0,Number.isFinite(e)?e:.5))}function S(e,t){return typeof e=="number"?N(e):t}function k(e){const t=S(e.retention??e.retentionStrength,Number.NaN);if(Number.isFinite(t))return t;const n=typeof e.reminder_count=="number"?e.reminder_count:0,i=Array.isArray(e.related_memories)?e.related_memories.length:0;return N((n+i+1)/6)}function x(e){return S(e.confidence,N((e.priority||2)/4))}function B(e){try{const t=JSON.parse(e.trigger_data||"{}"),n=t.condition??t.topic??t.at??t.in_minutes??t.inMinutes??t.codebase;return l(String(n??e.trigger_type)).replace(/\s+/g," ").slice(0,26)}catch{return l(e.trigger_type).slice(0,26)}}function X(e){const t=l(e.content).replace(/\s+/g," ").trim().slice(0,48),n=l(e.status).slice(0,12),i=B(e);return l(`${t} | ${e.id.slice(0,8)} | p${e.priority} | ${n} | ${i}`)}function $(e,t=F){return{id:"intentions:status",kind:"intention-status",text:l(e),x:-.58,y:.02,size:.044,color:t,depth:.78,weight:.62,revealSpan:32,maxWidthEm:50}}function M(){return{id:"intentions:filter",kind:"intention-filter",text:r(u)===h?"[ SHOWING: ACTIVE - CLICK FOR ALL ]":"[ SHOWING: ALL - CLICK FOR ACTIVE ]",x:-.94,y:.9,size:.024,color:H,depth:1,weight:.7,revealSpan:12,maxWidthEm:40,hitPadX:.03,hitPadY:.03}}function w(){if(r(L))return[$("LOADING INTENTION FIELD...",m)];if(r(I))return[$(`ERROR - ${r(I)}`.slice(0,72),G)];if(r(a).length===0)return[M(),$(`EMPTY ${r(u).toUpperCase()} INTENTION FIELD`,F)];const e=[M()],t=r(a).slice(0,_),n=.72,i=1.5/Math.max(1,_-1);for(let s=0;s<t.length;s++){const f=t[s],q=`intent:${f.id}`,A=r(C)===f.id;e.push({id:q,kind:"intention",intentionId:f.id,text:X(f),x:-.88,y:n-s*i,size:A?.031:.026,color:A?Y:m,depth:A?1:x(f),weight:k(f),startFrame:s*2,revealSpan:20,maxWidthEm:52,hitPadX:.03,hitPadY:.015})}return e}const j=v(()=>({organ:"intentions",nodes:[...r(a).map((e,t)=>({source:{kind:"receipt",id:e.id},index:t,label:l(e.content).slice(0,48),retention:k(e),activation:x(e),trust:x(e),tags:e.tags??[e.status,e.trigger_type].filter(Boolean),type:e.trigger_type})),...r(E).map((e,t)=>({source:{kind:"memory",id:e.id},index:r(a).length+t,label:l(e.content).slice(0,48),retention:N(e.retention),activation:e.predictedNeed==="high"?1:e.predictedNeed==="medium"?.65:.35,trust:N(e.retention),tags:[e.predictedNeed],type:e.nodeType}))],edges:[],events:[],receipts:r(a).map((e,t)=>({source:{kind:"receipt",id:e.id},label:l(e.status),nodeIndices:[t]})),scalars:{total:r(T),visible:r(a).length,predicted:r(E).length,filter:r(u)===O?1:0},alive:r(a).length>0}));function J(e){var n;if(e.kind==="intention-filter"){b(r(u)===h?O:h);return}if(e.kind!=="intention")return;const t=e.payload;o(C,t.intentionId??((n=t.source)==null?void 0:n.id)??null,!0),R()}oe("16y0tkj",e=>{ie(()=>{se.title="Intentions · Vestige"})});{let e=v(()=>`real-intention-field:${r(u)}:${r(T)}:${r(C)??"none"}`),t=v(()=>`EMPTY ${r(u).toUpperCase()} INTENTION FIELD`);ae(p,{organ:"intentions",get seed(){return r(e)},get scene(){return r(j)},passes:V,get loading(){return r(L)},get error(){return r(I)},get emptyLabel(){return r(t)},onpick:J})}ne()}export{Ce as component};