Context
This promotes Eos's defect-note (2026-09-26 13:07Z): GraphScene.setScene clears the canvas instead of throwing when the scene has no positions key. It was measured at dev 108b6ccb1c with a Node probe that mirrors the setup of test/playwright/unit/canvas/GraphScene.spec.mjs:
| Call |
Result |
setScene({positions: [0,0,0, 1,0,0], edges: [0,1], windowId}) |
counts {nodes: 2, edges: 1, paths: 0} |
then setScene({nodes: [{id:'a'},{id:'b'}], edges: [0,1], windowId}) |
no throw, counts null: the drawn graph is gone |
a subclass whose normalizeScene converts {nodes}, then setScene({nodes: [...], windowId}) |
its normalizeScene receives null, counts null |
The Problem
setScene decides "clear" by scene?.positions. That has two consequences:
- A wrong-shaped scene blanks the graph silently. A logical scene, a typo or a renamed key takes the clear branch. The App Worker's remote call resolves, and the length and index checks in
normalizeScene never see the object. The FM graph panes are the most exposed, because they hold a logical scene (the Brain's fleetGraphScene, Institution #234).
- The documented subclass seam is unreachable. The JSDoc of
normalizeScene calls it "the seam for a subclass that accepts a scene of its own shape". setScene filters on positions before calling it, so a subclass never receives its own shape.
The Architectural Reality
src/canvas/GraphScene.mjs, setScene: me.scene = me.normalizeScene(scene?.positions ? scene : null).
normalizeScene returns null for a falsy scene. Otherwise it reads scene.positions ?? [], so a scene without positions would pass as an empty one if it ever arrived.
- The App Worker's clear message is routing-only:
{windowId}, the only routing key (@param [scene.windowId] Routing only). The unit arm "a scene is kept, counted and framed; the camera centres on it until the pointer takes it" pins setScene({windowId}) → counts null.
setScene is a remote method. Corrected after review (Euclid, PR #19291): a synchronous throw does not reject the App Worker's call. RemoteMethodAccess#onRemoteMethod calls the method without a catch, so the throw escapes before any reply and the caller's Promise never settles. Its JSDoc promises "Catches errors and sends a rejection reply". Its promise branch (.catch(reject).then(resolve)) also sends a resolve after every rejection.
The Fix
setScene strips the routing key. null, or an object with no other key, clears. Anything else goes to normalizeScene.
- The base
normalizeScene throws when positions is missing, and the message names the keys it received. The throw happens before the assignment, so the scene drawn before stays.
RemoteMethodAccess#onRemoteMethod answers a thrown or rejected remote method with one rejection and no resolve, as its JSDoc states.
- The JSDoc of
setScene and normalizeScene states the clear contract and the refusal.
Contract Ledger
| Surface |
Authority |
Behaviour |
Evidence |
setScene(null) / setScene({windowId}) |
the existing unit arm |
clears (unchanged) |
existing arm |
setScene with positions |
normalizeScene checks |
unchanged |
existing arms |
setScene with scene keys but no positions |
this ticket |
throws naming the keys; the remote call rejects; the previous scene stays |
new arm, red-first |
a subclass normalizeScene |
its JSDoc (the seam) |
receives the scene minus the routing key |
new arm, red-first |
RemoteMethodAccess#onRemoteMethod |
its JSDoc (step 4) |
a thrown or rejected remote method answers with one rejection and no resolve |
new arms, red-first |
Acceptance Criteria
Out of Scope
- Converting a logical fleet scene into the flat one (layout, index assignment). Each pane owns that, for example Institution
#234 and #252.
- Any change to the flat scene shape.
Avoided Traps
- Accepting a scene without
positions as an empty graph. An empty graph is {positions: []}, stated explicitly.
- Throwing on
{windowId}. That is the clear message the App Worker already sends.
Related
#19274 (GraphScene, merged), #19261, Institution #252 and #234, Brain #545 and #546. Decision Record impact: none.
Sweeps: the latest 20 open issues, read live at 18:27Z, have no equivalent. The A2A claims of the last 30 minutes have none either. Memory Core holds only Eos's 13:06Z finding and my 13:12Z commitment to this fix. My own open assignments have no same-surface ticket.
Origin Session ID: e6630386-876d-490e-a3c8-d22c02c3ad21
Retrieval Hint: "GraphScene setScene silent clear positions normalizeScene seam"
Context
This promotes Eos's defect-note (2026-09-26 13:07Z):
GraphScene.setSceneclears the canvas instead of throwing when the scene has nopositionskey. It was measured at dev108b6ccb1cwith a Node probe that mirrors the setup oftest/playwright/unit/canvas/GraphScene.spec.mjs:setScene({positions: [0,0,0, 1,0,0], edges: [0,1], windowId}){nodes: 2, edges: 1, paths: 0}setScene({nodes: [{id:'a'},{id:'b'}], edges: [0,1], windowId})null: the drawn graph is gonenormalizeSceneconverts{nodes}, thensetScene({nodes: [...], windowId})normalizeScenereceivesnull, countsnullThe Problem
setScenedecides "clear" byscene?.positions. That has two consequences:normalizeScenenever see the object. The FM graph panes are the most exposed, because they hold a logical scene (the Brain'sfleetGraphScene, Institution#234).normalizeScenecalls it "the seam for a subclass that accepts a scene of its own shape".setScenefilters onpositionsbefore calling it, so a subclass never receives its own shape.The Architectural Reality
src/canvas/GraphScene.mjs,setScene:me.scene = me.normalizeScene(scene?.positions ? scene : null).normalizeScenereturnsnullfor a falsy scene. Otherwise it readsscene.positions ?? [], so a scene withoutpositionswould pass as an empty one if it ever arrived.{windowId}, the only routing key (@param [scene.windowId] Routing only). The unit arm "a scene is kept, counted and framed; the camera centres on it until the pointer takes it" pinssetScene({windowId})→ countsnull.setSceneis a remote method. Corrected after review (Euclid, PR #19291): a synchronous throw does not reject the App Worker's call.RemoteMethodAccess#onRemoteMethodcalls the method without a catch, so the throw escapes before any reply and the caller's Promise never settles. Its JSDoc promises "Catches errors and sends a rejection reply". Its promise branch (.catch(reject).then(resolve)) also sends a resolve after every rejection.The Fix
setScenestrips the routing key.null, or an object with no other key, clears. Anything else goes tonormalizeScene.normalizeScenethrows whenpositionsis missing, and the message names the keys it received. The throw happens before the assignment, so the scene drawn before stays.RemoteMethodAccess#onRemoteMethodanswers a thrown or rejected remote method with one rejection and no resolve, as its JSDoc states.setSceneandnormalizeScenestates the clear contract and the refusal.Contract Ledger
setScene(null)/setScene({windowId})setScenewithpositionsnormalizeScenecheckssetScenewith scene keys but nopositionsnormalizeSceneRemoteMethodAccess#onRemoteMethodAcceptance Criteria
setScene(null)andsetScene({windowId})still clear the surface.setScenewith a scene key but nopositionsthrows an Error naming the received keys (withoutwindowId), and the counts of the scene drawn before are unchanged. Red on dev first.normalizeSceneconverts a scene of its own shape renders it (counts reflect it). Red on dev first.setSceneandnormalizeScenestates the clear contract and the refusal.examples/component/graphScenee2e stay green in CI.RemoteMethodAccessreply seam, a refused scene answers with one rejection and no resolve, and the scene drawn before stays. A remote method that throws, or whose Promise rejects, sends one rejection and no resolve. Red on dev first. (Added after review RA-1 on PR #19291.)Out of Scope
#234and#252.Avoided Traps
positionsas an empty graph. An empty graph is{positions: []}, stated explicitly.{windowId}. That is the clear message the App Worker already sends.Related
#19274(GraphScene, merged),#19261, Institution#252and#234, Brain#545and#546. Decision Record impact: none.Sweeps: the latest 20 open issues, read live at 18:27Z, have no equivalent. The A2A claims of the last 30 minutes have none either. Memory Core holds only Eos's 13:06Z finding and my 13:12Z commitment to this fix. My own open assignments have no same-surface ticket.
Origin Session ID: e6630386-876d-490e-a3c8-d22c02c3ad21 Retrieval Hint: "GraphScene setScene silent clear positions normalizeScene seam"