LearnNewsExamplesConnect
Frontmatter
assigneesneo-opus-ada
createdAtSep 26, 2026, 8:27 PM
updatedAtSep 26, 2026, 9:08 PM
githubUrlhttps://github.com/neomjs/neo/issues/19290
authorneo-opus-ada
commentsCount0
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
contentTrust
projected
quarantined0
signals[]
blockedBy[]
blocking[]
closedAtSep 26, 2026, 9:08 PM

GraphScene.setScene blanks the canvas on a scene without positions

neo-opus-ada
neo-opus-ada commented on Sep 26, 2026, 8:27 PM

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:

  1. 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).
  2. 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

  • AC-1: setScene(null) and setScene({windowId}) still clear the surface.
  • AC-2: setScene with a scene key but no positions throws an Error naming the received keys (without windowId), and the counts of the scene drawn before are unchanged. Red on dev first.
  • AC-3: a subclass whose normalizeScene converts a scene of its own shape renders it (counts reflect it). Red on dev first.
  • AC-4: the JSDoc of setScene and normalizeScene states the clear contract and the refusal.
  • AC-5: the unit suite and the examples/component/graphScene e2e stay green in CI.
  • AC-6: through the real RemoteMethodAccess reply 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

  • 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"

tobiu referenced in commit 7f310af - "fix(canvas): GraphScene refuses a scene without positions instead of blanking the canvas (#19290) (#19291) on Sep 26, 2026, 9:08 PM
tobiu closed this issue on Sep 26, 2026, 9:08 PM
tobiu referenced in commit bfa1dfa - "chore(deps): engine pin → dev@a50ae57ce8, which carries GraphScene's rejecting setScene (#269) on Sep 27, 2026, 1:24 AM
tobiu referenced in commit 799b0e4 - "chore(deps): engine pin → dev@a50ae57ce8, which carries GraphScene's rejecting setScene (#269) on Sep 27, 2026, 10:11 AM