vestige/apps/dashboard/build/_app/immutable/nodes/19.CLd0kemn.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
4.5 KiB
JavaScript

var V=Object.defineProperty;var W=(u,c,p)=>c in u?V(u,c,{enumerable:!0,configurable:!0,writable:!0,value:p}):u[c]=p;var j=(u,c,p)=>W(u,typeof c!="symbol"?c+"":c,p);import"../chunks/Bzak7iHL.js";import{o as U}from"../chunks/DAau0uzT.js";import{p as X,d as P,e as q,b as J,h as Q,g as i,s as f,u as S,$ as Z}from"../chunks/CGq8RnJq.js";import{h as ee}from"../chunks/De_e6MzK.js";import{R as te}from"../chunks/BpEKQwpr.js";import{a as w}from"../chunks/D35IQVqe.js";import{r as k}from"../chunks/BMB5u1EX.js";import{T as re}from"../chunks/D7ozXiSB.js";import{L as ne,a as M,F as v}from"../chunks/DETSv_kY.js";function pe(u,c){X(c,!0);const p=[...k("#22C7DE"),1],N=[...k("#FFB020"),.88];[...k("#FF3B30")];const y=42,b=-1e5;let m=P(q({projects:[],patterns:[]})),R=P(!0),A=P(null),d=P(null),E=[],_=null;U(()=>{L(),w.memories.list({limit:"90"}).then(e=>{E=e.memories.map(t=>{const r=a(t.retentionStrength);return{id:t.id,score:.28+.4*r,hue:v.bridge,energy:.14+.28*r,metric2:r,kind:"pattern-pool",payload:t}}),_==null||_.refresh()}).catch(()=>{})});async function L(){f(R,!0),f(A,null);try{f(m,await w.crossProjectPatterns(),!0)}catch(e){f(m,{projects:[],patterns:[]},!0),f(A,e instanceof Error?e.message:String(e),!0)}finally{f(R,!1)}}const $=S(()=>[...i(d)?i(m).patterns.filter(t=>t.category===i(d)):i(m).patterns].sort((t,r)=>r.transfer_count-t.transfer_count||r.confidence-t.confidence)),I=S(()=>O(i(m).projects,i($)));function O(e,t){const r=Math.max(1,...t.map(n=>g(n.transfer_count)));return{organ:"patterns",nodes:t.slice(0,y).map((n,l)=>{const h=a(g(n.transfer_count)/r),x=a(n.confidence);return{source:{kind:"pattern",id:C(n)},index:l,label:F(n),retention:x,activation:h,trust:x,lastAccessed:n.last_used,tags:[n.category,n.origin_project,...n.transferred_to],type:n.category}}),edges:[],events:t.slice(0,y).map((n,l)=>({source:{kind:"event",id:`patterns.${C(n)}.${n.last_used}`},type:n.category,targetIndex:l,frame:12+l*3,energy:a(n.confidence)})),receipts:[],scalars:{projectCount:e.length,patternCount:t.length,maxTransferCount:r,totalTransfers:t.reduce((n,l)=>n+g(l.transfer_count),0)},alive:t.length>0,patterns:t,projects:e,maxTransferCount:r}}const z={ErrorHandling:0,AsyncConcurrency:1,Testing:2,Architecture:3,Performance:4,Security:5};function B(e){const t=new D(e);_=t;const r=new re(e);return r.init(),[t,{render:o=>r.render(o),pickAt:(o,s)=>r.pickAt(o,s),dispose:()=>r.dispose(),uploadScene:o=>r.setText(Y(o))}]}class D{constructor(t){j(this,"field");j(this,"lastNodes",[]);this.field=new ne(t)}uploadScene(t){this.lastNodes=t.nodes,this.apply()}refresh(){this.apply()}apply(){const t=this.lastNodes;if(t.length===0){this.field.setCells(M(E,(o,s)=>s%6,{ringCount:6,maxRadius:.92,minCellR:.02,maxCellR:.05}));return}const r=t.map(o=>{const s=a(g(o.activation??0));return{id:o.source.id,score:s,hue:s>=.5?v.forward:v.bridge,energy:a(.5+.5*g(o.retention??0)),metric2:a(g(o.trust??0)),kind:"pattern",payload:o}});this.field.setCells(M(r,(o,s)=>H(t[s]),{ringCount:6,maxRadius:.92,minCellR:.055,maxCellR:.15}))}compute(t){this.field.compute(t)}render(t){this.field.render(t)}pickAt(t,r){return this.field.pickAt(t,r)}dispose(){this.field.dispose()}}function H(e){const t=e.type;return z[t]??0}function Y(e){const t=e.patterns.slice(0,y),r=.74,o=1.48/Math.max(1,y-1);return t.map((s,n)=>{const l=a(g(s.transfer_count)/e.maxTransferCount),h=a(s.confidence),x=.06*Math.sin(n*.7),K=a(.6+l*.2+(h-.5)*.4+x);return{id:`pattern:${C(s)}`,kind:"pattern",patternKey:C(s),category:s.category,text:F(s),x:-.88,y:r-n*o,size:.024+h*.005,color:i(d)&&s.category===i(d)?N:p,depth:K,weight:h,startFrame:b+n*2,revealSpan:20,maxWidthEm:58,hitPadX:.03,hitPadY:.013}})}function G(e){if(e.kind!=="pattern")return;const t=e.payload;f(d,i(d)===t.category?null:t.category??null,!0)}function F(e){return T([e.name,e.origin_project,e.transferred_to.join(","),e.category,String(e.transfer_count),String(Math.round(a(e.confidence)*100)),e.last_used].join(" | ")).slice(0,118)}function C(e){return T([e.name,e.origin_project,e.category,e.last_used].join(":")).slice(0,180)}function T(e){return e.replace(/[\u2014\u2013]/g,"-").replace(/[\u2018\u2019]/g,"'").replace(/[\u201C\u201D]/g,'"').replace(/\u2026/g,"...").replace(/[^\x20-\x7E]/g,"?")}function g(e){return Number.isFinite(e)?e:0}function a(e){return Math.min(1,Math.max(0,Number.isFinite(e)?e:0))}ee("1gg45vd",e=>{Q(()=>{Z.title="Patterns · Vestige"})});{let e=S(()=>`cross-project-patterns:${i(m).projects.length}:${i($).length}:${i(d)??"all"}`);te(u,{organ:"patterns",get seed(){return i(e)},get scene(){return i(I)},passes:B,get loading(){return i(R)},get error(){return i(A)},onpick:G})}J()}export{pe as component};