Context
- The operator's goal. On 2026-09-26 @tobiu asked for the 3D graph inside the Fleet Manager, with follow-ups: gravity wells, filter/highlight one peer's items, highlight the Golden Path, and node details on zoom.
- The first slice. neomjs/neo-agent-institution#230 (merged 2026-09-26 as neomjs/neo-agent-institution#234) ships the Observatory pane: a WebGL2 scene on the canvas worker.
- The graduated shape. D#19151 H3-a graduated the engine-native renderer (WebGL2 in the canvas worker; witness at 100k nodes / 1M edges, far 118 · mid 120 · near 116 fps). neomjs/neo-agent-institution#230 names this leaf as the epic's engine half: "the engine
src/canvas primitive + CANVAS_EXPECTATIONS", once the slice proves the shape.
The Problem
The Observatory's renderer (apps/agentos/canvas/Observatory.mjs) holds two kinds of code in one class.
Generic WebGL2 graph-scene machinery:
- the point-and-line program (depth-scaled point size, round points, premultiplied output)
- VAO / index-buffer upload and dispose
- a yaw / pitch / distance orbit camera, with
fit() to the scene's bounding sphere
- drag orbits, wheel zooms
project() and screen-space pick()
- frames on demand only (idle draws nothing)
getStats()
FM specifics: the palette, currency tones, the singleton, and the scene derived from the Golden Path envelope.
Every follow-up the operator listed needs the generic half: H3-e's LOD over the Brain's scene feed, the team lens (colour and highlight by peer), node selection, gravity wells. Kept in the app, each follow-up extends app code the engine cannot test, and the next app that wants a graph copies it.
One engine gap shows in the slice: SharedCanvas forwards no pixel ratio in the size message, so the Observatory assumes dpr: 2 (its own JSDoc says so). Only Sparkline takes a ratio, through its own data.
The Architectural Reality
Neo.canvas.Base already carries the seams.
contextType / contextAttributes (#19168 / PR #19169)
- pointer input:
onMouseDown / onMouseUp / onWheel / onMouseClick, and mouse.dx/dy
updateSize(size) → updateResources
- The build contract.
buildScripts/util/check-consumer-runtime-build.mjs CANVAS_EXPECTATIONS states what a workspace build's canvas worker must reach. Today that is src/canvas/Header.mjs from the package (#19163 / PR #19165) plus an app-space renderer.
- Consumption needs a pin bump. Institution pins
neo.mjs by commit, so the Observatory can extend an engine class only after a pin bump. That is a second, Institution-side leaf.
The Fix
- Add
src/canvas/GraphScene.mjs. It extends Neo.canvas.Base with contextType: 'webgl2' and holds the generic half:
- Scene input: typed arrays —
positions: Float32Array (xyz), colors: Float32Array (rgb), sizes: Float32Array, edges: Uint32Array (pairs), paths: Uint32Array[] (line strips such as a route).
- Behavior: the program, upload / dispose, the orbit camera +
fit, drag / wheel, pick, frames on demand, getStats.
- Style inputs: colors and sizes arrive with the scene, so no palette lives in the engine.
- Export the math as pure functions (
matrix, project, fit, pick), so unit arms cover them without a GL context.
SharedCanvas forwards devicePixelRatio in its size message, and GraphScene reads it. The assumed ratio retires.
CANVAS_EXPECTATIONS gains a row asserting that a workspace build's canvas worker reaches src/canvas/GraphScene.mjs from the package.
- Follow-up (not this ticket): an Institution leaf bumps the pin, and
AgentOS.canvas.Observatory extends Neo.canvas.GraphScene, keeping only palette, currency and scene derivation.
Contract Ledger
| Target surface |
Source of authority |
Proposed behavior |
Fallback |
Docs |
Evidence |
Neo.canvas.GraphScene remote setScene({positions, colors, sizes, edges, paths}) |
this ticket, from the Observatory's shape |
draws the typed-array scene; a call without positions clears the surface |
an unsupported WebGL2 host leaves the renderer idle (Base behavior) |
JSDoc |
AC-1, AC-2 |
Neo.canvas.GraphScene remote pick({x, y}) |
same |
the nearest node index within the pick radius, or -1 |
— |
JSDoc |
AC-2 |
Neo.canvas.GraphScene remote getStats() |
same |
camera, drawing buffer, the scene's counts, what is uploaded to the GPU (null while nothing is), frames, contextLost, restores |
— |
JSDoc |
AC-1, AC-6 |
SharedCanvas size message devicePixelRatio |
this ticket |
carries the host's ratio; renderers size the drawing buffer by it |
absent → 1 |
JSDoc |
AC-3 |
CANVAS_EXPECTATIONS |
the consumer-build contract |
+ a GraphScene.mjs row |
— |
inline |
AC-4 |
Acceptance Criteria
Sunset of the app-local renderer
apps/agentos/canvas/Observatory.mjs carries its own copy of this machinery until the Institution imports the primitive. Its retirement is the AC of the twin Institution ticket, filed with this one: pin bump → AgentOS.canvas.Observatory extends Neo.canvas.GraphScene → the duplicated program / camera / pick code deleted from the app. This engine ticket does not close until that twin is filed, so the retirement has a named owner.
Out of Scope
- The Institution migration: its own leaf, after the pin bump.
- A graph pane in the Workstation, AC-6's first placement. The Workstation is @neo-fable's surface and is under v13.2 stabilization, so a pane waits for her go (asked 2026-09-26,
MESSAGE:73c12ed5). The e2e gains an arm there once the pane lands. WEBGL_lose_context is deterministic, so the restore path needs no app load to be witnessed.
- LOD over the Brain scene feed (H3-e).
- Force layout / gravity wells.
- Labels on the GL surface: they stay in the pane's DOM head, as in the Observatory today.
Decision Record impact
aligned-with D#19151 H3-a (the engine-native renderer). No ADR (neomjs/neo-agent-institution#230's classification: Optional).
Related
- neomjs/neo#10034 (the epic), neomjs/neo#19151 (H3-a/e/g)
- neomjs/neo-agent-institution#230 / neomjs/neo-agent-institution#234 (the slice this extracts from)
- #19168 / PR #19169 and #19173 (the engine seams)
- #19163 / PR #19165 (the canvas worker loads engine renderers from the package)
Verified on dev a9abb6c1dc before filing: SharedCanvas#updateSize sends {height, width, windowId} and no pixel ratio; Neo.canvas.Base carries contextType / contextAttributes, onMouseDown / onMouseUp / onWheel / onMouseClick and mouse.dx/dy; CANVAS_EXPECTATIONS holds the src/canvas/Header.mjs row; only Sparkline reads a ratio, from its own data; the merged Observatory assumes dpr: 2; the Institution pins neo.mjs by commit.
Live latest-open sweep: the latest 20 open issues of this repository at 2026-09-26T10:39:50Z, plus gh search issues --owner neomjs for "GraphScene" and "canvas webgl2 graph renderer primitive" — no equivalent. A2A in-flight sweep (all read states, last 25): Clio's 09:50Z line assigns this leaf to me ("the engine GraphScene leaf is yours"); no competing claim. Memory Core sweep: Clio's 08:10Z session (the Observatory slice) and the D#19151 cycle — no prior decision against an engine primitive. Own-assignment sweep: none covers it. Structure map: N/A (engine src/canvas; the siblings name the placement).
Origin Session ID: 1b945fcf-1142-475f-8007-ac18d51c069a
Retrieval Hint: query_raw_memories("engine GraphScene canvas primitive WebGL2 orbit pick devicePixelRatio Observatory extraction")
Context
src/canvasprimitive +CANVAS_EXPECTATIONS", once the slice proves the shape.The Problem
The Observatory's renderer (
apps/agentos/canvas/Observatory.mjs) holds two kinds of code in one class.Generic WebGL2 graph-scene machinery:
fit()to the scene's bounding sphereproject()and screen-spacepick()getStats()FM specifics: the palette, currency tones, the singleton, and the scene derived from the Golden Path envelope.
Every follow-up the operator listed needs the generic half: H3-e's LOD over the Brain's scene feed, the team lens (colour and highlight by peer), node selection, gravity wells. Kept in the app, each follow-up extends app code the engine cannot test, and the next app that wants a graph copies it.
One engine gap shows in the slice:
SharedCanvasforwards no pixel ratio in the size message, so the Observatory assumesdpr: 2(its own JSDoc says so). OnlySparklinetakes a ratio, through its own data.The Architectural Reality
Neo.canvas.Basealready carries the seams.contextType/contextAttributes(#19168 / PR #19169)onMouseDown/onMouseUp/onWheel/onMouseClick, andmouse.dx/dyupdateSize(size)→updateResourcesbuildScripts/util/check-consumer-runtime-build.mjsCANVAS_EXPECTATIONSstates what a workspace build's canvas worker must reach. Today that issrc/canvas/Header.mjsfrom the package (#19163 / PR #19165) plus an app-space renderer.neo.mjsby commit, so the Observatory can extend an engine class only after a pin bump. That is a second, Institution-side leaf.The Fix
src/canvas/GraphScene.mjs. It extendsNeo.canvas.BasewithcontextType: 'webgl2'and holds the generic half:positions: Float32Array(xyz),colors: Float32Array(rgb),sizes: Float32Array,edges: Uint32Array(pairs),paths: Uint32Array[](line strips such as a route).fit, drag / wheel,pick, frames on demand,getStats.matrix,project,fit,pick), so unit arms cover them without a GL context.SharedCanvasforwardsdevicePixelRatioin its size message, andGraphScenereads it. The assumed ratio retires.CANVAS_EXPECTATIONSgains a row asserting that a workspace build's canvas worker reachessrc/canvas/GraphScene.mjsfrom the package.AgentOS.canvas.ObservatoryextendsNeo.canvas.GraphScene, keeping only palette, currency and scene derivation.Contract Ledger
Neo.canvas.GraphSceneremotesetScene({positions, colors, sizes, edges, paths})positionsclears the surfaceBasebehavior)Neo.canvas.GraphSceneremotepick({x, y})-1Neo.canvas.GraphSceneremotegetStats()nullwhile nothing is), frames,contextLost,restoresSharedCanvassize messagedevicePixelRatio1CANVAS_EXPECTATIONSGraphScene.mjsrowAcceptance Criteria
GraphScenedraws a typed-array scene of points, edges and paths on the canvas worker, drawing frames only on a scene, size, theme or camera change. A canvas e2e readsgetStats(): frames > 0 after a scene; stable across an idle second.matrix/projectround-trip;fitframes a bounding sphere;pickreturns the nearest in-radius index and-1outside.SharedCanvasforwardsdevicePixelRatio, and a unit arm pins that the drawing buffer issize × ratio.CANVAS_EXPECTATIONSrow.src/canvas/GraphScene.mjs.WEBGL_lose_context) restores and redraws the current scene, and a resize re-sizes the drawing buffer without dropping the scene. A canvas e2e covers both on the engine exampleexamples/component/graphScene. The Workstation placement this AC first named is under Out of Scope.Sunset of the app-local renderer
apps/agentos/canvas/Observatory.mjscarries its own copy of this machinery until the Institution imports the primitive. Its retirement is the AC of the twin Institution ticket, filed with this one: pin bump →AgentOS.canvas.Observatory extends Neo.canvas.GraphScene→ the duplicated program / camera / pick code deleted from the app. This engine ticket does not close until that twin is filed, so the retirement has a named owner.Out of Scope
MESSAGE:73c12ed5). The e2e gains an arm there once the pane lands.WEBGL_lose_contextis deterministic, so the restore path needs no app load to be witnessed.Decision Record impact
aligned-with D#19151 H3-a (the engine-native renderer). No ADR (neomjs/neo-agent-institution#230's classification:
Optional).Related
Verified on dev
a9abb6c1dcbefore filing:SharedCanvas#updateSizesends{height, width, windowId}and no pixel ratio;Neo.canvas.BasecarriescontextType/contextAttributes,onMouseDown/onMouseUp/onWheel/onMouseClickandmouse.dx/dy;CANVAS_EXPECTATIONSholds thesrc/canvas/Header.mjsrow; onlySparklinereads a ratio, from its own data; the merged Observatory assumesdpr: 2; the Institution pinsneo.mjsby commit.Live latest-open sweep: the latest 20 open issues of this repository at 2026-09-26T10:39:50Z, plus
gh search issues --owner neomjsfor "GraphScene" and "canvas webgl2 graph renderer primitive" — no equivalent. A2A in-flight sweep (all read states, last 25): Clio's 09:50Z line assigns this leaf to me ("the engine GraphScene leaf is yours"); no competing claim. Memory Core sweep: Clio's 08:10Z session (the Observatory slice) and the D#19151 cycle — no prior decision against an engine primitive. Own-assignment sweep: none covers it. Structure map: N/A (enginesrc/canvas; the siblings name the placement).Origin Session ID: 1b945fcf-1142-475f-8007-ac18d51c069a Retrieval Hint:
query_raw_memories("engine GraphScene canvas primitive WebGL2 orbit pick devicePixelRatio Observatory extraction")