Internal design rationale and implementation plans for the @invana/canvas
monorepo. Not part of the published VitePress site (apps/docs/) — these are
working design-of-record documents. Day-to-day API/concept docs live in
apps/docs/; the product "why" + direction lives in ../roadmap.md.
New plans/design notes go here (
docs/), not at the repo root.
- rfcs/ — every feature request and bug fix gets a document first, then
the code (root
CLAUDE.mdrule 15).rfcs/feat/for a new capability,rfcs/fix/for something already shipped that behaves wrong; file nameYYYY-MM-DD-<slug>.md, slug naming the problem so it stays findable when the solution changes. rfcs/README.md has the section list and the two standing rules for the fix table (name the downstream consumers; separate the defect from the dressing). The long-form*-plan.mddocs below predate the folder and stay put — they're the design of record an RFC links to rather than re-litigates.- feat/2026-11-17-marker-icons-and-zoom-labels-are-not-config.md
— 🚧 T1–T4, T2b, E1, S1 implemented 2026-11-17 (V1–V9 pass; V10 partly run). A marker's icon, heading and zoom-tier label are expressible only as code or
per-node records. Fix:
NodeStylingTemplate.icon; named icons from a serialisableGraphLayerOptions.iconSet(SVG markup by name, offline) resolved innodeSpec; per-typeNodeTypeBinding.states[name].labeltemplates; icon rotation bound to a record field (data.course). Whole-shape rotation and a hot-path heading update deferred to P5. Phase P2 ofgeo-intelligence-plan.md. - fix/2026-11-17-bubble-sets-draw-nothing-at-map-scale.md
— 🚧 F1–F4 implemented 2026-11-17 (V1–V5 pass); F5 (
setOptions— the editor was inert) proposed.BubbleSetsLayerpaints nothing on a map (bubblesets-jsgrids in whole units; a cluster is <1 world unit there) and sizes pixel-constant members by their authored spec. Fix: compute in a normalised space (identity at defaults), measure members by drawn bounds, recompute on zoom settle when members are pixel-constant. Phase P1 ofgeo-intelligence-plan.md. - fix/2026-08-05-group-frame-occludes-edges.md
— 🚧 implemented 2026-08-05 (F1·F2·F3·F5
landed; F4·F6implemented, pending V4). A group frame is a shape, so it paints inshapeLayer, which sits above every connector;behindChildren'szIndex - 1only orders it among sibling shapes, so the edges between a frame's own members are painted over. Scopes the landing of theplaneaxis fromrender-planes-and-emphasis-plan.md(design locked there, not here) + the blast radius across everystyle.groupgraph. - feat/2026-08-12-star-exports-hide-surface-drift.md
— ✅ landed 2026-08-12 (mutation-tested: a canary export trips all three packages). Keep the one specs
export *per barrel; make the surface reviewable instead: acheck-api-surface.mjssnapshot check (thecheck-boundariespattern — diff the built.d.tsexport list against a checked-inapi/<pkg>.surface.txt, faillinton drift), de-dup the names reaching barrels by two routes (Point/Rectexplicit and starred — explicit silently wins), and a standing rule: at most oneexport *per barrel, only for the specs vocabulary. Explicitly rejects expanding the star into ~150 named exports ×3 barrels (three hand-kept copies = guaranteed drift). - feat/2026-08-12-canvas-core-folder-sprawl.md
— ✅ landed 2026-08-12. Two same-day landings left
canvas-core/srcwith 13 top-level folders + 4 loose root files; regrouped into 6 concern folders (specs/incl.geom.ts·state/(CanvasStore/frame/port/view/data/events/theme) ·contracts/·abstracts/(+ Camera + registries) ·lib/(geometry/svg/animation) ·headless/). Internal-only — both tsup entries and every external import site unchanged; verified 258 tests. - feat/2026-08-12-canvas-core-depends-on-the-kernel.md
— ✅ landed 2026-08-12 (all rows; verified: build 20/20 · types 19/19 ·
boundaries incl. the new
core-purityrow · 258 tests · live Storybook smoke — §8 records the background-tab rAF trap the smoke uncovered). Invert the bottom of the stack:canvas-corebecomes truly dependency-free (the floor — vocabulary, contracts, abstracts, pure utils) andcanvas-storedepends on it, keeping only the state machinery (the repo's three third-party libs touch exactly 7 kernel files: immer ×5, zustand ×1, rbush ×1 — measured). Moves the spec vocabulary + shapeGeometry + SpecStore, the event bus/emitters, theme, and the dep-free data primitives (ColumnStore/LayerData/ DirtyBatcher) down into core. Three hard problems carried as design rows: H1Layer.statecan no longer be built in the constructor (the memory store is immer-backed at runtime — injection via actx.createStateStorefactory), H2CanvasContext/Cameraneed a structuralICanvasStore, H3 core redeclares immer'sPatchstructurally so even the type level is dep-free. - feat/2026-08-12-engine-package-structure.md
— ✅ landed 2026-08-12 (all 33 change rows; verified: build 20/20 · types 19/19 ·
boundaries · 256 tests · live Storybook smoke incl. GraphVisualiser).
The combined file-tree restructure of all three engine packages
(canvas · canvas-store · renderer-pixijs), superseding the two per-package structure
RFCs below. Side-by-side now/target trees, move tables and blast radius for:
canvas16 top-level folders → 5 with a widenedcore/charter — not just the renderer contracts but theLayer/Behaviour/Layoutabstracts (+ICanvasContext, gesture types) move intocore/so extension packages and future backends (pixi now, three.js later) depend on a small frozen@invana/canvas-core, and@invana/canvasbecomes the pure orchestrator;canvas-store16 folders → 11 (zero one-file folders —geom.ts/frame.tsflatten to root,adapters/zustand.ts);renderer-pixijs14 folders + 10 loose root files → 3 groups + 3 files (renderer/·primitives/·assets/), doubling as therenderer-threejslayout template. Deletes the./specssubpath (19 importer files repoint to the root). §2.1 records a trial implementation of the canvas-core extraction + canvas restructure that passed every check end-to-end (build 20/20 · types 19/19 · boundaries · 88 tests) and was then discarded to stay in planning — so the canvas half is measured fact:CanvasContextis already an interface,Cameraand the registries move whole,SpecProjectoris contract-side, and canvas lands at 4 folders + index. - feat/2026-08-11-canvas-src-layout-hides-the-backend-seam.md
— ❌ superseded by
2026-08-12-engine-package-structure.md(rule 2 reversed: abstracts move intocore/abstracts/). Thepackages/canvas/srcfile + folder structure, before and after: 16 top-level folders / 76 files → 6 / 82, restructured around the future@invana/canvas-coreboundary. The backend-facing half (core/— contracts, connector geometry, badges, animation, SVG serialisers, the headless reference implementation) becomes one contiguous subtree that lifts out as a package by moving a folder;export/becomesio/since it holdsimportCanvasStatetoo; the./specssubpath is deleted — an 18-line re-export of a re-export, and the npm numbers (120 downloads/month on a two-month-old package, with0.0.xranges pinning exactly) say no one is on the other end of the compatibility promise. Full tree, per-folder move table, new-file list, and the 6 rules that produced it. - feat/2026-08-11-canvas-store-structure.md
— ❌ superseded by
2026-08-12-engine-package-structure.md(successor also flattens the three one-file folders this one kept). Thepackages/canvas-store/srcstructure, 16 folders / 51 files → 14 / 51. A deliberately light touch — every kernel folder already names a real concern.actions/+history/fold intoview/(both are operations on the view store);renderer/IRenderer.tsis renamedbackend.tsbecause the filename lies — it declares onlyRendererBackend, and 33 of its 34 lines are a comment explaining thatIRendererdeliberately lives elsewhere. Also resolves a genuine duplicate:theme/exists in both canvas-store and canvas with the same three types, so the kernel's becomes canonical — noting the one behavioural difference (the canvas copy emitstheme:changewithout a source descriptor). - feat/2026-08-11-canvas-core-structure.md
— ✅ landed (in
mainsince v0.0.12,5e6757b5; the folder layout below was since reshaped bycanvas-core-folder-sprawl/canvas-core-depends-on-the-kernel). The new@invana/canvas-corepackage: 47 files / 5 folders (contracts/·geometry/·svg/·animation/·headless/), lifted wholesale from@invana/canvas'ssrc/core/subtree — nothing written fresh at extraction time. So a rendering backend depends on a small frozen package rather than the whole engine. Carries the file-origin map, thepackage.json, the four-package layering, the three prerequisites, and a checkable acceptance test:grep "@invana/canvas'" packages/renderer-pixijs/src→ 0 hits. - fix/2026-09-10-renderer-preference-canvas-never-reaches-the-backend.md
— ✅ landed 2026-09-10 (D1 deferred, D2 accepted).
preference: 'canvas'is silently rewritten to'webgl'one line before it crosses the renderer seam (Canvas.ts#L337), so pixi's canvas backend is unreachable through the engine — including viabestRenderPreference(), which the TSDoc recommends and which returns'canvas'on a device with neither WebGPU nor WebGL. Root cause is three independent declarations of one option ('…|canvas'in the engine,'…|auto'in the kernel contract,'…|canvas'in the backend); the rewrite was a type-fit, not a decision, and'auto'has no producer anywhere. 4 rows, 2 open decisions (adopt pixi 8.18's array-valuedpreference; drop'auto'). - fix/2026-09-10-label-measurement-allocates-a-textstyle-per-call.md
— 🚧 implemented, in
mainsince5e6757b5(F1·F2implemented; V1 · V4 pending).measureLabelContentbuilds aTextStyleper call, once per fit-to-label node per re-project, against 1–3 distinct styles. A cost defect with no visible symptom: pixi's metrics cache is value-keyed, so the measuring is already free on repeat and only the allocation is wasted. Records why the obvious fix — one shared mutableTextStyle— is wrong (cachedCanvasTextMetricsretain the style by reference, so mutation would corrupt entries backing realTextobjects). D2 was decided (a) — land it — without taking the measurement. - feat/2026-09-27-no-floating-controls-inside-the-canvas.md
— ✅ landed. Control panels: floating
controls over the canvas stored as JSON in
definition.controlPanels, so they save, export and undo with the canvas. Items name a command, icon, widget or slot; the engine'sCommandRegistryruns commands. canvas-react's headless<ControlPanel>declares panels and canvas-ui's<ControlPanels>draws them. F12 (a Studio editor for panels) is the open follow-up. - feat/2026-09-27-two-ways-to-float-a-toolbar.md
— ✅ landed. Toolbars are content; ControlPanel is how
controls float. Eleven toolbars lose
position/bareand render only their controls. Anything over the canvas goes through<ControlPanel>. - feat/2026-09-28-graph-toolbar-actions-cannot-be-saved.md
— ✅ landed. Graph toolbar actions become
commands: undo / redo, clipboard, select mode, edge type, grid and layout picking.
Adds the
choiceitem kind, override-stacking registrations andinvalidate(), plus one canvas-ui preset per toolbar. X2 (toolbars as thin wrappers over presets) waits on header slots that accept specs. - feat/2026-09-28-control-panels-cannot-pan-or-model.md
— ✅ landed. Presets per mode:
camera.pan/zoomTo/resetandbehaviour.togglecommands;tool.*commands from<GraphToolProvider>;theme.togglefrom<CanvasThemeSync>; the PAN, ZOOM_LEVEL, INPUT, NAVIGATION, CANVAS, EXPLORER, MODELLER and THEME presets, and apan-padwidget. Stories:canvas-react/ControlPanel/{Canvas,GraphCanvas}/*. - feat/2026-09-28-control-panels-cannot-be-edited-in-the-studio.md
— ✅ landed (E9 deferred — story only if asked). A Studio editor for control panels (F12): an aggregate editor in
canvas-ui/editor-panels/control-panels/, with panel fields and an item list whose pickers read the live command / icon / widget registries. Applies throughcanvas.update({ controlPanels }); also the last section ofCanvasSettingsEditorPanel. - feat/2026-09-28-toolbars-and-control-panels-draw-controls-twice.md
— ✅ landed. Toolbars become presets + props (X2): one exported
<ControlItems>renderer; the gaps closed (layout.toggle,history.redraw, icon classes, section keys; factory layouts ended up as private commands the toolbar registers while mounted). Finding: header slots already take ReactNodes, so the recorded blocker didn't block. Toolbar headers render byte-identical to before. - feat/2026-09-28-the-modeller-tool-lives-outside-the-canvas.md
— ✅ landed (S1 deferred — story only if asked). The modeller tool moves to
interaction.viewMode(+viewModeArgs); behaviours gain amodesoption and gate themselves;tool.*commands move to graph and the React bridge goes. - feat/2026-09-28-canvas-definition-edits-cannot-be-undone.md
— ✅ landed 2026-09-28. A view history for Studio edits: records only
edit:*-namedcanvas.updates todefinition(a baseline write makes undo restore real pre-edit values), merges live-edit bursts, reconciles live instances on undo / redo, and one Undo button arbitrates between the view and graph stacks. - feat/2026-09-28-control-panel-command-args-are-raw-json.md
— ✅ landed 2026-09-28. Commands describe their args (
CanvasCommand.args, plain data in core) so the control-panel editor draws fields — reference kinds pick live layers / behaviours / layouts; undeclared keys keep a JSON fallback. - feat/2026-09-28-app-header-controls-do-not-save-with-the-canvas.md
— ✅ landed 2026-09-28.
placement: 'header-*'onControlPanelSpecsoGraphCanvasAppheader controls save with the canvas; adds alayer.visibletoggle command. - feat/2026-09-28-hooks-and-commands-duplicate-the-same-logic.md
— ✅ landed 2026-09-28 (G1 deferred to the next breaking release). Hooks and commands call one set of
functions in
@invana/graph(select mode, clipboard, two-stack undo);GraphControlsToolbar's private layout commands go; the section hooks are deprecated; the logic → hooks → commands rule is incanvas-react/CLAUDE.md. - feat/2026-09-29-command-controls-go-stale-or-fail-silently.md
— 🚧 implemented on
feat/commands-followups-2. Command controls stay live and say when they can't work: owner-sidecommands.invalidate()bridges replace write-site calls; an unregistered command reads "(unavailable)"- a dev warning; dev-build arg validation;
scene:behaviour:unregister;useHistoryis two-stack;useLock/useEdgeTypeshare engine functions with their commands; 11 behaviours keepgetOptions()current.
- a dev warning; dev-build arg validation;
- feat/2026-09-29-commands-stop-at-saved-control-panels.md
— 🚧 accepted; phases A–E implemented on
feat/commands-phases-a-b-c(unmerged; F, G deferred). The remaining command work, in seven phases: A defects (O3 behaviour events, O4 re-attach, V5) → B widget / choice option fields + footer panels → CGraphCanvasowns history + clipboard → D typed commands (generic map) → E shortcuts, command menus, palette → F stories (only when asked) → G breaking removals. - feat/2026-09-28-an-analysis-cannot-be-recorded-or-replayed.md
— 🚧 accepted 2026-09-28 (F1–F17; F18–F23 deferred; lands as three PRs, see D-15). Playbooks: a JSON script, and history as the record.
canvas.playbookis a list of JSON steps (addSteponly appends;next/previous/goToplay them through the ordinary canvas methods).canvas.historybecomes one operation log (the two stacks merge, no limit) with a free-textactoron every entry.GraphStore.applyDeltais the one recorded data door; derived behaviour writes go unrecorded. PlusFocusBehaviour, store-driven selection and inspect, relayout on hide/show, and feed-friendly layout. No filter in the canvas.
- feat/2026-11-17-marker-icons-and-zoom-labels-are-not-config.md
— 🚧 T1–T4, T2b, E1, S1 implemented 2026-11-17 (V1–V9 pass; V10 partly run). A marker's icon, heading and zoom-tier label are expressible only as code or
per-node records. Fix:
- rfcs/feat/2026-10-08-a-release-can-ship-local-package-links.md — ✅ a release ships npm versions only.
pnpm check-release-depsfails on anyfile:/link:/ git / URL dependency in the overrides, manifests or lockfile.release.shruns it before bumping and the release workflow'sresolvejob runs it before anything publishes. Not inpnpm lint, so developing against a local design kit still lints. - release-0.0.12-checklist.md — 🚧 is v0.0.12 shippable? The tree is mechanically green (build 20/20 · types 19/19 · lint 0 errors · 369 tests · boundaries · API surface · Node ESM smoke on the built
dist/), so every open item is a release item, not a code one. Five blockers: three package names publish for the first time (canvas-core,renderer-pixijs,canvas-telemetry-otelare 404 on npm, and@invana/canvas@0.0.12hard-depends on two of them —pnpm -r publishis not atomic, so a token that cannot create names lands an unusable version); the branch is notmain; 13 breaking commits since v0.0.11 with no breaking-change group incliff.toml;apps/docsstill documents a@invana/canvas/primitivessubpath that no longer exists and tells users to installpixi.js; and README/CLAUDE.md still callrenderer-pixijsan optional lazily-resolved peer when it is a static hard dependency. Plus eleven should-fix rows (the deadpreference: 'canvas'option, untested packages, the open security S1/S2;canvas-telemetry-otel's missing docs and the publish-metadata gap are now fixed), a pre-tag verification table, and the ordered release sequence.
- architecture-proposal.md — target Layer / Behaviour /
Layout / Renderer architecture for the rewrite. Long-form rationale; partially
implemented. Referenced by
§-number from source TSDoc acrosspackages/canvas. - canvas-engine-types.md — the
@invana/canvasengine type reference (as-built): the full public type surface grouped by subsystem — primitives (geometry · shapes · fills · stroke · labels · connectors/anchors/routers/pathStyles/markers · decorations · effects), engine (Canvas/config · Camera · Context · Events incl. the fullCanvasGlobalEvents+ renderer event maps · Renderer · Theme), and abstractions (Layer/Behaviour/Layout bases + built-ins · Store/DirtyBatcher/ColumnStore · registries). The renderer layer the graph types compile down to; companion to the state inventory. Notes the source≠docs naming caveats (PrimitivesRenderer,BaseShapeSpec, …).
- canvas-templates-plan.md — canvas templates & theming (runtime implemented).
- element-detail-value-rendering-plan.md — detail views + extensible property rendering.
- data-types-instances.md — input vs stored instances (NodeData/NodeOption split, G6-aligned).
- data-types-implementation-plan.md — phasing for the data-model migration.
- node-record-types-rfc.md — two record types, not five (📋 proposed; half already true). Inventories what
GraphNode/NodeOption/NodeData/NodeInput/GraphDataOptionseach claimed to do and which had users —NodeData's own TSDoc called itself "the recordGraphStoreholds" while the store demonstrably holdsGraphNode, and it had zero runtime users; 112 story files had imported it anyway because it was exported and structurally compatible. Names the distinction the old design conflated: two resolver moments — layer-template resolvers (NodeOption.style, fire every render against the stored node, ✅ built, this is howColorByBehaviourworks) versus per-record input resolvers (fire once at insert against raw data, ❌ never implemented). Target is one resolver type + one stored type, which deleting the dead three already achieved. Remaining work is the leak:GraphNode.styleisunknownwhereNodeData.stylewasNodeStyle, so the type is strictly weaker on its most-read field and three stories now carry casts — and the stated reason (a store→layer cycle) doesn't hold, since type-only imports are erased. Recommends extractingNodeStyleto its own module. 5 work items, the largest being a doc sweep:packages/graph/CLAUDE.mdstill documents the deleted split as current. - required-type-on-records-rfc.md —
typebecomes required onGraphNode/GraphEdge(🚧 core landed, migration pending). One type,type: string, every author writes it — the separate-input-type alternative was built, measured and reverted: it migrates for nearly free but means two types to keep straight for one field. Correcting the draft's own scare number: the headline "24,683 records" is the record count, not the edit count —h1b2019,flare,life-treeandlatticehave zero literal node lines (all loop-generated), so they're ~2 edits each. Real shape: a dozen dataset generators at one line each, plus 2,546 literal fixture sites across 232 storybook files (median 7/file).UNKNOWN_TYPEships as a named export and the store still normalises with||not??on both insert and update paths — now as a runtime net forimportData, parsed JSON andPartialpatches, all of which bypass the compiler. §9 is the migration plan: revert → datasets get real types (flare/h1b2019/life-treealready carryisLeaf/depth, so a one-line ternary gives them a genuine partition where they had none) → ts-morph codemod driven byTS2741diagnostics rather than regex → reader cleanup. Also: what'unknown'-as-a-value changes (§4), the dead-type-cluster deletion (§6, done), and all six serialization paths traced (§7) — old snapshots need no migration, new ones omittypewhen it equals the sentinel. - node-edge-options-plan.md — superseded (data-model layer) by
data-types-instances.md; render-shape decisions still hold. - graph-datasets-folder-exports-plan.md — one folder, one module for
@invana/graph-datasets: finishb3c0cb3by makingdata: GraphData+settings: CanvasConfigthe only exports of each of the 24 dataset folders, one package subpath per dataset (@invana/graph-datasets/les-miserables), legacy per-dataset aliases + theiras unknown as GraphDatalaundering casts deleted, non-graph payloads (hierarchies · topojson · sankey source · meta · traces) split into their own files. Uncovers two shipping datasets whosedata.edgesisundefined. 24-row manifest + 63-file consumer migration. - node-styling-unification-plan.md — one tiny semantic node-styling API (
primaryColor/label/showLabel/size/icon/shape) that styles both simple shapes and composite/template nodes, hiding the flatNodeStyle. Composite = a shape kind extendingCompositeShape(registered like any shape; explicit w/h, no scalar size); templates takeprimaryColor; content-LOD (semantic zoom) deferred into the template. Phased impl + deferred declarative-template form.
- store-owns-state-plan.md — make
GraphStorethe single owner of interaction state. - store-owns-state-pseudocode.md — companion pseudocode for the above.
- unified-canvas-options-plan.md — one declarative, id-addressed
GraphCanvasoptions object. - canvas-state-plan.md — the consolidated review doc for
@invana/canvas-store: concepts + data model (CanvasStore { view, data }), architecture + code/file structure, performance (the "state → targeted render" wiring), telemetry, collaboration, and the migration from the existing engine + its impact/blast radius. Sequences the four state docs below at the package level. - canvas-store-data-event-flow.md — the data hierarchy + flow companion: the full
CanvasStore { view, data, events }tree, the data write→trigger→flush→render path (incl. theFlushModetrigger), the bus event families +state:change/data:flushbridges, and thedataLayerIdpointer +ctx.selffacade. Tags ✅ built vs 🔧 proposed. - canvas-store-d13-data-ownership.md — the D13 decision doc (Phase 3 gate): reconciling graph's mature
GraphStorewith the kernel'sLayerData— recommends interface, not inheritance (kernelDataSourceinterface + registration;GraphStoreimplements it; no merge), with the event-model crux (granular vs delta) resolved via an additiveonChangeprojection onGraphStore. Sub-steps 3.1a–3.3. - canvas-store-migration-plan.md — the execution plan: the phased, checklist-driven path from today's as-built kernel (Phase 0 done) to a fully-wired
canvas-storedriving the engine — kernel fast lane (Phase 1) → engine-under-the-store M0 (Phase 2) → data ownership D7 (Phase 3) → React reads, interaction/camera fold, drop-bridge, telemetry, collab, scale. Per-phase gates + revertibility; maps each cross-cutting decision to the phase that resolves it. The actionable companion tocanvas-state-plan.md§10. - canvas-store-state-inventory.md — the state census + type map: every piece of state across canvas settings / layers / behaviours / layouts / styling / templates / theme / records, each with its type definition, physics class (definition / interaction / runtime / data-cold / data-hot / derived / handle), source-of-truth today, and target home in
canvas-store. Includes the proposed kernel shape, per-instance config catalogs, the rendering-data-model type appendix, a source→target mapping table, and the 9 cross-cutting decisions. - reactive-state-store-plan.md — single reactive store (zustand behind a transferable
ReactiveStoreport) for config + interaction state; no UI copies; telemetry decorator; CRDT-ready. - collaborative-state-plan.md — near-realtime, multi-user, offline collaboration on top of that store (CRDT doc + presence, PG/Redis, OTel).
- event-taxonomy.md — canonical event catalogue + the
<domain>:<subject>:<action>bus naming scheme (telemetry / realtime / query), and the state-ownership migration map that moves all state + events out of the engine intocanvas-store. - canvas-3-package-architecture.md — draft: target split into
canvas-store(state + events) /canvas(orchestrator) /canvas-pixijs(renderer), with one end-to-end example (state + events + telemetry + history + rendering + layout updates) and the phased path (IRendererabstraction gated to Phase 3). - current-architecture.md — as-built: the packages, the vocabulary (six things are called "layer"), the concept/ownership diagram, today's data flow, and the full census of where pixi is bound — 53 files inside
@invana/canvasplus 7 rule-breaking leaks outside it. Read first. - renderer-split-design.md — target + refactor:
canvasorchestrates, renderers subscribe to the store and draw. Specs become durable state, custom paint collapses into apathspec kind, and the renderer contract shrinks to subscribe + a small lifecycle surface. Includes the three.js second-backend design (orthographic, engine-owned camera/picking, SDF text) and the P0–P7 refactor path.
- graph-canvas-operations.md — the GraphCanvas operations layer: graph verbs (focus / focusNeighbours / isolate / select-subtree / collapse / pin / remove) modelled as the query → primitive action → composite op stack, with a decomposition catalog. Composites batch kernel primitives +
GraphStorequeries; none live in the kernel (domain-free). Notes the view-vs-data batching split + undo semantics.
-
ui-consolidation-plan.md — the headless-vs-pixels re-split of
@invana/canvas-react+@invana/canvas-ui: canvas-react becomes the headless binding layer (roots, contexts, null-rendering wrappers, store hooks — never imports@invana/ui), canvas-ui becomes the React UI kit (components, toolbars, menus, editors, views,GraphCanvasApp) built on canvas-react's hooks so it couples tocanvas-storeand is live by default. Dependency flips to canvas-ui → canvas-react; the 23@invana/uifiles + all pixels move out of canvas-react; editors keep a controlled inner + connected wrapper (packages the per-consumerSettingsPanelbridge once). Move manifest + 8-phase migration (P0 instructions → P7 connected wrappers). -
canvas-settings-editor-panel-plan.md — clean rewrite of the settings editor panel (
CanvasSettingsEditorPanel): a pure projection of canvas-state — reads defaults fromstore.view.definition(+ registry introspection for kinds only), writes edits viacanvas.update(...). Untangles today's 4-jobs-in-one-file into a single store seam (useCanvasSettings, null-safe so the*Innergate collapses) + presentational pieces (SettingsInstanceRow/InstanceSettingsForm/buildSettingsSections) + schema registry. Rename table + behaviour-preserving migration steps. -
canvas-react-plan.md — React entry-point (declarative
<Canvas>). -
graph-canvas-apps-plan.md — one shell (
GraphCanvasApp), standard*Apps as JSON defaults, one item shape for toolbars, rails and menus. -
designer-studio-plan.md — Designer studio page (sibling of Explorer, on
GraphCanvasApp); umbrella doc sequencing the state refactor → editor kit → page → telemetry → collaboration. -
toolbars-plan.md — reusable toolbar building blocks + assembled toolbars.
-
commands-followups.md — open work from the command / control-panel refactor (📋 26 items): duplicate hook ⇄ command paths to unify, unfinished toolbar conversion, command weak spots (no types,
invalidate()discipline, unregistered commands), deferred RFC rows. Proposes the rule: logic in engine functions, hooks for code, commands only for saved controls. -
storybook-namespace-migration-plan.md — slim
canvas-react/down to 3 stories (<Canvas>,<GraphCanvas>, reseed — the only ones demoing canvas-react's own exports): relocate the other 22 so each sits under the package that owns the code it demos — GraphCanvasApp (10) + hover/template/layers/layout-comparison UI (6, +streaming-demo.tsxhelper) →canvas-ui/, cross-package demo apps (4) →usecases/,ExportImage→canvas/&ExportState→canvas-store/. Glob-discovered (no config change); onlytitle:strings rewrite. Full 25-story table + open sub-decision on the export stories' canvas-ui chrome. -
usecases-storybook-taxonomy-plan.md — split
stories/usecases/intoapps/+domains/(executed 2026-07-31): the product surfaces (a story about the tool, dataset as prop) vsusecases/domains/<domain>/= the verticals with several styling / layout configs of one dataset as sibling files (code-kg/{DotsForce,CompositeCards,HealthBadges},cora/{CitationNetwork,SubjectBundle}). Lowercases theUsecases/title prefix — reversing as-built note (1) ofstorybook-namespace-migration-plan.md. Full 17-story manifest. As built (2026-08-01, notes 5–7): theapps/bucket is gone — the three surfaces (CanvasDesigner·GraphModeller·GraphVisualiser) sit in the root ofusecases/,domains/is the only folder; open blocker on the ellipse-frame coverage the deletedSimpleAndCompositeNodesuniquely held. -
casestudies-rfc.md —
usecases/split intotools/+by-casestudies/: the five case studies, their data, and the analyst's story (🚧 the namespace split and the dataset audit have landed; the five stories aren't written). Re-charters the verticals bucket around a higher bar — a named analyst, a question, a decision they must defend — and picks the five to pitch: financial crime · attack paths · target discovery · supply risk · AI traces, each with a step-by-step demo script (observe → focus → investigate) under the thesis that an explanation is a subgraph. Key process decision (D1a): growby-casestudies/, don't bulk-migrate into it — a folder that says "case study" while holding a dataset demo violates its own charter, so the five are authored one at a time and a demo is absorbed only once rewritten. Also the dataset register (what each runs on, real vs created) and the 🔒 locked licence policy — CC0 · public domain · MIT · Apache-2.0 · BSD · ISC · self-generated; no copyleft, no NC, no per-use data attribution — retroactive to everything already shipping. Headline finding: the dangerous failure mode is the integration trap — PrimeKG is "MIT" on the code while its data pulls in DrugBank (NC), Hetionet is "CC0" on the integration only, Alibaba clusterdata has no licence at all. The §5.4 audit of all 15 shipping datasets found four unusable (game-of-throneshad no upstream licence,wikipedia-dataviz/coraCC BY-SA,life-treeunlicensed) — all replaced by seeded generators, ~9.4 MB → ~20 KB. Survivors put four of five case studies on real data: Wikidata (CC0), Open Targets (CC0), air-routes (Apache-2.0). -
new-behaviours-rfc.md — the engine work the case studies require (📋 proposed; §7 decisions locked): five industries, written independently, converge on one gap — the engine is strong at observe, decent at focus, and has almost nothing for investigate. Lists 6 new behaviours (B1 focal-emphasis driver · B2 traversal-highlight · B3 neighbourhood-expand · B4 timeline · B5 edge-centrality · B6 graph-diff), 7 updates to existing ones, and 4 prerequisites that gate them — P1 the ops layer (design ✅ locked,
GraphCanvas.tsimplements none of it), P2path()/reachableFrom(), P3 evidence export, P4 centrality algorithms (NodeCentralityBehaviouris degree-only but every story is about a bridge, not a hub). Down from 8 behaviours: two merges (path+reachability → onemode-driven behaviour; colour-by-value → U5,ColorByLabelBehaviour→ColorByBehaviourwithmode: 'categorical' | 'range', serialisable field paths, five scales, auto domains,valueColors, and a bins/gradient legend contract — §4.1, now the largest single item). Both merges were unblocked by the same finding: editorfieldsmay be a function of the live form values, so mode-driven disjoint field sets are a solved, in-use pattern — which reversed two of the draft's own recommendations. Each item with separate design vs implementation status, plus what already exists and must not be re-planned (dimmed/highlightedstates, per-element visibility,AdjacencyIndex,data:changed) and the rule-12 editor tax (6 new editors + 2 rewritten +kinddiscriminators). Minimum viable unlock: P1 + P2 + B1 + B2. -
color-by-behaviour-rfc.md —
ColorByLabelBehaviour→ColorByBehaviour(📋 proposed; the U5 item ofnew-behaviours-rfc.mdin full). One behaviour, two modes —'categorical'(which kind is this?) and'range'(how much of this is there?) — because both write the same template fields through the same resolver mechanism, so splitting them would need single-writer discipline to solve a problem the split created. Written options-first (§2 is the RFC): the four constraints the interface must satisfy, the borrowedweightKey/weightBynaming convention (serialisable string primary, function escape hatch that supersedes it), why it stays flat rather than a discriminated union (setOptionstakesPartial<TOptions>;Partial<A|B>distributes badly), theResolvedOptions+resolveOptions(prev, patch)pattern with its load-bearing??vs'x' in patchsplit, and a mode × scale validity matrix that doubles as the editor'sfields-function spec. Headline modelling catch, found by designing options before code: the domain must be per-kind (nodeDomain/edgeDomain) — node risk[0,1]and edge latency[0,250]share no scale — generalised to unit-bearing options are per-kind, unit-free options are shared. Also: root-relative dot paths (a deliberate divergence fromweightKey's data-relative key), five scales (continuous + quantile/threshold binning), hand-rolled sRGB lerp with a sequential single-hue default ramp that sidesteps the grey-midpoint problem, auto-domain rescan ondata:changed(refresh the domain, never re-run the install path), a per-channelgetLegend()contract +GraphLegendLayer.colorByBehaviourId, back-compat aliases, and a six-step implementation sequence where steps 1–3 are useful alone. Keepsdab4ad0's identity-guarded restore untouched. -
node-style-live-binding-plan.md — store-bound node-style editing: a
useNodeStyleEditor(nodeId)hook +<GraphNodeStyleEditor>drop-in (canvas-react) that seed a headless canvas-ui editor fromresolveNodeStyle, stay reactive viauseGraphEvent('node:update'), and write back live viaupdateNode(raw-stylespread, history-coalesced) — so editors reflect the canvas and auto-sync without hand-wiredonSubmit/updateNode. Also fixes the "Size shows 0" symptom (unsetsizeoverride) by dropping rawsizefrom the Simple basics tier. Live-vs-Apply, the wholesale-style footgun, and whyuseStorecan't read nodes.
- large-graph-performance-plan.md — rendering perf on large, crowded graphs (the ~5k-node / ~28.6k-edge "hairball"): the symptom, the telemetry-measured root cause (no viewport culling + one
Graphicsper edge → ~110k display objects re-rendered every frame; thelayersphase dominates pan/drag/layout; loose edge bboxes make hover hit-test expensive), the zoom-regime framing (culling wins zoomed-in; batching + LOD win zoomed-out; neither is universal), the render options (A culling · B edge batching · C zoom-LOD · D cache path samples · E gate edge hit-test by zoom · F frame-coalesced flush · G hover fast-path), and — for hovering the right edge in a crowd — the edge-pick correctness analysis (nearest-wins is technically right but flickers / is ambiguous / invisible when edges are near-coincident) with its own options (H segment-level hit index · I stable nearest + hysteresis · J node-incidence bias · K node-hover-first · L ambiguity picker) and the "reliable-when-separable, graceful-when-not" stance. Recommended phasing: cheap standalone wins + edge-pick stability first → segment index → culling → batching/LOD. Companion to thefeat/canvas-telemetry-otelobservability work. - render-pipeline-plan.md — how render work is expressed, merged, ordered and paid for. Today there is no pipeline: a store event calls the renderer imperatively and immediately (
GraphLayer's flush handler is a hand-rolled miniature of the right idea — four dirty sets drained in a prose-documented order). Proposes a render-intent queue: producersmark(id, class)instead of calling the renderer; intents coalesce on(id, class)via an explicit merge matrix; a frame planner orders them by cost class (move~0.05 ms →geometryhigh — a 100× spread today invisible to callers) under an interaction-aware budget, so cheap work always runs at 60 fps and only expensive classes slip. Adds the dependency-ordering contract (remove → install → move → frames → geometry → route → restyle → decorations), a bulk lane (machine-rate work skips per-item events — the kernel's own two-lane doctrine, extended from positions to install/update), epochs for one-compare invalidation, and backpressure with a degradation ladder. §8 answers the worker question: layout / ingest / derived geometry / index build / vertex-buffer construction move off-thread; rendering itself doesn't (OffscreenCanvas relocates the freeze and costs input latency — but theIRendererextraction makes a worker renderer just another implementation, so the option stays open). Phased R0–R5 + W1–W3, with risks (R2 is a behaviour-preserving refactor of code that works) and the over-abstraction check. - large-graph-load-pipeline-plan.md — initial-load perf (the disjoint half of the perf plan), written as a consumer of the render pipeline: loading ~5k nodes / ~20k edges freezes the tab for seconds before any layout, because
GraphLayerinstalls every element inline in one unbroken macrotask (addShape→ Graphics + rbush + labelText;addConnector→ Container + 3Graphics+ a full route). Culling and frame-coalesced flush can't help — the cost is constructing the instances. Key framing: budgeting alone gives non-blocking, not snappy (same 2–4 s, now as popcorn), so it takes three levers — yield (install as a deferrable intent class, nodes before edges, epoch per load, sync threshold), cut (install-time LOD: skip sub-pixel labelText,keepFractionedges, badges, unrouted connectors — the largest single win, and the on-ramp to virtualization), and order (camera-fit from store bounds → node bodies → edges → labels: progressive fidelity, not progressive elements; a live canvas + progress chip, never a spinner). Plus edge-install staged against layout cool-down. Records the partial-render hazards (getBounds/fitOnLoadread the renderer, cull invalidation,exportImage, headless), the honest ceiling (25k display objects cost what they cost → virtualization / edge batching next), and phases L0–L6.
- geo-intelligence-plan.md — 📋 mark, query, track and brief on a map, all as JSON (
data+config). Phases P1–P8: BubbleSets at map scale · marker icons / rotation / zoom labels as template config ·GeoFeaturesLayer(GeoJSON areas, lines, circles with provenance) · draw / measure / area-query tools · live tracking (fixes, interpolation, trails, signal state, follow) · time (kernel clock, slider, replay, geofences, route deviation, ETA) · analyst extras · maritime and last-mile case studies. Indexes the per-phase RFCs and the open decisions. - analyst-requirements.md — the tracked analyst requirements (
A1…A30): each one a question a named analyst asks while deciding, with its phase and status. The what and why; the plan above is the how.
- autofit-bounds-rfc.md — 📋
fitOnLoadframes the wrong box. The camera lands zoomed into the gap between two nodes (4400 % on the GraphVisualiser, 2750 % onFullFeatured, a blankd3-hierarchy/Tree), which reads as "the nodes aren't rendering" — four such reports in one session, every one a camera bug over a correctly-drawn scene. Established:GraphLayer.getBounds()measured a 7 × 7 rect (one node ofradius: 3.5— i.e. 252 nodes still stacked at the origin) while the graph was visibly spread out, and fitting that into a 1200 px viewport is the 4400 %; an animated force sim self-corrects because_armAutoFitre-fits on everylayout:run:tick, while a one-shot layout (animate: false, d3-hierarchy, sankey, ELK) gets exactly one shot and keeps the stale box. Not yet established — and the reason this is an RFC rather than a patch: the write path looks synchronous (setPositionsBulk→store.flush()insidegetBounds→node:update→moveShapemutatingspec.x/yin place, the very fields the bounds read), and the two failures disagree (Les Mis self-corrects seconds later = one-frame race; the hierarchy case still read 7 × 7 two seconds on = positions never reached the specs). Plan: one instrumented run whose three outcomes each name their own fix site (_armAutoFitwiring ·fitView· the store→layer bridge), then a ≤20-line change on the principle that a measurement must not depend on frame ordering — explicitly not re-timingfitView, which the Fit button,fitOnLoadand the layout wrappers all share. Outcome C would meangetShapeWorldBoundscan disagree with the store for bulk writes, which affects hit-test bounds / minimap / ELK sizing too, and re-scopes this. - text-labels-plan.md — text labels for nodes & edges.
- badges-edges-plan.md — badges on edges + node parity (draft).
- group-aware-layouts-plan.md — make
parentIdgroups lay out correctly in every layout, not just ELK. Today only ELK does containment (opt-in), d3-force approximates it (centroid pull), geometric/sankey ignore it, andD3HierarchyLayoutcrashes (its tree comes from edges, so a frame node is a second root). Three root causes: every hierarchy-aware layout conflatesparentIdwith "group" (a group isstyle.group/isGroupNode— so plain trees get boxed), collapse-hiding is derived viacollapsedAncestorsoshouldPlaceNode'shiddentest misses collapsed members everywhere, and each layout owns private copies of the rules. Fix: shared helpers in@invana/graph(placeable predicate ·effectiveEndpointedge remap+dedupe to a fixpoint ·GroupOptionsinsets), then ELK native compound (fix + collapse the flat/compound branches into one + defaultincludeGroups: true) · the d3-hierarchy crash fix · aRecursiveGroupLayout(lay each group out in isolation → box → super-node at the parent level → translate) that gives grid/circular/tree/radial containment for free. Records the two meanings of "group support" (native vs recursive) and recursion's blind-subgraph quality caveat. - per-element-visibility-plan.md — first-class per-element hide/show for nodes & edges (single + batched bulk), a
hiddenflag stored as aflags-column bit (sibling ofpinned) with the effective-visibility rule (edge hidden if an endpoint is) owned byGraphStore. Culls from render/hit-test/bounds/camera/layout/labels/minimap (notalpha 0), fixing invisible-but-clickable;node:visibility/edge:visibilityevents (derived-only incident-edge cascade), serialization round-trip, andLayer.setVisible+scene:layer:visibilitychangefor whole-layer visibility.