Repository navigation
feat(agent-crdt): write local collapse/pin changes back to the document - #18281
claude[bot] wants to merge 7 commits into
Conversation
…e doc flags.collapsed and flags.pinned are durable node state, but no mint port covers a scalar-field change on an existing node: the three ports cover createNode/deleteNode/clearGraph, links and widgets. The follower's reconcile still re-reads flags from the document on every full resync, so the toggle is silently reverted.
Route LGraphNode.collapse/pin through a nodeDataStore setNodeFlags command, and add a mint port that relays it to a bound document. The frozen wire vocabulary has no node-field op, but add_node is an LWW upsert, so the port re-mints the node's current snapshot. Scope: collapsed and pinned only. Title, mode and properties have the same asymmetry and are follow-up work.
|
Important Review skippedBot user detected. To trigger a single review, invoke the ⚙️ Run configurationConfiguration used: Repository: Comfy-Org/ComfyUI_frontend/.coderabbit.yaml Review profile: ASSERTIVE Plan: Advanced Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Comment |
🎨 Storybook: ✅ Built — View Storybook🎭 Playwright: ✅ 2117 passed, 0 failed📊 Browser Reports
🌾 Fallow: ✅ PassedFallow audits the diff for duplication, complexity and dead code. It gates on new findings only, so when the audit completes, a red is something this PR introduced or moved — never inherited backlog. A red can also mean the audit itself did not finish; the details below say which happened. No new findings in the changed files. Reproduce locally# the base the gate compared against
npx fallow audit --root . --quiet --format json \
--changed-since 9ff1b3be5ca234ca8e2126d4260667b1f2b3ca8a
Full docs: ADR-DEVEX-LINT-0015 📦 Bundle: 9.97 MB gzip 🔴 +9.62 kBDetailsSummary
Category Glance App Entry Points — 3.87 kB (baseline 3.87 kB) • ⚪ 0 BMain entry bundles and manifests
Status: 1 added / 1 removed Graph Workspace — 1.44 MB (baseline 1.44 MB) • 🔴 +112 BGraph editor runtime, canvas, workflow orchestration
Status: 2 added / 2 removed / 1 unchanged Views & Navigation — 132 kB (baseline 132 kB) • ⚪ 0 BTop-level views, pages, and routed surfaces
Status: 14 added / 14 removed / 4 unchanged Panels & Settings — 639 kB (baseline 639 kB) • ⚪ 0 BConfiguration panels, inspectors, and settings screens
Status: 10 added / 10 removed / 18 unchanged User & Accounts — 37.9 kB (baseline 37.9 kB) • ⚪ 0 BAuthentication, profile, and account management bundles
Status: 7 added / 7 removed / 4 unchanged Editors & Dialogs — 126 kB (baseline 126 kB) • ⚪ 0 BModals, dialogs, drawers, and in-app editors
Status: 7 added / 7 removed / 1 unchanged UI Components — 124 kB (baseline 123 kB) • 🔴 +235 BReusable component library chunks
Status: 7 added / 7 removed / 9 unchanged Data & Services — 3.92 MB (baseline 3.91 MB) • 🔴 +9.59 kBStores, services, APIs, and repositories
Status: 13 added / 13 removed / 3 unchanged Utilities & Hooks — 577 kB (baseline 577 kB) • 🔴 +34 BHelpers, composables, and utility bundles
Status: 21 added / 21 removed / 17 unchanged Vendor & Third-Party — 17.4 MB (baseline 17.4 MB) • 🔴 +34 BExternal libraries and shared vendor chunks
Status: 1 added / 1 removed / 17 unchanged Other — 17.8 MB (baseline 17.8 MB) • 🔴 +24.1 kBBundles that do not match a named category
Status: 113 added / 113 removed / 189 unchanged ⚡ Performance Report
Show regressions
All metrics
Historical variance (last 15 runs)
Trend (last 15 commits on main)
Raw data{
"timestamp": "2026-09-23T02:52:48.809Z",
"gitSha": "4634351cf844ec1a6230cef489e3f60e4725e854",
"branch": "prototype/node-scalar-field-writeback",
"measurements": [
{
"name": "canvas-idle",
"durationMs": 2008.9930000000322,
"styleRecalcs": 10,
"styleRecalcDurationMs": 6.459000000000001,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 385.03,
"heapDeltaBytes": -6215316,
"heapUsedBytes": 56185944,
"domNodes": -258,
"jsHeapTotalBytes": 4972544,
"scriptDurationMs": 7.698,
"eventListeners": -174,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "canvas-idle",
"durationMs": 2009.7160000000258,
"styleRecalcs": 10,
"styleRecalcDurationMs": 6.164,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 396.08199999999994,
"heapDeltaBytes": -6117756,
"heapUsedBytes": 56262732,
"domNodes": -261,
"jsHeapTotalBytes": 4710400,
"scriptDurationMs": 8.221,
"eventListeners": -174,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "canvas-mouse-sweep",
"durationMs": 1711.5990000000352,
"styleRecalcs": 45,
"styleRecalcDurationMs": 11.166,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 633.462,
"heapDeltaBytes": -6307908,
"heapUsedBytes": 61177112,
"domNodes": -260,
"jsHeapTotalBytes": 6021120,
"scriptDurationMs": 110.738,
"eventListeners": -174,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.670000000000012,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "canvas-mouse-sweep",
"durationMs": 1694.539000000077,
"styleRecalcs": 49,
"styleRecalcDurationMs": 12.056999999999999,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 612.692,
"heapDeltaBytes": 854232,
"heapUsedBytes": 68384200,
"domNodes": -258,
"jsHeapTotalBytes": 5496832,
"scriptDurationMs": 107.58800000000001,
"eventListeners": -152,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "canvas-zoom-sweep",
"durationMs": 1693.736000000058,
"styleRecalcs": 28,
"styleRecalcDurationMs": 11.078000000000001,
"layouts": 6,
"layoutDurationMs": 0.9259999999999999,
"taskDurationMs": 270.677,
"heapDeltaBytes": 2696596,
"heapUsedBytes": 70239228,
"domNodes": 77,
"jsHeapTotalBytes": 5505024,
"scriptDurationMs": 8.716999999999999,
"eventListeners": 15,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "canvas-zoom-sweep",
"durationMs": 1699.7949999999946,
"styleRecalcs": 28,
"styleRecalcDurationMs": 11.004000000000001,
"layouts": 6,
"layoutDurationMs": 0.998,
"taskDurationMs": 269.13200000000006,
"heapDeltaBytes": 3194496,
"heapUsedBytes": 70745692,
"domNodes": 77,
"jsHeapTotalBytes": 6291456,
"scriptDurationMs": 9.566,
"eventListeners": 15,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "dom-widget-clipping",
"durationMs": 550.2619999999752,
"styleRecalcs": 13,
"styleRecalcDurationMs": 7.470999999999998,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 352.117,
"heapDeltaBytes": 18382096,
"heapUsedBytes": 86353612,
"domNodes": 22,
"jsHeapTotalBytes": 5505024,
"scriptDurationMs": 127.69800000000001,
"eventListeners": 0,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.663333333333338,
"p95FrameDurationMs": 16.799999999999727
},
{
"name": "dom-widget-clipping",
"durationMs": 532.3029999999562,
"styleRecalcs": 14,
"styleRecalcDurationMs": 6.439000000000002,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 336.715,
"heapDeltaBytes": 19039144,
"heapUsedBytes": 86527312,
"domNodes": 23,
"jsHeapTotalBytes": 5242880,
"scriptDurationMs": 120.548,
"eventListeners": 0,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.663333333333338,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "dom-widget-order-dense-n200-w200-i120",
"durationMs": 1051.9649999999956,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 718.1149999999999,
"heapDeltaBytes": -13170600,
"heapUsedBytes": 73159768,
"domNodes": -292,
"jsHeapTotalBytes": 19005440,
"scriptDurationMs": 43.44400000000001,
"eventListeners": -217,
"totalBlockingTimeMs": 413,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "dom-widget-order-dense-n200-w200-i120",
"durationMs": 1065.9590000000208,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 730.7689999999999,
"heapDeltaBytes": -17640088,
"heapUsedBytes": 72846960,
"domNodes": -291,
"jsHeapTotalBytes": 20578304,
"scriptDurationMs": 45.895999999999994,
"eventListeners": -217,
"totalBlockingTimeMs": 424,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "dom-widget-order-sparse-n1000-w20-i120",
"durationMs": 730.67199999997,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 326.759,
"heapDeltaBytes": 14267700,
"heapUsedBytes": 90906080,
"domNodes": 0,
"jsHeapTotalBytes": 0,
"scriptDurationMs": 96.93599999999999,
"eventListeners": 0,
"totalBlockingTimeMs": 123,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "dom-widget-order-sparse-n1000-w20-i120",
"durationMs": 730.6639999999334,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 329.6460000000003,
"heapDeltaBytes": 15261352,
"heapUsedBytes": 90532016,
"domNodes": 0,
"jsHeapTotalBytes": 0,
"scriptDurationMs": 102.89800000000001,
"eventListeners": 0,
"totalBlockingTimeMs": 119,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "extension-clean-combined-draw",
"durationMs": 6893.441999999994,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 5972.429,
"heapDeltaBytes": -13508116,
"heapUsedBytes": 68437524,
"domNodes": -12,
"jsHeapTotalBytes": 4980736,
"scriptDurationMs": 4703.631,
"eventListeners": 0,
"totalBlockingTimeMs": 50,
"frameDurationMs": 17.779999999999987,
"p95FrameDurationMs": 33.29999999999927
},
{
"name": "extension-clean-combined-draw",
"durationMs": 6427.030999999943,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 5660.7880000000005,
"heapDeltaBytes": -1150384,
"heapUsedBytes": 72816956,
"domNodes": 0,
"jsHeapTotalBytes": 4718592,
"scriptDurationMs": 4451.62,
"eventListeners": 0,
"totalBlockingTimeMs": 0,
"frameDurationMs": 17.779999999999987,
"p95FrameDurationMs": 33.29999999999927
},
{
"name": "extension-rgthree-prototype-draw",
"durationMs": 6203.400999999985,
"styleRecalcs": 2,
"styleRecalcDurationMs": 1.026000000000001,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 5293.028,
"heapDeltaBytes": 13784628,
"heapUsedBytes": 87339112,
"domNodes": 4,
"jsHeapTotalBytes": 4456448,
"scriptDurationMs": 4300.192,
"eventListeners": 0,
"totalBlockingTimeMs": 29,
"frameDurationMs": 17.773333333333298,
"p95FrameDurationMs": 33.29999999999927
},
{
"name": "extension-rgthree-prototype-draw",
"durationMs": 6625.32299999998,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 5867.5,
"heapDeltaBytes": -534144,
"heapUsedBytes": 81421904,
"domNodes": -16,
"jsHeapTotalBytes": 5242880,
"scriptDurationMs": 4575.965,
"eventListeners": 0,
"totalBlockingTimeMs": 38,
"frameDurationMs": 17.776666666666703,
"p95FrameDurationMs": 33.30000000000109
},
{
"name": "large-graph-idle",
"durationMs": 2025.9209999999257,
"styleRecalcs": 10,
"styleRecalcDurationMs": 6.31,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 514.062,
"heapDeltaBytes": -7411752,
"heapUsedBytes": 79959420,
"domNodes": -243,
"jsHeapTotalBytes": -233472,
"scriptDurationMs": 28.626000000000005,
"eventListeners": -174,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.699999999999818
},
{
"name": "large-graph-idle",
"durationMs": 2041.2320000000364,
"styleRecalcs": 10,
"styleRecalcDurationMs": 5.911,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 513.2099999999999,
"heapDeltaBytes": -5644440,
"heapUsedBytes": 81687600,
"domNodes": -239,
"jsHeapTotalBytes": 552960,
"scriptDurationMs": 31.851,
"eventListeners": -174,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "large-graph-pan",
"durationMs": 2165.593999999942,
"styleRecalcs": 70,
"styleRecalcDurationMs": 12.004000000000001,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 1282.2279999999998,
"heapDeltaBytes": -3641696,
"heapUsedBytes": 77370692,
"domNodes": -215,
"jsHeapTotalBytes": 3100672,
"scriptDurationMs": 607.622,
"eventListeners": -174,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "large-graph-pan",
"durationMs": 2107.198999999923,
"styleRecalcs": 66,
"styleRecalcDurationMs": 7.598000000000001,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 1213.5980000000002,
"heapDeltaBytes": 20101304,
"heapUsedBytes": 84277244,
"domNodes": -246,
"jsHeapTotalBytes": 749568,
"scriptDurationMs": 605.7620000000001,
"eventListeners": 0,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "large-graph-zoom",
"durationMs": 3158.8140000000067,
"styleRecalcs": 63,
"styleRecalcDurationMs": 10.251,
"layouts": 60,
"layoutDurationMs": 11.718,
"taskDurationMs": 1312.9910000000002,
"heapDeltaBytes": 8580576,
"heapUsedBytes": 74337572,
"domNodes": 8,
"jsHeapTotalBytes": 0,
"scriptDurationMs": 581.802,
"eventListeners": 0,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "large-graph-zoom",
"durationMs": 3114.321000000018,
"styleRecalcs": 66,
"styleRecalcDurationMs": 11.450000000000001,
"layouts": 60,
"layoutDurationMs": 9.721,
"taskDurationMs": 1245.546,
"heapDeltaBytes": 9862664,
"heapUsedBytes": 73949872,
"domNodes": -242,
"jsHeapTotalBytes": 0,
"scriptDurationMs": 536.616,
"eventListeners": -174,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "legacy-node-drag",
"durationMs": 2257.425999999896,
"styleRecalcs": 47,
"styleRecalcDurationMs": 7.731999999999999,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 1441.238,
"heapDeltaBytes": -2257344,
"heapUsedBytes": 82473676,
"domNodes": -244,
"jsHeapTotalBytes": 147456,
"scriptDurationMs": 686.746,
"eventListeners": -4,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "legacy-node-drag",
"durationMs": 2279.9009999999953,
"styleRecalcs": 49,
"styleRecalcDurationMs": 8.423,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 1428.843,
"heapDeltaBytes": -17641272,
"heapUsedBytes": 73943880,
"domNodes": -215,
"jsHeapTotalBytes": 516096,
"scriptDurationMs": 677.837,
"eventListeners": 6,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "minimap-idle",
"durationMs": 2023.142000000007,
"styleRecalcs": 8,
"styleRecalcDurationMs": 6.422000000000001,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 497.5840000000001,
"heapDeltaBytes": -7556904,
"heapUsedBytes": 81882228,
"domNodes": -245,
"jsHeapTotalBytes": -757760,
"scriptDurationMs": 30.201999999999998,
"eventListeners": -174,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.670000000000012,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "minimap-idle",
"durationMs": 2021.4079999999512,
"styleRecalcs": 7,
"styleRecalcDurationMs": 4.726000000000001,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 463.7739999999999,
"heapDeltaBytes": -4785452,
"heapUsedBytes": 84436744,
"domNodes": -244,
"jsHeapTotalBytes": -495616,
"scriptDurationMs": 27.873999999999995,
"eventListeners": -174,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "subgraph-dom-widget-clipping",
"durationMs": 479.3329999999969,
"styleRecalcs": 48,
"styleRecalcDurationMs": 7.659999999999998,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 309.39400000000006,
"heapDeltaBytes": 14091888,
"heapUsedBytes": 84050900,
"domNodes": 22,
"jsHeapTotalBytes": 5505024,
"scriptDurationMs": 107.416,
"eventListeners": 6,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666682,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "subgraph-dom-widget-clipping",
"durationMs": 430.5340000000797,
"styleRecalcs": 48,
"styleRecalcDurationMs": 8.896,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 288.196,
"heapDeltaBytes": 13759136,
"heapUsedBytes": 83617236,
"domNodes": 22,
"jsHeapTotalBytes": 5242880,
"scriptDurationMs": 108.72500000000001,
"eventListeners": 6,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666682,
"p95FrameDurationMs": 16.700000000000273
},
{
"name": "subgraph-idle",
"durationMs": 2009.8520000000235,
"styleRecalcs": 11,
"styleRecalcDurationMs": 6.041999999999999,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 385.40199999999993,
"heapDeltaBytes": -2685964,
"heapUsedBytes": 60517668,
"domNodes": -276,
"jsHeapTotalBytes": 4186112,
"scriptDurationMs": 6.236999999999999,
"eventListeners": -220,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "subgraph-idle",
"durationMs": 2002.9670000000124,
"styleRecalcs": 13,
"styleRecalcDurationMs": 8.053,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 396.235,
"heapDeltaBytes": 10211856,
"heapUsedBytes": 80287532,
"domNodes": -273,
"jsHeapTotalBytes": 4972544,
"scriptDurationMs": 6.978999999999999,
"eventListeners": -198,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333335,
"p95FrameDurationMs": 16.699999999999818
},
{
"name": "subgraph-mouse-sweep",
"durationMs": 1689.053000000058,
"styleRecalcs": 46,
"styleRecalcDurationMs": 10.615999999999998,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 584.9530000000001,
"heapDeltaBytes": -1059524,
"heapUsedBytes": 68843948,
"domNodes": -274,
"jsHeapTotalBytes": 5496832,
"scriptDurationMs": 73.523,
"eventListeners": -220,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "subgraph-mouse-sweep",
"durationMs": 1688.7280000000828,
"styleRecalcs": 48,
"styleRecalcDurationMs": 12.298,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 585.928,
"heapDeltaBytes": -7971752,
"heapUsedBytes": 61867304,
"domNodes": -271,
"jsHeapTotalBytes": 4710400,
"scriptDurationMs": 72.16300000000001,
"eventListeners": -220,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "subgraph-transition-enter",
"durationMs": 883.8059999999359,
"styleRecalcs": 17,
"styleRecalcDurationMs": 20.608,
"layouts": 5,
"layoutDurationMs": 8.315,
"taskDurationMs": 705.7,
"heapDeltaBytes": -6247792,
"heapUsedBytes": 82902240,
"domNodes": 13667,
"jsHeapTotalBytes": 11534336,
"scriptDurationMs": 21.581000000000003,
"eventListeners": 2383,
"totalBlockingTimeMs": 114,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "viewport-pan-sweep",
"durationMs": 8174.306999999999,
"styleRecalcs": 251,
"styleRecalcDurationMs": 27.329,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 4249.575,
"heapDeltaBytes": -10867600,
"heapUsedBytes": 75946448,
"domNodes": -236,
"jsHeapTotalBytes": 1302528,
"scriptDurationMs": 1913.713,
"eventListeners": -174,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333338,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "viewport-pan-sweep",
"durationMs": 8210.445999999934,
"styleRecalcs": 251,
"styleRecalcDurationMs": 25.095,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 4406.11,
"heapDeltaBytes": -5559516,
"heapUsedBytes": 81463744,
"domNodes": -241,
"jsHeapTotalBytes": 778240,
"scriptDurationMs": 2021.2909999999997,
"eventListeners": -174,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "vue-large-graph-idle",
"durationMs": 8649.249000000054,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 7947.594,
"heapDeltaBytes": -58885420,
"heapUsedBytes": 181167124,
"domNodes": -8062,
"jsHeapTotalBytes": -13787136,
"scriptDurationMs": 137.62,
"eventListeners": -14928,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "vue-large-graph-idle",
"durationMs": 12291.561999999998,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 11413.044999999998,
"heapDeltaBytes": -70801952,
"heapUsedBytes": 170251936,
"domNodes": -8062,
"jsHeapTotalBytes": -19337216,
"scriptDurationMs": 171.037,
"eventListeners": -14928,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333338,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "vue-large-graph-pan",
"durationMs": 11200.926000000094,
"styleRecalcs": 66,
"styleRecalcDurationMs": 11.453999999999992,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 10540.534000000001,
"heapDeltaBytes": -41398248,
"heapUsedBytes": 185636272,
"domNodes": -8062,
"jsHeapTotalBytes": -12386304,
"scriptDurationMs": 603.9879999999999,
"eventListeners": -14928,
"totalBlockingTimeMs": 0,
"frameDurationMs": 17.223333333333358,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "vue-large-graph-pan",
"durationMs": 15551.981999999953,
"styleRecalcs": 76,
"styleRecalcDurationMs": 13.565999999999995,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 14970.012999999997,
"heapDeltaBytes": -49311352,
"heapUsedBytes": 191814580,
"domNodes": -8062,
"jsHeapTotalBytes": -20058112,
"scriptDurationMs": 725.3570000000001,
"eventListeners": -14928,
"totalBlockingTimeMs": 3,
"frameDurationMs": 17.223333333333358,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "vue-node-resize-workload",
"durationMs": 3150.0760000000128,
"styleRecalcs": 20,
"styleRecalcDurationMs": 60.84800000000001,
"layouts": 20,
"layoutDurationMs": 19.198000000000008,
"taskDurationMs": 3012.125,
"heapDeltaBytes": -42967080,
"heapUsedBytes": 197602596,
"domNodes": -8062,
"jsHeapTotalBytes": 17100800,
"scriptDurationMs": 55.696999999999996,
"eventListeners": -14928,
"totalBlockingTimeMs": 87,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "vue-node-resize-workload",
"durationMs": 4472.100000000069,
"styleRecalcs": 20,
"styleRecalcDurationMs": 60.336,
"layouts": 20,
"layoutDurationMs": 21.008000000000013,
"taskDurationMs": 4297.679,
"heapDeltaBytes": -45185228,
"heapUsedBytes": 194768572,
"domNodes": -8062,
"jsHeapTotalBytes": 11378688,
"scriptDurationMs": 80.962,
"eventListeners": -14928,
"totalBlockingTimeMs": 33,
"frameDurationMs": 17.223333333333297,
"p95FrameDurationMs": 16.80000000000109
},
{
"name": "vue-zoom-out-idle",
"durationMs": 5837.086999999997,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 5411.903,
"heapDeltaBytes": -9803192,
"heapUsedBytes": 172991140,
"domNodes": 0,
"jsHeapTotalBytes": -8912896,
"scriptDurationMs": 73.52800000000003,
"eventListeners": 0,
"totalBlockingTimeMs": 0,
"frameDurationMs": 17.220000000000073,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "vue-zoom-out-idle",
"durationMs": 6175.374000000033,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 5764.861,
"heapDeltaBytes": 13918856,
"heapUsedBytes": 195762368,
"domNodes": 0,
"jsHeapTotalBytes": -14680064,
"scriptDurationMs": 87.13500000000002,
"eventListeners": 0,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "workflow-execution",
"durationMs": 459.48599999996986,
"styleRecalcs": 19,
"styleRecalcDurationMs": 18.29,
"layouts": 4,
"layoutDurationMs": 1.7599999999999998,
"taskDurationMs": 106.89500000000001,
"heapDeltaBytes": 5108636,
"heapUsedBytes": 70501572,
"domNodes": 152,
"jsHeapTotalBytes": 524288,
"scriptDurationMs": 8.555000000000001,
"eventListeners": 81,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000273
},
{
"name": "workflow-execution",
"durationMs": 422.9299999999512,
"styleRecalcs": 16,
"styleRecalcDurationMs": 18.291999999999998,
"layouts": 4,
"layoutDurationMs": 1.6560000000000004,
"taskDurationMs": 92.743,
"heapDeltaBytes": 4921536,
"heapUsedBytes": 70549008,
"domNodes": 125,
"jsHeapTotalBytes": 0,
"scriptDurationMs": 7.7059999999999995,
"eventListeners": 81,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666682,
"p95FrameDurationMs": 16.700000000000728
}
]
}🔬 E2E CoverageNote Shard completeness could not be verified for this run, so these totals may not be comparable with a whole merge.
Top 10 files by uncovered lines
🧩 Custom Nodes Ecosystem Matrix: ✅ PassedExecutes the frontend JS of every registry pack that ships any, against this change, in both renderers. The eight
On a pin-bump PR, a red gate means the ecosystem moved — not that your diff broke something. That is what the bump PR is for. Outside a pin bump or a cold rebuild of the unpinned tail, a red means the diff. Note the corpus size and the executed count are different numbers, and the verdict is against the executed count: roughly 3,100 of ~5,100 packs ship no extension-shaped JS and are skipped. Reproduce locally# build one shard's fixture, then run it
python3 scripts/registry-census/build_matrix.py --shard 1/4
MATRIX_RENDERER=vue MATRIX_VUE=1 \
npx vitest run --config vitest.matrix.config.mts
Full docs: scripts/registry-census/README.md |
Codecov Report❌ Patch coverage is
@@ Coverage Diff @@
## main #18281 +/- ##
==========================================
+ Coverage 83.35% 84.37% +1.02%
==========================================
Files 2987 2285 -702
Lines 147778 130593 -17185
Branches 38158 33930 -4228
==========================================
- Hits 123174 110193 -12981
+ Misses 23323 20104 -3219
+ Partials 1281 296 -985
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 736 files with indirect coverage changes 🚀 New features to boost your workflow:
|
Resolves conflict in src/stores/nodeDataStore.ts: main refactored updateNode's slot-copy into refillArray/replaceSlotsInPlace (avoids a RangeError on very long slot lists) right next to where this PR added setNodeFlags. Both additions are independent; kept both and added replaceNodeSlots/setNodeFlags to the returned store interface in alphabetical order matching the existing convention. package.json/pnpm-lock.yaml merged cleanly, taking main's @comfyorg/comfy-multi-player bump to 0.3.3.
This comment has been minimized.
This comment has been minimized.
5dfaa0f to
4bfc968
Compare
Merging main into this branch pulled in #18109's boundRootGraphId addition to MintPortWiringDeps, but this test's attachMintPortWiring mock predates that and never got the field, breaking pnpm typecheck (TS2345: Property 'boundRootGraphId' is missing). Add it following the same pattern already used in mintPortWiring.test.ts.
|
The main-merge commit (4bfc968) broke Root cause: main's #18109 added a required Fixed in 56b6626 by adding Created by Claude Tag |
comfy-multi-player 0.3.3 (already pinned) shipped a real set_node_field op (PR #235) for per-field LWW writes to title/mode/flags.collapsed/ flags.pinned. Swap the node-flag mint port from the add_node whole-node upsert prototype to this narrower op, so a local collapse/pin toggle no longer clobbers a concurrent remote widget write on the same node. mintPortWiring now forwards the setNodeFlags patch itself to the flag listener instead of just graphId/nodeId, since the port needs the changed field(s) and value(s) to address the register directly.
nodeFlagMintPort.ts was its only external caller; it stopped needing the whole-node snapshot helper once it moved to set_node_field.
|
Swapped the node-flag write-back prototype from the What changed
Why: the Verification: Generated by Claude Code |
There was a problem hiding this comment.
🔍 Cursor Review — Consolidated panel
Triggered by @christian-byrne.
Found 10 finding(s).
| Severity | Count |
|---|---|
| 🟠 High | 2 |
| 🟡 Medium | 6 |
| 🟢 Low | 2 |
Panel: 8/8 reviewers contributed findings.
|
|
||
| deps.enqueue([ | ||
| { | ||
| op: 'add_node', |
There was a problem hiding this comment.
🟠 High — Encoding a flag-only edit as an add_node LWW upsert ships the node's ENTIRE serialized snapshot, so when its stamp wins it replaces the document's whole node map — widget values (and their per-widget stamps), pos, size, mode, properties — with whatever the local graph happens to hold. A collapse/pin concurrent with a remote widget or geometry write on the same node therefore destroys the remote value, and dragging a node locally then collapsing it silently publishes the new position as a side effect. The CAVEAT documents only the widget half and ships it unmitigated; at minimum re-read the doc's node map and merge just flags, or land the narrow set_node_field op first. Raised by 7 of 8 reviewers (gpt-5.6-sol-max adversarial, claude-opus-5-thinking-max adversarial, gemini-3.1-pro adversarial, kimi-k3-max edge-case, and 3 others).
There was a problem hiding this comment.
This review ran against 56b6626, the head before the add_node → set_node_field swap (see the PR's latest comment). This finding described the whole-node upsert prototype directly and is now moot: nodeFlagMintPort.ts mints { op: 'set_node_field', node_id, field: 'flags.collapsed' | 'flags.pinned', value } instead of re-serializing and upserting the whole node. set_node_field claims only the addressed flag's per-(node, field) LWW register (comfy-multi-player's applySetNodeField), so it commutes with any concurrent write to a different register on the same node — it can no longer touch widgets_values, pos, size, mode, or properties.
Added a regression test (nodeFlagWriteback.test.ts, "a concurrent remote widget write survives a local flag toggle") proving a remote set_widget write on the same node survives a local collapse toggle, which is the exact hazard this finding raised.
Generated by Claude Code
| session, | ||
| isEnabled: deps.isEnabled, | ||
| isDocBound: deps.isDocBound, | ||
| rootGraphId, |
There was a problem hiding this comment.
🟠 High — The new port is scoped with rootGraphId (derived from the LIVE canvas graph) instead of the deps.boundRootGraphId() the layout port takes for exactly this reason: during a workflow switch isDocBound() already reports the incoming workflow while the shared canvas graph still holds the outgoing one, so a flag toggle in that window passes the change.graphId !== root check and mints a foreign workflow's node into the bound document. Because add_node is create-or-replace (unlike the widget port, which only writes a value onto an existing id), this can conjure or overwrite a same-id node in the wrong doc — the failure reportOpForUnboundGraph guards in layoutMintPort. Raised by 5 of 8 reviewers (gpt-5.6-sol-max adversarial, claude-opus-5-thinking-max adversarial, claude-opus-5-thinking-max edge-case, gpt-5.6-sol-max edge-case, kimi-k3-max edge-case).
There was a problem hiding this comment.
Confirmed still applicable post-swap (this is about scoping, independent of add_node vs set_node_field) — fixed in 2afe389.
attachNodeFlagMintPort now takes boundRootGraphId(): RootGraphId | null instead of the live-graph-derived rootGraphId, mirroring the layout port's own boundRootGraphId dependency and its reportOpForUnboundGraph pattern exactly: mintPortWiring.ts now wires boundRootGraphId: deps.boundRootGraphId into the flag port (was rootGraphId, the live-canvas-derived accessor). A mismatch is reported via reportError with errorType: 'agent_crdt_op_for_unbound_graph' (the same slug layoutMintPort already uses for this exact failure mode), deduped per tick.
New regression test in nodeFlagWriteback.test.ts: "does not mint into a foreign document during a workflow-switch race (bound root differs from the live graph)" — sets boundRootGraphId() to a different id than the live graph's root, toggles a flag, and asserts nothing is minted and reportError fires with that error type. Also added the sibling "mints when there is no stored bound root graph id (untracked, not restricted)" case, matching the layout port's own behavior when boundRootGraphId() is null.
Generated by Claude Code
| return | ||
| } | ||
|
|
||
| deps.enqueue([ |
There was a problem hiding this comment.
🟡 Medium — Each toggle enqueues its own add_node for the same node register with no per-node coalescing, so toggles made before the follower sequence advances share one [baseVersion, actor] stamp and are then ordered by random op_id — an earlier snapshot can beat the user's final state. The payload is also the node's full serialization (widgets_values can hold large text or base64), and the collapse/pin commands iterate the whole selection, so one shortcut press on a select-all can enqueue the entire workflow's serialized size. Coalesce repeated flag mints per node id before sending. Raised by 3 of 8 reviewers (gpt-5.6-sol-max adversarial, claude-opus-5-thinking-max adversarial, gpt-5.6-sol-max edge-case).
There was a problem hiding this comment.
The payload-size half is moot: set_node_field's payload is { op, node_id, field, value } with a boolean value — it can no longer carry widgets_values or any other node data, whole-selection or not.
Checked the coalescing half specifically: the same-tick, same-actor stamp tie-break (stampKey = [base_version, actor, op_id], and compareStampKeys falls through to comparing two random op_id UUIDs when base_version/actor are equal) is unchanged by the swap and can still reorder two rapid toggles of the same flag on the same node before the follower sequence advances. Decided not to add per-node coalescing here, though:
- The blast radius is now a single boolean register, not a whole node — worst case is a
collapsed/pinnedflag momentarily disagreeing with the last click, which self-corrects on the very next observed toggle (there's no data loss to a different field or widget the way the old upsert risked). - This tie-break behavior is inherent to the wire vocabulary's LWW design (any two same-tick, same-actor writes to the same register are subject to it — e.g. two rapid
set_widgetwrites to the same widget have the identical property), and no existing mint port in this codebase (linkMintPort,widgetMintPort,layoutMintPort) coalesces same-tick writes to work around it. Adding bespoke coalescing only to the flag port would be inconsistent with the rest of the architecture for a now-low-severity edge case.
Happy to revisit if you'd rather this be handled uniformly across mint ports as a follow-up.
Generated by Claude Code
| deps.enqueue([ | ||
| { | ||
| op: 'add_node', | ||
| node_id: change.nodeId, |
There was a problem hiding this comment.
🟡 Medium — add_node is also a create op, so a collapse/pin racing a collaborator's or agent's delete_node re-creates the whole node in the document (add-wins by stamp) and silently undoes the deletion. A field-scoped write would simply lose to the delete; the whole-node re-add resurrects it. Raised by 2 of 8 reviewers (gpt-5.6-sol-max adversarial, claude-opus-5-thinking-max adversarial).
There was a problem hiding this comment.
Moot after the add_node → set_node_field swap. set_node_field is not a create op: applySetNodeField looks up the existing node (nodesMap(doc).get(String(op.node_id))) and returns "no-op" when it's absent — "Delete-wins: the target is gone, so the write is a silent no-op that still consumes its op_id." A collapse/pin racing a concurrent delete_node now simply loses to the delete, exactly as the finding suggests as the fix; it cannot resurrect the node the way the whole-node add_node upsert could.
Generated by Claude Code
| node_id: change.nodeId, | ||
| class_type: node.type, | ||
| pos: [...(node.pos ?? [0, 0])], | ||
| node: withoutGhostFlag(node) |
There was a problem hiding this comment.
🟡 Medium — Replacing an existing id via add_node is observed downstream as a root-map replacement, which the follower adapter treats as a new node incarnation: it deletes and rematerializes the live node instead of patching flags. Every successful collapse/pin round-trip then fires node lifecycle callbacks and drops non-serialized custom-node state and object references — the kind of entity-callback change the repo's architecture constraints flag as ecosystem-breaking. Raised by 2 of 8 reviewers (gpt-5.6-sol-max adversarial, gpt-5.6-sol-max edge-case).
There was a problem hiding this comment.
Moot — set_node_field never replaces the node's root-map entry. applySetNodeField looks up the existing node and writes only into its flags nested map (or top-level title/mode), it never calls createNodeMap/re-inserts the node's id into nodesMap(doc). There's no root-map replacement for a follower adapter to observe as a delete+rematerialize, so no lifecycle-callback churn or dropped custom-node/object-reference state on a successful collapse/pin round-trip — the node's document entry is patched in place.
Generated by Claude Code
| Object.assign(node._state.flags, flags) | ||
| return | ||
| } | ||
| useNodeDataStore().setNodeFlags(graphScope, node.id, flags) |
There was a problem hiding this comment.
🟡 Medium — The store action's boolean is discarded, so a rejected write (no entry under graphScope.rootGraphId, or state.graphId !== graphScope.owningGraphId after an owner change) silently drops a flag change that the old this.flags.x = … could not lose. Callers have already committed side effects by then: collapse() bumped the graph version and dirtied the canvas, and pin() goes on to set this.resizable = !pinned from its locally computed value, so resizable can now permanently disagree with flags.pinned — a state the previous read-back ordering made unreachable. Surface or assert on the failure the way the sibling registerNodeState/unregisterNodeState do. Raised by 5 of 8 reviewers (claude-opus-5-thinking-max adversarial, kimi-k3-max adversarial, claude-opus-5-thinking-max edge-case, gpt-5.6-sol-max edge-case, kimi-k3-max edge-case).
There was a problem hiding this comment.
Confirmed still applicable (independent of add_node vs set_node_field — this is about the store call's return value being discarded) — fixed in 2afe389.
nodeShellState.setNodeFlags now asserts via useNodeDataStore().ownsNode(graphScope, node._state) before delegating to the store's mutating setNodeFlags, the same pattern unregisterNodeState already uses for its own "identity drift" check. Deliberately checked with ownsNode rather than the store action's own boolean return: that return legitimately reports false for a benign no-op (patch already matches current flags — see the fix for #9 below, which makes that case more common), which is not the same failure as a rejected write against a state the bucket no longer holds. ownsNode isolates the real failure (no entry, wrong owning graph, or an identity mismatch) so collapse()/pin()'s already-committed side effects (graph version bump, resizable derived from the local pinned value) never silently disagree with a dropped flag write.
New test in nodeShellState.test.ts: "reports a state that drifted out of its bucket before writing flags", mirroring the existing unregisterNodeState drift test's setup (swap in a fresh, unregistered _state while _graphScope still points at the live scope) and asserting setNodeFlags throws /identity drift/.
Generated by Claude Code
| if (!mintable) return | ||
|
|
||
| const root = deps.rootGraphId() | ||
| if (root === null || change.graphId !== root) { |
There was a problem hiding this comment.
🟡 Medium — Every collapse/pin of a subgraph-interior node takes this branch and is dropped, yet the UI keeps offering both actions, so local state diverges and the next document reconcile reverts the user's edit — the exact silent revert this PR exists to fix, just relocated to subgraphs. Logging the divergence does not preserve it; either gate the affected UI for interior nodes or land an op that can address them. Raised by 2 of 8 reviewers (gpt-5.6-sol-max adversarial, gpt-5.6-sol-max edge-case).
There was a problem hiding this comment.
Confirmed this is still a real, valid finding — but it's unrelated to add_node vs set_node_field (the pre-swap code had the identical gap), and I did not implement either of the two fixes you named, so flagging that honestly rather than claiming this is resolved.
Why it's not a quick fix: set_node_field (like the whole-node add_node before it) has no subgraph-scoped addressing form — SetNodeFieldOp only carries node_id, unlike set_widget's path/inner_widget interior variant. So "land an op that can address them" needs a comfy-multi-player wire-vocabulary change (out of scope for a frontend swap PR), and "gate the affected UI for interior nodes" means disabling collapse/pin for any node inside a subgraph — a user-facing behavior change I don't think a mint-port bug fix should make unilaterally.
What did improve as a side effect of the #2/#6 fixes: the divergence is no longer silent to telemetry — it's now deduped and routed through reportError with structured context (graphId, boundRootGraphId, nodeId) instead of a raw, undeduped console.error, so it's at least observable and rate-limited rather than spamming per node in a loop.
Recommend tracking the real fix (either op support for interior addressing, or a deliberate product decision to gate the UI) as separate follow-up work rather than folding it into this swap.
Generated by Claude Code
| return | ||
| } | ||
|
|
||
| const node = deps.serializeNode(String(change.nodeId)) |
There was a problem hiding this comment.
🟡 Medium — serializeNode routes through LGraphNode.serialize(), which for a missing-node placeholder (unregistered node type, served from state.lastSerialization) returns the cached load-time snapshot with only mode and pos refreshed — flags is the stale loaded copy. Collapsing or pinning such a node mints an upsert that does not carry the toggled flag, so the write-back no-ops (the reconcile still reverts the toggle) while also replaying a stale whole-node snapshot over the document's copy. Raised by 2 of 8 reviewers (claude-opus-5-thinking-max edge-case, gpt-5.6-sol-max edge-case).
There was a problem hiding this comment.
Moot — nodeFlagMintPort.ts no longer calls serializeNode/LGraphNode.serialize() at all. The rewrite builds set_node_field ops directly from the NodeFlagsPatch the setNodeFlags store action already applied (forwarded through mintPortWiring.ts's $onAction hook), not from any node snapshot. There's no whole-node serialization step left for a missing-node placeholder's stale flags to leak through.
Generated by Claude Code
| // Subgraph-interior nodes have no root-scope `add_node` to upsert, so | ||
| // the doc diverges from the local graph; observable, never silent (the | ||
| // surfacing-honesty principle). | ||
| console.error( |
There was a problem hiding this comment.
🟢 Low — This console.error has no dedupe and never reaches telemetry, unlike layoutMintPort, which dedupes per key via reportedInteriorChanges and routes through reportError (the repo requires reportError() over raw console/sink calls). Because "collapse selected"/"pin selected" loop over the selection, collapsing a large selection inside a subgraph emits one error per node, and the branch also prints the "outside the root graph" message when root === null, i.e. when no graph is open at all. Raised by 2 of 8 reviewers (claude-opus-5-thinking-max adversarial, claude-opus-5-thinking-max edge-case).
There was a problem hiding this comment.
Confirmed still applicable regardless of op type — fixed in 2afe389 as part of the #2 scoping fix.
The bare console.error is gone; nodeFlagMintPort.ts now routes through reportError (per this repo's convention) with errorType: 'agent_crdt_op_for_unbound_graph', deduped per tick via a Set + queueMicrotask cleanup — the same shape as layoutMintPort's reportedInteriorChanges/reportedUnboundGraphChanges. New test "reports an unbound-graph flag toggle only once per tick" (mirrors layoutMintPort.test.ts's own dedupe test) asserts two toggles in the same tick report once, and a third after a microtask flush reports again.
The "wrong message when no graph is open" half is also resolved as a side effect of the #2 fix: the old check used the live canvas graph's root (null mid-load even while a doc might already be bound), which is what produced that misleading case. The new check reads boundRootGraphId() — the bound workflow's own stored id — so it no longer fires from that particular race. (If isDocBound() is false, i.e. no graph is open/bound at all, the port doesn't reach this branch — shouldMint already returns early.)
Generated by Claude Code
| const state = roots.get(graphScope.rootGraphId)?.byId.get(nodeId) | ||
| if (!state || state.graphId !== graphScope.owningGraphId) return false | ||
| const entries = Object.entries(flags) as [keyof NodeFlagsPatch, boolean][] | ||
| if (entries.every(([key, value]) => state.flags[key] === value)) |
There was a problem hiding this comment.
🟢 Low — The no-change guard compares with === while LGraphNode.pinned/collapsed read the flags through !!, and pin() patches { pinned: undefined } when unpinning. For a node whose flags hold an explicit pinned: false (valid workflow JSON, or a document projection that emits false), a no-op unpin — e.g. SetPinned.vue's nodes.forEach((node) => node.pin(value)) over a mixed selection — reports changed and mints a destructive whole-node upsert for a change no user can see; compare truthiness instead. Raised by 1 of 8 reviewers (claude-opus-5-thinking-max edge-case).
There was a problem hiding this comment.
Confirmed still applicable to the set_node_field path (this is about the no-change guard, not the op payload) — fixed in 2afe389.
The guard now compares !!state.flags[key] === !!value instead of ===, matching how LGraphNode.pinned/collapsed already read these flags back. A no-op pin(false) (patching { pinned: undefined }) against a state holding an explicit flags.pinned = false now correctly reports no change, instead of minting a write for a change no user can see — it's a smaller blast radius than before (one set_node_field op instead of a whole-node add_node upsert) but still unnecessary doc traffic worth avoiding.
New tests in nodeDataStore.test.ts: one asserting the no-op-unpin-against-explicit-false case reports changed: false, and one asserting a genuine toggle still reports changed: true (guarding against a fix that swallows real changes too).
Generated by Claude Code
…_field swap The review ran against the pre-swap head (56b6626), so most findings described add_node-upsert hazards the swap already resolved; the remaining findings were independent of the op choice and still applied: - nodeFlagMintPort: scope against boundRootGraphId (the bound doc's own stored root), not the live canvas graph's root, so a flag toggle during a workflow-switch race can't mint into the wrong document. Ports the layout port's reportOpForUnboundGraph pattern (reportError, deduped per tick) in place of the bare, undeduped console.error. - nodeShellState.setNodeFlags: assert via ownsNode before delegating to the store, so a rejected write (identity drift) fails loudly instead of leaving collapse()/pin()'s already-committed side effects (version bump, resizable) disagreeing with a silently-dropped flag. - nodeDataStore.setNodeFlags: compare flags by truthiness, not ===, so a no-op unpin (pin(false) patches { pinned: undefined } against a state that may hold explicit false) doesn't mint a write for a change no user can see.
|
Closing as superseded by #18700. Its command-site minting commits (95f459b and 8ed543b) replace the store-side mintPortWiring/nodeDataStore observation introduced here, and a894512 removes the remote-apply hooks this branch depends on. Keeping this path would reintroduce side-effect-derived intent rather than the single graph API path. |
Requested by Christian Byrne · Slack thread
Prototype / spike — not intended to merge as-is. This exists to validate an approach and give the team something concrete to argue with.
Before
#18191 fixed
flags.ghostleaking into the agent CRDT document. It worked by exclusion:ghostis transient, so the fix strips it at the mint and reconcile-read boundaries.That fix exposed the structural gap underneath it. The reconcile path unconditionally reads node scalar fields (
flagsamong them) from the document and reapplies them viaassignNodeFields, but the mint/wire layer has no path to write a local scalar-field change into the document. The three mint ports cover createNode/deleteNode/clearGraph, links and widgets — nothing for a property change on an existing node.flags.collapsedandflags.pinnedhave exactly that asymmetry, but unlikeghostthey are durable state a collaborator should see. You cannot fix them by exclusion. Today: collapse a node, let a full reconcile run, and the node springs back open.After
A local collapse or pin reaches the document, and a later reconcile reads the toggle back instead of clobbering it.
Approach
Three pieces, each small:
A command seam.
LGraphNode.collapse()/pin()mutatedthis.flags.xdirectly. They now go through a newnodeDataStore.setNodeFlags(scope, nodeId, patch)action (via asetNodeFlagshelper innodeShellState.ts, alongside the existingsetTrackedNodeState). This is ADR-CRDT-LAYOUT-0003's command pattern applied to a durable mutation: "durable entity mutations flow through explicit operations rather than direct property access", so an observer can see them. It also satisfies ADR-ECS-0008's dedicated-store rule — node flags already live innodeDataStore; they just had no named action. Those two methods are the single chokepoint: every collapse/pin call site in the app funnels through them.A mint port.
nodeFlagMintPort.tssubscribes to that action (throughmintPortWiring's$onAction, the same shape the link port already uses) and enqueues a wire op. It reuses the existing gates: product flag, doc-bound, teardown bracket, and remote-context suppression so a remote apply never echoes.The wire op. This is the interesting part, and where the team should push back.
On the wire op, and the companion PR
The frozen wire vocabulary has no node-field op. But
add_nodeis an LWW upsert, not an insert:applyAddNodereplaces an existing id's node map verbatim when the incoming stamp wins, re-deriving link refs from the livelinksmap. So the port re-mints the node's current snapshot, and it works end-to-end against the real applier today with no protocol change. The test proves that by running the minted op throughapplyOpsfrom the pinned package and projecting the result.The cost: the upsert carries the whole node, so it also rewrites that node's widget values and clears its widget stamps. A flag toggle concurrent with a remote widget write on the same node can lose the remote value. That is documented on the port.
A companion prototype adds a proper field-addressed op,
set_node_field, tocomfy-multi-player— one LWW register per(node lifetime, field), so two fields of one node never contend and neither disturbs the node's widget stamps. Once that lands and is published, swapping this port over is a change to the singleenqueuecall innodeFlagMintPort.ts; nothing else here moves. Shipping the no-protocol-change variant first means this PR is independently runnable and reviewable rather than blocked on an unpublished dependency.Scope
collapsedandpinnedonly.title,modeandpropertieshave the same read-without-write-back asymmetry and are deliberate follow-up work —WRITABLE_NODE_FIELDSin the companion PR already anticipates title and mode. Subgraph-interior nodes are out of scope and surface loudly rather than silently diverging.Red → green
5c226d3test:collapsed/pinnedon a realLGraphNodeunder real mint-port wiring mints nothing. Fails on the assertion ([]vs the expected op), not on a compile or setup error.8b466b2feat:Re-proved locally by stashing the fix and re-running: red again, same assertions. 970 tests across
agent/crdt,nodeDataStore,core/graphand the litegraph suite pass with the change in.Test plan
src/workbench/extensions/agent/crdt/nodeFlagWriteback.test.ts— per-flag mint, the minted op applying cleanly to a real document and projecting the toggle back, plus unbound and detach negative controlspnpm typecheck,pnpm lint,pnpm format,pnpm knip(all via the pre-commit and pre-push hooks, no--no-verify)🤖 Generated with Claude Code
https://claude.ai/code/session_016jorVkGmycSkD6j7A6sdJV
Generated by Claude Code