Skip to content

2.0 N0-N2: node definition registry + read-only code view (flag codeView, off) - #564

Merged
AlexZ005 merged 3 commits into
mainfrom
feat/2.0-n012
Nov 19, 2026
Merged

AlexZ005 merged 3 commits into
mainfrom
feat/2.0-n012

Conversation

@AlexZ005

Copy link
Copy Markdown
Collaborator

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 codeView flag, 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 as
export 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).
  • The nodeCatalog core groups, flowSockets, the Nodes editor's card map and evalNodeBody's dispatch are generated from it.
  • Moved mechanically (acorn): catalog text verbatim, eval bodies verbatim with runtime helpers as rt.<name>.
  • A definition missing a part fails npm run build (vite plugin node-registry-check). Adding a node type means one entry in one file.

N2: read-only code view (flag codeView)

  • One generator, src/lib/nodes/flowCode.js. The Nodes editor, the VR sheet and the agent all print the same text.
  • flowCodeParse.js reads the code back without running anything. graph → code → graph is exact on all 69 fixture graphs.
  • Nodes editor: a Code tab. Press a line to select its node; selecting a node marks its line; Copy.
  • Phone: the tab opens as a full-width sheet.
  • VR: the Logic panel gets a Code sheet.
  • Agent: with the flag on, list_scene {flow} returns code and describe_node_types cards carry a code shape. No tool names change; tpAgent contract 1.9.0 → 1.10.0 (additive).
  • Turn it on with localStorage['flag:codeView'] = '1'.

Proof

  • Parity fingerprint, IDENTICAL to v1.67.0. It covers:

    • the catalog JSON;
    • the socket type of every handle;
    • evalNode on 2060 nodes (every scene and template, plus one synthetic node per type), in 5 rounds, without and with a pulsed context.
  • 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:

    • Deck: −2.2 % idle and −2.2 % armed; the two base runs differ by 5.6 % and 7.6 %.
    • PC GPU: +4.4 % idle (base runs differ by 6.4 %) and −1.9 % armed.
    • Quest: handed to the int, which runs it on its preview.
  • Focused e2e, all green:

    Suite pass/fail
    flow-runtime 11/0
    flow-nodes-core 15/0
    logic-nodes 77/0
    nodesync-join 7/0
    click-once 31/0
    game-state 45/0
    flow-physics-actions 37/0
    hud-nodes 24/0
    flow-code-view (new, in battery.json) 40/0
    vr-logic-iwer (+ row C) 61/0
  • 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 --check matches; build is green.

  • Full battery on the PC GPU (641 suites) vs v1.67.0:

    • u1: 611 green, 9 flaky (green on the retry), 5 pre-existing.
    • The 16 NEW reds were rerun as u2. 14 were green; they had failed only on the snapshot's missing tools/agent deps or as flakes.
    • agent-mcp is pre-existing.
    • agent-chat pinned the contract version and is bumped here: agent-chat 51/0 after the bump (pc slot).

Found, not fixed (pre-existing on v1.67.0)

  • flow-new-nodes expects Select to have 4 handles; it has 6 since 21-E. The suite is not in battery.json.
  • animfinished, animmarker, onanimstate and ongrab fall through to the value of hudTimerRemaining in evalNodeBody. Kept verbatim.

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

AlexZ005 and others added 3 commits November 17, 2026 23:19
…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
AlexZ005 merged commit 72214d2 into main Nov 19, 2026
19 of 21 checks passed
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>
AlexZ005 added a commit that referenced this pull request Nov 19, 2026
core #565 (95-moment SM1-SM4) + core #564 (2.0-n012 node registry + read-only code view, flag codeView off) +
the 95-int hardening (lazy code view, picomatch grype rule, battery-snapshot tools/agent).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@AlexZ005
AlexZ005 deleted the feat/2.0-n012 branch November 19, 2026 10:57
@AlexZ005

Copy link
Copy Markdown
Collaborator Author

In main via 95-int (release merge e27e2ae, v1.68.0).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant