Skip to content

fix(ni): the board paints designed cards handed over from reactive state - #517

Merged
SecureCloudGroup merged 1 commit into
mainfrom
round20/board-paints-state
Oct 14, 2026
Merged

SecureCloudGroup merged 1 commit into
mainfrom
round20/board-paints-state

Conversation

@SecureCloudGroup

Copy link
Copy Markdown
Owner

Release blocker found while recording the Neural Interface clip. In a real browser the /ni board never rendered once it held any designed (form/CLIR) card: applyLive cloned the CLIR with structuredClone, but on the board the CLIR comes out of a deep $state, so its nested arrays are Svelte proxies and the clone throws DataCloneError: [object Object] could not be cloned. Every designed card, and the C2 VerifyPanel, sat on the spinner. No release carried it (the painter landed after v0.25.0); every unit test and the painter harness fed plain objects, so nothing caught it.

Fix: a JSON round trip instead of structuredClone (a CLIR is JSON by contract, validateClir). Tests: clir.test.ts feeds applyLive a deep Proxy (asserting structuredClone throws on it, the hazard pinned) and checks plain output; a new mounted IrPaint.test.ts paints a stat card and a live tide curve handed over as nested proxies. Both fail on the old code with the DataCloneError and pass now. Gates: svelte-check 530 files 0 / 0, vitest 48 files / 648 tests, bundle rebuilt. Merge before tagging v0.26.0.

On the board a card's CLIR lives inside a deep $state, so its nested arrays reach the painter as
Svelte proxies; applyLive cloned them with structuredClone, which throws DataCloneError on any
Proxy, and every designed card left the board (and the C2 panel) on its spinner. Found recording
the Neural Interface clip; no release carried it (the painter landed after v0.25.0). A JSON round
trip replaces the clone (a CLIR is JSON by contract). Regression tests pin it on both layers: the
unit test feeds applyLive a deep Proxy (and shows structuredClone throws on it), and a mounted
IrPaint paints a stat card and a live tide curve handed over as nested proxies.
@SecureCloudGroup
SecureCloudGroup merged commit 0ed8f3b into main Oct 14, 2026
13 checks passed
@SecureCloudGroup
SecureCloudGroup deleted the round20/board-paints-state branch October 14, 2026 14:07
SecureCloudGroup added a commit that referenced this pull request Oct 14, 2026
The effect that reloads the board when the vault flips to unlocked called load() under
tracking; load()'s synchronous prefix reads `items` (a $state) and then reassigns it after
the fetch, so every reload re-ran the effect and the page issued GET /api/ni/board back to
back, forever (dozens per 0.1 s on a board with three live cards). The call now runs under
`untrack`, so the effect depends on the unlocked flag only. Found recording the Neural
Interface clip; the first-card crash fixed in #517 had hidden it.
SecureCloudGroup added a commit that referenced this pull request Oct 14, 2026
…screenshot (#520)

* docs(media): quickstart clip 12 — the Neural Interface — and the board screenshot

Recorded with tools/gifgen against main after #517/#518/#519, deterministically: the released
Library pack v1.5.0 mounted read-only into the demo container, canned model turns for the intent,
query, design pick and fit check of three asks, and recorded source responses served by the
recorder-only shim (gated on SB_GIFDEMO=1 + SB_GIFDEMO_NI; every other fetch refused). The clip:
ask in plain words, tap the Library source it found, check the designed card, live on the board;
a second ask; an honest stop with a dataset link. Board screenshot 04-neural-board.png (three live
cards). README row 12; docs/03 embeds; gifgen README and run.sh (`./run.sh 12` does take, encode,
poster, sheet and the docshot). Help bundle rebuilt.

* gifgen: parse the design-pick skeleton with string slicing, not backtracking regexes (CodeQL py/polynomial-redos)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant