Repository navigation
2.0 N0-N2: node definition registry + read-only code view (flag codeView, off) - #564
Merged
Merged
Conversation
…nodes) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The 143 core node types moved from four hand-kept places (nodeCatalog, Nodes.svelte CORE_NODE_TYPES, flowSockets OUTPUT/INPUT/OUTPUT_HANDLES, evalNodeBody's switch) into src/lib/nodes/families/<group>.js, one entry per type: palette spec + sockets + card key + eval. The four places are generated from it (src/lib/nodes/index.js). Eval bodies are the old case bodies verbatim, handed the same locals and flowRuntime's helpers as `rt`. The tick model does not change. A definition missing a half fails `npm run build` (vite plugin node-registry-check). graph-audit, scene-lint and node-catalog-scan read the definitions through scripts/node-catalog-source.cjs. Parity: catalog JSON, socket types and evalNode over 2060 nodes (scenes, templates, one synthetic node per type) byte-identical to v1.67.0; svelte-check unchanged (274/37); unit 5010 + nodeRegistry 14. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
One generator (src/lib/nodes/flowCode.js, a leaf) prints a flow graph as code:
one statement per node, sources first, wires as arguments, the node id in a
trailing comment. flowCodeParse.js reads it back (literals only, nothing runs);
graph -> code -> graph is exact on ids, types, effective data and wires over
every fixture graph (69 graphs, 1267 nodes, 1191 wires).
- Nodes editor: a Code tab (flag only) with line -> node and node -> line jumps
and Copy; on a phone the panel is a full-width sheet.
- VR logic panel: a Code button opens a read-only paged sheet; a line press
selects that node.
- Agent: list_scene {flow} carries `code` and describe_node_types cards carry
a `code` shape, both only with the flag; contract 1.10.0 (additive).
- Flag: localStorage 'flag:codeView' = '1', local, off by default.
- Tests: unit flowCode (5 built-ins round trip + shapes), nodeTypesCore +2;
e2e flow-code-view (in battery.json) + vr-logic-iwer row C.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
AlexZ005
added a commit
that referenced
this pull request
Nov 19, 2026
…+ list_scene code) The union of #565 + #564 put the editor's boot 0.2 KB over its line (3456.2 / 3456 KB). The code view (flag codeView, off by default) was statically imported by the Nodes editor and ai/tools; both now load it on use. Editor boot 3450.7 KB, play 2104.9 KB. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Collaborator
Author
|
In main via 95-int (release merge e27e2ae, v1.68.0). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Roadmap 2.0 (one language), rows N0, N1 and N2 only. N3/N4 (editing as code) are in rework and not here. No own int: the next int merges this; the code view stays behind the
codeViewflag, off by default. The tick model does not change.N0: design page
src/lib/nodes/DESIGN.md(one page): one code shape for behaviours and nodes. A graph reads asexport default flow(({ types }) => { const x = type(params, wires); // #id }), sources first, defaults left out.N1: node definition registry (no behaviour change)
src/lib/nodes/families/<group>.js× 12: 143 core types, one definition each (palette entry + sockets + card key + eval).rt.<name>.npm run build(vite pluginnode-registry-check). Adding a node type means one entry in one file.N2: read-only code view (flag
codeView)src/lib/nodes/flowCode.js. The Nodes editor, the VR sheet and the agent all print the same text.flowCodeParse.jsreads the code back without running anything. graph → code → graph is exact on all 69 fixture graphs.list_scene {flow}returnscodeanddescribe_node_typescards carry acodeshape. No tool names change; tpAgent contract 1.9.0 → 1.10.0 (additive).localStorage['flag:codeView'] = '1'.Proof
Parity fingerprint, IDENTICAL to v1.67.0. It covers:
graphHash, base build vs lane build, through the real load path: 34 scenes and templates (55 graphs, 973 nodes) are IDENTICAL. The fixtures are byte-identical to the scenes repo's origin/main. The 5 module games time out on both builds; their load and hash code is unchanged.
Flow-tick bench on prod builds with a monotonic synthetic clock, 360 nodes, order base, lane, lane, base:
Focused e2e, all green:
Unit: 5038/5038, including the round trip of the 5 N0 built-ins. svelte-check 274/37 = baseline. check:tokens, emoji, storage, loaders, zindex and render-seam are clean;
catalog:agent --checkmatches; build is green.Full battery on the PC GPU (641 suites) vs v1.67.0:
tools/agentdeps or as flakes.Found, not fixed (pre-existing on v1.67.0)
Changelog and docs lines are in the lane's handover (
STATUS-2.0-n012.md, "For the orchestrator"). CHANGELOG.md is not touched.🤖 Generated with Claude Code