Skip to content

refactor: read widgeted-input connectivity from linkStore - #13455

Merged
DrJKL merged 11 commits into
feature/ecs-migrationfrom
drjkl/the-body-in-the-library
Jul 14, 2026
Merged

DrJKL merged 11 commits into
feature/ecs-migrationfrom
drjkl/the-body-in-the-library

Conversation

@DrJKL

@DrJKL DrJKL commented Jul 6, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Migrates the inputs[].link mirror-based reactivity tracking to linkStore queries and deletes the slot-link reprojection machinery in useGraphNodeManager.

Changes

  • What: NodeSlots.linkedWidgetedInputs, usePartitionedBadges' pricing pokes, and trackNodePrice now query linkStore.isInputSlotConnected (root graph id + unfiltered slot index). Deletes the node:slot-links:changed handler and its load-bearing comment, the emitter-less node:slot-errors:changed handler, refreshNodeInputs, and the node-removal refresh-all loop. Adds unified-mode NodeSlots tests (none existed) and a trackNodePrice reactivity test. Drafts docs/architecture/node-data-store.md for the next phase.
  • Not removed: the node:slot-links:changed emitters and trigger type entries, the input.link mirror itself, the computation-path inp.link reads in useNodePricing.buildJsonataContext (migrated in refactor!: delete the input.link runtime mirror #13498 alongside the mirror deletion), and the node:slot-label:changed handler — those belong to the Slot extraction / nodeDataStore phases.

Review Focus

  • The node-removal refresh-all loop deletion (own commit) — originally shipped as a regression fix; gated locally on the vue-nodes legacy widget e2e spec plus the full vueNodes suite (126 passed).
  • Pricing badges previously only re-evaluated for widgeted inputs (the trigger's gate); linkStore queries now also cover non-widgeted pricing inputs — a correctness improvement, not parity.

🤖 Generated with Claude Code

@coderabbitai

coderabbitai Bot commented Jul 6, 2026 •

Copy link
Copy Markdown
Contributor
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch drjkl/the-body-in-the-library

Comment @coderabbitai help to get the list of available commands.

@github-actions

github-actions Bot commented Jul 6, 2026 •

Copy link
Copy Markdown
Contributor

🎨 Storybook: ✅ Built — View Storybook

Details

⏰ Completed at: 07/14/2026, 08:22:03 PM UTC

Links

🎭 Playwright: ✅ 1696 passed, 0 failed

📊 Browser Reports
  • chromium: View Report (✅ 1675 / ❌ 0 / ⚠️ 0 / ⏭️ 5)
  • chromium-2x: View Report (✅ 2 / ❌ 0 / ⚠️ 0 / ⏭️ 0)
  • chromium-0.5x: View Report (✅ 1 / ❌ 0 / ⚠️ 0 / ⏭️ 0)
  • mobile-chrome: View Report (✅ 18 / ❌ 0 / ⚠️ 0 / ⏭️ 0)

📦 Bundle Size

⏳ Size data collection in progress…

⚡ Performance Report

canvas-idle: · 60.0 avg FPS · 59.9 P5 FPS ✅ (target: ≥52) · 0ms TBT · 54.8 MB heap
canvas-mouse-sweep: · 60.0 avg FPS · 59.7 P5 FPS ✅ (target: ≥52) · 0ms TBT · 54.7 MB heap
canvas-zoom-sweep: · 60.0 avg FPS · 59.7 P5 FPS ✅ (target: ≥52) · 0ms TBT · 66.7 MB heap
dom-widget-clipping: · 60.0 avg FPS · 59.9 P5 FPS ✅ (target: ≥52) · 0ms TBT · 48.0 MB heap
large-graph-idle: · 60.0 avg FPS · 59.7 P5 FPS ✅ (target: ≥52) · 0ms TBT · 54.3 MB heap
large-graph-pan: · 60.0 avg FPS · 59.9 P5 FPS ✅ (target: ≥52) · 0ms TBT · 78.6 MB heap
large-graph-zoom: · 60.0 avg FPS · 59.7 P5 FPS ✅ (target: ≥52) · 0ms TBT · 73.5 MB heap
minimap-idle: · 60.0 avg FPS · 59.9 P5 FPS ✅ (target: ≥52) · 0ms TBT · 55.3 MB heap
subgraph-dom-widget-clipping: · 60.0 avg FPS · 59.7 P5 FPS ✅ (target: ≥52) · 0ms TBT · 45.4 MB heap
subgraph-idle: · 60.0 avg FPS · 59.7 P5 FPS ✅ (target: ≥52) · 0ms TBT · 59.6 MB heap
subgraph-mouse-sweep: · 60.0 avg FPS · 59.9 P5 FPS ✅ (target: ≥52) · 0ms TBT · 61.9 MB heap
subgraph-transition-enter: · 60.0 avg FPS · 59.5 P5 FPS ✅ (target: ≥52) · 138ms TBT · 92.4 MB heap
viewport-pan-sweep: · 60.0 avg FPS · 59.9 P5 FPS ✅ (target: ≥52) · 0ms TBT · 73.3 MB heap
vue-large-graph-idle: · 59.0 avg FPS · 59.7 P5 FPS ✅ (target: ≥52) · 0ms TBT · 160.4 MB heap
vue-large-graph-pan: · 56.3 avg FPS · 59.5 P5 FPS ✅ (target: ≥52) · 6ms TBT · 156.5 MB heap
workflow-execution: · 60.0 avg FPS · 59.7 P5 FPS ✅ (target: ≥52) · 0ms TBT · 54.4 MB heap

ℹ️ No baseline found — significance unavailable.

Absolute values
Metric Value
canvas-idle: avg frame time 17ms
canvas-idle: p95 frame time 17ms
canvas-idle: layout duration 0ms
canvas-idle: style recalc duration 7ms
canvas-idle: layout count 0
canvas-idle: style recalc count 9
canvas-idle: task duration 389ms
canvas-idle: script duration 21ms
canvas-idle: TBT 0ms
canvas-idle: heap used 54.8 MB
canvas-idle: DOM nodes -280
canvas-idle: event listeners -199
canvas-mouse-sweep: avg frame time 17ms
canvas-mouse-sweep: p95 frame time 17ms
canvas-mouse-sweep: layout duration 3ms
canvas-mouse-sweep: style recalc duration 34ms
canvas-mouse-sweep: layout count 12
canvas-mouse-sweep: style recalc count 72
canvas-mouse-sweep: task duration 753ms
canvas-mouse-sweep: script duration 117ms
canvas-mouse-sweep: TBT 0ms
canvas-mouse-sweep: heap used 54.7 MB
canvas-mouse-sweep: DOM nodes -245
canvas-mouse-sweep: event listeners -199
canvas-zoom-sweep: avg frame time 17ms
canvas-zoom-sweep: p95 frame time 17ms
canvas-zoom-sweep: layout duration 1ms
canvas-zoom-sweep: style recalc duration 15ms
canvas-zoom-sweep: layout count 6
canvas-zoom-sweep: style recalc count 31
canvas-zoom-sweep: task duration 308ms
canvas-zoom-sweep: script duration 22ms
canvas-zoom-sweep: TBT 0ms
canvas-zoom-sweep: heap used 66.7 MB
canvas-zoom-sweep: DOM nodes -211
canvas-zoom-sweep: event listeners -184
dom-widget-clipping: avg frame time 17ms
dom-widget-clipping: p95 frame time 17ms
dom-widget-clipping: layout duration 0ms
dom-widget-clipping: style recalc duration 8ms
dom-widget-clipping: layout count 0
dom-widget-clipping: style recalc count 12
dom-widget-clipping: task duration 344ms
dom-widget-clipping: script duration 54ms
dom-widget-clipping: TBT 0ms
dom-widget-clipping: heap used 48.0 MB
dom-widget-clipping: DOM nodes -128
dom-widget-clipping: event listeners -102
large-graph-idle: avg frame time 17ms
large-graph-idle: p95 frame time 17ms
large-graph-idle: layout duration 0ms
large-graph-idle: style recalc duration 12ms
large-graph-idle: layout count 0
large-graph-idle: style recalc count 10
large-graph-idle: task duration 642ms
large-graph-idle: script duration 230ms
large-graph-idle: TBT 0ms
large-graph-idle: heap used 54.3 MB
large-graph-idle: DOM nodes -268
large-graph-idle: event listeners -198
large-graph-pan: avg frame time 17ms
large-graph-pan: p95 frame time 17ms
large-graph-pan: layout duration 0ms
large-graph-pan: style recalc duration 16ms
large-graph-pan: layout count 0
large-graph-pan: style recalc count 69
large-graph-pan: task duration 1187ms
large-graph-pan: script duration 571ms
large-graph-pan: TBT 0ms
large-graph-pan: heap used 78.6 MB
large-graph-pan: DOM nodes -275
large-graph-pan: event listeners -197
large-graph-zoom: avg frame time 17ms
large-graph-zoom: p95 frame time 17ms
large-graph-zoom: layout duration 6ms
large-graph-zoom: style recalc duration 14ms
large-graph-zoom: layout count 60
large-graph-zoom: style recalc count 64
large-graph-zoom: task duration 1373ms
large-graph-zoom: script duration 672ms
large-graph-zoom: TBT 0ms
large-graph-zoom: heap used 73.5 MB
large-graph-zoom: DOM nodes -136
large-graph-zoom: event listeners -94
minimap-idle: avg frame time 17ms
minimap-idle: p95 frame time 17ms
minimap-idle: layout duration 0ms
minimap-idle: style recalc duration 6ms
minimap-idle: layout count 0
minimap-idle: style recalc count 8
minimap-idle: task duration 590ms
minimap-idle: script duration 219ms
minimap-idle: TBT 0ms
minimap-idle: heap used 55.3 MB
minimap-idle: DOM nodes -272
minimap-idle: event listeners -198
subgraph-dom-widget-clipping: avg frame time 17ms
subgraph-dom-widget-clipping: p95 frame time 17ms
subgraph-dom-widget-clipping: layout duration 0ms
subgraph-dom-widget-clipping: style recalc duration 11ms
subgraph-dom-widget-clipping: layout count 0
subgraph-dom-widget-clipping: style recalc count 47
subgraph-dom-widget-clipping: task duration 375ms
subgraph-dom-widget-clipping: script duration 113ms
subgraph-dom-widget-clipping: TBT 0ms
subgraph-dom-widget-clipping: heap used 45.4 MB
subgraph-dom-widget-clipping: DOM nodes -275
subgraph-dom-widget-clipping: event listeners -195
subgraph-idle: avg frame time 17ms
subgraph-idle: p95 frame time 17ms
subgraph-idle: layout duration 0ms
subgraph-idle: style recalc duration 11ms
subgraph-idle: layout count 0
subgraph-idle: style recalc count 12
subgraph-idle: task duration 385ms
subgraph-idle: script duration 16ms
subgraph-idle: TBT 0ms
subgraph-idle: heap used 59.6 MB
subgraph-idle: DOM nodes -271
subgraph-idle: event listeners -199
subgraph-mouse-sweep: avg frame time 17ms
subgraph-mouse-sweep: p95 frame time 17ms
subgraph-mouse-sweep: layout duration 4ms
subgraph-mouse-sweep: style recalc duration 33ms
subgraph-mouse-sweep: layout count 16
subgraph-mouse-sweep: style recalc count 76
subgraph-mouse-sweep: task duration 621ms
subgraph-mouse-sweep: script duration 85ms
subgraph-mouse-sweep: TBT 0ms
subgraph-mouse-sweep: heap used 61.9 MB
subgraph-mouse-sweep: DOM nodes -95
subgraph-mouse-sweep: event listeners -98
subgraph-transition-enter: avg frame time 17ms
subgraph-transition-enter: p95 frame time 17ms
subgraph-transition-enter: layout duration 15ms
subgraph-transition-enter: style recalc duration 30ms
subgraph-transition-enter: layout count 14
subgraph-transition-enter: style recalc count 18
subgraph-transition-enter: task duration 721ms
subgraph-transition-enter: script duration 25ms
subgraph-transition-enter: TBT 138ms
subgraph-transition-enter: heap used 92.4 MB
subgraph-transition-enter: DOM nodes 13673
subgraph-transition-enter: event listeners 2533
viewport-pan-sweep: avg frame time 17ms
viewport-pan-sweep: p95 frame time 17ms
viewport-pan-sweep: layout duration 0ms
viewport-pan-sweep: style recalc duration 47ms
viewport-pan-sweep: layout count 0
viewport-pan-sweep: style recalc count 250
viewport-pan-sweep: task duration 3916ms
viewport-pan-sweep: script duration 1744ms
viewport-pan-sweep: TBT 0ms
viewport-pan-sweep: heap used 73.3 MB
viewport-pan-sweep: DOM nodes -270
viewport-pan-sweep: event listeners -147
vue-large-graph-idle: avg frame time 17ms
vue-large-graph-idle: p95 frame time 17ms
vue-large-graph-idle: layout duration 0ms
vue-large-graph-idle: style recalc duration 0ms
vue-large-graph-idle: layout count 0
vue-large-graph-idle: style recalc count 0
vue-large-graph-idle: task duration 10883ms
vue-large-graph-idle: script duration 813ms
vue-large-graph-idle: TBT 0ms
vue-large-graph-idle: heap used 160.4 MB
vue-large-graph-idle: DOM nodes -3301
vue-large-graph-idle: event listeners -16377
vue-large-graph-pan: avg frame time 18ms
vue-large-graph-pan: p95 frame time 17ms
vue-large-graph-pan: layout duration 0ms
vue-large-graph-pan: style recalc duration 15ms
vue-large-graph-pan: layout count 0
vue-large-graph-pan: style recalc count 66
vue-large-graph-pan: task duration 14417ms
vue-large-graph-pan: script duration 1143ms
vue-large-graph-pan: TBT 6ms
vue-large-graph-pan: heap used 156.5 MB
vue-large-graph-pan: DOM nodes -5807
vue-large-graph-pan: event listeners -16368
workflow-execution: avg frame time 17ms
workflow-execution: p95 frame time 17ms
workflow-execution: layout duration 1ms
workflow-execution: style recalc duration 23ms
workflow-execution: layout count 4
workflow-execution: style recalc count 18
workflow-execution: task duration 156ms
workflow-execution: script duration 17ms
workflow-execution: TBT 0ms
workflow-execution: heap used 54.4 MB
workflow-execution: DOM nodes -2
workflow-execution: event listeners -33
Raw data
{
  "timestamp": "2026-07-14T20:31:27.645Z",
  "gitSha": "82d6d9e8ba73ace6d52b6b03777e5bad858f0400",
  "branch": "drjkl/the-body-in-the-library",
  "measurements": [
    {
      "name": "canvas-idle",
      "durationMs": 2038.6560000000031,
      "styleRecalcs": 7,
      "styleRecalcDurationMs": 4.935999999999999,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 416.292,
      "heapDeltaBytes": -3925444,
      "heapUsedBytes": 49082100,
      "domNodes": -291,
      "jsHeapTotalBytes": 16904192,
      "scriptDurationMs": 20.580000000000002,
      "eventListeners": -199,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666666666666668,
      "p95FrameDurationMs": 16.700000000000728
    },
    {
      "name": "canvas-idle",
      "durationMs": 2041.7469999999867,
      "styleRecalcs": 10,
      "styleRecalcDurationMs": 8.081000000000001,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 361.19199999999995,
      "heapDeltaBytes": 13119572,
      "heapUsedBytes": 65887452,
      "domNodes": -269,
      "jsHeapTotalBytes": 15331328,
      "scriptDurationMs": 20.648000000000003,
      "eventListeners": -199,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.670000000000012,
      "p95FrameDurationMs": 16.699999999999818
    },
    {
      "name": "canvas-mouse-sweep",
      "durationMs": 1802.0670000000223,
      "styleRecalcs": 71,
      "styleRecalcDurationMs": 34.64,
      "layouts": 12,
      "layoutDurationMs": 3.0059999999999993,
      "taskDurationMs": 752.8249999999999,
      "heapDeltaBytes": -12387412,
      "heapUsedBytes": 57467408,
      "domNodes": -244,
      "jsHeapTotalBytes": 19288064,
      "scriptDurationMs": 117.039,
      "eventListeners": -199,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666666666666668,
      "p95FrameDurationMs": 16.699999999999818
    },
    {
      "name": "canvas-mouse-sweep",
      "durationMs": 1809.6030000000383,
      "styleRecalcs": 72,
      "styleRecalcDurationMs": 34.034,
      "layouts": 12,
      "layoutDurationMs": 3.0109999999999997,
      "taskDurationMs": 752.652,
      "heapDeltaBytes": -12394320,
      "heapUsedBytes": 57328944,
      "domNodes": -245,
      "jsHeapTotalBytes": 19550208,
      "scriptDurationMs": 116.366,
      "eventListeners": -199,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.66999999999998,
      "p95FrameDurationMs": 16.799999999999272
    },
    {
      "name": "canvas-zoom-sweep",
      "durationMs": 1730.7859999999664,
      "styleRecalcs": 30,
      "styleRecalcDurationMs": 15.328999999999999,
      "layouts": 6,
      "layoutDurationMs": 0.655,
      "taskDurationMs": 309.45500000000004,
      "heapDeltaBytes": 17252968,
      "heapUsedBytes": 69880160,
      "domNodes": -211,
      "jsHeapTotalBytes": 13234176,
      "scriptDurationMs": 22.207000000000004,
      "eventListeners": -184,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666666666666668,
      "p95FrameDurationMs": 16.700000000000728
    },
    {
      "name": "canvas-zoom-sweep",
      "durationMs": 1743.5509999999113,
      "styleRecalcs": 31,
      "styleRecalcDurationMs": 14.307000000000002,
      "layouts": 6,
      "layoutDurationMs": 0.625,
      "taskDurationMs": 306.32,
      "heapDeltaBytes": 17544068,
      "heapUsedBytes": 69950576,
      "domNodes": -211,
      "jsHeapTotalBytes": 13496320,
      "scriptDurationMs": 22.433,
      "eventListeners": -184,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666666666666668,
      "p95FrameDurationMs": 16.800000000000182
    },
    {
      "name": "dom-widget-clipping",
      "durationMs": 591.4940000000115,
      "styleRecalcs": 12,
      "styleRecalcDurationMs": 8.471999999999998,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 365.677,
      "heapDeltaBytes": -22650964,
      "heapUsedBytes": 47275212,
      "domNodes": -275,
      "jsHeapTotalBytes": 6180864,
      "scriptDurationMs": 53.63799999999999,
      "eventListeners": -203,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666666666666668,
      "p95FrameDurationMs": 16.700000000000728
    },
    {
      "name": "dom-widget-clipping",
      "durationMs": 545.6749999999602,
      "styleRecalcs": 12,
      "styleRecalcDurationMs": 7.777999999999999,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 323.26500000000004,
      "heapDeltaBytes": -12207740,
      "heapUsedBytes": 53423436,
      "domNodes": 20,
      "jsHeapTotalBytes": 20733952,
      "scriptDurationMs": 54.266,
      "eventListeners": 0,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666666666666668,
      "p95FrameDurationMs": 16.700000000000728
    },
    {
      "name": "large-graph-idle",
      "durationMs": 2038.1830000000036,
      "styleRecalcs": 10,
      "styleRecalcDurationMs": 9.007,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 632.334,
      "heapDeltaBytes": -7193116,
      "heapUsedBytes": 56350932,
      "domNodes": -268,
      "jsHeapTotalBytes": -1089536,
      "scriptDurationMs": 223.329,
      "eventListeners": -199,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666666666666668,
      "p95FrameDurationMs": 16.800000000000182
    },
    {
      "name": "large-graph-idle",
      "durationMs": 2071.986000000038,
      "styleRecalcs": 10,
      "styleRecalcDurationMs": 15.251000000000001,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 651.3959999999998,
      "heapDeltaBytes": -13011328,
      "heapUsedBytes": 57466652,
      "domNodes": -267,
      "jsHeapTotalBytes": -2105344,
      "scriptDurationMs": 236.35699999999997,
      "eventListeners": -197,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666666666666668,
      "p95FrameDurationMs": 16.700000000000728
    },
    {
      "name": "large-graph-pan",
      "durationMs": 2123.2290000000376,
      "styleRecalcs": 69,
      "styleRecalcDurationMs": 14.937,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 1205.404,
      "heapDeltaBytes": 10859352,
      "heapUsedBytes": 82842664,
      "domNodes": -275,
      "jsHeapTotalBytes": -327680,
      "scriptDurationMs": 583.621,
      "eventListeners": -197,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666666666666668,
      "p95FrameDurationMs": 16.700000000000728
    },
    {
      "name": "large-graph-pan",
      "durationMs": 2130.7919999999285,
      "styleRecalcs": 69,
      "styleRecalcDurationMs": 16.441,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 1168.68,
      "heapDeltaBytes": 16967904,
      "heapUsedBytes": 82010952,
      "domNodes": -275,
      "jsHeapTotalBytes": 425984,
      "scriptDurationMs": 558.537,
      "eventListeners": -197,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666666666666668,
      "p95FrameDurationMs": 16.699999999999818
    },
    {
      "name": "large-graph-zoom",
      "durationMs": 3093.3950000000436,
      "styleRecalcs": 64,
      "styleRecalcDurationMs": 14.757999999999997,
      "layouts": 60,
      "layoutDurationMs": 6.390000000000001,
      "taskDurationMs": 1371.412,
      "heapDeltaBytes": 22905252,
      "heapUsedBytes": 77235272,
      "domNodes": -279,
      "jsHeapTotalBytes": 524288,
      "scriptDurationMs": 663.632,
      "eventListeners": -195,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.66333333333335,
      "p95FrameDurationMs": 16.699999999999818
    },
    {
      "name": "large-graph-zoom",
      "durationMs": 3088.581999999974,
      "styleRecalcs": 63,
      "styleRecalcDurationMs": 14.038000000000002,
      "layouts": 60,
      "layoutDurationMs": 6.362,
      "taskDurationMs": 1375.026,
      "heapDeltaBytes": 21586648,
      "heapUsedBytes": 76856052,
      "domNodes": 8,
      "jsHeapTotalBytes": 0,
      "scriptDurationMs": 679.876,
      "eventListeners": 8,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666666666666668,
      "p95FrameDurationMs": 16.800000000000182
    },
    {
      "name": "minimap-idle",
      "durationMs": 2026.5529999999785,
      "styleRecalcs": 9,
      "styleRecalcDurationMs": 7.3130000000000015,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 614.9440000000001,
      "heapDeltaBytes": -8361952,
      "heapUsedBytes": 57411264,
      "domNodes": -271,
      "jsHeapTotalBytes": -1843200,
      "scriptDurationMs": 224.48200000000003,
      "eventListeners": -199,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666666666666668,
      "p95FrameDurationMs": 16.700000000000728
    },
    {
      "name": "minimap-idle",
      "durationMs": 1998.960000000011,
      "styleRecalcs": 7,
      "styleRecalcDurationMs": 4.810000000000001,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 564.2420000000001,
      "heapDeltaBytes": 5091976,
      "heapUsedBytes": 58458084,
      "domNodes": -273,
      "jsHeapTotalBytes": 4194304,
      "scriptDurationMs": 214.48099999999997,
      "eventListeners": -197,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.66333333333335,
      "p95FrameDurationMs": 16.699999999999818
    },
    {
      "name": "subgraph-dom-widget-clipping",
      "durationMs": 582.4109999999791,
      "styleRecalcs": 45,
      "styleRecalcDurationMs": 10.511999999999999,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 379.46999999999997,
      "heapDeltaBytes": -4640080,
      "heapUsedBytes": 47706484,
      "domNodes": -276,
      "jsHeapTotalBytes": 1175552,
      "scriptDurationMs": 113.766,
      "eventListeners": -197,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666666666666668,
      "p95FrameDurationMs": 16.799999999999727
    },
    {
      "name": "subgraph-dom-widget-clipping",
      "durationMs": 579.8950000000787,
      "styleRecalcs": 48,
      "styleRecalcDurationMs": 11.299,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 369.747,
      "heapDeltaBytes": -22316476,
      "heapUsedBytes": 47501836,
      "domNodes": -273,
      "jsHeapTotalBytes": 6180864,
      "scriptDurationMs": 111.973,
      "eventListeners": -193,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.66666666666665,
      "p95FrameDurationMs": 16.700000000000273
    },
    {
      "name": "subgraph-idle",
      "durationMs": 2052.336999999966,
      "styleRecalcs": 12,
      "styleRecalcDurationMs": 12.615000000000002,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 399.325,
      "heapDeltaBytes": -7319608,
      "heapUsedBytes": 62437388,
      "domNodes": -269,
      "jsHeapTotalBytes": 19812352,
      "scriptDurationMs": 16.351000000000003,
      "eventListeners": -199,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666666666666668,
      "p95FrameDurationMs": 16.700000000000728
    },
    {
      "name": "subgraph-idle",
      "durationMs": 2027.592000000027,
      "styleRecalcs": 11,
      "styleRecalcDurationMs": 8.524999999999999,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 370.135,
      "heapDeltaBytes": -7286948,
      "heapUsedBytes": 62630228,
      "domNodes": -272,
      "jsHeapTotalBytes": 19025920,
      "scriptDurationMs": 15.759000000000002,
      "eventListeners": -199,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666666666666668,
      "p95FrameDurationMs": 16.799999999999272
    },
    {
      "name": "subgraph-mouse-sweep",
      "durationMs": 1724.9820000000113,
      "styleRecalcs": 77,
      "styleRecalcDurationMs": 33.756,
      "layouts": 16,
      "layoutDurationMs": 4.119000000000001,
      "taskDurationMs": 602.084,
      "heapDeltaBytes": -4854580,
      "heapUsedBytes": 58775200,
      "domNodes": 62,
      "jsHeapTotalBytes": 15466496,
      "scriptDurationMs": 86.257,
      "eventListeners": 4,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666666666666668,
      "p95FrameDurationMs": 16.700000000000728
    },
    {
      "name": "subgraph-mouse-sweep",
      "durationMs": 1707.8470000000152,
      "styleRecalcs": 75,
      "styleRecalcDurationMs": 32.722,
      "layouts": 16,
      "layoutDurationMs": 3.9120000000000004,
      "taskDurationMs": 639.6800000000001,
      "heapDeltaBytes": 18659184,
      "heapUsedBytes": 70968396,
      "domNodes": -252,
      "jsHeapTotalBytes": 15855616,
      "scriptDurationMs": 82.91100000000002,
      "eventListeners": -199,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666666666666668,
      "p95FrameDurationMs": 16.700000000000728
    },
    {
      "name": "subgraph-transition-enter",
      "durationMs": 949.3290000000343,
      "styleRecalcs": 18,
      "styleRecalcDurationMs": 30.335999999999995,
      "layouts": 14,
      "layoutDurationMs": 14.586000000000002,
      "taskDurationMs": 721.175,
      "heapDeltaBytes": 29858400,
      "heapUsedBytes": 96888172,
      "domNodes": 13673,
      "jsHeapTotalBytes": 14417920,
      "scriptDurationMs": 24.717000000000002,
      "eventListeners": 2533,
      "totalBlockingTimeMs": 138,
      "frameDurationMs": 16.66333333333332,
      "p95FrameDurationMs": 16.800000000000182
    },
    {
      "name": "viewport-pan-sweep",
      "durationMs": 8157.893000000002,
      "styleRecalcs": 250,
      "styleRecalcDurationMs": 46.238,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 3873.3399999999997,
      "heapDeltaBytes": 24884980,
      "heapUsedBytes": 88439364,
      "domNodes": -274,
      "jsHeapTotalBytes": 1736704,
      "scriptDurationMs": 1722.2499999999998,
      "eventListeners": -183,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.669999999999952,
      "p95FrameDurationMs": 16.700000000000728
    },
    {
      "name": "viewport-pan-sweep",
      "durationMs": 8163.317000000006,
      "styleRecalcs": 250,
      "styleRecalcDurationMs": 48.108,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 3959.088,
      "heapDeltaBytes": 4998716,
      "heapUsedBytes": 65259520,
      "domNodes": -265,
      "jsHeapTotalBytes": 5959680,
      "scriptDurationMs": 1765.353,
      "eventListeners": -110,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.66333333333332,
      "p95FrameDurationMs": 16.700000000000728
    },
    {
      "name": "vue-large-graph-idle",
      "durationMs": 11148.814000000017,
      "styleRecalcs": 0,
      "styleRecalcDurationMs": 0,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 11136.982,
      "heapDeltaBytes": -39433716,
      "heapUsedBytes": 169160124,
      "domNodes": -3302,
      "jsHeapTotalBytes": 20680704,
      "scriptDurationMs": 823.697,
      "eventListeners": -16373,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 17.223333333333358,
      "p95FrameDurationMs": 16.799999999999272
    },
    {
      "name": "vue-large-graph-idle",
      "durationMs": 10640.557000000059,
      "styleRecalcs": 0,
      "styleRecalcDurationMs": 0,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 10628.255000000001,
      "heapDeltaBytes": -28253372,
      "heapUsedBytes": 167140880,
      "domNodes": -3300,
      "jsHeapTotalBytes": 12292096,
      "scriptDurationMs": 802.494,
      "eventListeners": -16380,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.66333333333326,
      "p95FrameDurationMs": 16.700000000000728
    },
    {
      "name": "vue-large-graph-pan",
      "durationMs": 14199.482999999986,
      "styleRecalcs": 65,
      "styleRecalcDurationMs": 15.179000000000025,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 14175.518,
      "heapDeltaBytes": -46706876,
      "heapUsedBytes": 173068248,
      "domNodes": -8314,
      "jsHeapTotalBytes": 19918848,
      "scriptDurationMs": 1125.055,
      "eventListeners": -16370,
      "totalBlockingTimeMs": 3,
      "frameDurationMs": 17.776666666666642,
      "p95FrameDurationMs": 16.799999999999272
    },
    {
      "name": "vue-large-graph-pan",
      "durationMs": 14677.569000000061,
      "styleRecalcs": 66,
      "styleRecalcDurationMs": 15.021000000000006,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 14658.376,
      "heapDeltaBytes": -48620504,
      "heapUsedBytes": 155066324,
      "domNodes": -3300,
      "jsHeapTotalBytes": 8126464,
      "scriptDurationMs": 1161.128,
      "eventListeners": -16366,
      "totalBlockingTimeMs": 8,
      "frameDurationMs": 17.776666666666642,
      "p95FrameDurationMs": 16.80000000000291
    },
    {
      "name": "workflow-execution",
      "durationMs": 502.89199999997436,
      "styleRecalcs": 18,
      "styleRecalcDurationMs": 23.708,
      "layouts": 4,
      "layoutDurationMs": 1.0190000000000001,
      "taskDurationMs": 206.90200000000004,
      "heapDeltaBytes": -21713920,
      "heapUsedBytes": 49284232,
      "domNodes": -161,
      "jsHeapTotalBytes": 4870144,
      "scriptDurationMs": 16.599,
      "eventListeners": -134,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666666666666682,
      "p95FrameDurationMs": 16.800000000000182
    },
    {
      "name": "workflow-execution",
      "durationMs": 450.7969999999659,
      "styleRecalcs": 18,
      "styleRecalcDurationMs": 21.66,
      "layouts": 4,
      "layoutDurationMs": 1.1380000000000001,
      "taskDurationMs": 104.706,
      "heapDeltaBytes": 4990948,
      "heapUsedBytes": 64722628,
      "domNodes": 157,
      "jsHeapTotalBytes": 4980736,
      "scriptDurationMs": 16.78,
      "eventListeners": 69,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666666666666682,
      "p95FrameDurationMs": 16.700000000000728
    }
  ]
}

@codecov

codecov Bot commented Jul 6, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 95.00000% with 1 line in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/composables/useUpstreamValue.ts 0.00% 1 Missing ⚠️
@@                   Coverage Diff                    @@
##             feature/ecs-migration   #13455   +/-   ##
========================================================
  Coverage                         ?   78.70%           
========================================================
  Files                            ?     1651           
  Lines                            ?   111016           
  Branches                         ?    40586           
========================================================
  Hits                             ?    87377           
  Misses                           ?    22786           
  Partials                         ?      853           
Flag Coverage Δ
unit 65.72% <95.00%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
src/composables/graph/useGraphNodeManager.ts 93.48% <ø> (ø)
src/lib/litegraph/src/LGraph.ts 91.47% <ø> (ø)
src/lib/litegraph/src/LGraphNode.ts 80.58% <ø> (ø)
src/lib/litegraph/src/subgraph/SubgraphInput.ts 89.51% <ø> (ø)
...rc/lib/litegraph/src/subgraph/SubgraphInputNode.ts 79.87% <ø> (ø)
src/lib/litegraph/src/types/graphTriggers.ts 100.00% <ø> (ø)
src/renderer/core/canvas/canvasStore.ts 83.72% <100.00%> (ø)
...derer/extensions/vueNodes/components/NodeSlots.vue 88.52% <100.00%> (ø)
...sions/vueNodes/composables/usePartitionedBadges.ts 97.01% <100.00%> (ø)
...nsions/vueNodes/composables/useProcessedWidgets.ts 90.37% <ø> (ø)
... and 2 more
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@DrJKL
DrJKL force-pushed the drjkl/the-mirror-crackd branch from c1f9c5d to 20fef21 Compare July 6, 2026 20:11
@DrJKL
DrJKL force-pushed the drjkl/the-body-in-the-library branch from 1466cd2 to fe199d2 Compare July 6, 2026 20:16
@DrJKL
DrJKL force-pushed the drjkl/the-mirror-crackd branch from 20fef21 to d072488 Compare July 6, 2026 20:51
@DrJKL
DrJKL force-pushed the drjkl/the-body-in-the-library branch from fe199d2 to a6b9d4e Compare July 6, 2026 20:51
@DrJKL DrJKL added the refactor label Jul 6, 2026
@DrJKL
DrJKL marked this pull request as ready for review July 7, 2026 06:41
@dosubot dosubot Bot added the size:L This PR changes 100-499 lines, ignoring generated files. label Jul 7, 2026
@DrJKL
DrJKL force-pushed the drjkl/the-mirror-crackd branch from d072488 to 67948e9 Compare July 10, 2026 20:26
Base automatically changed from drjkl/the-mirror-crackd to feature/ecs-migration July 11, 2026 01:04
@dosubot dosubot Bot added size:XXL This PR changes 1000+ lines, ignoring generated files. and removed size:L This PR changes 100-499 lines, ignoring generated files. labels Jul 11, 2026
DrJKL and others added 5 commits July 10, 2026 18:08
NodeSlots.linkedWidgetedInputs, usePartitionedBadges, and trackNodePrice
queried the input.link slot mirror, which only stayed reactive through
the node:slot-links:changed -> refreshNodeInputs reprojection. All three
now query linkStore.isInputSlotConnected by root graph id and slot
index, so the slot-links handler and the emitter-less
node:slot-errors:changed handler are deleted.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The refresh-all loop existed to poke inputs[].link readers after a
neighbor's links were torn down. Those readers now query linkStore,
which unregisters link state reactively during removal, so the loop and
refreshNodeInputs go. Verified against the vue-nodes legacy widget e2e
spec that motivated the loop.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Decisions 1 (single NodeState object, proxy-returning registration) is
agreed; field set, slot scope, and consumer contract are drafted pending
review. Records the shipped inputs[].link reader migration.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Review follow-ups: drop comments that paraphrased the call, type the
graphId params as UUID, unify the undefined guard, hoist the mocked
graph id, and thread the shared pinia through renderUnified.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Badges go straight to plain BadgeData rows in a dedicated store,
written by a reactive badge system; core badges materialize as rows
too, killing the dual derivation and positional slice(1). Adds badge
vocabulary to the domain glossary and repoints the node-data-store
badges row.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@DrJKL
DrJKL force-pushed the drjkl/the-body-in-the-library branch from a6b9d4e to 4fab502 Compare July 11, 2026 02:02
@dosubot dosubot Bot added size:L This PR changes 100-499 lines, ignoring generated files. and removed size:XXL This PR changes 1000+ lines, ignoring generated files. labels Jul 11, 2026
- canvasStore.rootGraphId computed replaces per-site
  canvas?.graph?.rootGraph.id chains (non-reactive .graph reads)
- delete node:slot-links:changed and node:slot-errors:changed
  outright: emitters, event map, types (zero listeners; badge
  system reads linkStore)
- dedupe usePartitionedBadges inline pricing block into
  trackNodePrice; narrow nodeDataUtils params to Pick
- test hygiene: seed real canvasStore instead of module mocks,
  drop redundant NodeSlots/nodeDataUtils tests, cover
  SubgraphInput connect via linkedWidgetedInputs
@dosubot dosubot Bot added size:XL This PR changes 500-999 lines, ignoring generated files. and removed size:L This PR changes 100-499 lines, ignoring generated files. labels Jul 11, 2026
@DrJKL
DrJKL force-pushed the drjkl/the-body-in-the-library branch from 7754105 to abe1cf7 Compare July 13, 2026 16:47
configure() reassigns the graph id in place on every workflow load, but
canvasStore.rootGraphId memoized the untracked field read, so every
consumer keyed widget/link store queries by the previous workflow's id
and Vue node widgets vanished after loading a workflow.
@DrJKL
DrJKL force-pushed the drjkl/the-body-in-the-library branch from abe1cf7 to c757a23 Compare July 13, 2026 17:09

@christian-byrne christian-byrne left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issue: the PR description claims to "migrate the last inputs[].link mirror readers to linkStore queries," but buildJsonataContext in useNodePricing.ts still reads slot?.link != null (line 255) and inp.link != null (line 265) to build the evaluation context sent to the pricing engine. trackNodePrice in usePartitionedBadges now triggers on linkStore changes, but the actual price computation still reads the mirror field. The two sources can diverge during subgraph load ordering: reactive tracking fires, a new price is computed, but buildJsonataContext reads stale inp.link data.

import { isSlotObject } from '@/utils/typeGuardUtil'
import type { UUID } from '@/utils/uuid'

function coerceINodeSlot(input: INodeInputSlot): INodeSlot {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

question: when a computed first evaluates isInputSlotConnected(graphId, nodeId, slot) before any link for that graphId has been registered (bucket absent), targetIndex.value.get(graphId) returns undefined and short-circuits before reaching the reactive inner Map. Because targetIndex is ref<Map<...>> (not reactive(Map)), calling .get() on the unwrapped outer Map does not register a key-access Vue dependency. If the bucket is created later (first link for that graphId), does the calling computed re-run? The existing tests all seed useLinkStore() before the computed is first read, sidestepping this ordering. A test where the computed reads isInputSlotConnected before any link for that graph exists -- then a link is added -- would either confirm or expose this gap.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ref(new Map()) deep-wraps its value via reactive(), so targetIndex.value is a reactive Map proxy, not a raw Map. Vue's collection instrumentation tracks get/has per key even when the key is absent, and .set of a new key fires an ADD trigger for that key. A computed that reads isInputSlotConnected before any link for that graph exists registers a dep on the missing bucket key and re-runs when the first link creates it.

Confirmed with the test you described: computed reads absent bucket, returns false; registerLink re-evaluates to true; same for an absent key in an existing bucket; deleteLink invalidates back. Added to linkStore.test.ts (eab43ec). Mutation-checked: downgrading targetIndex to shallowRef fails it.

])

id: UUID = zeroUuid
/**

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion: (non-blocking) LGraph now imports shallowRef/toRaw from Vue to back id with a reactive ref, coupling a core domain/engine class to Vue's reactivity at instantiation time. Two alternatives that would avoid the import: (a) dispatch a domain event on id change that canvasStore observes and writes into a Vue ref it owns, or (b) make configure() replace the graph instance so currentGraph (the existing shallowRef<LGraph>) triggers naturally without any Vue import in litegraph. If the current approach is intentional interim debt, trim the 5-line JSDoc explaining how toRaw works down to one line explaining why the shallowRef exists (so workflow-load id reassignment propagates to store buckets).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGraphNode/LGraphCanvas already import from vue, and LGraph.clear() already calls useLinkStore/useWidgetValueStore. On (b): configure() mutates the instance in place, so swapping instances touches every graph-reference holder. (a) adds an event plus observer for what one shallowRef does.

Took the JSDoc trim (352b1da): one line on why the ref exists.

newValue: unknown
}
'node:slot-errors:changed': { nodeId: SerializedNodeId }
'node:slot-links:changed': {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion: (non-blocking) node:slot-links:changed was only 47 days old (PR #12197, 2026-05-27) and is now hard-removed from LGraphTriggerActions. The "zero emitters repo-wide" scan covered internal code -- external custom nodes that used this event for cross-component coordination now silently no-op when they call graph.trigger('node:slot-links:changed', ...) (trigger validates against the actions array). Consider either a one-cycle deprecation shim with a console warning, or a changelog/migration note for extension authors.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

trigger() already silently drops unknown actions (if (!isLGraphTriggerAction(action)) return), so external callers of the removed event get the same no-op as any unknown string. No new failure mode. The event lived 47 days as internal badge plumbing, never documented as extension API. A shim would resurrect the plumbing this PR deletes.

export function linkedWidgetedInputs(
nodeData: VueNodeData | undefined
nodeData: Pick<VueNodeData, 'id' | 'inputs'> | undefined,
graphId: UUID | undefined

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion: (non-blocking) linkedWidgetedInputs(nodeData, graphId) now has a required second parameter. Any caller passing only nodeData (including extension code via dynamic import) gets a TypeScript error or silently returns empty array. Making graphId?: UUID optional (falling back to the existing early-return empty path) would preserve call-site compatibility at no cost.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Keeping it required. Every caller passes it (NodeSlots.vue passes rootGraphId; tests pass it explicitly), and nodeDataUtils isn't reachable from the extension API surface. Optional would trade a compile error for a silent [] when a future caller forgets to thread graphId, the failure mode this refactor removes.

@@ -36,7 +61,8 @@ export function trackNodePrice(node: TrackableNode) {
getInputNames,
getNodeRevisionRef

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion: (non-blocking) trackNodePrice is exported and currently consumed by two call sites: usePartitionedBadges and PartnerNodesList.vue. The node-badge design doc (Decision 3) says this function "moves inside the BadgeSystem." Exporting it now means the eventual centralization must coordinate two external consumers rather than one -- it widens the coupling it says will be removed. Consider keeping it internal to usePartitionedBadges until the BadgeSystem lands; PartnerNodesList can get pricing data from the badge store at that point.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Both the export and the PartnerNodesList consumer pre-date this PR (both unchanged from main). Un-exporting now would leave PartnerNodesList without a pricing source until the badge store exists. Centralization is the stack: #13458 introduces nodeBadgeStore, #13460 cuts renderers over to store rows; PartnerNodesList migrates then.

const widgetStore = useWidgetValueStore()
const graphId = app.canvas?.graph?.rootGraph.id
const graphId = useCanvasStore().rootGraphId
if (relevantNames.length > 0 && node.id != null) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

question: trackNodePrice calls useCanvasStore().rootGraphId to obtain graphId. If rootGraphId is undefined when unpartitionedBadges first evaluates (canvas not yet set), touchPricingInputConnectivity returns early without touching reactive state -- no isInputSlotConnected dependency is registered for those nodes. The computed re-runs when rootGraphId becomes non-null. Is there a scenario (subgraph load ordering, deferred canvas assignment) where the reactive chain is established too late and pricing badges show stale connectivity for a frame or more?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Transiently stale, self-healing, no lost frames beyond the re-run. For dynamic-pricing nodes, trackNodePrice reads useCanvasStore().rootGraphId before the undefined guards (usePartitionedBadges.ts:74), so even when it's undefined the badge computed registers a dep on it. When the canvas is set, or a workflow load reassigns the id (reactive as of this PR), the computed re-runs and touchPricingInputConnectivity registers the isInputSlotConnected deps. Verified with a test: rootGraphId undefined, evaluate, set graph, re-run, register relevant link, re-run again.

On subgraph ordering: registration and query use the same key. registerLinkTopology keys by graph.rootGraph.id (LLink.ts:623), including for subgraphs, and Subgraph.rootGraph resolves through nesting. Root configure() assigns the id before links are added, so links never land under a different key than the one queried.

import { toLinkId } from '@/types/linkId'
import { toNodeId } from '@/types/nodeId'

const GRAPH_ID = 'graph-test'

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion: (non-blocking) the trackNodePrice re-run test connects slot 0 (image) which the mock declares relevant. A bug that inverted the relevance filter (!inputNames.includes) would still pass: the "irrelevant input does not re-run" assertion tests other separately, but there is no assertion within the connect/disconnect test that connecting a non-relevant slot first does not increment runs. Adding that check makes the filter's correctness load-bearing in this test rather than incidental.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The inversion (!inputNames.includes) fails both existing tests. "does not re-run when an irrelevant input connects": inverted filter makes other relevant, runs goes to 2, expect(1) fails. "re-runs when a pricing-relevant input connects": the connect assertion passes incidentally (the first read tracks the absent bucket key, so bucket creation re-runs it), but the disconnect assertion fails (expect(3), stays 2). The mutant is caught today; an intra-test assertion would duplicate the second test. Can add it if you want each test standing alone.


const currentGraph = shallowRef<LGraph | null>(null)
const rootGraphId = computed(() => currentGraph.value?.rootGraph.id)
const isInSubgraph = ref(false)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

question: rootGraphId = computed(() => currentGraph.value?.rootGraph.id). Since currentGraph is shallowRef<LGraph>, Vue only tracks the top-level .value -- not deep property reads off that object. The computed only gets a dependency on LGraph._id because the class getter calls toRaw(this)._id.value, and a shallowRef.value read inside a computed registers a dep even on the raw object. This chain works today, but it is a non-local invariant: if toRaw is ever removed from the getter, or rootGraph is not the same object as the LGraph instance, the computed silently stops updating. A test that verifies rootGraphId updates when rootGraph.id is reassigned without currentGraph being swapped would make this invariant regression-proof.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That test exists: canvasStore.test.ts:127-143. It sets the canvas once, never swaps currentGraph, and calls graph.configure({...serialize(), id: workflowId}), which reassigns id in place on the same instance. Mutation-tested: replacing the _id shallowRef with a plain field fails the test with a stale cached value, so it exercises computed invalidation, not a fresh getter read.

On toRaw: currentGraph is a shallowRef, so graphs are raw instances where toRaw is identity (no reactive()-wrapped graph exists in src/). If a graph were ever read through a reactive proxy, a missing toRaw surfaces as id === undefined (ref auto-unwrap), loud rather than stale. It's defensive, per the comment above the getter.

toRaw(this)._id.value = value
}

revision: number = 0

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

question: the node-removal refresh-all loop was the fix for #5834 (widgets not disabling when linked). Tracing the actual disable path: buildSlotMetadata -> linkStore.getInputSlotLink is independently reactive, so the loop deletion is correct if _removeLink is always called during node removal. The deleted node:slot-links:changed triggers were at sites where input.link = null is written. Are there any disconnect paths that write input.link = null without going through link_info.disconnect(graph, ...) -> _removeLink? If so, the linkStore would retain a stale entry and the widget-disable computed would show the widget as still-disabled after the upstream node is removed.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Audited every .link = write in src/, not just litegraph. Three categories, all safe:

  • Paired with LLink.disconnect(): disconnectInput, disconnectOutput (both branches, including missing-target), SubgraphInputNode._disconnectNodeInput. disconnect() → unregisterLinkTopology → linkStore.deleteLink. (_removeLink duplicates the same cleanup for linkDeduplication/linkFixer.)
  • Endpoint moves without disconnect (useNodeReplacement, dynamicWidgets, subgraph boundary re-pointing): these mutate link.target_id/target_slot, which are accessors routing through updateEndpoint, so the store re-keys old to new atomically.
  • Serialized/cloned plain data (unpackSubgraph clone data, node.clone(), migrateReroute, linkFixer on ISerialisedGraph): never registered, can't strand entries.

LGraph.remove disconnects every connected input and output, removes floating links, and on last-instance subgraph-node removal calls unregisterAllLinkTopologies. Undo/redo goes through configure() without keep_old, which runs clear() and wipes the root graph's bucket via linkStore.clearGraph. Verified by test: removing an upstream node (including fan-out to two consumers) leaves getInputSlotLink undefined and the widget-disable computed re-enables. The #5834 path holds without the refresh-all loop.

@@ -0,0 +1,145 @@
# Node Data Store

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nitpick: (non-blocking) both node-data-store.md and node-badge-store.md mix shipped decisions (Decision 3, marked "Shipped ahead of the store itself 2026-07-05") with unimplemented future work in the same document without a clear boundary. Future contributors reading these as an architecture reference may treat aspirational decisions as live constraints. A "Current State / Shipped" section before "Planned" sections, or a prominent "Draft -- partially implemented" callout at the top, would help. Also: the "Supporting Documents" table in ADR 0008 lists link-topology-store.md and reroute-chain-store.md but not these two new docs.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I plan on trimming or deleting a lot of the docs before merging the feature branch in.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also noting the ADR 0008 supporting-docs table gap: gets fixed if these docs survive the pre-merge trim.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/renderer/extensions/vueNodes/composables/usePartitionedBadges.ts (1)

56-63: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

trackNodePrice export still widens BadgeSystem-migration coupling.

Still exported and consumed by two call sites (usePartitionedBadges here, and PartnerNodesList.vue). The badge design doc's Decision 3 states this function moves inside the BadgeSystem — keeping it exported now means centralization later has to coordinate two external consumers instead of one.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/renderer/extensions/vueNodes/composables/usePartitionedBadges.ts` around
lines 56 - 63, Remove the public export from trackNodePrice and update its
consumers in usePartitionedBadges and PartnerNodesList.vue to access the
behavior through the BadgeSystem-owned interface instead. Keep the pricing
behavior unchanged while ensuring only BadgeSystem remains coupled to the
implementation.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@docs/architecture/node-badge-store.md`:
- Line 37: Label the code fences containing BadgeData in
docs/architecture/node-badge-store.md (line 37) and NodeState in
docs/architecture/node-data-store.md (line 28) with the TypeScript language
identifier, using ts or typescript.

In `@docs/architecture/node-data-store.md`:
- Around line 69-80: The migration description in the architecture documentation
overstates removal of inputs[].link readers and slot-link trigger contracts.
Narrow the claim to the renderer paths actually migrated, and explicitly
document that useNodePricing.buildJsonataContext still reads input.link while
its emitters and trigger types remain retained.

In `@src/renderer/extensions/vueNodes/utils/nodeDataUtils.ts`:
- Around line 30-33: Update the linkedWidgetedInputs function signature so
graphId is an optional UUID parameter, allowing callers to omit it while
preserving the existing early-return behavior for undefined graph IDs.

---

Outside diff comments:
In `@src/renderer/extensions/vueNodes/composables/usePartitionedBadges.ts`:
- Around line 56-63: Remove the public export from trackNodePrice and update its
consumers in usePartitionedBadges and PartnerNodesList.vue to access the
behavior through the BadgeSystem-owned interface instead. Keep the pricing
behavior unchanged while ensuring only BadgeSystem remains coupled to the
implementation.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 92fd3370-d3d6-4bf0-a7c5-4e40bb6569cd

📥 Commits

Reviewing files that changed from the base of the PR and between 368b5be and 352b1da.

📒 Files selected for processing (23)
  • docs/architecture/domain-glossary.md
  • docs/architecture/node-badge-store.md
  • docs/architecture/node-data-store.md
  • src/composables/graph/useGraphNodeManager.test.ts
  • src/composables/graph/useGraphNodeManager.ts
  • src/composables/useUpstreamValue.ts
  • src/lib/litegraph/src/LGraph.ts
  • src/lib/litegraph/src/LGraphNode.ts
  • src/lib/litegraph/src/infrastructure/LGraphEventMap.ts
  • src/lib/litegraph/src/subgraph/SubgraphInput.ts
  • src/lib/litegraph/src/subgraph/SubgraphInputNode.ts
  • src/lib/litegraph/src/types/graphTriggers.ts
  • src/renderer/core/canvas/canvasStore.test.ts
  • src/renderer/core/canvas/canvasStore.ts
  • src/renderer/extensions/vueNodes/components/NodeSlots.test.ts
  • src/renderer/extensions/vueNodes/components/NodeSlots.vue
  • src/renderer/extensions/vueNodes/components/NodeWidgets.test.ts
  • src/renderer/extensions/vueNodes/composables/usePartitionedBadges.test.ts
  • src/renderer/extensions/vueNodes/composables/usePartitionedBadges.ts
  • src/renderer/extensions/vueNodes/composables/useProcessedWidgets.test.ts
  • src/renderer/extensions/vueNodes/composables/useProcessedWidgets.ts
  • src/renderer/extensions/vueNodes/utils/__tests__/nodeDataUtils.test.ts
  • src/renderer/extensions/vueNodes/utils/nodeDataUtils.ts
💤 Files with no reviewable changes (5)
  • src/lib/litegraph/src/subgraph/SubgraphInputNode.ts
  • src/lib/litegraph/src/subgraph/SubgraphInput.ts
  • src/lib/litegraph/src/infrastructure/LGraphEventMap.ts
  • src/composables/graph/useGraphNodeManager.ts
  • src/lib/litegraph/src/types/graphTriggers.ts


The store holds only plain data (ADR 0008 component rule):

```

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Add languages to the architecture-document code fences.

  • docs/architecture/node-badge-store.md#L37-L37: label the BadgeData fence as ts or typescript.
  • docs/architecture/node-data-store.md#L28-L28: label the NodeState fence as ts or typescript.
🧰 Tools
🪛 markdownlint-cli2 (0.23.0)

[warning] 37-37: Fenced code blocks should have a language specified

(MD040, fenced-code-language)

📍 Affects 2 files
  • docs/architecture/node-badge-store.md#L37-L37 (this comment)
  • docs/architecture/node-data-store.md#L28-L28
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/architecture/node-badge-store.md` at line 37, Label the code fences
containing BadgeData in docs/architecture/node-badge-store.md (line 37) and
NodeState in docs/architecture/node-data-store.md (line 28) with the TypeScript
language identifier, using ts or typescript.

Source: Linters/SAST tools

Comment on lines +69 to +80
What this phase does remove is the last `inputs[].link` dependency: the
three remaining readers (`nodeDataUtils.linkedWidgetedInputs` used by
`NodeSlots`, and `usePartitionedBadges`' badge computed plus its
exported `trackNodePrice`) move to `linkStore.isInputSlotConnected`
queries — presence is all any of them needed — which deletes the
`node:slot-links:changed` → `refreshNodeInputs` reprojection in
`useGraphNodeManager`, the dead `node:slot-errors:changed` handler
(zero emitters repo-wide), and the node-removal refresh-all loop.
With their last listeners gone, both trigger actions are deleted
outright — emitters, event-map entries, and types (the badge system
sources connectivity from `linkStore`, not events; resurrect from git
if a consumer ever materialises). Readers get the root graph id from

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick win

Align the migration claim with the retained contracts.

This section says the last inputs[].link readers and slot-link trigger contracts are deleted, but the PR retains computation-path reads in useNodePricing.buildJsonataContext, the input.link emitters, and their trigger types. Narrow the claim to the renderer paths actually migrated and document the retained paths.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/architecture/node-data-store.md` around lines 69 - 80, The migration
description in the architecture documentation overstates removal of
inputs[].link readers and slot-link trigger contracts. Narrow the claim to the
renderer paths actually migrated, and explicitly document that
useNodePricing.buildJsonataContext still reads input.link while its emitters and
trigger types remain retained.

DrJKL added 2 commits July 14, 2026 12:50
Computed reads of isInputSlotConnected before a graph bucket exists must
re-evaluate when the first link registers. Fails if targetIndex is
downgraded to shallowRef.
@DrJKL

DrJKL commented Jul 14, 2026

Copy link
Copy Markdown
Contributor Author

Re: the buildJsonataContext trigger/value split flagged in the review body — the lines 255/265 reads are unchanged from main; this PR only migrated the tracking reads in trackNodePrice. The split exists only between this PR and #13498, which converts both lines to node.isInputConnected(index) when the input.link mirror is deleted. Gone before feature/ecs-migration merges.

Description updated: "last mirror readers" now reads "mirror-based reactivity tracking", and the "Not removed" list names the buildJsonataContext reads with the #13498 pointer.

@
refactor: require nodeData and graphId in linkedWidgetedInputs

Callers already guard both; optional params hid missing-graph bugs
behind a silent empty return.
@
@DrJKL
DrJKL requested a review from christian-byrne July 14, 2026 20:22
@DrJKL
DrJKL merged commit 0d4df04 into feature/ecs-migration Jul 14, 2026
47 checks passed
@DrJKL
DrJKL deleted the drjkl/the-body-in-the-library branch July 14, 2026 21:27
@github-actions github-actions Bot locked and limited conversation to collaborators Jul 14, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

refactor size:XL This PR changes 500-999 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants