test(graph): ruthless coverage for v2.0.8 memory-state colour mode

80 new vitest cases exhaustively exercising the v2.0.8 colour-mode
additions, taking total dashboard coverage to 251 tests.

Pure-function correctness:
- getMemoryState: 12 retention boundaries including exact thresholds,
  NaN, ±Infinity, negative, and >1 values + determinism across 10k
  random samples.
- getNodeColor: per-node-type mapping in type mode (all 8 types),
  per-bucket mapping in state mode, unknown-type fallback, and the
  invariants that type mode ignores retention + state mode ignores type.
- MEMORY_STATE_COLORS: valid 6-digit hex, all four buckets distinct,
  zero overlap with NODE_TYPE_COLORS.
- MEMORY_STATE_DESCRIPTIONS: threshold parentheticals match getMemoryState
  bucket boundaries (70 / 40 / 10), all four lines distinct.

NodeManager state machine:
- default mode 'type', field writable pre-createNodes.
- setColorMode is idempotent (early return verified via copy() spy counts).
- setColorMode calls color.copy + emissive.copy + glow.color.copy exactly
  once per node per transition, never replaces mesh / glow / material
  references, preserves userData.{nodeId,type,retention}.
- rapid 5× type <-> state toggle preserves all three maps.
- addNode during state mode inherits the mode; subsequent switch to
  type correctly retints the live-added node.
- suppressed-node interaction: setColorMode updates color + emissive but
  never touches opacity or emissiveIntensity (v2.0.5 SIF channel stays
  isolated from v2.0.8 colour channel).
- defensive paths: missing glow, missing userData.retention, missing
  userData.type — all degrade to sane defaults without throwing.

Also refreshes the embedded dashboard build so the Rust binary picks up
the new SvelteKit chunks with the memory-state-colors feature baked in.
This commit is contained in:
Sam Valladares 2026-04-19 21:12:06 -05:00
parent 318d4db147
commit d7f0fe03e0
56 changed files with 682 additions and 18 deletions

View file

@ -11,13 +11,13 @@
<link rel="icon" type="image/svg+xml" href="/dashboard/favicon.svg" />
<link rel="apple-touch-icon" href="/dashboard/favicon.svg" />
<link rel="manifest" href="/dashboard/manifest.json" />
<link href="/dashboard/_app/immutable/entry/start.DuH_5L6-.js" rel="modulepreload">
<link href="/dashboard/_app/immutable/chunks/00s_zK56.js" rel="modulepreload">
<link href="/dashboard/_app/immutable/entry/start.BieeVrE-.js" rel="modulepreload">
<link href="/dashboard/_app/immutable/chunks/BOu53idK.js" rel="modulepreload">
<link href="/dashboard/_app/immutable/chunks/VE8Jor13.js" rel="modulepreload">
<link href="/dashboard/_app/immutable/chunks/CCRrbKqn.js" rel="modulepreload">
<link href="/dashboard/_app/immutable/chunks/FMdNDkar.js" rel="modulepreload">
<link href="/dashboard/_app/immutable/chunks/UvrLlSZu.js" rel="modulepreload">
<link href="/dashboard/_app/immutable/chunks/DWVWfZUn.js" rel="modulepreload">
<link href="/dashboard/_app/immutable/entry/app.B2ShtSI_.js" rel="modulepreload">
<link href="/dashboard/_app/immutable/entry/app.hiopGwi-.js" rel="modulepreload">
<link href="/dashboard/_app/immutable/chunks/DHnEMX8z.js" rel="modulepreload">
<link href="/dashboard/_app/immutable/chunks/7UNxJI5L.js" rel="modulepreload">
<link href="/dashboard/_app/immutable/chunks/Bzak7iHL.js" rel="modulepreload">
@ -33,7 +33,7 @@
<div style="display: contents">
<script>
{
__sveltekit_1m3s8yh = {
__sveltekit_9mpvth = {
base: "/dashboard",
assets: "/dashboard"
};
@ -41,8 +41,8 @@
const element = document.currentScript.parentElement;
Promise.all([
import("/dashboard/_app/immutable/entry/start.DuH_5L6-.js"),
import("/dashboard/_app/immutable/entry/app.B2ShtSI_.js")
import("/dashboard/_app/immutable/entry/start.BieeVrE-.js"),
import("/dashboard/_app/immutable/entry/app.hiopGwi-.js")
]).then(([kit, app]) => {
kit.start(app, element);
});