Skip to content

feat: nodeBadgeStore + badge system (slice A) - #13458

Merged
DrJKL merged 12 commits into
feature/ecs-migrationfrom
drjkl/a-badge-is-announced
Jul 15, 2026
Merged

DrJKL merged 12 commits into
feature/ecs-migrationfrom
drjkl/a-badge-is-announced

Conversation

@DrJKL

@DrJKL DrJKL commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Summary

Extracts node badges into a dedicated store per ADR 0008 — slice A of docs/architecture/node-badge-store.md: store, plain BadgeData rows, reactive badge system, and LGraph chokepoint registration. Stacked on #13455.

Changes

  • What:
    • src/types/badgeData.ts — plain BadgeData { kind, text, fgColor?, bgColor?, iconKey? } rows (decision 1).
    • src/stores/nodeBadgeStore.ts — root-scoped buckets keyed by NodeId, kind-ordered reads, identity-checked row deletes, registerNode/unregisterNode/clearGraph registration trio; row writes refused for unregistered nodes (decision 2).
    • src/systems/badgeSystem.ts — pure computeBadges(sources) + effect-scope-per-node shell watching registeredNodeIds; writes core and credits rows from nodeDef/settings/palette/pricing/widget-value/link-connectivity sources (decisions 3–4).
    • LGraph.add/remove/clear + subgraph-definition GC maintain the store registration (linkStore/rerouteStore convention).
    • Design record updated with implementation notes.
  • Breaking: none yet — node.badges/useNodeBadge closures untouched; nothing starts the system in production until slice B's consumer cutover.

Review Focus

  • Registration is bucket-key presence; the system discovers nodes by watching registeredNodeIds, so litegraph never imports pricing/nodeDef modules (no import cycle via the litegraph barrel).
  • Core rows are fine-grained (lifecycle, id, source) under one visibility rule — unification notes in the design record (Vue gains HideBuiltIn on id badges; legacy join/truncation becomes slice-B draw-cache presentation).
  • Subgraph credits aggregation, the legacy node.badges surface, and badgePosition are open decisions in the design record and deliberately not in this PR.
  • Slice A+B together would exceed the ~300-line guideline, hence the split; store row APIs (registerBadge/deleteBadge) land now because the slice-B shim consumes them.

🤖 Generated with Claude Code

@coderabbitai

coderabbitai Bot commented Jul 6, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 8ab38947-0e16-45bf-81a7-dd231bdb4d90

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • ✅ Review completed - (🔄 Check again to review again)
📝 Walkthrough

Walkthrough

Adds graph-scoped node badge storage, LiteGraph lifecycle registration, reactive core and credits badge generation, pricing updates, test coverage, Pinia test setup, and slice A architecture documentation.

Changes

Node badge infrastructure

Layer / File(s) Summary
Badge data contract and store
src/types/badgeData.ts, src/stores/nodeBadgeStore.ts, src/stores/nodeBadgeStore.test.ts
Defines badge kinds and presentation data, then adds graph- and node-scoped storage with ordered reads, kind replacement, registration, deletion, and clearing behavior.
Graph lifecycle registration
src/lib/litegraph/src/LGraph.ts, src/lib/litegraph/src/LGraph.badges.test.ts
Registers nodes when added and unregisters nodes, subgraph contents, and graph buckets during removal or clearing.
Reactive badge computation and maintenance
src/systems/badgeSystem.ts, src/systems/badgeSystem.test.ts, docs/architecture/node-badge-store.md
Computes visible core and credits rows, tracks pricing-related reactive inputs, maintains per-node effect scopes, and documents slice A behavior.
Pinia-backed test setup
src/components/graph/widgets/domWidgetZIndex.test.ts, src/lib/litegraph/src/*.test.ts, src/utils/litegraphUtil.test.ts
Initializes an active testing Pinia instance for affected test suites.

Estimated code review effort: 4 (Complex) | ~45 minutes

Sequence Diagram(s)

sequenceDiagram
  participant LGraph
  participant useNodeBadgeStore
  participant startBadgeSystem
  participant gatherSources
  participant computeBadges
  LGraph->>useNodeBadgeStore: registerNode(graphId, nodeId)
  startBadgeSystem->>useNodeBadgeStore: watch registeredNodeIds(graphId)
  startBadgeSystem->>gatherSources: resolve node badge sources
  gatherSources->>computeBadges: project visible rows
  computeBadges->>useNodeBadgeStore: update core and credits rows
Loading

Suggested reviewers: christian-byrne, austinmroz, codejuggernaut


Important

Pre-merge checks failed

Please resolve all errors before merging. Addressing warnings is optional.

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
End-To-End Regression Coverage For Fixes ❓ Inconclusive Commit subjects/title are not available here, so I can’t reliably tell whether the PR uses bug-fix language. Please provide the PR title and commit subjects (or confirm there is no bug-fix language) so I can apply the regression-test rule.
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title is concise and accurately summarizes the main change: slice A of the node badge store and badge system.
Description check ✅ Passed The description covers Summary, Changes, and Review Focus; only the optional Screenshots section is missing.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Adr Compliance For Entity/Litegraph Changes ✅ Passed PASS: The diff only wires badge-store registration into existing LGraph chokepoints and adds plain store/system code; no new entity APIs, callbacks, or mutable spatial fields were introduced.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch drjkl/a-badge-is-announced

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

@github-actions

github-actions Bot commented Jul 6, 2026 •

Copy link
Copy Markdown
Contributor

🎭 Playwright: ✅ 1694 passed, 0 failed · 1 flaky

📊 Browser Reports
  • chromium: View Report (✅ 1673 / ❌ 0 / ⚠️ 1 / ⏭️ 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)

🎨 Storybook: ✅ Built — View Storybook

Details

⏰ Completed at: 07/15/2026, 01:10:51 AM UTC

Links

📦 Bundle Size

⏳ Size data collection in progress…

⚡ Performance Report

canvas-idle: · 60.0 avg FPS · 59.5 P5 FPS ✅ (target: ≥52) · 0ms TBT · 57.6 MB heap
canvas-mouse-sweep: · 60.0 avg FPS · 59.5 P5 FPS ✅ (target: ≥52) · 0ms TBT · 54.7 MB heap
canvas-zoom-sweep: · 60.0 avg FPS · 59.9 P5 FPS ✅ (target: ≥52) · 0ms TBT · 61.3 MB heap
dom-widget-clipping: · 60.0 avg FPS · 59.9 P5 FPS ✅ (target: ≥52) · 0ms TBT · 54.2 MB heap
large-graph-idle: · 60.0 avg FPS · 59.5 P5 FPS ✅ (target: ≥52) · 0ms TBT · 58.2 MB heap
large-graph-pan: · 60.0 avg FPS · 59.9 P5 FPS ✅ (target: ≥52) · 0ms TBT · 65.4 MB heap
large-graph-zoom: · 60.0 avg FPS · 59.7 P5 FPS ✅ (target: ≥52) · 0ms TBT · 65.4 MB heap
minimap-idle: · 60.0 avg FPS · 59.9 P5 FPS ✅ (target: ≥52) · 0ms TBT · 55.9 MB heap
subgraph-dom-widget-clipping: · 60.0 avg FPS · 59.7 P5 FPS ✅ (target: ≥52) · 0ms TBT · 64.4 MB heap
subgraph-idle: · 60.0 avg FPS · 59.5 P5 FPS ✅ (target: ≥52) · 0ms TBT · 60.0 MB heap
subgraph-mouse-sweep: · 60.0 avg FPS · 59.7 P5 FPS ✅ (target: ≥52) · 0ms TBT · 50.8 MB heap
subgraph-transition-enter: · 60.0 avg FPS · 59.9 P5 FPS ✅ (target: ≥52) · 149ms TBT · 86.4 MB heap
viewport-pan-sweep: · 60.0 avg FPS · 59.9 P5 FPS ✅ (target: ≥52) · 0ms TBT · 60.5 MB heap
vue-large-graph-idle: · 58.1 avg FPS · 59.5 P5 FPS ✅ (target: ≥52) · 0ms TBT · 161.1 MB heap
vue-large-graph-pan: · 58.1 avg FPS · 59.9 P5 FPS ✅ (target: ≥52) · 20ms TBT · 152.4 MB heap
workflow-execution: · 60.0 avg FPS · 59.7 P5 FPS ✅ (target: ≥52) · 0ms TBT · 55.3 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 6ms
canvas-idle: layout count 0
canvas-idle: style recalc count 8
canvas-idle: task duration 393ms
canvas-idle: script duration 21ms
canvas-idle: TBT 0ms
canvas-idle: heap used 57.6 MB
canvas-idle: DOM nodes -135
canvas-idle: event listeners -97
canvas-mouse-sweep: avg frame time 17ms
canvas-mouse-sweep: p95 frame time 17ms
canvas-mouse-sweep: layout duration 4ms
canvas-mouse-sweep: style recalc duration 37ms
canvas-mouse-sweep: layout count 12
canvas-mouse-sweep: style recalc count 73
canvas-mouse-sweep: task duration 764ms
canvas-mouse-sweep: script duration 124ms
canvas-mouse-sweep: TBT 0ms
canvas-mouse-sweep: heap used 54.7 MB
canvas-mouse-sweep: DOM nodes -91
canvas-mouse-sweep: event listeners -98
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 17ms
canvas-zoom-sweep: layout count 6
canvas-zoom-sweep: style recalc count 33
canvas-zoom-sweep: task duration 323ms
canvas-zoom-sweep: script duration 24ms
canvas-zoom-sweep: TBT 0ms
canvas-zoom-sweep: heap used 61.3 MB
canvas-zoom-sweep: DOM nodes -73
canvas-zoom-sweep: event listeners -83
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 9ms
dom-widget-clipping: layout count 0
dom-widget-clipping: style recalc count 12
dom-widget-clipping: task duration 361ms
dom-widget-clipping: script duration 58ms
dom-widget-clipping: TBT 0ms
dom-widget-clipping: heap used 54.2 MB
dom-widget-clipping: DOM nodes -281
dom-widget-clipping: event listeners -203
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 9ms
large-graph-idle: layout count 0
large-graph-idle: style recalc count 11
large-graph-idle: task duration 642ms
large-graph-idle: script duration 230ms
large-graph-idle: TBT 0ms
large-graph-idle: heap used 58.2 MB
large-graph-idle: DOM nodes -124
large-graph-idle: event listeners -97
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 1204ms
large-graph-pan: script duration 553ms
large-graph-pan: TBT 0ms
large-graph-pan: heap used 65.4 MB
large-graph-pan: DOM nodes -277
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 7ms
large-graph-zoom: style recalc duration 17ms
large-graph-zoom: layout count 60
large-graph-zoom: style recalc count 64
large-graph-zoom: task duration 1486ms
large-graph-zoom: script duration 716ms
large-graph-zoom: TBT 0ms
large-graph-zoom: heap used 65.4 MB
large-graph-zoom: DOM nodes 10
large-graph-zoom: event listeners 8
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 628ms
minimap-idle: script duration 229ms
minimap-idle: TBT 0ms
minimap-idle: heap used 55.9 MB
minimap-idle: DOM nodes -270
minimap-idle: event listeners -197
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 364ms
subgraph-dom-widget-clipping: script duration 120ms
subgraph-dom-widget-clipping: TBT 0ms
subgraph-dom-widget-clipping: heap used 64.4 MB
subgraph-dom-widget-clipping: DOM nodes -135
subgraph-dom-widget-clipping: event listeners -96
subgraph-idle: avg frame time 17ms
subgraph-idle: p95 frame time 17ms
subgraph-idle: layout duration 0ms
subgraph-idle: style recalc duration 9ms
subgraph-idle: layout count 0
subgraph-idle: style recalc count 10
subgraph-idle: task duration 334ms
subgraph-idle: script duration 15ms
subgraph-idle: TBT 0ms
subgraph-idle: heap used 60.0 MB
subgraph-idle: DOM nodes 19
subgraph-idle: event listeners 4
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 36ms
subgraph-mouse-sweep: layout count 16
subgraph-mouse-sweep: style recalc count 77
subgraph-mouse-sweep: task duration 661ms
subgraph-mouse-sweep: script duration 88ms
subgraph-mouse-sweep: TBT 0ms
subgraph-mouse-sweep: heap used 50.8 MB
subgraph-mouse-sweep: DOM nodes -85
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 16ms
subgraph-transition-enter: style recalc duration 32ms
subgraph-transition-enter: layout count 14
subgraph-transition-enter: style recalc count 18
subgraph-transition-enter: task duration 816ms
subgraph-transition-enter: script duration 27ms
subgraph-transition-enter: TBT 149ms
subgraph-transition-enter: heap used 86.4 MB
subgraph-transition-enter: DOM nodes 12228
subgraph-transition-enter: event listeners 844
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 50ms
viewport-pan-sweep: layout count 0
viewport-pan-sweep: style recalc count 250
viewport-pan-sweep: task duration 4251ms
viewport-pan-sweep: script duration 1855ms
viewport-pan-sweep: TBT 0ms
viewport-pan-sweep: heap used 60.5 MB
viewport-pan-sweep: DOM nodes -270
viewport-pan-sweep: event listeners -151
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 12224ms
vue-large-graph-idle: script duration 903ms
vue-large-graph-idle: TBT 0ms
vue-large-graph-idle: heap used 161.1 MB
vue-large-graph-idle: DOM nodes -5806
vue-large-graph-idle: event listeners -16372
vue-large-graph-pan: avg frame time 17ms
vue-large-graph-pan: p95 frame time 17ms
vue-large-graph-pan: layout duration 0ms
vue-large-graph-pan: style recalc duration 17ms
vue-large-graph-pan: layout count 0
vue-large-graph-pan: style recalc count 79
vue-large-graph-pan: task duration 15524ms
vue-large-graph-pan: script duration 1247ms
vue-large-graph-pan: TBT 20ms
vue-large-graph-pan: heap used 152.4 MB
vue-large-graph-pan: DOM nodes -5806
vue-large-graph-pan: event listeners -16376
workflow-execution: avg frame time 17ms
workflow-execution: p95 frame time 17ms
workflow-execution: layout duration 2ms
workflow-execution: style recalc duration 23ms
workflow-execution: layout count 5
workflow-execution: style recalc count 16
workflow-execution: task duration 145ms
workflow-execution: script duration 17ms
workflow-execution: TBT 0ms
workflow-execution: heap used 55.3 MB
workflow-execution: DOM nodes 11
workflow-execution: event listeners -32
Raw data
{
  "timestamp": "2026-07-15T01:24:01.673Z",
  "gitSha": "ab796b0bfb639cc7ec786d15fd020ba37cb0fe9e",
  "branch": "drjkl/a-badge-is-announced",
  "measurements": [
    {
      "name": "canvas-idle",
      "durationMs": 2014.7049999999922,
      "styleRecalcs": 7,
      "styleRecalcDurationMs": 4.694999999999999,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 378.79100000000005,
      "heapDeltaBytes": -944800,
      "heapUsedBytes": 57472384,
      "domNodes": 14,
      "jsHeapTotalBytes": 24641536,
      "scriptDurationMs": 19.598999999999997,
      "eventListeners": 6,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.66333333333335,
      "p95FrameDurationMs": 16.799999999999272
    },
    {
      "name": "canvas-idle",
      "durationMs": 2060.217000000023,
      "styleRecalcs": 8,
      "styleRecalcDurationMs": 7.772000000000001,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 407.973,
      "heapDeltaBytes": -6591424,
      "heapUsedBytes": 63314096,
      "domNodes": -283,
      "jsHeapTotalBytes": 17453056,
      "scriptDurationMs": 22.259,
      "eventListeners": -199,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666666666666668,
      "p95FrameDurationMs": 16.800000000000182
    },
    {
      "name": "canvas-mouse-sweep",
      "durationMs": 1859.3199999999968,
      "styleRecalcs": 74,
      "styleRecalcDurationMs": 40.064,
      "layouts": 12,
      "layoutDurationMs": 3.6109999999999998,
      "taskDurationMs": 777.111,
      "heapDeltaBytes": 8175280,
      "heapUsedBytes": 59518268,
      "domNodes": -235,
      "jsHeapTotalBytes": 17952768,
      "scriptDurationMs": 119.309,
      "eventListeners": -199,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.670000000000012,
      "p95FrameDurationMs": 16.800000000000182
    },
    {
      "name": "canvas-mouse-sweep",
      "durationMs": 1808.0940000000396,
      "styleRecalcs": 72,
      "styleRecalcDurationMs": 34.902,
      "layouts": 12,
      "layoutDurationMs": 3.5530000000000004,
      "taskDurationMs": 750.126,
      "heapDeltaBytes": -3567724,
      "heapUsedBytes": 55111080,
      "domNodes": 54,
      "jsHeapTotalBytes": 19398656,
      "scriptDurationMs": 129.276,
      "eventListeners": 4,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666666666666668,
      "p95FrameDurationMs": 16.799999999999272
    },
    {
      "name": "canvas-zoom-sweep",
      "durationMs": 1772.9160000000093,
      "styleRecalcs": 33,
      "styleRecalcDurationMs": 15.934999999999997,
      "layouts": 6,
      "layoutDurationMs": 0.5920000000000001,
      "taskDurationMs": 305.284,
      "heapDeltaBytes": 2991548,
      "heapUsedBytes": 62045756,
      "domNodes": 79,
      "jsHeapTotalBytes": 25165824,
      "scriptDurationMs": 25.579000000000004,
      "eventListeners": 19,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666666666666668,
      "p95FrameDurationMs": 16.700000000000728
    },
    {
      "name": "canvas-zoom-sweep",
      "durationMs": 1723.7250000000586,
      "styleRecalcs": 32,
      "styleRecalcDurationMs": 17.332,
      "layouts": 6,
      "layoutDurationMs": 0.6040000000000001,
      "taskDurationMs": 340.48100000000005,
      "heapDeltaBytes": -3548844,
      "heapUsedBytes": 66406312,
      "domNodes": -225,
      "jsHeapTotalBytes": 12472320,
      "scriptDurationMs": 22.968000000000004,
      "eventListeners": -184,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666666666666668,
      "p95FrameDurationMs": 16.700000000000728
    },
    {
      "name": "dom-widget-clipping",
      "durationMs": 593.6809999999753,
      "styleRecalcs": 11,
      "styleRecalcDurationMs": 8.536,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 361.89,
      "heapDeltaBytes": -2666816,
      "heapUsedBytes": 49389624,
      "domNodes": -272,
      "jsHeapTotalBytes": 1437696,
      "scriptDurationMs": 57.27600000000001,
      "eventListeners": -203,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666666666666668,
      "p95FrameDurationMs": 16.700000000000728
    },
    {
      "name": "dom-widget-clipping",
      "durationMs": 575.9239999999863,
      "styleRecalcs": 12,
      "styleRecalcDurationMs": 8.957999999999998,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 360.588,
      "heapDeltaBytes": 11695196,
      "heapUsedBytes": 64360172,
      "domNodes": -289,
      "jsHeapTotalBytes": 5369856,
      "scriptDurationMs": 59.436,
      "eventListeners": -203,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666666666666668,
      "p95FrameDurationMs": 16.700000000000728
    },
    {
      "name": "large-graph-idle",
      "durationMs": 2015.7809999999472,
      "styleRecalcs": 11,
      "styleRecalcDurationMs": 9.628,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 638.865,
      "heapDeltaBytes": -12330592,
      "heapUsedBytes": 65662880,
      "domNodes": 22,
      "jsHeapTotalBytes": 8007680,
      "scriptDurationMs": 229.659,
      "eventListeners": 4,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.66999999999998,
      "p95FrameDurationMs": 16.799999999999272
    },
    {
      "name": "large-graph-idle",
      "durationMs": 2044.1190000000233,
      "styleRecalcs": 10,
      "styleRecalcDurationMs": 8.999,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 644.6879999999999,
      "heapDeltaBytes": -7138556,
      "heapUsedBytes": 56494224,
      "domNodes": -270,
      "jsHeapTotalBytes": -1875968,
      "scriptDurationMs": 231.328,
      "eventListeners": -197,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666666666666668,
      "p95FrameDurationMs": 16.800000000000182
    },
    {
      "name": "large-graph-pan",
      "durationMs": 2118.072999999981,
      "styleRecalcs": 68,
      "styleRecalcDurationMs": 15.541999999999996,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 1213.8629999999998,
      "heapDeltaBytes": 15815820,
      "heapUsedBytes": 81311716,
      "domNodes": -278,
      "jsHeapTotalBytes": -360448,
      "scriptDurationMs": 548.627,
      "eventListeners": -197,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666666666666668,
      "p95FrameDurationMs": 16.700000000000728
    },
    {
      "name": "large-graph-pan",
      "durationMs": 2122.5689999999986,
      "styleRecalcs": 69,
      "styleRecalcDurationMs": 16.282,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 1194.197,
      "heapDeltaBytes": -9604528,
      "heapUsedBytes": 55917788,
      "domNodes": -275,
      "jsHeapTotalBytes": 745472,
      "scriptDurationMs": 558.184,
      "eventListeners": -197,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666666666666668,
      "p95FrameDurationMs": 16.700000000000728
    },
    {
      "name": "large-graph-zoom",
      "durationMs": 3212.557000000004,
      "styleRecalcs": 66,
      "styleRecalcDurationMs": 19.385999999999996,
      "layouts": 60,
      "layoutDurationMs": 7.384999999999999,
      "taskDurationMs": 1530.21,
      "heapDeltaBytes": 865940,
      "heapUsedBytes": 60260796,
      "domNodes": 14,
      "jsHeapTotalBytes": 8388608,
      "scriptDurationMs": 740.623,
      "eventListeners": 8,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666666666666668,
      "p95FrameDurationMs": 16.700000000000728
    },
    {
      "name": "large-graph-zoom",
      "durationMs": 3111.503999999968,
      "styleRecalcs": 62,
      "styleRecalcDurationMs": 14.726999999999997,
      "layouts": 60,
      "layoutDurationMs": 6.871,
      "taskDurationMs": 1442.627,
      "heapDeltaBytes": 21579820,
      "heapUsedBytes": 76900108,
      "domNodes": 6,
      "jsHeapTotalBytes": 0,
      "scriptDurationMs": 692.185,
      "eventListeners": 8,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.66333333333332,
      "p95FrameDurationMs": 16.800000000000182
    },
    {
      "name": "minimap-idle",
      "durationMs": 2052.1759999999745,
      "styleRecalcs": 8,
      "styleRecalcDurationMs": 6.121999999999999,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 659.103,
      "heapDeltaBytes": -20270072,
      "heapUsedBytes": 57786668,
      "domNodes": -272,
      "jsHeapTotalBytes": 2961408,
      "scriptDurationMs": 235.20000000000002,
      "eventListeners": -197,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666666666666668,
      "p95FrameDurationMs": 16.700000000000728
    },
    {
      "name": "minimap-idle",
      "durationMs": 2011.6519999999127,
      "styleRecalcs": 7,
      "styleRecalcDurationMs": 5.303999999999999,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 596.606,
      "heapDeltaBytes": 5275200,
      "heapUsedBytes": 59530352,
      "domNodes": -267,
      "jsHeapTotalBytes": 3932160,
      "scriptDurationMs": 221.829,
      "eventListeners": -197,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666666666666668,
      "p95FrameDurationMs": 16.700000000000728
    },
    {
      "name": "subgraph-dom-widget-clipping",
      "durationMs": 605.214999999987,
      "styleRecalcs": 46,
      "styleRecalcDurationMs": 10.841999999999999,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 383.9920000000001,
      "heapDeltaBytes": 15253624,
      "heapUsedBytes": 68208400,
      "domNodes": -289,
      "jsHeapTotalBytes": 1961984,
      "scriptDurationMs": 118.242,
      "eventListeners": -197,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.66666666666665,
      "p95FrameDurationMs": 16.700000000000728
    },
    {
      "name": "subgraph-dom-widget-clipping",
      "durationMs": 529.8099999999977,
      "styleRecalcs": 47,
      "styleRecalcDurationMs": 11.088000000000001,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 343.45599999999996,
      "heapDeltaBytes": 7596768,
      "heapUsedBytes": 66799696,
      "domNodes": 20,
      "jsHeapTotalBytes": 20185088,
      "scriptDurationMs": 120.86999999999999,
      "eventListeners": 6,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666666666666668,
      "p95FrameDurationMs": 16.800000000000182
    },
    {
      "name": "subgraph-idle",
      "durationMs": 2022.0259999999826,
      "styleRecalcs": 9,
      "styleRecalcDurationMs": 7.877000000000001,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 331.3,
      "heapDeltaBytes": 4399452,
      "heapUsedBytes": 67984932,
      "domNodes": 18,
      "jsHeapTotalBytes": 14942208,
      "scriptDurationMs": 15.524000000000001,
      "eventListeners": 4,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666666666666668,
      "p95FrameDurationMs": 16.800000000000182
    },
    {
      "name": "subgraph-idle",
      "durationMs": 1992.2789999999964,
      "styleRecalcs": 10,
      "styleRecalcDurationMs": 9.467,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 336.19599999999997,
      "heapDeltaBytes": -1376520,
      "heapUsedBytes": 57741892,
      "domNodes": 20,
      "jsHeapTotalBytes": 25165824,
      "scriptDurationMs": 15.129,
      "eventListeners": 4,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.66333333333335,
      "p95FrameDurationMs": 16.800000000000182
    },
    {
      "name": "subgraph-mouse-sweep",
      "durationMs": 1714.8300000000063,
      "styleRecalcs": 77,
      "styleRecalcDurationMs": 35.156,
      "layouts": 16,
      "layoutDurationMs": 3.8280000000000007,
      "taskDurationMs": 678.697,
      "heapDeltaBytes": -16646568,
      "heapUsedBytes": 53126128,
      "domNodes": -234,
      "jsHeapTotalBytes": 19812352,
      "scriptDurationMs": 86.69200000000001,
      "eventListeners": -199,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666666666666668,
      "p95FrameDurationMs": 16.800000000000182
    },
    {
      "name": "subgraph-mouse-sweep",
      "durationMs": 1680.5249999999887,
      "styleRecalcs": 76,
      "styleRecalcDurationMs": 36.455,
      "layouts": 16,
      "layoutDurationMs": 3.999,
      "taskDurationMs": 643.265,
      "heapDeltaBytes": -8846700,
      "heapUsedBytes": 53460588,
      "domNodes": 65,
      "jsHeapTotalBytes": 26476544,
      "scriptDurationMs": 90.051,
      "eventListeners": 4,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666666666666668,
      "p95FrameDurationMs": 16.699999999999818
    },
    {
      "name": "subgraph-transition-enter",
      "durationMs": 1016.1939999999845,
      "styleRecalcs": 18,
      "styleRecalcDurationMs": 31.692999999999998,
      "layouts": 14,
      "layoutDurationMs": 15.533000000000001,
      "taskDurationMs": 815.8429999999998,
      "heapDeltaBytes": -709444,
      "heapUsedBytes": 90621420,
      "domNodes": 12228,
      "jsHeapTotalBytes": 11812864,
      "scriptDurationMs": 26.888999999999996,
      "eventListeners": 844,
      "totalBlockingTimeMs": 149,
      "frameDurationMs": 16.666666666666668,
      "p95FrameDurationMs": 16.700000000000728
    },
    {
      "name": "viewport-pan-sweep",
      "durationMs": 8203.395,
      "styleRecalcs": 250,
      "styleRecalcDurationMs": 51.745,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 4343.032999999999,
      "heapDeltaBytes": 1587536,
      "heapUsedBytes": 60656376,
      "domNodes": -268,
      "jsHeapTotalBytes": 8552448,
      "scriptDurationMs": 1858.799,
      "eventListeners": -118,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666666666666668,
      "p95FrameDurationMs": 16.700000000000728
    },
    {
      "name": "viewport-pan-sweep",
      "durationMs": 8178.772000000037,
      "styleRecalcs": 250,
      "styleRecalcDurationMs": 48.92400000000001,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 4158.005999999999,
      "heapDeltaBytes": 2627104,
      "heapUsedBytes": 66212008,
      "domNodes": -271,
      "jsHeapTotalBytes": -98304,
      "scriptDurationMs": 1850.67,
      "eventListeners": -183,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666666666666668,
      "p95FrameDurationMs": 16.700000000000728
    },
    {
      "name": "vue-large-graph-idle",
      "durationMs": 12379.501000000004,
      "styleRecalcs": 0,
      "styleRecalcDurationMs": 0,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 12343.181999999999,
      "heapDeltaBytes": -27988952,
      "heapUsedBytes": 166572232,
      "domNodes": -3300,
      "jsHeapTotalBytes": -524288,
      "scriptDurationMs": 891.9080000000001,
      "eventListeners": -16370,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 17.219999999999953,
      "p95FrameDurationMs": 16.799999999999272
    },
    {
      "name": "vue-large-graph-idle",
      "durationMs": 12123.301999999967,
      "styleRecalcs": 0,
      "styleRecalcDurationMs": 0,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 12104.232,
      "heapDeltaBytes": -50720604,
      "heapUsedBytes": 171303400,
      "domNodes": -8311,
      "jsHeapTotalBytes": 23851008,
      "scriptDurationMs": 913.4850000000001,
      "eventListeners": -16374,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 17.219999999999953,
      "p95FrameDurationMs": 16.80000000000291
    },
    {
      "name": "vue-large-graph-pan",
      "durationMs": 15728.33700000001,
      "styleRecalcs": 81,
      "styleRecalcDurationMs": 17.588999999999967,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 15707.719000000001,
      "heapDeltaBytes": -41372048,
      "heapUsedBytes": 164426952,
      "domNodes": -8311,
      "jsHeapTotalBytes": 16486400,
      "scriptDurationMs": 1214.732,
      "eventListeners": -16376,
      "totalBlockingTimeMs": 20,
      "frameDurationMs": 17.223333333333358,
      "p95FrameDurationMs": 16.700000000000728
    },
    {
      "name": "vue-large-graph-pan",
      "durationMs": 15362.539000000084,
      "styleRecalcs": 76,
      "styleRecalcDurationMs": 16.751000000000015,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 15339.827000000001,
      "heapDeltaBytes": -57822192,
      "heapUsedBytes": 155172328,
      "domNodes": -3300,
      "jsHeapTotalBytes": 14389248,
      "scriptDurationMs": 1279.799,
      "eventListeners": -16376,
      "totalBlockingTimeMs": 19,
      "frameDurationMs": 17.223333333333358,
      "p95FrameDurationMs": 16.700000000000728
    },
    {
      "name": "workflow-execution",
      "durationMs": 449.36500000000024,
      "styleRecalcs": 18,
      "styleRecalcDurationMs": 24.776999999999997,
      "layouts": 5,
      "layoutDurationMs": 1.435,
      "taskDurationMs": 113.098,
      "heapDeltaBytes": 5217452,
      "heapUsedBytes": 64500876,
      "domNodes": 168,
      "jsHeapTotalBytes": 4980736,
      "scriptDurationMs": 17.17,
      "eventListeners": 69,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666666666666668,
      "p95FrameDurationMs": 16.800000000000182
    },
    {
      "name": "workflow-execution",
      "durationMs": 513.8189999998986,
      "styleRecalcs": 14,
      "styleRecalcDurationMs": 20.276000000000003,
      "layouts": 5,
      "layoutDurationMs": 1.8429999999999997,
      "taskDurationMs": 176.793,
      "heapDeltaBytes": -1777684,
      "heapUsedBytes": 51400976,
      "domNodes": -146,
      "jsHeapTotalBytes": -659456,
      "scriptDurationMs": 16.8,
      "eventListeners": -132,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.66333333333335,
      "p95FrameDurationMs": 16.699999999999818
    }
  ]
}

@codecov

codecov Bot commented Jul 6, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 87.05036% with 18 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/systems/badgeSystem.ts 80.00% 17 Missing and 1 partial ⚠️
@@                   Coverage Diff                    @@
##             feature/ecs-migration   #13458   +/-   ##
========================================================
  Coverage                         ?   78.71%           
========================================================
  Files                            ?     1654           
  Lines                            ?   111155           
  Branches                         ?    39977           
========================================================
  Hits                             ?    87499           
  Misses                           ?    22802           
  Partials                         ?      854           
Flag Coverage Δ
unit 65.78% <87.05%> (?)

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

Files with missing lines Coverage Δ
src/lib/litegraph/src/LGraph.ts 91.47% <ø> (ø)
src/stores/nodeBadgeStore.ts 100.00% <100.00%> (ø)
src/types/badgeData.ts 100.00% <100.00%> (ø)
src/systems/badgeSystem.ts 80.00% <80.00%> (ø)
🚀 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 added the preview-cpu Creates a preview ephemeral environment for this PR (CPU only) label Jul 6, 2026
@DrJKL
DrJKL force-pushed the drjkl/the-body-in-the-library branch 2 times, most recently from fe199d2 to a6b9d4e Compare July 6, 2026 20:51
@DrJKL DrJKL added refactor and removed preview-cpu Creates a preview ephemeral environment for this PR (CPU only) labels Jul 6, 2026
@DrJKL
DrJKL force-pushed the drjkl/a-badge-is-announced branch from 3410ae6 to cb9ebec Compare July 6, 2026 20:58
@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-body-in-the-library branch 2 times, most recently from abe1cf7 to c757a23 Compare July 13, 2026 17:09
SUBGRAPH_OUTPUT_ID
} from '@/lib/litegraph/src/constants'
import { isNodeBindable } from '@/lib/litegraph/src/utils/type'
import type { UUID } from '@/utils/uuid'

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: (blocking) Three computed() reads — useUpstreamValue.ts:24, useProcessedWidgets.ts:542, NodeSlots.vue:68 — now access canvas?.graph?.rootGraph.id through a shallowRef<LGraphCanvas>, losing reactive tracking when the graph id changes on workflow reload. The deleted canvasStore.rootGraphId computed was the reactive bridge. After a second workflow load those computeds return the stale old UUID, causing widgetValueStore/linkStore queries to hit the wrong bucket silently. The deleted test in canvasStore.test.ts that verified rootGraphId reactivity should be restored.

Also: startBadgeSystem (slice B) takes a fixed graphId — with the shallowRef gone, there is no reactive signal for a restart when graph.configure() reassigns the id. Either restore canvasStore.rootGraphId as a computed tracking via the 'configured' event, or re-promote LGraph.id to a shallowRef.

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.

This diff never touches LGraph.id — at HEAD it's shallowRef-backed (LGraph.ts:296), canvasStore.rootGraphId exists (canvasStore.ts:118) with its reactivity test, and all three computeds track through it. That work landed in #13455 ("fix: make LGraph.id reactive so graph-id reads track workflow loads"), now merged into feature/ecs-migration; the diff showing it deleted was against main. Slice-B restart concern is handled the same way: the bootstrap can watch(canvasStore.rootGraphId).

@@ -395,6 +411,17 @@
if (this.isRootGraph && graphId !== zeroUuid) {
usePreviewExposureStore().clearGraph(graphId)
useWidgetValueStore().clearGraph(graphId)

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: (blocking) LGraph.id was a shallowRef<UUID> with reactive getter/setter; this PR replaces it with a plain id: UUID = zeroUuid field and also removes canvasStore.rootGraphId. Three computed() reads now access canvas?.graph?.rootGraph.id through a shallowRef<LGraphCanvas> — deep property reads through a shallowRef are not transitively tracked. On workflow reload (graph.configure() reassigns the id), those computeds return the stale old UUID silently: useUpstreamValue.ts:24 queries wrong upstream, useProcessedWidgets.ts:542 queries widgetValueStore under the old bucket, NodeSlots.vue:68 passes the wrong graphId to linkStore. The test deleted from canvasStore.test.ts that verified rootGraphId reactivity should not be removed without a replacement.

For slice B: startBadgeSystem takes a fixed graphId — with the reactive signal gone there is no mechanism to restart the system when configure() assigns a new id. The badge system would silently watch a dead bucket for the rest of the session. Either restore canvasStore.rootGraphId as a computed tracking via a 'configured' event, or re-promote LGraph.id to a shallowRef.

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.

This diff never touches LGraph.id — at HEAD it's shallowRef-backed (LGraph.ts:296), canvasStore.rootGraphId exists (canvasStore.ts:118) with its reactivity test, and all three computeds track through it. That work landed in #13455 ("fix: make LGraph.id reactive so graph-id reads track workflow loads"), now merged into feature/ecs-migration; the diff showing it deleted was against main. Slice-B restart concern is handled the same way: the bootstrap can watch(canvasStore.rootGraphId).

const slotMetadata = new Map<string, WidgetSlotMetadata>()

function makeReactiveNodeArrays(node: LGraphNode): {
inputs: INodeInputSlot[]

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: (blocking) The reactiveArrayNodes WeakSet that prevented makeReactiveNodeArrays from stacking getter layers on repeated calls was removed in this diff. During graph configuration (configuringGraph=true), handleNodeAdded calls extractVueNodeData(node) and then onAfterGraphConfigured calls it again -- makeReactiveNodeArrays fires twice per node on every workflow load, stacking a syncing getter on top of the existing one. The deleted test "does not re-wrap node.widgets on repeated extraction" proved this invariant and should be restored alongside the WeakSet guard.

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.

Guard is present at HEAD (useGraphNodeManager.ts:28,67-70) along with the "does not re-wrap node.widgets on repeated extraction" test (useGraphNodeManager.test.ts:69). It landed via #13455; this PR doesn't touch the file. Stale diff-vs-main.

if (window.app?.configuringGraph) {
// During workflow loading - defer layout initialization until configure completes
// Chain our callback with any existing onAfterGraphConfigured callback
node.onAfterGraphConfigured = useChainCallback(

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: (blocking) This second call to extractVueNodeData during onAfterGraphConfigured, combined with the earlier call in handleNodeAdded, double-invokes makeReactiveNodeArrays per node on every workflow load due to the removed WeakSet guard. See the comment above at the first call site.

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.

Guard is present at HEAD (useGraphNodeManager.ts:28,67-70) along with the "does not re-wrap node.widgets on repeated extraction" test (useGraphNodeManager.test.ts:69). It landed via #13455; this PR doesn't touch the file. Stale diff-vs-main.

Comment thread src/lib/litegraph/src/LGraph.ts Outdated
unregisterAllRerouteChains(this)
for (const node of this._nodes) {
useNodeBadgeStore().unregisterNode(this.rootGraph.id, node.id)
}

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 else-branch of clear() iterates this._nodes (direct nodes only) for unregisterNode calls. Nodes nested 2+ levels deep -- a SubgraphNode whose definition contains another SubgraphNode containing InnerNode -- are not unregistered and accumulate in the badge store indefinitely. When the badge system (slice B) starts, it creates per-node watchEffect scopes for these orphaned IDs and resolveNode returns undefined for them. Replace the flat for (const node of this._nodes) loop with forEachNode(this, ...) matching the pattern used at ~line 1149 for fireNodeRemovalLifecycle.

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.

Fixed in 3dcb36d — the else-branch now uses forEachNode, matching the removal-lifecycle pattern. Added a depth test in LGraph.badges.test.ts ("unregisters nodes at every nesting depth when a subgraph is cleared"), verified red on the old loop.

import { useLinkStore } from '@/stores/linkStore'
import { useRerouteStore } from '@/stores/rerouteStore'
import { useNodeBadgeStore } from '@/stores/nodeBadgeStore'
import { usePreviewExposureStore } from '@/stores/previewExposureStore'

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: node:slot-links:changed (emitted in the base PR) fires after this.inputs[slot].link = null but before the output-side removal completes. Handlers querying full link topology see a half-disconnected state -- the input reports disconnected but the output still claims the link exists. Moving the trigger after link_info.disconnect(graph, ...) completes, or documenting the partial-teardown ordering in LGraphEventMap.ts, would prevent future consumer bugs from the base PR (#13455).

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.

node:slot-links:changed no longer exists — #13455's final form deleted both slot events (zero occurrences in src/ at HEAD). Moot.

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.

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) Decision 3 states the PR "deletes" node:slot-links:changed / node:slot-errors:changed and that the latter has "zero emitters repo-wide." The base PR (#13455) actually adds both events to LGraphEventMap.ts and graphTriggers.ts with emitter sites in LGraphNode.ts, SubgraphInput.ts, and SubgraphInputNode.ts. The refreshNodeInputs handler removal is accurate, but the "zero emitters" claim is now incorrect. A brief update noting that node:slot-links:changed is now live at widgeted-input chokepoints would align the doc with the shipped code.

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 doc is accurate at HEAD: #13455's merged form deletes both slot events (emitters, event map, types). The intermediate revision that added them didn't ship.

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

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: All four emit sites for node:slot-links:changed are gated on if (input.widget) -- non-widget inputs that connect/disconnect never fire this event. Would renaming to node:widget-slot-links:changed be more accurate? Or should the widget-only scope be documented in the JSDoc on LGraphEventMap.ts?

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.

Moot — the event was deleted before merge; there's nothing to rename. If a slot-links event returns in the node-data-store slice, widget-only scoping will be decided then.

`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.
Shipped ahead of the store itself (2026-07-05).

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: node:slot-errors:changed is registered in graphTriggers.ts and LGraphEventMap.ts (base PR #13455) but has no emitter in any non-test code -- the architecture doc previously said to "resurrect from git if a consumer ever materialises." Would it be cleaner to remove the type now and restore it in the slice that adds an emitter? Or add a // TODO(slice-B) comment so reviewers know it is intentionally dormant?

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.

Already gone — node:slot-errors:changed was removed along with its registration before #13455 merged.

target architecture, see [ECS Target Architecture](ecs-target-architecture.md).
For verified accuracy of these documents, see
[Appendix: Critical Analysis](appendix-critical-analysis.md).

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) The shipped-store inventory tables in proto-ecs-stores.md and ecs-migration-plan.md do not list nodeBadgeStore. Adding a row (following the linkStore/rerouteStore pattern) would keep the cross-reference docs accurate.

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.

👍🏻

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.

Added to both tables (shipped stores + key format) in 0be6c32, proto-ecs-stores.md too.

plain-data components, separation of data from behavior, command-driven
mutation, and no god-object growth — realized across those stores. Where the
text below says "the World," read "the set of dedicated stores"; where it shows
`world.getComponent(id, Component)`, read the matching store getter (for

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) The ADR amendment history records PR 12617 (widgetValueStore) and 2026-07-05 (linkStore/rerouteStore). Adding an entry for nodeBadgeStore (PR #13458) would complete the amendment log.

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.

👍🏻

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.

Amendment added in 0be6c32.

@DrJKL
DrJKL force-pushed the drjkl/a-badge-is-announced branch 2 times, most recently from ff8a725 to 123c08b Compare July 14, 2026 20:29

@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: 4

🤖 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 `@src/lib/litegraph/src/LGraph.badges.test.ts`:
- Around line 31-40: Update the test around the root graph clear behavior to
configure the graph before calling clear, ensuring graph.id differs from
zeroUuid and the root-configured path invokes useNodeBadgeStore().clearGraph().
Keep the existing assertion against registeredNodeIds(graphId) to verify the
bucket is cleared.

In `@src/lib/litegraph/src/LGraph.ts`:
- Around line 480-488: Update the clear() else-branch to traverse every nested
node using the existing deep traversal approach from forEachNode, rather than
iterating only this._nodes. Unregister each visited node’s badge through
useNodeBadgeStore().unregisterNode(this.rootGraph.id, node.id), while leaving
link and reroute cleanup unchanged.

In `@src/systems/badgeSystem.ts`:
- Around line 190-197: Update the badge-writing loop in the relevant badge
system flow to derive its kinds from BADGE_KIND_ORDER, excluding 'extension',
instead of hardcoding ['core', 'credits']. Keep the existing setBadgesOfKind
call and row filtering behavior unchanged so all system-written kinds remain
synchronized with the defined order.
- Around line 89-92: Add JSDoc to BadgeSystemOptions.resolveNode documenting
that the resolver must traverse subgraphs, including nodes registered under
rootGraph.id, rather than searching only top-level nodes. Keep the interface and
resolver behavior unchanged.
🪄 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: 614fda36-7cd0-4998-9a8e-2a2c326e75d7

📥 Commits

Reviewing files that changed from the base of the PR and between c757a23 and ff8a725.

📒 Files selected for processing (16)
  • docs/architecture/node-badge-store.md
  • src/components/graph/widgets/domWidgetZIndex.test.ts
  • src/lib/litegraph/src/LGraph.badges.test.ts
  • src/lib/litegraph/src/LGraph.serialise.test.ts
  • src/lib/litegraph/src/LGraph.ts
  • src/lib/litegraph/src/LGraphCanvas.clipboard.test.ts
  • src/lib/litegraph/src/LGraphCanvas.cloneZIndex.test.ts
  • src/lib/litegraph/src/LGraphCanvas.ghost.test.ts
  • src/lib/litegraph/src/LGraphCanvas.groupSelection.test.ts
  • src/lib/litegraph/src/LGraphCanvas.slotHitDetection.test.ts
  • src/stores/nodeBadgeStore.test.ts
  • src/stores/nodeBadgeStore.ts
  • src/systems/badgeSystem.test.ts
  • src/systems/badgeSystem.ts
  • src/types/badgeData.ts
  • src/utils/litegraphUtil.test.ts

Comment thread src/lib/litegraph/src/LGraph.ts Resolved
Comment thread src/systems/badgeSystem.ts Resolved
Comment thread src/systems/badgeSystem.ts Resolved
Base automatically changed from drjkl/the-body-in-the-library to feature/ecs-migration July 14, 2026 21:27
@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 14, 2026
DrJKL and others added 4 commits July 14, 2026 15:44
Root-graph-scoped buckets keyed by NodeId holding plain BadgeData rows,
per docs/architecture/node-badge-store.md decisions 1-2. Reads are
kind-ordered (core, credits, extension); the badge system rewrites its
kinds wholesale via setBadgesOfKind, extension rows use identity-checked
register/delete.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
startBadgeSystem watches the registered-node set of a root graph bucket
and runs one effect scope per node: a pure computeBadges projection of
nodeDef, badge-mode settings, palette, and pricing sources, written to
nodeBadgeStore as core/credits rows (node-badge-store.md decisions 3-4).
nodeBadgeStore gains the registerNode/unregisterNode/registeredNodeIds
registration surface the system consumes.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
add/remove/clear (and subgraph-definition GC) now maintain each node's
nodeBadgeStore registration in the root bucket, following the
linkStore/rerouteStore chokepoint convention. Tests that construct
graphs without an active Pinia gain the standard testing-pinia setup.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
DrJKL and others added 5 commits July 14, 2026 15:44
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
A per-node effect flushing between unregisterNode and its scope being
stopped could re-create the bucket key and resurrect a removed node's
registration. Row writes (registerBadge, setBadgesOfKind) now require
an existing registration; registerBadge returns undefined when refused.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
clear() unregistered only direct nodes; badge rows for nodes 2+
subgraph levels deep leaked in the shared root bucket.
Also document the two badge write paths: setBadgesOfKind is the
system-internal bulk path; extensions use registerBadge/deleteBadge.
Route deleteBadge/getBadges reads through the registeredRows guard.
@DrJKL
DrJKL force-pushed the drjkl/a-badge-is-announced branch from 786a688 to c4ab44a Compare July 14, 2026 22:58
@dosubot dosubot Bot added size:L This PR changes 100-499 lines, ignoring generated files. and removed size:XL This PR changes 500-999 lines, ignoring generated files. labels Jul 14, 2026

@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: 2

🤖 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`:
- Around line 40-48: Update the BadgeData fenced code block in the architecture
documentation to include an explicit language identifier, using text for the
schematic (or typescript only if the block is made valid TypeScript), so
markdownlint no longer reports MD040.

In `@src/lib/litegraph/src/LGraph.ts`:
- Line 1094: Update the ID remapping logic in ensureGlobalIdUniqueness() to
unregister the node’s previous ID and register its reassigned ID in the root
graph bucket via useNodeBadgeStore(). Preserve the existing initial registration
in the node-loading path while keeping badge-store keys synchronized after every
remap.
🪄 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: fa726343-733f-4a15-87ed-d9dacb9103f2

📥 Commits

Reviewing files that changed from the base of the PR and between ff8a725 and 97a7ffb.

📒 Files selected for processing (20)
  • docs/adr/0008-entity-component-system.md
  • docs/architecture/ecs-migration-plan.md
  • docs/architecture/node-badge-store.md
  • docs/architecture/proto-ecs-stores.md
  • src/components/graph/widgets/domWidgetZIndex.test.ts
  • src/lib/litegraph/src/LGraph.badges.test.ts
  • src/lib/litegraph/src/LGraph.serialise.test.ts
  • src/lib/litegraph/src/LGraph.ts
  • src/lib/litegraph/src/LGraphCanvas.clipboard.test.ts
  • src/lib/litegraph/src/LGraphCanvas.cloneZIndex.test.ts
  • src/lib/litegraph/src/LGraphCanvas.ghost.test.ts
  • src/lib/litegraph/src/LGraphCanvas.groupSelection.test.ts
  • src/lib/litegraph/src/LGraphCanvas.slotHitDetection.test.ts
  • src/renderer/extensions/vueNodes/composables/usePartitionedBadges.test.ts
  • src/stores/nodeBadgeStore.test.ts
  • src/stores/nodeBadgeStore.ts
  • src/systems/badgeSystem.test.ts
  • src/systems/badgeSystem.ts
  • src/types/badgeData.ts
  • src/utils/litegraphUtil.test.ts

@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.

Caution

Inline review comments failed to post. This is likely due to GitHub's internal server error or limits when posting large numbers of comments. If you are seeing this consistently it is likely a permissions issue. Please check "Moderation" -> "Code review limits" under your organization settings.

Actionable comments posted: 2

🤖 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`:
- Around line 40-48: Update the BadgeData fenced code block in the architecture
documentation to include an explicit language identifier, using text for the
schematic (or typescript only if the block is made valid TypeScript), so
markdownlint no longer reports MD040.

In `@src/lib/litegraph/src/LGraph.ts`:
- Line 1094: Update the ID remapping logic in ensureGlobalIdUniqueness() to
unregister the node’s previous ID and register its reassigned ID in the root
graph bucket via useNodeBadgeStore(). Preserve the existing initial registration
in the node-loading path while keeping badge-store keys synchronized after every
remap.
🪄 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: fa726343-733f-4a15-87ed-d9dacb9103f2

📥 Commits

Reviewing files that changed from the base of the PR and between ff8a725 and 97a7ffb.

📒 Files selected for processing (20)
  • docs/adr/0008-entity-component-system.md
  • docs/architecture/ecs-migration-plan.md
  • docs/architecture/node-badge-store.md
  • docs/architecture/proto-ecs-stores.md
  • src/components/graph/widgets/domWidgetZIndex.test.ts
  • src/lib/litegraph/src/LGraph.badges.test.ts
  • src/lib/litegraph/src/LGraph.serialise.test.ts
  • src/lib/litegraph/src/LGraph.ts
  • src/lib/litegraph/src/LGraphCanvas.clipboard.test.ts
  • src/lib/litegraph/src/LGraphCanvas.cloneZIndex.test.ts
  • src/lib/litegraph/src/LGraphCanvas.ghost.test.ts
  • src/lib/litegraph/src/LGraphCanvas.groupSelection.test.ts
  • src/lib/litegraph/src/LGraphCanvas.slotHitDetection.test.ts
  • src/renderer/extensions/vueNodes/composables/usePartitionedBadges.test.ts
  • src/stores/nodeBadgeStore.test.ts
  • src/stores/nodeBadgeStore.ts
  • src/systems/badgeSystem.test.ts
  • src/systems/badgeSystem.ts
  • src/types/badgeData.ts
  • src/utils/litegraphUtil.test.ts
🛑 Comments failed to post (2)
docs/architecture/node-badge-store.md (1)

40-48: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Add a language identifier to the BadgeData fence.

markdownlint reports MD040 at Line 40 because this fenced block has no language. Use text for the schematic, or typescript if it is intended to represent valid TypeScript.

🧰 Tools
🪛 markdownlint-cli2 (0.23.0)

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

(MD040, fenced-code-language)

🤖 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` around lines 40 - 48, Update the
BadgeData fenced code block in the architecture documentation to include an
explicit language identifier, using text for the schematic (or typescript only
if the block is made valid TypeScript), so markdownlint no longer reports MD040.

Source: Linters/SAST tools

src/lib/litegraph/src/LGraph.ts (1)

1094-1094: 🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

Keep badge-store keys synchronized when node IDs are remapped.

Line 1094 registers the initial node.id, but
ensureGlobalIdUniqueness() later reassigns IDs without moving this entry.
That leaves an orphaned old key while the new ID is unregistered and rejects
badge writes. Update the remapping path to unregister the old ID and register
the new ID under the root graph bucket.

🤖 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/lib/litegraph/src/LGraph.ts` at line 1094, Update the ID remapping logic
in ensureGlobalIdUniqueness() to unregister the node’s previous ID and register
its reassigned ID in the root graph bucket via useNodeBadgeStore(). Preserve the
existing initial registration in the node-loading path while keeping badge-store
keys synchronized after every remap.

@DrJKL
DrJKL merged commit eb80183 into feature/ecs-migration Jul 15, 2026
47 checks passed
@DrJKL
DrJKL deleted the drjkl/a-badge-is-announced branch July 15, 2026 02:56
@github-actions github-actions Bot locked and limited conversation to collaborators Jul 15, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

refactor size:L This PR changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants