Skip to content

FE-2033: feat(cmp): add define_subgraph operation - #17454

Closed
christian-byrne wants to merge 13 commits into
christian-byrne/ecw-106-comfy-multi-player-workspacefrom
christian-byrne/define-subgraph-op
Closed

christian-byrne wants to merge 13 commits into
christian-byrne/ecw-106-comfy-multi-player-workspacefrom
christian-byrne/define-subgraph-op

Conversation

@christian-byrne

@christian-byrne christian-byrne commented Sep 11, 2026 •

Copy link
Copy Markdown
Contributor
  • Adds the sole explicit define_subgraph creation op.
  • Implements the TDD V2+ cmp slice, stacked on the workspace-move PR.
  • Draft until the workspace move lands.
Full context for agent readers

Design source: subgraph support technical design

Linear scope ticket: agent editing subgraph

Related work:

Rules implemented:

  • define_subgraph alone carries a complete initial definition.
  • Definition IDs are non-empty strings and must match the payload's id.
  • Exact op replay is byte-identical and returns no-op.
  • Reusing a definition ID with different content uses the lexicographically larger canonical SHA-256 digest as the deterministic winner; a delivered loser rejects with definition_conflict. If a later arrival wins, stamped widget edits to nodes present in the winner are preserved and stamps for removed targets are discarded so later writes use the existing unknown-target path.
  • A batch can define, edit the interior by the existing path, then add an instance.
  • UUID-shaped unknown instance types use the existing invalid-node-payload rejection path; no placeholder is created.
  • Malformed definitions reject before attachment to the document.
  • Projection emits definitions under definitions.subgraphs, including nested definition data handled by the existing projection.
  • Ordinary ops reject subgraph_definition, definitions, and substitute subgraph_id fields.
  • Preserves in-op ordering identity (KA-2), portable purity (KA-3), deterministic idempotency (KA-4), catalog pinning (KA-12), no platform coupling (FC-3), stable retry identity (FC-7), and verbatim replay payloads (FC-8).

Tests added:

  • Ten negative payload/scoping cases required by the design.
  • Root/interior widget-edit parity.
  • Definition projection.
  • Byte-idempotent replay.
  • Same-ID/different-content conflict and byte identity.
  • Define-to-interior-to-instance ordering in one batch.
  • Instance-before-definition rejection.
  • Existing exhaustive vocabulary helpers updated for the new op while retaining the 200,000-case cap.

Gates:

  • Package Vitest: 72 files, 890 tests passed.
  • Package typecheck/build: passed.
  • Package lint: passed with zero errors; pre-existing warning baseline remains.
  • Purity, import graph, pins, profile claims, CodeRabbit config, and corpus verification: passed.
  • Commit hooks: formatting, oxlint, ESLint, typecheck, and knip passed.

Vetoable decisions:

  • Payload names are subgraph_id and subgraph_definition.
  • Definition scope uses the existing path field with the definition ID as the first segment; legacy instance-rooted paths remain supported.
  • Definition IDs accept any non-empty string, while UUID-shaped node types are classified as subgraph instances for unknown-definition rejection.
  • Same-ID/different-content uses definition_conflict; unknown UUID-shaped instance types use invalid_node_payload.
  • A deterministic canonical SHA-256 digest selects the conflict winner, is stored in private metadata, and is excluded from projection at every depth.
  • define_subgraph is included in the exported batchable-op set.

@coderabbitai

coderabbitai Bot commented Sep 11, 2026 •

Copy link
Copy Markdown
Contributor

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: Repository: Comfy-Org/ComfyUI_frontend/.coderabbit.yaml

Review profile: ASSERTIVE

Plan: Team

Run ID: 009666b6-3cc9-4afa-9083-5d9e6d042c7b

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:

  • 🔍 Trigger review

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

@christian-byrne christian-byrne added the cursor-review Trigger multi-model Cursor agent review on this PR label Sep 11, 2026
@github-actions

github-actions Bot commented Sep 11, 2026 •

Copy link
Copy Markdown
Contributor

🌐 Website E2E

Tip

All tests passed.

Status ✅ Passed
Report View Report

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

📊 Browser Reports
  • chromium: View Report (✅ 2009 / ❌ 0 / ⚠️ 1 / ⏭️ 13)
  • 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: 09/21/2026, 04:51:51 PM 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 · 58.5 MB heap
canvas-mouse-sweep: · 60.0 avg FPS · 59.9 P5 FPS ✅ (target: ≥52) · 0ms TBT · 65.5 MB heap
canvas-zoom-sweep: · 60.0 avg FPS · 59.7 P5 FPS ✅ (target: ≥52) · 0ms TBT · 61.5 MB heap
dom-widget-clipping: · 60.0 avg FPS · 59.7 P5 FPS ✅ (target: ≥52) · 0ms TBT · 76.4 MB heap
large-graph-idle: · 60.0 avg FPS · 59.7 P5 FPS ✅ (target: ≥52) · 0ms TBT · 72.8 MB heap
large-graph-pan: · 60.0 avg FPS · 59.9 P5 FPS ✅ (target: ≥52) · 0ms TBT · 84.4 MB heap
large-graph-zoom: · 60.0 avg FPS · 59.7 P5 FPS ✅ (target: ≥52) · 0ms TBT · 71.1 MB heap
legacy-node-drag: · 60.0 avg FPS · 59.7 P5 FPS ✅ (target: ≥52) · 0ms TBT · 70.3 MB heap
minimap-idle: · 60.0 avg FPS · 59.7 P5 FPS ✅ (target: ≥52) · 0ms TBT · 76.6 MB heap
subgraph-dom-widget-clipping: · 60.0 avg FPS · 59.7 P5 FPS ✅ (target: ≥52) · 0ms TBT · 72.4 MB heap
subgraph-idle: · 60.0 avg FPS · 59.7 P5 FPS ✅ (target: ≥52) · 0ms TBT · 53.8 MB heap
subgraph-mouse-sweep: · 60.0 avg FPS · 59.7 P5 FPS ✅ (target: ≥52) · 0ms TBT · 56.7 MB heap
subgraph-transition-enter: · 60.0 avg FPS · 59.5 P5 FPS ✅ (target: ≥52) · 88ms TBT · 98.5 MB heap
viewport-pan-sweep: · 60.0 avg FPS · 59.5 P5 FPS ✅ (target: ≥52) · 0ms TBT · 76.9 MB heap
vue-large-graph-idle: · 60.0 avg FPS · 59.9 P5 FPS ✅ (target: ≥52) · 0ms TBT · 170.2 MB heap
vue-large-graph-pan: · 57.1 avg FPS · 59.7 P5 FPS ✅ (target: ≥52) · 0ms TBT · 185.6 MB heap
vue-node-resize-workload: · 60.0 avg FPS · 59.7 P5 FPS ✅ (target: ≥52) · 4ms TBT · 167.6 MB heap
vue-zoom-out-idle: · 60.0 avg FPS · 59.9 P5 FPS ✅ (target: ≥52) · 0ms TBT · 181.5 MB heap
workflow-execution: · 60.0 avg FPS · 59.7 P5 FPS ✅ (target: ≥52) · 0ms TBT · 63.1 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 12
canvas-idle: task duration 313ms
canvas-idle: script duration 6ms
canvas-idle: TBT 0ms
canvas-idle: heap used 58.5 MB
canvas-idle: DOM nodes -118
canvas-idle: event listeners -173
canvas-mouse-sweep: avg frame time 17ms
canvas-mouse-sweep: p95 frame time 17ms
canvas-mouse-sweep: layout duration 2ms
canvas-mouse-sweep: style recalc duration 14ms
canvas-mouse-sweep: layout count 14
canvas-mouse-sweep: style recalc count 75
canvas-mouse-sweep: task duration 529ms
canvas-mouse-sweep: script duration 90ms
canvas-mouse-sweep: TBT 0ms
canvas-mouse-sweep: heap used 65.5 MB
canvas-mouse-sweep: DOM nodes -258
canvas-mouse-sweep: event listeners -169
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 10ms
canvas-zoom-sweep: layout count 6
canvas-zoom-sweep: style recalc count 31
canvas-zoom-sweep: task duration 230ms
canvas-zoom-sweep: script duration 7ms
canvas-zoom-sweep: TBT 0ms
canvas-zoom-sweep: heap used 61.5 MB
canvas-zoom-sweep: DOM nodes 77
canvas-zoom-sweep: event listeners 19
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 5ms
dom-widget-clipping: layout count 0
dom-widget-clipping: style recalc count 12
dom-widget-clipping: task duration 279ms
dom-widget-clipping: script duration 98ms
dom-widget-clipping: TBT 0ms
dom-widget-clipping: heap used 76.4 MB
dom-widget-clipping: DOM nodes 20
dom-widget-clipping: event listeners 2
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 5ms
large-graph-idle: layout count 0
large-graph-idle: style recalc count 9
large-graph-idle: task duration 426ms
large-graph-idle: script duration 20ms
large-graph-idle: TBT 0ms
large-graph-idle: heap used 72.8 MB
large-graph-idle: DOM nodes -251
large-graph-idle: event listeners -181
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 7ms
large-graph-pan: layout count 0
large-graph-pan: style recalc count 68
large-graph-pan: task duration 978ms
large-graph-pan: script duration 472ms
large-graph-pan: TBT 0ms
large-graph-pan: heap used 84.4 MB
large-graph-pan: DOM nodes -244
large-graph-pan: event listeners -89
large-graph-zoom: avg frame time 17ms
large-graph-zoom: p95 frame time 17ms
large-graph-zoom: layout duration 8ms
large-graph-zoom: style recalc duration 8ms
large-graph-zoom: layout count 60
large-graph-zoom: style recalc count 64
large-graph-zoom: task duration 1039ms
large-graph-zoom: script duration 453ms
large-graph-zoom: TBT 0ms
large-graph-zoom: heap used 71.1 MB
large-graph-zoom: DOM nodes 9
large-graph-zoom: event listeners 8
legacy-node-drag: avg frame time 17ms
legacy-node-drag: p95 frame time 17ms
legacy-node-drag: layout duration 0ms
legacy-node-drag: style recalc duration 6ms
legacy-node-drag: layout count 0
legacy-node-drag: style recalc count 46
legacy-node-drag: task duration 1164ms
legacy-node-drag: script duration 541ms
legacy-node-drag: TBT 0ms
legacy-node-drag: heap used 70.3 MB
legacy-node-drag: DOM nodes -105
legacy-node-drag: event listeners 90
minimap-idle: avg frame time 17ms
minimap-idle: p95 frame time 17ms
minimap-idle: layout duration 0ms
minimap-idle: style recalc duration 4ms
minimap-idle: layout count 0
minimap-idle: style recalc count 9
minimap-idle: task duration 388ms
minimap-idle: script duration 19ms
minimap-idle: TBT 0ms
minimap-idle: heap used 76.6 MB
minimap-idle: DOM nodes -245
minimap-idle: event listeners -167
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 7ms
subgraph-dom-widget-clipping: layout count 0
subgraph-dom-widget-clipping: style recalc count 48
subgraph-dom-widget-clipping: task duration 253ms
subgraph-dom-widget-clipping: script duration 86ms
subgraph-dom-widget-clipping: TBT 0ms
subgraph-dom-widget-clipping: heap used 72.4 MB
subgraph-dom-widget-clipping: DOM nodes 22
subgraph-dom-widget-clipping: event listeners 8
subgraph-idle: avg frame time 17ms
subgraph-idle: p95 frame time 17ms
subgraph-idle: layout duration 0ms
subgraph-idle: style recalc duration 5ms
subgraph-idle: layout count 0
subgraph-idle: style recalc count 11
subgraph-idle: task duration 313ms
subgraph-idle: script duration 5ms
subgraph-idle: TBT 0ms
subgraph-idle: heap used 53.8 MB
subgraph-idle: DOM nodes -127
subgraph-idle: event listeners -96
subgraph-mouse-sweep: avg frame time 17ms
subgraph-mouse-sweep: p95 frame time 17ms
subgraph-mouse-sweep: layout duration 3ms
subgraph-mouse-sweep: style recalc duration 15ms
subgraph-mouse-sweep: layout count 18
subgraph-mouse-sweep: style recalc count 78
subgraph-mouse-sweep: task duration 489ms
subgraph-mouse-sweep: script duration 59ms
subgraph-mouse-sweep: TBT 0ms
subgraph-mouse-sweep: heap used 56.7 MB
subgraph-mouse-sweep: DOM nodes -273
subgraph-mouse-sweep: event listeners -230
subgraph-transition-enter: avg frame time 17ms
subgraph-transition-enter: p95 frame time 17ms
subgraph-transition-enter: layout duration 7ms
subgraph-transition-enter: style recalc duration 18ms
subgraph-transition-enter: layout count 5
subgraph-transition-enter: style recalc count 19
subgraph-transition-enter: task duration 569ms
subgraph-transition-enter: script duration 17ms
subgraph-transition-enter: TBT 88ms
subgraph-transition-enter: heap used 98.5 MB
subgraph-transition-enter: DOM nodes 13587
subgraph-transition-enter: event listeners 2385
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 20ms
viewport-pan-sweep: layout count 0
viewport-pan-sweep: style recalc count 249
viewport-pan-sweep: task duration 3518ms
viewport-pan-sweep: script duration 1612ms
viewport-pan-sweep: TBT 0ms
viewport-pan-sweep: heap used 76.9 MB
viewport-pan-sweep: DOM nodes -247
viewport-pan-sweep: event listeners -161
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 8571ms
vue-large-graph-idle: script duration 90ms
vue-large-graph-idle: TBT 0ms
vue-large-graph-idle: heap used 170.2 MB
vue-large-graph-idle: DOM nodes -8062
vue-large-graph-idle: event listeners -14928
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 11ms
vue-large-graph-pan: layout count 0
vue-large-graph-pan: style recalc count 67
vue-large-graph-pan: task duration 11202ms
vue-large-graph-pan: script duration 529ms
vue-large-graph-pan: TBT 0ms
vue-large-graph-pan: heap used 185.6 MB
vue-large-graph-pan: DOM nodes -8077
vue-large-graph-pan: event listeners -14925
vue-node-resize-workload: avg frame time 17ms
vue-node-resize-workload: p95 frame time 17ms
vue-node-resize-workload: layout duration 16ms
vue-node-resize-workload: style recalc duration 50ms
vue-node-resize-workload: layout count 20
vue-node-resize-workload: style recalc count 20
vue-node-resize-workload: task duration 3158ms
vue-node-resize-workload: script duration 42ms
vue-node-resize-workload: TBT 4ms
vue-node-resize-workload: heap used 167.6 MB
vue-node-resize-workload: DOM nodes -8062
vue-node-resize-workload: event listeners -14927
vue-zoom-out-idle: avg frame time 17ms
vue-zoom-out-idle: p95 frame time 17ms
vue-zoom-out-idle: layout duration 0ms
vue-zoom-out-idle: style recalc duration 0ms
vue-zoom-out-idle: layout count 0
vue-zoom-out-idle: style recalc count 1
vue-zoom-out-idle: task duration 4308ms
vue-zoom-out-idle: script duration 48ms
vue-zoom-out-idle: TBT 0ms
vue-zoom-out-idle: heap used 181.5 MB
vue-zoom-out-idle: DOM nodes 0
vue-zoom-out-idle: event listeners -7
workflow-execution: avg frame time 17ms
workflow-execution: p95 frame time 17ms
workflow-execution: layout duration 1ms
workflow-execution: style recalc duration 11ms
workflow-execution: layout count 4
workflow-execution: style recalc count 10
workflow-execution: task duration 67ms
workflow-execution: script duration 7ms
workflow-execution: TBT 0ms
workflow-execution: heap used 63.1 MB
workflow-execution: DOM nodes 125
workflow-execution: event listeners 50
Raw data
{
  "timestamp": "2026-09-21T16:59:16.832Z",
  "gitSha": "d8d21eb9b571d7c5d2826a9cd4ab3837f793e0d0",
  "branch": "christian-byrne/define-subgraph-op",
  "measurements": [
    {
      "name": "canvas-idle",
      "durationMs": 2008.9120000000094,
      "styleRecalcs": 12,
      "styleRecalcDurationMs": 5.872,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 354.576,
      "heapDeltaBytes": -6747964,
      "heapUsedBytes": 55778328,
      "domNodes": 23,
      "jsHeapTotalBytes": 4710400,
      "scriptDurationMs": 5.756000000000001,
      "eventListeners": -194,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.670000000000012,
      "p95FrameDurationMs": 16.800000000000182
    },
    {
      "name": "canvas-idle",
      "durationMs": 1987.7290000000016,
      "styleRecalcs": 11,
      "styleRecalcDurationMs": 5.328,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 271.41499999999996,
      "heapDeltaBytes": 4723908,
      "heapUsedBytes": 66967700,
      "domNodes": -258,
      "jsHeapTotalBytes": 4448256,
      "scriptDurationMs": 5.96,
      "eventListeners": -152,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666666666666668,
      "p95FrameDurationMs": 16.800000000000182
    },
    {
      "name": "canvas-mouse-sweep",
      "durationMs": 1695.8810000000426,
      "styleRecalcs": 75,
      "styleRecalcDurationMs": 14.612,
      "layouts": 14,
      "layoutDurationMs": 2.578,
      "taskDurationMs": 528.996,
      "heapDeltaBytes": 15734396,
      "heapUsedBytes": 78390444,
      "domNodes": -258,
      "jsHeapTotalBytes": 5234688,
      "scriptDurationMs": 91.697,
      "eventListeners": -154,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666666666666668,
      "p95FrameDurationMs": 16.700000000000728
    },
    {
      "name": "canvas-mouse-sweep",
      "durationMs": 1691.675000000032,
      "styleRecalcs": 74,
      "styleRecalcDurationMs": 14.353,
      "layouts": 14,
      "layoutDurationMs": 2.3469999999999995,
      "taskDurationMs": 528.719,
      "heapDeltaBytes": -3464348,
      "heapUsedBytes": 59029748,
      "domNodes": -257,
      "jsHeapTotalBytes": 5234688,
      "scriptDurationMs": 87.908,
      "eventListeners": -184,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.66333333333332,
      "p95FrameDurationMs": 16.700000000000728
    },
    {
      "name": "canvas-zoom-sweep",
      "durationMs": 1709.8660000000336,
      "styleRecalcs": 31,
      "styleRecalcDurationMs": 11.390999999999998,
      "layouts": 6,
      "layoutDurationMs": 0.98,
      "taskDurationMs": 244.732,
      "heapDeltaBytes": 2213460,
      "heapUsedBytes": 64390880,
      "domNodes": 76,
      "jsHeapTotalBytes": 5242880,
      "scriptDurationMs": 7.281000000000001,
      "eventListeners": 19,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666666666666668,
      "p95FrameDurationMs": 16.700000000000728
    },
    {
      "name": "canvas-zoom-sweep",
      "durationMs": 1711.3879999999995,
      "styleRecalcs": 30,
      "styleRecalcDurationMs": 9.575999999999997,
      "layouts": 6,
      "layoutDurationMs": 0.8079999999999999,
      "taskDurationMs": 215.13800000000003,
      "heapDeltaBytes": 2175472,
      "heapUsedBytes": 64671304,
      "domNodes": 77,
      "jsHeapTotalBytes": 5767168,
      "scriptDurationMs": 6.7029999999999985,
      "eventListeners": 19,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.66333333333332,
      "p95FrameDurationMs": 16.800000000000182
    },
    {
      "name": "dom-widget-clipping",
      "durationMs": 433.12399999996387,
      "styleRecalcs": 12,
      "styleRecalcDurationMs": 4.922000000000001,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 278.64,
      "heapDeltaBytes": 17560780,
      "heapUsedBytes": 80242144,
      "domNodes": 20,
      "jsHeapTotalBytes": 4980736,
      "scriptDurationMs": 97.53699999999999,
      "eventListeners": 2,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.669999999999998,
      "p95FrameDurationMs": 16.799999999999727
    },
    {
      "name": "dom-widget-clipping",
      "durationMs": 450.10899999999765,
      "styleRecalcs": 12,
      "styleRecalcDurationMs": 4.718000000000001,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 279.523,
      "heapDeltaBytes": 17476788,
      "heapUsedBytes": 79984504,
      "domNodes": 20,
      "jsHeapTotalBytes": 5242880,
      "scriptDurationMs": 97.563,
      "eventListeners": 2,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666666666666668,
      "p95FrameDurationMs": 16.700000000000273
    },
    {
      "name": "large-graph-idle",
      "durationMs": 1991.8160000000285,
      "styleRecalcs": 9,
      "styleRecalcDurationMs": 4.558000000000002,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 404.633,
      "heapDeltaBytes": -1724284,
      "heapUsedBytes": 77536960,
      "domNodes": -247,
      "jsHeapTotalBytes": -8192,
      "scriptDurationMs": 18.874999999999996,
      "eventListeners": -182,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.66333333333335,
      "p95FrameDurationMs": 16.800000000000182
    },
    {
      "name": "large-graph-idle",
      "durationMs": 2009.9309999999946,
      "styleRecalcs": 9,
      "styleRecalcDurationMs": 5.545,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 446.783,
      "heapDeltaBytes": -11298888,
      "heapUsedBytes": 75175600,
      "domNodes": -254,
      "jsHeapTotalBytes": -233472,
      "scriptDurationMs": 20.930999999999997,
      "eventListeners": -180,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.66333333333332,
      "p95FrameDurationMs": 16.700000000000728
    },
    {
      "name": "large-graph-pan",
      "durationMs": 2101.169000000027,
      "styleRecalcs": 67,
      "styleRecalcDurationMs": 6.660999999999999,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 948.7110000000001,
      "heapDeltaBytes": 14800928,
      "heapUsedBytes": 79555656,
      "domNodes": -243,
      "jsHeapTotalBytes": 1011712,
      "scriptDurationMs": 467.75,
      "eventListeners": 4,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.66333333333335,
      "p95FrameDurationMs": 16.699999999999818
    },
    {
      "name": "large-graph-pan",
      "durationMs": 2128.4899999999993,
      "styleRecalcs": 69,
      "styleRecalcDurationMs": 8.104,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 1007.7389999999999,
      "heapDeltaBytes": 17999336,
      "heapUsedBytes": 97386756,
      "domNodes": -244,
      "jsHeapTotalBytes": 3624960,
      "scriptDurationMs": 476.427,
      "eventListeners": -182,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666666666666668,
      "p95FrameDurationMs": 16.700000000000728
    },
    {
      "name": "large-graph-zoom",
      "durationMs": 3036.846999999966,
      "styleRecalcs": 64,
      "styleRecalcDurationMs": 7.851999999999998,
      "layouts": 60,
      "layoutDurationMs": 7.5459999999999985,
      "taskDurationMs": 979.852,
      "heapDeltaBytes": 8128140,
      "heapUsedBytes": 74326476,
      "domNodes": 10,
      "jsHeapTotalBytes": 262144,
      "scriptDurationMs": 425.165,
      "eventListeners": 8,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666666666666668,
      "p95FrameDurationMs": 16.700000000000728
    },
    {
      "name": "large-graph-zoom",
      "durationMs": 3059.7569999999905,
      "styleRecalcs": 63,
      "styleRecalcDurationMs": 8.152,
      "layouts": 60,
      "layoutDurationMs": 8.388,
      "taskDurationMs": 1098.668,
      "heapDeltaBytes": 8702872,
      "heapUsedBytes": 74820392,
      "domNodes": 8,
      "jsHeapTotalBytes": 0,
      "scriptDurationMs": 479.87100000000004,
      "eventListeners": 8,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.670000000000012,
      "p95FrameDurationMs": 16.800000000000182
    },
    {
      "name": "legacy-node-drag",
      "durationMs": 2172.971000000018,
      "styleRecalcs": 47,
      "styleRecalcDurationMs": 6.7829999999999995,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 1180.344,
      "heapDeltaBytes": -16475788,
      "heapUsedBytes": 66650400,
      "domNodes": -220,
      "jsHeapTotalBytes": 778240,
      "scriptDurationMs": 536.2,
      "eventListeners": -4,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.66333333333332,
      "p95FrameDurationMs": 16.700000000000728
    },
    {
      "name": "legacy-node-drag",
      "durationMs": 2104.0700000000356,
      "styleRecalcs": 45,
      "styleRecalcDurationMs": 4.628,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 1147.954,
      "heapDeltaBytes": 14943372,
      "heapUsedBytes": 80842124,
      "domNodes": 10,
      "jsHeapTotalBytes": 679936,
      "scriptDurationMs": 545.0310000000001,
      "eventListeners": 184,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666666666666668,
      "p95FrameDurationMs": 16.799999999999272
    },
    {
      "name": "minimap-idle",
      "durationMs": 2020.8450000000084,
      "styleRecalcs": 8,
      "styleRecalcDurationMs": 4.100000000000001,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 376.93100000000004,
      "heapDeltaBytes": -3952844,
      "heapUsedBytes": 83802560,
      "domNodes": -240,
      "jsHeapTotalBytes": -1282048,
      "scriptDurationMs": 16.465,
      "eventListeners": -152,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666666666666668,
      "p95FrameDurationMs": 16.800000000000182
    },
    {
      "name": "minimap-idle",
      "durationMs": 2012.499000000048,
      "styleRecalcs": 9,
      "styleRecalcDurationMs": 4.614000000000002,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 398.11400000000003,
      "heapDeltaBytes": -10565040,
      "heapUsedBytes": 76795912,
      "domNodes": -250,
      "jsHeapTotalBytes": 28672,
      "scriptDurationMs": 21.486000000000004,
      "eventListeners": -182,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666666666666668,
      "p95FrameDurationMs": 16.700000000000728
    },
    {
      "name": "subgraph-dom-widget-clipping",
      "durationMs": 414.45000000004484,
      "styleRecalcs": 47,
      "styleRecalcDurationMs": 6.424000000000001,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 254.48099999999997,
      "heapDeltaBytes": 12743116,
      "heapUsedBytes": 75122176,
      "domNodes": 20,
      "jsHeapTotalBytes": 5505024,
      "scriptDurationMs": 87.784,
      "eventListeners": 8,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666666666666668,
      "p95FrameDurationMs": 16.800000000000182
    },
    {
      "name": "subgraph-dom-widget-clipping",
      "durationMs": 411.3479999999754,
      "styleRecalcs": 49,
      "styleRecalcDurationMs": 7.3740000000000006,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 252.49300000000002,
      "heapDeltaBytes": 13434680,
      "heapUsedBytes": 76691132,
      "domNodes": 23,
      "jsHeapTotalBytes": 5505024,
      "scriptDurationMs": 84.52600000000001,
      "eventListeners": 8,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666666666666668,
      "p95FrameDurationMs": 16.700000000000273
    },
    {
      "name": "subgraph-idle",
      "durationMs": 1993.1050000000141,
      "styleRecalcs": 10,
      "styleRecalcDurationMs": 5.068,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 318.005,
      "heapDeltaBytes": -4867132,
      "heapUsedBytes": 57873652,
      "domNodes": -274,
      "jsHeapTotalBytes": 4710400,
      "scriptDurationMs": 4.8629999999999995,
      "eventListeners": -198,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.670000000000012,
      "p95FrameDurationMs": 16.800000000000182
    },
    {
      "name": "subgraph-idle",
      "durationMs": 1998.8819999999805,
      "styleRecalcs": 11,
      "styleRecalcDurationMs": 5.210000000000001,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 307.69199999999995,
      "heapDeltaBytes": -8424360,
      "heapUsedBytes": 54967820,
      "domNodes": 21,
      "jsHeapTotalBytes": 4710400,
      "scriptDurationMs": 4.8229999999999995,
      "eventListeners": 6,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666666666666668,
      "p95FrameDurationMs": 16.700000000000728
    },
    {
      "name": "subgraph-mouse-sweep",
      "durationMs": 1691.8529999999805,
      "styleRecalcs": 78,
      "styleRecalcDurationMs": 15.163,
      "layouts": 18,
      "layoutDurationMs": 3.006,
      "taskDurationMs": 472.156,
      "heapDeltaBytes": -3094848,
      "heapUsedBytes": 60621816,
      "domNodes": -272,
      "jsHeapTotalBytes": 5234688,
      "scriptDurationMs": 57.461999999999996,
      "eventListeners": -230,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.66333333333332,
      "p95FrameDurationMs": 16.700000000000728
    },
    {
      "name": "subgraph-mouse-sweep",
      "durationMs": 1695.0899999999933,
      "styleRecalcs": 77,
      "styleRecalcDurationMs": 15.803999999999998,
      "layouts": 18,
      "layoutDurationMs": 3.3890000000000002,
      "taskDurationMs": 505.99399999999997,
      "heapDeltaBytes": -5328468,
      "heapUsedBytes": 58378732,
      "domNodes": -273,
      "jsHeapTotalBytes": 6283264,
      "scriptDurationMs": 60.12500000000001,
      "eventListeners": -230,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666666666666668,
      "p95FrameDurationMs": 16.799999999999272
    },
    {
      "name": "subgraph-transition-enter",
      "durationMs": 815.858999999989,
      "styleRecalcs": 19,
      "styleRecalcDurationMs": 18.452,
      "layouts": 5,
      "layoutDurationMs": 7.434999999999999,
      "taskDurationMs": 568.8480000000001,
      "heapDeltaBytes": 20010616,
      "heapUsedBytes": 103266280,
      "domNodes": 13587,
      "jsHeapTotalBytes": 11272192,
      "scriptDurationMs": 17.433000000000003,
      "eventListeners": 2385,
      "totalBlockingTimeMs": 88,
      "frameDurationMs": 16.666666666666668,
      "p95FrameDurationMs": 16.800000000000182
    },
    {
      "name": "viewport-pan-sweep",
      "durationMs": 8102.035000000001,
      "styleRecalcs": 249,
      "styleRecalcDurationMs": 20.65,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 3638.898,
      "heapDeltaBytes": 15652668,
      "heapUsedBytes": 94472684,
      "domNodes": -253,
      "jsHeapTotalBytes": 2052096,
      "scriptDurationMs": 1684.462,
      "eventListeners": -176,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666666666666668,
      "p95FrameDurationMs": 16.80000000000109
    },
    {
      "name": "viewport-pan-sweep",
      "durationMs": 8126.854000000038,
      "styleRecalcs": 249,
      "styleRecalcDurationMs": 19.755000000000003,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 3397.11,
      "heapDeltaBytes": -12444084,
      "heapUsedBytes": 66751952,
      "domNodes": -241,
      "jsHeapTotalBytes": 2613248,
      "scriptDurationMs": 1539.0710000000001,
      "eventListeners": -146,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.66333333333332,
      "p95FrameDurationMs": 16.799999999999272
    },
    {
      "name": "vue-large-graph-idle",
      "durationMs": 9154.35199999996,
      "styleRecalcs": 0,
      "styleRecalcDurationMs": 0,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 8414.683,
      "heapDeltaBytes": -22713008,
      "heapUsedBytes": 186447948,
      "domNodes": -8062,
      "jsHeapTotalBytes": -7118848,
      "scriptDurationMs": 81.632,
      "eventListeners": -14928,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.66333333333332,
      "p95FrameDurationMs": 16.700000000000728
    },
    {
      "name": "vue-large-graph-idle",
      "durationMs": 9532.68300000002,
      "styleRecalcs": 0,
      "styleRecalcDurationMs": 0,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 8727.903,
      "heapDeltaBytes": -44609952,
      "heapUsedBytes": 170485016,
      "domNodes": -8062,
      "jsHeapTotalBytes": -11268096,
      "scriptDurationMs": 99.22200000000001,
      "eventListeners": -14928,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.66333333333326,
      "p95FrameDurationMs": 16.700000000000728
    },
    {
      "name": "vue-large-graph-pan",
      "durationMs": 11805.831000000013,
      "styleRecalcs": 66,
      "styleRecalcDurationMs": 9.419000000000011,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 11125.024,
      "heapDeltaBytes": -18111192,
      "heapUsedBytes": 197659444,
      "domNodes": -8062,
      "jsHeapTotalBytes": -5033984,
      "scriptDurationMs": 505.424,
      "eventListeners": -14923,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 17.776666666666642,
      "p95FrameDurationMs": 16.799999999999272
    },
    {
      "name": "vue-large-graph-pan",
      "durationMs": 12068.597000000067,
      "styleRecalcs": 67,
      "styleRecalcDurationMs": 11.914000000000009,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 11279.964,
      "heapDeltaBytes": -37257100,
      "heapUsedBytes": 191508092,
      "domNodes": -8091,
      "jsHeapTotalBytes": -12111872,
      "scriptDurationMs": 552.578,
      "eventListeners": -14926,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 17.219999999999953,
      "p95FrameDurationMs": 16.700000000000728
    },
    {
      "name": "vue-node-resize-workload",
      "durationMs": 3269.9399999999628,
      "styleRecalcs": 20,
      "styleRecalcDurationMs": 50.805000000000014,
      "layouts": 20,
      "layoutDurationMs": 16.343999999999998,
      "taskDurationMs": 3127.7309999999998,
      "heapDeltaBytes": -52104504,
      "heapUsedBytes": 179147528,
      "domNodes": -8062,
      "jsHeapTotalBytes": 22487040,
      "scriptDurationMs": 39.86600000000001,
      "eventListeners": -14928,
      "totalBlockingTimeMs": 2,
      "frameDurationMs": 16.666666666666668,
      "p95FrameDurationMs": 16.700000000000728
    },
    {
      "name": "vue-node-resize-workload",
      "durationMs": 3360.341999999946,
      "styleRecalcs": 20,
      "styleRecalcDurationMs": 48.99300000000001,
      "layouts": 20,
      "layoutDurationMs": 16.408999999999992,
      "taskDurationMs": 3187.3489999999997,
      "heapDeltaBytes": -44283816,
      "heapUsedBytes": 172257020,
      "domNodes": -8062,
      "jsHeapTotalBytes": 18546688,
      "scriptDurationMs": 43.728,
      "eventListeners": -14926,
      "totalBlockingTimeMs": 5,
      "frameDurationMs": 16.666666666666668,
      "p95FrameDurationMs": 16.799999999999272
    },
    {
      "name": "vue-zoom-out-idle",
      "durationMs": 4606.378000000006,
      "styleRecalcs": 1,
      "styleRecalcDurationMs": 0.09500000000001174,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 4283.207,
      "heapDeltaBytes": 2094348,
      "heapUsedBytes": 184268872,
      "domNodes": 0,
      "jsHeapTotalBytes": -15466496,
      "scriptDurationMs": 45.39199999999999,
      "eventListeners": -6,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.670000000000012,
      "p95FrameDurationMs": 16.700000000000728
    },
    {
      "name": "vue-zoom-out-idle",
      "durationMs": 4693.144999999959,
      "styleRecalcs": 0,
      "styleRecalcDurationMs": 0,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 4332.21,
      "heapDeltaBytes": 18997896,
      "heapUsedBytes": 196357788,
      "domNodes": 0,
      "jsHeapTotalBytes": -13631488,
      "scriptDurationMs": 49.816000000000024,
      "eventListeners": -8,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.66666666666673,
      "p95FrameDurationMs": 16.700000000000728
    },
    {
      "name": "workflow-execution",
      "durationMs": 70.77500000002601,
      "styleRecalcs": 5,
      "styleRecalcDurationMs": 8.691999999999998,
      "layouts": 4,
      "layoutDurationMs": 1.3729999999999998,
      "taskDurationMs": 51.02599999999999,
      "heapDeltaBytes": 3182696,
      "heapUsedBytes": 65274264,
      "domNodes": 125,
      "jsHeapTotalBytes": 0,
      "scriptDurationMs": 6.409000000000002,
      "eventListeners": 17,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666666666666668,
      "p95FrameDurationMs": 16.700000000000273
    },
    {
      "name": "workflow-execution",
      "durationMs": 421.0480000000416,
      "styleRecalcs": 14,
      "styleRecalcDurationMs": 13.516999999999998,
      "layouts": 3,
      "layoutDurationMs": 0.775,
      "taskDurationMs": 82.60300000000001,
      "heapDeltaBytes": 4902052,
      "heapUsedBytes": 67019312,
      "domNodes": 124,
      "jsHeapTotalBytes": 0,
      "scriptDurationMs": 7.195999999999999,
      "eventListeners": 83,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.663333333333338,
      "p95FrameDurationMs": 16.800000000000182
    }
  ]
}

🔬 E2E Coverage

Metric Covered Total Pct
Lines 51072 77342 66.0% 🟡
Functions 0 0 — —
Branches 0 0 — —
Top 10 files by uncovered lines
File Coverage Missed
src/LGraphCanvas.ts 67.7% 1159
src/LGraphNode.ts 69.9% 388
src/extensions/core/cameraInfo/CameraInfoViewport.ts 2.5% 344
src/renderer/extensions/layerEditor/composables/useLayerEditorSession.ts 40.1% 332
src/platform/workspace/stores/workspaceAuthStore.ts 33.1% 331
src/platform/workspace/stores/billingOperationStore.ts 7.9% 313
src/LGraph.ts 79.1% 263
src/platform/workspace/stores/teamWorkspaceStore.ts 38.9% 256
src/scripts/app.ts 71.7% 255
src/core/billing/operationLifecycle.ts 0.9% 226

@codecov

codecov Bot commented Sep 11, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 13.19149% with 204 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
packages/comfy-multi-player/src/applier.ts 1.72% 171 Missing ⚠️
packages/comfy-multi-player/src/project.ts 0.00% 21 Missing ⚠️
packages/comfy-multi-player/src/doc.ts 0.00% 10 Missing ⚠️
packages/comfy-multi-player/src/stamps.ts 0.00% 2 Missing ⚠️
@@                                   Coverage Diff                                    @@
##           christian-byrne/ecw-106-comfy-multi-player-workspace   #17454      +/-   ##
========================================================================================
- Coverage                                                 83.64%   79.92%   -3.72%     
========================================================================================
  Files                                                      2226     2169      -57     
  Lines                                                    126658   133189    +6531     
  Branches                                                  36174    33440    -2734     
========================================================================================
+ Hits                                                     105943   106457     +514     
- Misses                                                    20407    26534    +6127     
+ Partials                                                    308      198     -110     
Flag Coverage Δ
billing-web-unit 77.35% <ø> (ø)
e2e 66.04% <ø> (+0.02%) ⬆️

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

Files with missing lines Coverage Δ
packages/comfy-multi-player/src/mint.ts 94.38% <100.00%> (ø)
packages/comfy-multi-player/src/types.ts 90.00% <100.00%> (ø)
.../extensions/agent/crdt/agentSubgraphDefinitions.ts 95.65% <100.00%> (-2.58%) ⬇️
packages/comfy-multi-player/src/stamps.ts 66.66% <0.00%> (ø)
packages/comfy-multi-player/src/doc.ts 56.27% <0.00%> (ø)
packages/comfy-multi-player/src/project.ts 0.00% <0.00%> (ø)
packages/comfy-multi-player/src/applier.ts 47.35% <1.72%> (ø)

... and 545 files with indirect coverage changes

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

@github-actions github-actions Bot added the risk:high PR risk grade (advisory shadow check; grader-owned) label Sep 11, 2026

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

🔍 Cursor Review — Consolidated panel

Triggered by @christian-byrne.

Found 10 finding(s).

Severity Count
🔴 Critical 1
🟠 High 7
🟡 Medium 2

Panel: 8/8 reviewers contributed findings.

Comment thread packages/comfy-multi-player/src/mint.ts Resolved

@christian-byrne christian-byrne left a comment

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.

  • Blocker: concurrent same-id ops diverge by delivery order
  • Nested definitions project but cannot be safely addressed or uniqued
  • Internal digest leaks; unknown UUIDs change established failure semantics
Full context for agent readers

Reviewed exact head dcf4315d571ea7b60e358a42a9e86399f54ef97c against base 7fe9d7d30fc338507c0db2284c1d9286171ddbb1.

Findings:

  1. Critical, packages/comfy-multi-player/src/applier.ts:480: conflicting concurrent definitions are first-arrival-wins. Opposite legal delivery orders over the same two ops projected A versus B, violating KA-4 convergence.
  2. High, packages/comfy-multi-player/src/applier.ts:535: nested definitions are validated and projected but stored as opaque JSON, so ordinary id-addressed edits cannot resolve them.
  3. High, packages/comfy-multi-player/src/applier.ts:525: nested IDs are checked only among siblings. Reuse against an ancestor or across branches is accepted, then frontend flattening collapses duplicate IDs.
  4. Medium, packages/comfy-multi-player/src/applier.ts:497: __definition_digest is not private end-to-end. The frontend follower reader emits the generated root key, and payload-supplied nested keys leak through package projection.
  5. Medium, packages/comfy-multi-player/src/applier.ts:1116: an unknown UUID-shaped interior target now rejects not_a_subgraph, while the same existing unknown-node path for a non-UUID target remains a no-op.

Reviewer-only probes, removed afterward: opposite-order conflicting definitions; nested definition edit by ID; duplicate IDs across branches and against an ancestor; nested private-key projection. All four failed on the head. Existing coverage did verify key-order-independent digest, replay after an interior edit, same-batch define/edit/add, sibling duplicate rejection, malformed-payload byte identity, and nested projection.

Verified commands:

  • pnpm install --frozen-lockfile: passed
  • pnpm vitest run packages/comfy-multi-player: expected root-config exclusion, no tests found
  • package pnpm test: 72 files, 898 tests passed
  • pnpm typecheck: passed
  • pnpm lint: passed with 189 existing warnings, 0 errors
  • package pnpm run build, check:purity, check:imports, check:pins, check:profile-claims, check:coderabbit, verify:corpus: passed
  • git diff --check: passed

Could not verify a CRDT insert_workflow op or remapWorkflowIds integration because neither symbol exists in this checkout. The frontend insertWorkflow path deserializes clipboard items and does not exercise this op applier. Direct Yjs merge of independently edited docs is prohibited by KA-1; the relevant concurrency probe therefore replayed the same semantic op set in opposite legal orders from one seeded snapshot.

@christian-byrne christian-byrne left a comment

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.

Three correctness gaps remain: conflict/edit convergence, tree-wide ID uniqueness, and private-key projection.

Full context for agent readers

All three were reproduced against the exact head with focused Vitest probes. The package suite and required gates remain green, so these are missing interaction cases rather than existing-suite failures.

@christian-byrne christian-byrne left a comment

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.

One P1: conflict replacement breaks deterministic convergence.

Full context for agent readers

A reviewer probe found two legal orders of the same op set produce different projections when a causal interior edit races the winning conflicting definition. Package tests, build, typecheck, lint, and the requested static gates otherwise passed.

@christian-byrne christian-byrne changed the title feat(cmp): add define_subgraph op for explicit subgraph creation feat(cmp): add define_subgraph operation Sep 11, 2026

@christian-byrne christian-byrne left a comment

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.

One blocking uniqueness gap. Other targeted V2 regressions fixed. Gates green except mutation evidence absent.

Full context for agent readers

Finding: a higher-digest replacement can introduce a nested definition ID already used by another root definition. The replacement branch does not call the whole-tree availability check used for first creation. Reviewer probe accepted the replacement and projected the duplicated ID twice.

Verified at 98c26c24db8e9c78a8c757289726ce13f41d7bb9:

  • Exact replay idempotence, conflict convergence under opposite legal replay orders, surviving-node widget edits, and removed-target rejection.
  • Nested definitions are projected and ID-addressable.
  • Root, ancestor, nested, and cross-branch uniqueness paths covered, with the replacement exception above.
  • UUID-shaped and ordinary unknown interior targets share the same no-op path.
  • Private __* keys do not leak at root or nested projection levels.
  • Ordinary ops reject definition payloads; malformed definitions reject atomically.
  • Install, package build, package tests, root typecheck, root lint, and seven package check:* plus verify:corpus gates completed. Package tests: 914 passed; stateless gate: 3 passed. Root lint: 0 errors, 189 existing warnings.

Not verified: mutation score, because check:mutation-report returned INCONCLUSIVE with no local mutation report. Remote reachability of pinned SHAs was not checked; the required offline pin check passed.

@christian-byrne christian-byrne left a comment

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.

One uniqueness defect found. Package and root gates otherwise green. Feature-flag policy failure is unrelated.

Full context for agent readers

Finding: a fresh define_subgraph op whose ID already belongs to a nested definition is accepted as a no-op when its canonical content matches. The contract requires every creation ID to be new across the whole definition tree; only exact replay of the identical op is idempotent. This acceptance also consumes the fresh op_id, masking an invalid second creation attempt instead of returning definition_conflict.

Verification:

  • Package build, typecheck, lint, test: passed; 72 files and 919 tests, lint had zero errors and existing warnings.
  • Package check:purity, check:pins, check:profile-claims, check:coderabbit, check:imports, check:stateless, and verify:corpus: passed.
  • Package check:mutation-report: inconclusive because no mutation report exists; mutation testing was not requested.
  • Root pnpm typecheck: passed.
  • CI feature-flag-policy failure noted as the known unrelated policy check. Website E2E is also red; it was not reproduced or attributed during this focused semantic review.

Reviewer-only probe covered opposite-order conflict convergence, nested ID-addressed editing, ancestor and cross-branch duplicate rejection, recursive private-key scrubbing, UUID-shaped and non-UUID unknown-target parity, and retention of widget edits on surviving nodes. All passed until the final nested-ID reuse assertion, which reproduced the defect: expected definition_conflict, received accepted no-op. The probe was removed afterward.

@christian-byrne christian-byrne changed the title feat(cmp): add define_subgraph operation FE-2033: feat(cmp): add define_subgraph operation Sep 14, 2026
@DrJKL
DrJKL added this pull request to stack #17874 September 16, 2026 23:01
@DrJKL
DrJKL removed this pull request from stack #17874 September 16, 2026 23:04

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

Three P1 findings block the stack:

  • A deterministic definition loser aborts its batch suffix, so replicas apply different operations.
  • Winning replacement drops valid instance-addressed widget edits.
  • Shared definitions instantiated below another nested definition are undercounted, allowing an edit that should reject.

I reproduced all three against 3e01e26be8db108ccae970df267d4820274ba54d. The remaining code and test findings are inline.

Findings without an inline anchor
  • P2: The PR description says definition IDs accept any non-empty string, but applyDefineSubgraph requires UUIDs. It also says an unknown UUID instance type rejects and cites an instance-before-definition rejection test, while the final implementation and test explicitly accept that case. Please update those protocol claims.
  • P3: The PR reports 890 package tests, but this head passes 920. The exact "ten negative cases" claim is not mapped to named tests, and the hook/lint claims have no current-head logs in the supplied evidence. Please update or remove stale verification claims.
Existing findings checked

The current head fixes the earlier findings for recursive widget validation, direct shared-definition guarding, first-arrival conflict selection, digest fallback after mint or compaction, UUID-shaped unknown-path parity, reserved-key validation, nested addressing, whole-tree uniqueness, replacement collisions, and fresh-op reuse of nested IDs.

The earlier private-key finding remains at the frontend reader and is covered by an inline comment. The earlier ordinary-edit preservation finding is only partly fixed: direct definition-addressed edits survive, but instance-addressed edits do not.

Coverage and checks

Standard review depth with correctness, maintainability, TypeScript, tests, and documentation lanes. All 13 changed files were covered.

  • Package typecheck passed.
  • Package Vitest passed: 72 files, 920 tests.
  • Purity, import graph, pins, profile claims, CodeRabbit configuration, and corpus checks passed.
  • Root typecheck and git diff --check passed.
  • Three focused probes reproduced the P1 findings.
  • Fallow found five introduced complexity signals. Four overlap the reported findings. Its raw mintDefinition size signal was not actionable by itself. Fallow also warned that repository baselines matched no current paths.

setDefinitionDigest(doc, op.subgraph_id, digest);
return "applied";
}
throw new OpRejectedError(

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 (P1): Returning definition_conflict for the deterministic loser aborts the remainder of this applyOps batch. I reproduced [loser, winner, suffix] applying the suffix while [winner, loser, suffix] reports batch_aborted for it, so the same op set leaves different projections and violates KA-4. Please make the digest loser a consumed deterministic no-op or equivalent suffix-neutral outcome, and submit the contender plus suffix in one applyOps call in the regression test.

const path = target[1].map(String);
const widget = target[3];
if (path.length !== 2 || typeof widget !== "string") continue;
const oldNode = definitionNode(existing, path[0]!, path[1]!);

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 (P1): This assumes path[0] is a definition ID. A valid edit addressed as [instanceId, nodeId] is stamped under the instance path, so replacement omits it and restores the winner's original widget value. I reproduced values 2 and 9 from the same operations in opposite legal orders. Please resolve stored paths to canonical definition and node identity before carrying edits across replacement.

if (!head) {
const definition = resolveDefinition(doc, path[0]!);
if (!definition || String(definition.get("id")) !== path[0]) return null;
const instances = countDefinitionInstances(doc, path[0]!, catalog);

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 (P1): countDefinitionInstances scans only top-level nodes and the immediate nodes map of each root definition. Two instances below another nested definition are therefore counted as zero. A direct edit to their shared definition was accepted instead of returning shared_definition_unforked. Please make the instance walk recursive and add a three-level falsifier.

if (
key === NODE_ORDER ||
key === LINK_ORDER ||
key === DEFINITION_DIGEST ||

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 (P2): This frontend projector removes one named private key, while package projectDefinition recursively removes every __* key. Arbitrary root, nested, and deep private fields therefore reach ExportedSubgraph through this path even though package projection strips them. Please share the package's private-key policy or apply the same recursive rule here.


function definitionDigests(doc: Y.Doc): Record<string, string> {
const value = metaMap(doc).get("__definition_digests");
return isPlainRecord(value) ? value as Record<string, string> : {};

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 (P2): isPlainRecord proves only the container shape, not that every replicated metadata value is a digest string. A malformed Yjs value is trusted as Record<string, string> and reaches lexical winner selection through JavaScript coercion. Please validate or reconstruct the entries instead of asserting the stronger type.

const PAIR_EXECUTIONS = 196_608;
const SAMPLED_RUNS = 1_696;
const SAMPLED_EXECUTIONS = SAMPLED_RUNS * 2;
const TOTAL_EXECUTIONS = PAIR_EXECUTIONS + SAMPLED_EXECUTIONS;

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 (P2): This change expands the matrix to 200,000 executions, while this package's guide caps a new suite at 20,000 and requires named equivalence classes or fixed-seed sampling above that limit. Please keep a sub-20,000 exhaustive definition-contention matrix and move broad cross-vocabulary combinations to the sampled property.

incumbent: Record<string, unknown>,
replacement: Record<string, unknown>,
) => {
const incumbentDigest = sha256Hex(canonicalOp(incumbent as unknown as Op))

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 (P2): The tests derive every expected winner with the production canonicalizer and hash, so they prove local self-consistency rather than the protocol's fixed larger-SHA-256 result. A mutually wrong canonicalizer or hash input can stay green. Please add one independently derived fixed digest vector and assert its exact winner in both orders.

| Kind | Payload beyond the envelope | Batchable (authoring) |
|---|---|---|
| `add_node` | `node_id`, `class_type`, `pos`, `node` (the complete node object, inserted verbatim) | yes |
| `define_subgraph` | `subgraph_id`, `subgraph_definition` (the complete initial definition, inserted once) | yes |

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 (P2): Adding this row makes seven implemented frozen kinds, but the heading immediately above still says Six kinds, frozen. Please update it to seven.

if (!catalog) {
throw new OpRejectedError("catalog_required", "define_subgraph: the pinned catalog is required to encode interior nodes");
}
const digest = sha256Hex(canonicalOp(op.subgraph_definition as unknown as Op));

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 (P3): Both new digest call sites need as unknown as Op because canonicalOp is typed more narrowly than its generic JSON-walker implementation. Please type the canonicalization input to the validated JSON value it actually accepts and remove both assertions.

const digests = definitionDigests(doc);
const existingDigest = digests[op.subgraph_id] ?? sha256Hex(canonicalOp(projectDefinition(existing, catalog) as unknown as Op));
if (existingDigest === digest) return "no-op";
// The lexicographically larger canonical digest wins, independent of delivery order.

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 (P3): This comment only paraphrases the digest > existingDigest condition below it. The variable names already state the mechanism, while the policy rationale belongs in the protocol documentation and tests. Please delete the comment.

)

Stacked on define_subgraph PR
#17454; merge after
it.

- Adds deterministic `insert_workflow` CRDT application.
- [V1.5 agent subgraph technical
design](https://www.notion.so/3d16d73d365081719b85ed515af98276).
- Supersedes [standalone package PR
183](Comfy-Org/comfy-multi-player#183).

<details><summary>Full context for agent readers</summary>

- Rebase now shares `define_subgraph` definition validation, tree-wide
ID uniqueness, conflict detection, digest storage, and nested encoding
helpers.

The package now accepts `insert_workflow` with required `nodes` and
optional `links`, `groups`, and `definitions` subgraphs. The shared
applier owns deterministic ID remapping from the immutable envelope ID
plus each original ID; CLI and cloud producers emit and relay the raw
payload. It drops each link whose remapped endpoint is missing without
rejecting the remaining insertion, makes exact-envelope replay
idempotent, rejects malformed payloads atomically, recursively removes
private `__*` keys from projected content, and converges independently
of legal arrival order. Semantic ops remain the replication unit; direct
Yjs document merging is not used.

Decision 9 redirects delivery from the retired standalone repository
into `packages/comfy-multi-player`. The accepted choices are
package-owned remapping, required nodes with optional remaining workflow
sections, and partial per-link endpoint dropping. This change preserves
the package invariants for semantic-op replication (KA-1), embedded
ordering identity (KA-2), portability (KA-3), deterministic idempotency
(KA-4), collision-free IDs (KA-5), no independently merged Yjs updates
(FC-1), no runtime coupling (FC-3), and no full-document mutation
primitive (FC-4).

Tests cover complete insertion; exact replay; colliding live and
concurrent IDs; top-level and nested definitions; opaque widgets;
optional sections; groups; recursive private-key scrubbing; both-order
convergence; partial dangling-link dropping; interior writes after
insertion; malformed payload rejection with byte identity; definition
conflicts; legacy fork-shaped IDs; public remapping; batch policy;
full-op permutations; and type-negative states. The failing-first spot
check produced 22 failures and 2 passes after temporarily removing the
applier implementation.

Gates: package build passed; 73 test files and 949 tests passed; purity
passed; import graph passed with 18 modules, 53 dependencies, and 0
violations; pins passed with 178 files, 19 citation sites, and 6 pins;
profile claims passed with 60 presence and 10 absence claims; CodeRabbit
config passed with 5 blocks from 4 profiles; corpus verification passed
for 8 files. Root typecheck passed. Root lint passed with 0 errors and
189 pre-existing warnings. `git diff --check` passed.

Linear: [FE-2033](https://linear.app/comfyorg/issue/FE-2033)

</details>
@vercel

vercel Bot commented Sep 18, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
billing-web Ignored Ignored Sep 21, 2026 4:50pm UTC

Request Review

christian-byrne added a commit that referenced this pull request Sep 22, 2026
)

- Projects nested `define_subgraph` definitions without cmp-private
bookkeeping.
- Reuses the app's existing subgraph creation lifecycle before host
materialization.
- Focused tests and all requested gates are green.

Justification: Christian's full integration/admin-merge grant,
explicitly confirmed by the [release
coordinator](https://ampcode.com/threads/T-01a0a6f4-ce4d-71c8-aa44-be96c230a4e5),
authorizes only
[c962fcd](c962fcd)
after successful hosted checks. The [current-head substantive
review](#17458 (review))
finds the mandatory-lookup objection addressed; it is an author-identity
COMMENT, not non-author approval. The newer main delta contains only
browser documentation/spec changes. This exact-merge compatibility
decision supersedes the older program guard's current-main-ancestry and
separate-human-approval prerequisites; that guard is not recorded as
passing. All 102 checks were terminal before this update: 86 successful
and 16 skipped. No reviewer state or thread is dismissed or resolved,
and no runtime or release acceptance is claimed. Fresh readback remains
required immediately before merge.

<details><summary>Full context for agent readers</summary>

## What changed

The cmp `define_subgraph` applier writes the normal Yjs definition shape
plus `__definition_digest`, a private replay/conflict key.
`agentSubgraphDefinitions.ts` now removes that key recursively from root
and nested `ExportedSubgraph` projections; its regression tests prove
the private field is absent from the projected `ExportedSubgraph` before
LiteGraph consumes it.

The lifecycle probe found that [the stacked follower
change](#17202)
already supplies the required frontend lifecycle. Before reconciling
root nodes, `reconcileAgentAdapters` registers each missing definition
with `rootGraph.createSubgraph`. `LGraph.createSubgraph` normalizes
definitions, registers the `Subgraph`, dispatches `subgraph-created`,
and configures nested definitions in dependency order. The app event
handler then calls `registerNewSubgraph`, which registers the definition
id with the `LiteGraph.createNode` factory. Host nodes are subsequently
created through that factory and registered by the normal ECS adapter
path.

Existing integration tests cover:

- one `subgraph-created` event per newly observed definition;
- a real `SubgraphNode` host created through the registered factory;
- no live mutation when a later payload reuses an already registered id;
- nested-definition registration, including partially registered trees;
- rollback removes a failed definition from `rootGraph.subgraphs` and
leaves its host unmaterialized when configuration fails.

This PR therefore makes the minimum compatibility change for [the
`define_subgraph`
applier](#17454)
rather than duplicating lifecycle code already owned by the stacked
follower branch.

Design reference: [agent-added subgraph lifecycle technical
design](https://www.notion.so/3d16d73d365081719b85ed515af98276).

## RED to GREEN evidence

RED commit `d3057115eb`:

```text
Test Files  1 failed (1)
Tests       1 failed | 13 passed (14)
Received definition retained __definition_digest.
```

GREEN commit `94bce71459`:

```text
Test Files  1 passed (1)
Tests       14 passed (14)
```

Follow-up commit `3853b94e20` adds a two-level nested regression test.
Before the fix, `drops define_subgraph bookkeeping from nested
definitions recursively` failed because both nested digests survived;
after the fix, all 15 reader tests pass.

## Gates

- Focused CRDT Vitest: 3 files, 64 tests passed.
- `pnpm typecheck`: passed.
- Scoped ESLint, type-aware oxlint, and oxfmt: passed.
- Fallow audit: passed with zero introduced findings.

## Vetoable decisions

- Keep this stacked on [the existing-subgraph follower
change](#17202); the
frontend consumes raw Yjs state rather than importing the cmp operation.
- Keep `__definition_digest` cmp-private and exclude it from the live
`ExportedSubgraph` projection.
- Keep creation-only ownership: once an id exists in
`rootGraph.subgraphs`, later definition payloads cannot reconfigure the
live subgraph.
- Do not add a browser test: the deterministic Vitest integration
already crosses Yjs mint/update, follower, ECS adapter, real `LGraph`,
lifecycle event, factory registration, and `SubgraphNode`
materialization without browser-only behavior.

</details>

---------

Co-authored-by: Amp <amp@ampcode.com>
@christian-byrne

Copy link
Copy Markdown
Contributor Author

Retired after standalone recovery. Package work landed in CMP recovery; the frontend remainder landed in reader recovery. Branch and reviews stay preserved.

Full context for agent readers

This closes the superseded source without merging its frozen workspace stack, retargeting it, deleting its branch, dismissing reviews, or transferring historical approvals. Christian requested completion of source retirement after moving CMP back to its own repository.

The final inspected source is the unchanged original head. Its current changed-file inventory contains 24 package paths and two frontend reader/test paths. Package implementation, tests and documentation have their destination in the merged standalone recovery. The insertion decision became the standalone insertion decision document, and the permutation suite lives under test/permutation/. These are successor mappings, not a claim of byte-identical files or unchanged protocol decisions.

The eleven latest definition-review obligations are individually mapped in the existing carryover record. Its one outstanding frontend entry is now superseded by the merged reader correction: recursive private-field filtering, named-widget sanitization, mandatory stored-definition lookup, nested definition ordering and source-state preservation. The original duplicated-order fixture correction is retained and strengthened at the merged test.

This pass directly checked committed package regressions for suffix-neutral definition conflicts, retained instance-addressed edits, malformed replicated digest/child values, recursive shared-instance accounting and nested-ID uniqueness. Historical package verification remains attributed to the standalone recovery receipt; no package tests were rerun here. The frontend source was qualified with focused reader and related suites, normal hooks, terminal hosted checks and the exact-head substantive review. That review is an author-identity COMMENT, not independent approval. The source merge used its documented explicit exception.

This does not close the full historical collaboration inventory, inherited insertion refactoring obligations, warning-policy work, or product acceptance. Those remain preserved in the package carryover and the program handoff. The existing Cloud backport remains separately owned, with checks pending at this read. No deployment, authenticated runtime result, new test execution or acceptance waiver follows from this closure.

Glossary: CMP is the standalone comfy-multi-player graph-operation package; retirement means closing a superseded source without merging it; backport means applying the landed source fix to the release branch.

@DrJKL DrJKL added agent Comfy Agent product, integration, tests or product documentation agent-crdt Agent document synchronization, graph projection or CRDT operations agent-docs Agent product architecture, contracts or documentation agent-test-unit Touches Agent-related unit/component tests or their support labels Sep 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agent Comfy Agent product, integration, tests or product documentation agent-crdt Agent document synchronization, graph projection or CRDT operations agent-docs Agent product architecture, contracts or documentation agent-test-unit Touches Agent-related unit/component tests or their support cursor-review Trigger multi-model Cursor agent review on this PR flag-exempt risk:high PR risk grade (advisory shadow check; grader-owned)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants