Repository navigation
refactor(agent): model node replacement as a pure state machine (PM-1293 PR-1) - #18150
christian-byrne wants to merge 6 commits into
Conversation
…293 PR-1) Names the states, events and driver effects of the materializer's placeholder-to-successor swap so every (state, event) pair is decided in one table. Commit point is add success; configure failure after it is a reported effect, not a restore. Record restoration after add failure is unconditional and successor cleanup is best-effort, matching main's pinned behaviour. Pure module, no wiring: the materializer keeps its inline flow until PR-2.
🎨 Storybook: ✅ Built — View Storybook🎭 Playwright: ✅ 2069 passed, 0 failed · 1 flaky📊 Browser Reports
📦 Bundle: 9.95 MB gzip 🔴 +255 kBDetailsSummary
Category Glance App Entry Points — 3.81 kB (baseline 3.73 kB) • 🔴 +80 BMain entry bundles and manifests
Status: 1 added / 1 removed Graph Workspace — 1.46 MB (baseline 1.43 MB) • 🔴 +31.5 kBGraph editor runtime, canvas, workflow orchestration
Status: 2 added / 2 removed / 1 unchanged Views & Navigation — 132 kB (baseline 124 kB) • 🔴 +7.83 kBTop-level views, pages, and routed surfaces
Status: 17 added / 16 removed / 1 unchanged Panels & Settings — 638 kB (baseline 621 kB) • 🔴 +17.3 kBConfiguration panels, inspectors, and settings screens
Status: 28 added / 27 removed User & Accounts — 37.9 kB (baseline 27.8 kB) • 🔴 +10.1 kBAuthentication, profile, and account management bundles
Status: 8 added / 8 removed / 3 unchanged Editors & Dialogs — 126 kB (baseline 126 kB) • 🔴 +740 BModals, dialogs, drawers, and in-app editors
Status: 8 added / 8 removed UI Components — 124 kB (baseline 117 kB) • 🔴 +7.2 kBReusable component library chunks
Status: 16 added / 15 removed Data & Services — 3.87 MB (baseline 3.6 MB) • 🔴 +267 kBStores, services, APIs, and repositories
Status: 16 added / 16 removed Utilities & Hooks — 566 kB (baseline 559 kB) • 🔴 +7.28 kBHelpers, composables, and utility bundles
Status: 30 added / 28 removed / 8 unchanged Vendor & Third-Party — 17.4 MB (baseline 18.1 MB) • 🟢 -665 kBExternal libraries and shared vendor chunks
Status: 10 added / 10 removed / 8 unchanged Other — 17.8 MB (baseline 16.4 MB) • 🔴 +1.39 MBBundles that do not match a named category
Status: 177 added / 172 removed / 124 unchanged ⚡ Performance Report
Show regressions
All metrics
Historical variance (last 15 runs)
Trend (last 15 commits on main)
Raw data{
"timestamp": "2026-09-21T05:22:24.470Z",
"gitSha": "66450cdcebc27d7ccbfbc581d028897fcd690fcb",
"branch": "pm1293/pr1-node-replacement-state-machine",
"measurements": [
{
"name": "canvas-idle",
"durationMs": 1999.0379999999845,
"styleRecalcs": 10,
"styleRecalcDurationMs": 7.167,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 329.51,
"heapDeltaBytes": 10568720,
"heapUsedBytes": 72689164,
"domNodes": -263,
"jsHeapTotalBytes": 4186112,
"scriptDurationMs": 7.327,
"eventListeners": -152,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.670000000000012,
"p95FrameDurationMs": 16.699999999999818
},
{
"name": "canvas-idle",
"durationMs": 1990.3999999999655,
"styleRecalcs": 10,
"styleRecalcDurationMs": 8.145,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 419.362,
"heapDeltaBytes": 13946200,
"heapUsedBytes": 76094872,
"domNodes": -262,
"jsHeapTotalBytes": 4448256,
"scriptDurationMs": 7.917999999999998,
"eventListeners": -152,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "canvas-mouse-sweep",
"durationMs": 1896.1960000000317,
"styleRecalcs": 76,
"styleRecalcDurationMs": 25.270000000000003,
"layouts": 14,
"layoutDurationMs": 4.244,
"taskDurationMs": 876.1069999999999,
"heapDeltaBytes": 17821248,
"heapUsedBytes": 79751072,
"domNodes": -262,
"jsHeapTotalBytes": 4710400,
"scriptDurationMs": 163.72599999999997,
"eventListeners": -152,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.670000000000012,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "canvas-mouse-sweep",
"durationMs": 1745.3889999999888,
"styleRecalcs": 75,
"styleRecalcDurationMs": 23.614,
"layouts": 14,
"layoutDurationMs": 3.7799999999999994,
"taskDurationMs": 765.2979999999999,
"heapDeltaBytes": 14706408,
"heapUsedBytes": 76767488,
"domNodes": -263,
"jsHeapTotalBytes": 6021120,
"scriptDurationMs": 151.43499999999997,
"eventListeners": -152,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "canvas-zoom-sweep",
"durationMs": 1722.3529999999982,
"styleRecalcs": 32,
"styleRecalcDurationMs": 14.317,
"layouts": 6,
"layoutDurationMs": 1.0690000000000002,
"taskDurationMs": 307.95399999999995,
"heapDeltaBytes": 2234056,
"heapUsedBytes": 63941912,
"domNodes": 76,
"jsHeapTotalBytes": 4980736,
"scriptDurationMs": 9.672,
"eventListeners": 15,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "canvas-zoom-sweep",
"durationMs": 1660.3420000000142,
"styleRecalcs": 31,
"styleRecalcDurationMs": 13.020999999999999,
"layouts": 6,
"layoutDurationMs": 0.897,
"taskDurationMs": 308.498,
"heapDeltaBytes": 2190860,
"heapUsedBytes": 64275788,
"domNodes": 76,
"jsHeapTotalBytes": 4718592,
"scriptDurationMs": 9.498,
"eventListeners": 15,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "dom-widget-clipping",
"durationMs": 600.0419999999735,
"styleRecalcs": 11,
"styleRecalcDurationMs": 7.297,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 413.01000000000005,
"heapDeltaBytes": 18513872,
"heapUsedBytes": 80569048,
"domNodes": 18,
"jsHeapTotalBytes": 6029312,
"scriptDurationMs": 157.022,
"eventListeners": 0,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "dom-widget-clipping",
"durationMs": 596.1970000000179,
"styleRecalcs": 11,
"styleRecalcDurationMs": 7.718000000000001,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 407.96700000000004,
"heapDeltaBytes": 18186404,
"heapUsedBytes": 80360624,
"domNodes": 18,
"jsHeapTotalBytes": 5242880,
"scriptDurationMs": 156.021,
"eventListeners": 0,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "large-graph-idle",
"durationMs": 2029.1129999999953,
"styleRecalcs": 8,
"styleRecalcDurationMs": 5.878000000000001,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 538.065,
"heapDeltaBytes": 2141692,
"heapUsedBytes": 82614808,
"domNodes": -244,
"jsHeapTotalBytes": -270336,
"scriptDurationMs": 28.059,
"eventListeners": -174,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "large-graph-idle",
"durationMs": 2021.1050000000341,
"styleRecalcs": 6,
"styleRecalcDurationMs": 4.868999999999998,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 396.5810000000001,
"heapDeltaBytes": 2236700,
"heapUsedBytes": 83235816,
"domNodes": -248,
"jsHeapTotalBytes": -1282048,
"scriptDurationMs": 31.020999999999994,
"eventListeners": -174,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.670000000000012,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "large-graph-pan",
"durationMs": 2222.7320000000077,
"styleRecalcs": 66,
"styleRecalcDurationMs": 10.094,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 1522.2190000000003,
"heapDeltaBytes": 20210764,
"heapUsedBytes": 84026672,
"domNodes": -253,
"jsHeapTotalBytes": 1536000,
"scriptDurationMs": 804.233,
"eventListeners": -152,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "large-graph-pan",
"durationMs": 2180.951999999934,
"styleRecalcs": 67,
"styleRecalcDurationMs": 10.227999999999998,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 1508.0690000000002,
"heapDeltaBytes": -2090272,
"heapUsedBytes": 80368404,
"domNodes": -247,
"jsHeapTotalBytes": 1302528,
"scriptDurationMs": 792.524,
"eventListeners": -152,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "large-graph-zoom",
"durationMs": 3357.2540000000117,
"styleRecalcs": 63,
"styleRecalcDurationMs": 10.747,
"layouts": 60,
"layoutDurationMs": 11.417,
"taskDurationMs": 1514.625,
"heapDeltaBytes": 8198176,
"heapUsedBytes": 74087976,
"domNodes": 6,
"jsHeapTotalBytes": 0,
"scriptDurationMs": 724.954,
"eventListeners": 0,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "large-graph-zoom",
"durationMs": 3407.6180000000704,
"styleRecalcs": 63,
"styleRecalcDurationMs": 10.612999999999998,
"layouts": 60,
"layoutDurationMs": 11.548000000000002,
"taskDurationMs": 1538.2279999999996,
"heapDeltaBytes": 9441924,
"heapUsedBytes": 75047800,
"domNodes": -254,
"jsHeapTotalBytes": 0,
"scriptDurationMs": 750.2299999999999,
"eventListeners": 0,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "legacy-node-drag",
"durationMs": 2910.9320000000025,
"styleRecalcs": 44,
"styleRecalcDurationMs": 7.647999999999999,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 1861.455,
"heapDeltaBytes": -7348448,
"heapUsedBytes": 75905916,
"domNodes": -254,
"jsHeapTotalBytes": 1265664,
"scriptDurationMs": 963.516,
"eventListeners": 6,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "legacy-node-drag",
"durationMs": 2703.261999999995,
"styleRecalcs": 42,
"styleRecalcDurationMs": 5.416999999999998,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 1780.306,
"heapDeltaBytes": 23232144,
"heapUsedBytes": 89141604,
"domNodes": 4,
"jsHeapTotalBytes": 1990656,
"scriptDurationMs": 929.125,
"eventListeners": 180,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66999999999998,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "minimap-idle",
"durationMs": 1992.0010000000161,
"styleRecalcs": 3,
"styleRecalcDurationMs": 1.9319999999999997,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 354.10299999999995,
"heapDeltaBytes": 19352612,
"heapUsedBytes": 83559072,
"domNodes": 6,
"jsHeapTotalBytes": 0,
"scriptDurationMs": 32.79899999999999,
"eventListeners": 0,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.699999999999818
},
{
"name": "minimap-idle",
"durationMs": 2047.2330000000056,
"styleRecalcs": 7,
"styleRecalcDurationMs": 6.5489999999999995,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 557.749,
"heapDeltaBytes": -4083676,
"heapUsedBytes": 76899784,
"domNodes": -263,
"jsHeapTotalBytes": -794624,
"scriptDurationMs": 29.717000000000006,
"eventListeners": -174,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "subgraph-dom-widget-clipping",
"durationMs": 555.090000000007,
"styleRecalcs": 48,
"styleRecalcDurationMs": 10.801,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 382.6740000000001,
"heapDeltaBytes": 14599544,
"heapUsedBytes": 78256956,
"domNodes": 22,
"jsHeapTotalBytes": 5505024,
"scriptDurationMs": 138.37199999999999,
"eventListeners": 6,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "subgraph-dom-widget-clipping",
"durationMs": 556.4529999999195,
"styleRecalcs": 48,
"styleRecalcDurationMs": 10.169,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 376.433,
"heapDeltaBytes": 13490340,
"heapUsedBytes": 76965268,
"domNodes": 22,
"jsHeapTotalBytes": 5242880,
"scriptDurationMs": 136.15,
"eventListeners": 6,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.699999999999818
},
{
"name": "subgraph-idle",
"durationMs": 2024.8580000000516,
"styleRecalcs": 10,
"styleRecalcDurationMs": 7.614000000000001,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 444.15400000000005,
"heapDeltaBytes": 631604,
"heapUsedBytes": 64140704,
"domNodes": -275,
"jsHeapTotalBytes": 4710400,
"scriptDurationMs": 6.796,
"eventListeners": -220,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "subgraph-idle",
"durationMs": 2007.2739999999953,
"styleRecalcs": 11,
"styleRecalcDurationMs": 7.668000000000001,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 410.531,
"heapDeltaBytes": -8348040,
"heapUsedBytes": 54933316,
"domNodes": -274,
"jsHeapTotalBytes": 4710400,
"scriptDurationMs": 6.867999999999999,
"eventListeners": -198,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "subgraph-mouse-sweep",
"durationMs": 1689.8950000000355,
"styleRecalcs": 77,
"styleRecalcDurationMs": 23.676,
"layouts": 18,
"layoutDurationMs": 4.389,
"taskDurationMs": 695.1160000000001,
"heapDeltaBytes": 922084,
"heapUsedBytes": 64499892,
"domNodes": -275,
"jsHeapTotalBytes": 6021120,
"scriptDurationMs": 93.916,
"eventListeners": -220,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "subgraph-mouse-sweep",
"durationMs": 1702.826000000016,
"styleRecalcs": 77,
"styleRecalcDurationMs": 21.594,
"layouts": 18,
"layoutDurationMs": 3.9839999999999995,
"taskDurationMs": 676.168,
"heapDeltaBytes": 2022276,
"heapUsedBytes": 65498688,
"domNodes": -275,
"jsHeapTotalBytes": 4710400,
"scriptDurationMs": 93.28299999999999,
"eventListeners": -220,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "subgraph-transition-enter",
"durationMs": 1050.8229999999799,
"styleRecalcs": 17,
"styleRecalcDurationMs": 27.438999999999997,
"layouts": 5,
"layoutDurationMs": 12.584000000000001,
"taskDurationMs": 818.155,
"heapDeltaBytes": 17186984,
"heapUsedBytes": 107150476,
"domNodes": 13587,
"jsHeapTotalBytes": 14155776,
"scriptDurationMs": 25.184000000000005,
"eventListeners": 2383,
"totalBlockingTimeMs": 134,
"frameDurationMs": 16.66333333333335,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "viewport-pan-sweep",
"durationMs": 8209.727999999985,
"styleRecalcs": 248,
"styleRecalcDurationMs": 31.858999999999998,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 5331.254999999999,
"heapDeltaBytes": -12815728,
"heapUsedBytes": 66726680,
"domNodes": -226,
"jsHeapTotalBytes": 4186112,
"scriptDurationMs": 2646.555,
"eventListeners": -174,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "viewport-pan-sweep",
"durationMs": 8202.615000000038,
"styleRecalcs": 247,
"styleRecalcDurationMs": 30.216,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 5327.177,
"heapDeltaBytes": -1042028,
"heapUsedBytes": 80107732,
"domNodes": -248,
"jsHeapTotalBytes": 516096,
"scriptDurationMs": 2649.866,
"eventListeners": -152,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "vue-large-graph-idle",
"durationMs": 15110.883000000002,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 14358.762999999999,
"heapDeltaBytes": -41850648,
"heapUsedBytes": 187115752,
"domNodes": -8061,
"jsHeapTotalBytes": -2605056,
"scriptDurationMs": 211.47800000000004,
"eventListeners": -14928,
"totalBlockingTimeMs": 0,
"frameDurationMs": 17.219999999999953,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "vue-large-graph-idle",
"durationMs": 11045.004000000063,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 10348.738000000001,
"heapDeltaBytes": -34732108,
"heapUsedBytes": 181163272,
"domNodes": -8061,
"jsHeapTotalBytes": -5021696,
"scriptDurationMs": 177.476,
"eventListeners": -14928,
"totalBlockingTimeMs": 0,
"frameDurationMs": 17.220000000000073,
"p95FrameDurationMs": 16.80000000000291
},
{
"name": "vue-large-graph-pan",
"durationMs": 19059.105999999985,
"styleRecalcs": 173,
"styleRecalcDurationMs": 15.412999999999982,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 18616.553,
"heapDeltaBytes": -60559760,
"heapUsedBytes": 168950068,
"domNodes": -8061,
"jsHeapTotalBytes": -7598080,
"scriptDurationMs": 858.0049999999999,
"eventListeners": -14928,
"totalBlockingTimeMs": 21,
"frameDurationMs": 17.776666666666642,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "vue-large-graph-pan",
"durationMs": 18910.386000000017,
"styleRecalcs": 178,
"styleRecalcDurationMs": 16.10199999999998,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 18462.378,
"heapDeltaBytes": -54987792,
"heapUsedBytes": 180181876,
"domNodes": -8061,
"jsHeapTotalBytes": -16232448,
"scriptDurationMs": 858.223,
"eventListeners": -14928,
"totalBlockingTimeMs": 23,
"frameDurationMs": 17.220000000000073,
"p95FrameDurationMs": 16.80000000000291
},
{
"name": "vue-node-resize-workload",
"durationMs": 5466.725999999994,
"styleRecalcs": 20,
"styleRecalcDurationMs": 76.07300000000004,
"layouts": 20,
"layoutDurationMs": 21.15199999999999,
"taskDurationMs": 5351.062,
"heapDeltaBytes": -57945012,
"heapUsedBytes": 180407236,
"domNodes": -8061,
"jsHeapTotalBytes": 8941568,
"scriptDurationMs": 86.283,
"eventListeners": -14928,
"totalBlockingTimeMs": 364,
"frameDurationMs": 17.779999999999987,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "vue-node-resize-workload",
"durationMs": 5363.552000000027,
"styleRecalcs": 20,
"styleRecalcDurationMs": 73.14999999999999,
"layouts": 20,
"layoutDurationMs": 20.014000000000003,
"taskDurationMs": 5270.262000000001,
"heapDeltaBytes": -31731944,
"heapUsedBytes": 183286568,
"domNodes": -8061,
"jsHeapTotalBytes": 16961536,
"scriptDurationMs": 83.45499999999998,
"eventListeners": -14928,
"totalBlockingTimeMs": 255,
"frameDurationMs": 17.776666666666642,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "vue-zoom-out-idle",
"durationMs": 7496.937000000003,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 7202.115000000001,
"heapDeltaBytes": -8085840,
"heapUsedBytes": 167032304,
"domNodes": 0,
"jsHeapTotalBytes": -13893632,
"scriptDurationMs": 106.36999999999996,
"eventListeners": 0,
"totalBlockingTimeMs": 0,
"frameDurationMs": 17.219999999999953,
"p95FrameDurationMs": 16.80000000000291
},
{
"name": "vue-zoom-out-idle",
"durationMs": 7356.750000000034,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 7091.729000000001,
"heapDeltaBytes": -23981284,
"heapUsedBytes": 169736880,
"domNodes": 0,
"jsHeapTotalBytes": -25952256,
"scriptDurationMs": 97.20400000000001,
"eventListeners": 0,
"totalBlockingTimeMs": 0,
"frameDurationMs": 17.780000000000047,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "workflow-execution",
"durationMs": 102.8140000000235,
"styleRecalcs": 9,
"styleRecalcDurationMs": 14.887,
"layouts": 3,
"layoutDurationMs": 1.572,
"taskDurationMs": 76.11899999999999,
"heapDeltaBytes": 3157348,
"heapUsedBytes": 64794340,
"domNodes": 127,
"jsHeapTotalBytes": 0,
"scriptDurationMs": 9.064999999999998,
"eventListeners": 17,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "workflow-execution",
"durationMs": 89.20100000000275,
"styleRecalcs": 8,
"styleRecalcDurationMs": 16.391000000000002,
"layouts": 3,
"layoutDurationMs": 1.314,
"taskDurationMs": 69.42200000000001,
"heapDeltaBytes": 2926760,
"heapUsedBytes": 64625408,
"domNodes": 125,
"jsHeapTotalBytes": 0,
"scriptDurationMs": 4.764000000000001,
"eventListeners": 17,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66666666666665,
"p95FrameDurationMs": 16.700000000000728
}
]
}🔬 E2E Coverage
Top 10 files by uncovered lines
🌾 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 35524d57b835337efbf97f59fb07c5e468de9882
Full docs: ADR-DEVEX-LINT-0015 🧩 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 |
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository: Comfy-Org/ComfyUI_frontend/.coderabbit.yaml Review profile: ASSERTIVE Plan: Team Run ID: 📒 Files selected for processing (2)
Included review availability: Your plan provides up to 10 included reviews per hour; 3 remain after this review. 📝 WalkthroughWalkthroughThis change adds a pure node-replacement state machine. It defines lifecycle contracts, transitions, effects, terminal states, and failure handling. Vitest tests cover legal and ignored events, successful replacement, configuration failure, add failure, cleanup failure, restoration, and stranded states. ChangesNode replacement lifecycle
Priority: ⬇️ Low Estimated code review effort: 3 (Moderate) | ~25 minutes Change: Refactor Suggested reviewers: 🚥 Pre-merge checks | ✅ 7✅ Passed checks (7 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. @@ Coverage Diff @@
## main #18150 +/- ##
==========================================
+ Coverage 82.80% 83.99% +1.19%
==========================================
Files 2947 2261 -686
Lines 145101 128829 -16272
Branches 37370 33483 -3887
==========================================
- Hits 120145 108206 -11939
+ Misses 23690 20333 -3357
+ Partials 1266 290 -976
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 811 files with indirect coverage changes 🚀 New features to boost your workflow:
|
DrJKL
left a comment
There was a problem hiding this comment.
Verdict: I found no P0/P1 blocker, but I recommend addressing the six review comments before this becomes the replacement contract. The main concern is staging a fully tested second policy owner beside the shipping materializer. The state/effect boundary also needs a precise completion contract before PR-2 wires it.
Existing feedback
CodeRabbit approved this exact head without actionable comments. There are no human review comments or unresolved findings to confirm or contest.
Checked and cleared
- Adding a state or event does force a test decision. The typed
statesandeventsrecords become incomplete, and the 42-pair assertion must change. I did not require a separate productionnevercheck because the PR claims this test-level guarantee. - I did not require a test for
IllegalReplacementTransition.name. The suite already proves the exported class and phase/event message; the custom name is a diagnostic detail rather than a documented contract. - Fallow reported 15 dev-dependency placement items in
package.json:@pinia/testing,@tailwindcss/vite,jsonc-parser,markdown-table,mixpanel-browser,monocart-coverage-reports,openai,picocolors,pretty-bytes,unplugin-icons,unplugin-vue-components,uuid,yaml,zip-dir, andzod-to-json-schema. Its JSON marks every itemintroduced: false, and this PR does not changepackage.json.
Coverage and checks
Standard-depth lanes run: correctness, maintainability, idiomaticity, tests, and documentation. I traced both changed files fully, current agentNodeMaterializer behavior, the Agent projection entry point, PR #18149's file/base relationship, and relevant state/effect and CRDT/ECS guidance. PR #18149 shares base bae78cd9 but changes five disjoint files; this head is not stacked on it. The future wiring PR will overlap agentNodeMaterializer.
Local checks on 9ce4ba78bf8435b73265b0f5047564516d3a08b1:
- focused Vitest: 15 passed
pnpm typecheck: passed- changed-file ESLint: passed
- type-aware oxlint: passed with five unrelated existing warnings
- changed-file oxfmt check: passed
pnpm knip: passed- Fallow review: pass, no changed-file complexity or duplication finding
git diff --check: passed
CI for this SHA is green for the relevant test, lint/format, Fallow, ecosystem, and coverage checks. Skipped jobs are scope gates, not failures.
| * is PM-1293 PR-2. | ||
| */ | ||
|
|
||
| export type ReplacementState = |
There was a problem hiding this comment.
P2: I would not merge this complete second policy owner while agentNodeMaterializer.materialize() remains the shipping owner. This module independently encodes release, commit, rollback ordering, and telemetry, but an exact import search finds no production consumer, so either implementation can change while the other suite stays green. Please introduce the reducer with the PR-2 driver and remove the inline policy in the same merge unit, or keep this PR stacked and unmerged until that wiring change is ready.
There was a problem hiding this comment.
Agreed. This PR is now a draft and stays stacked until the rewiring step drives materialize() through the table; they land in the same merge unit so there is never a second owner of the policy. Leaving this thread open for you to close.
…(PM-1293 PR-1) Address review on #18150: - restoring is a nonterminal phase; restored/stranded are reached only via restore-succeeded / restore-failed, so `restored` is never observable before the records are actually back #18150 (comment) - drop the optional configureFailure/cleanupFailure payloads; removing carries its required add cause, everything else is reported at the transition #18150 (comment) - events with no meaning in the current phase return the state untouched with no effects (docs/guidance/state-and-effects.md section 2); remove IllegalReplacementTransition #18150 (comment) - tests derive phases/events with Object.values(...).map and assert cause identity with toBe on the removing state and every report effect #18150 (comment) #18150 (comment) New report errorType agent_node_materialize_restore_failed for the stranded edge; main currently propagates a restore failure, the PR-2 driver decides whether to also rethrow.
…low complexity gate
…cement-state-machine
DrJKL
left a comment
There was a problem hiding this comment.
Verdict: follow-up changes address the prior transition findings; hold as a stacked draft.
I verified all six findings from my first review against this head. The restore phase is now nonterminal until an explicit result, failure payloads are required and preserve identity, out-of-phase events are identity-preserving no-ops, and the tests no longer need the casts I called out. The updated suite also fails against the prior implementation and passes here.
I left one inline contract issue that needs to be settled before the PR-2 driver lands. This state-machine scaffold still duplicates the live policy, so I agree it should not merge independently of the wiring step that removes the old owner.
| * authoritative records is unconditional, and no state is terminal until the | ||
| * driver has reported the outcome of that restore. | ||
| * | ||
| * Driver contract: run every returned effect in array order, then feed the |
There was a problem hiding this comment.
The executor contract is still under-specified for the effect lists returned below. fromRemoving() returns restore-records followed by one or two report effects, but “the last asynchronous or fallible effect” does not make explicit which effect produces the next event or whether execution continues after restore throws. Current materialize() stops at a restore failure before reporting the add/cleanup failures; a driver that catches restore, runs the remaining reports, and then emits restore-failed changes that behavior. Please make the effect-to-event and failure/continuation policy explicit before the wiring step, ideally in the typed driver boundary, so order and parity are not left to one reasonable interpretation.
There was a problem hiding this comment.
Typed the contract in bebce8c: each transition returns infallible commands plus at most one fallible step; stepEvent(step, result) is the only way a step outcome becomes the next event. Reports now run before restore-records, so a throwing restore no longer loses the add/cleanup reports; that is a deliberate parity change from materialize() and yours to veto.
Full context for agent readers
ReplacementTransitionis now{ state, commands: ReplacementCommand[], step: ReplacementStep | null }.ReplacementEffectis gone.commands(release-records,report) are bookkeeping the driver runs in order, unconditionally, before the step. They never produce an event.step(add-successor,configure-successor,remove-successor,restore-records) is the one effect whose outcome is the next event. Exactly one per non-terminal target state, none for terminal.stepEvent()reads aSTEP_EVENTStable, so the driver cannot choose or skip an event.- Execution after a throw: the driver loop for the rewiring step is
run commands; if step, run it and feed stepEvent(step, {ok} | {ok:false, cause}). Arestore()throw becomesrestore-failedand lands instrandedwithrestore_failedreported; it does not escape mid-sequence. Whether the driver rethrows oncestrandedis reached stays a rewiring-step decision, as the body says. - Ordering change from
main: onremoving -> restoring, theadd_failedandrollback_failedreports are commands, so they run before the restore step. Today's inline code reports them afterrestore()returns, so a throwing restore swallows them. Telemetry order is now add, cleanup, restore in every outcome. If you prefer restore-first, it is a one-row reorder plus the header note. - Tests: 31 pass. The table asserts commands and step per row; invariants assert one step per non-terminal target and none for terminal;
stepEventis covered for all four steps in both outcomes with cause identity; a referencedrive()loop asserts trace order for every path.
Each transition now returns infallible `commands` and at most one fallible `step`; `stepEvent()` is the only mapping from a step outcome to the next event. Reports run before the step, so a throwing restore no longer loses the add/cleanup reports (deliberate change from inline materialize()). Addresses #18150 (comment)
DrJKL
left a comment
There was a problem hiding this comment.
Verdict: ready to approve as part of the stacked merge unit; keep this draft until the PR-2 wiring is reviewed.
The typed commands/step split resolves my remaining concern. Commands have explicit unconditional ordering before one fallible step, and stepEvent() centrally owns the step-result-to-event mapping. The report-before-restore ordering is now an explicit, tested parity change: known add and cleanup failures remain observable if restoration also fails.
I found no new issue in this follow-up. This is not approval for standalone merge: materialize() still owns the production policy and no production driver exists in this PR, so the wiring and deletion of that duplicate owner still need to land and be reviewed in the same merge unit.
|
Unblocking the materializer rewiring: the three open design questions from the kickoff packet are ruled by default (Christian). @DrJKL you have a veto window until 2026-09-25; silence keeps the ruling.
The rewiring PR (materializer drives this state machine) opens as a draft stacked on this PR; this PR stays draft until the rewiring is reviewed, as agreed. Full context for agent readersWhy the id-release question lands on "keep": at The commit-point ruling follows the ticket's third scenario and the commands/step contract accepted in #18150 (review). The snapshot ruling follows the CRDT-backed ECS record being the single authoritative home for node state. Written ruling with line references: https://github.com/christian-byrne/in-app-agent-program/blob/main/program/decisions/DEC-2026-09-19-pm1293-agent-boundary-kickoff.md (section "Ruling (2026-09-21)"). Linear ticket: https://linear.app/comfyorg/issue/PM-1293 (redesign widget ownership and node replacement at the agent/litegraph boundary). |
dante01yoon
left a comment
There was a problem hiding this comment.
Draft, nothing wired, all 86 non-skipped checks green at bebce8c. The table reads well, and enumerating the full 8x9 cross product plus a reference drive() loop is a genuinely strong way to fix a policy before anything depends on it — adding a phase or event really can't slip through undecided.
I checked the encoded rows against agentNodeMaterializer.materialize() on main rather than against the PR description, and they match everywhere except one field. Confirmed parity:
- Commit point is
addsuccess, and a laterconfigure()failure reports without rolling back —maincatches it and stillreturn true. - Cleanup is best-effort while restore is not, and both causes are reported.
add_failedis reported beforerollback_failed(mainordering atagentNodeMaterializer.ts:319then:328).agent_node_materialize_restore_failedis new, which is consistent withrestoringbeing a real phase rather thanmain's unguardedrestore()call — and the report-before-restore reorder is the right call: onmaina throwingrestore()escapes before either report fires, so both facts are lost exactly when they matter most.- The
remove-successorstep is unconditional here whilemainguards ongraph._nodes_by_id[node.id] === node. That guard belongs in the driver's step implementation (return{ ok: true }when nothing is attached), so the table is still faithful.
The one gap is that report cannot carry the outcome tag main computes, and unlike context the driver cannot recover it — detail inline. Since you're holding this as a draft until the PR-2 rewiring, COMMENT rather than REQUEST_CHANGES; but I'd settle that field here, in the table, rather than when the driver has to reproduce today's telemetry.
On your two Review Focus questions, for what it's worth: the commit point matches main and I'd keep it — removing a successor that has already adopted its layout entry is the more damaging of the two failure modes, and your doc comment says so. Report-before-restore I'd keep too, for the reason above.
Validation: read-only review of the head sources and of main's materialize(); I did not run the Vitest suite. CI is green at this head.
| /** Infallible bookkeeping; the driver runs these in order, before the step. */ | ||
| export type ReplacementCommand = | ||
| | { kind: 'release-records' } | ||
| | { kind: 'report'; errorType: ReplacementErrorType; cause: unknown } |
There was a problem hiding this comment.
issue: report can't express the outcome tag main computes, so the PR-2 driver won't be able to reproduce today's add-failure telemetry from this table.
agentNodeMaterializer.materialize() on main emits the add-failure report as:
reportError(cause, {
errorType: 'agent_node_materialize_add_failed',
tags: { ...AGENT_ECS_TAGS, outcome: cleanupFailed ? 'degraded' : 'recovered' },
context: { graphId: graph.id, nodeId: String(state.id) }
})outcome is the one field whose value depends on which transition was taken, and it's the field this type drops. fromRemoving emits a byte-identical report('agent_node_materialize_add_failed', addCause) from both the cleanup-succeeded arm (line 213) and the cleanup-failed arm (line 220), so by the time the driver holds the command the recovered / degraded distinction is already gone. The only way back is for the driver to look ahead in the commands array for a following rollback_failed and infer — which is precisely the branching the contract on lines 32-38 exists to forbid ("the driver runs them in array order, unconditionally"; "a driver cannot pick a different event or skip one").
Concretely: agent_node_materialize_add_failed can be split by outcome today into add failures the rollback recovered versus ones it didn't. Once the rewiring step makes this table the owner, every add failure carries whatever constant the driver picks, and that split collapses with nothing in CI to signal it — the sort of loss that's only noticed the next time someone reaches for the dashboard.
Putting the tag on the command keeps the decision in the table, where the arm that knows the answer already is:
| {
kind: 'report'
errorType: ReplacementErrorType
outcome: 'recovered' | 'degraded'
cause: unknown
}configure_failed (line 196) and rollback_failed (line 221) are both 'degraded' on main, restore_failed presumably likewise; only add_failed varies by arm, so it's a small change and one extra assertion in the four failure-cause tests.
Separately and less urgently: context: { graphId, nodeId } is also absent, but the driver has both in scope and can supply them itself — unlike outcome. A line in the module header saying the driver owns context while the table owns errorType + outcome would stop PR-2 having to re-derive that split.
There was a problem hiding this comment.
Done in 1e9b5c9d22: report now carries outcome, decided by the arm that knows it (cleanup-succeeded gives recovered, every other report gives degraded), and the header states the driver owns context while the table owns errorType and outcome.
Full context for agent readers
ReplacementCommand'sreportvariant gainedoutcome: 'recovered' | 'degraded'. Thereport()helper takes it as a required positional argument so no call site can omit it.- Arm mapping against
main'smaterialize():add_failedaftercleanup-succeededisrecovered;add_failedaftercleanup-failed,rollback_failed,configure_failedaredegraded(matchingmain).restore_failedhas nomaincounterpart and isdegraded, since the graph and stores disagree instranded. - Tests: the legal-transition table rows assert the full command object including
outcome; the referencedrive()trace now encodesreport:<errorType>:<outcome>so the three scripted failure paths distinguish the two add-failure tags; one new test compares the twoadd_failedcommands directly and fails if they are byte-identical again. 32 pass. ReplacementOutcomeis module-private because the pre-push knip check rejects an export with no external consumer; the driver reaches it throughExtract<ReplacementCommand, { kind: 'report' }>['outcome']until the wiring step imports it.
|
|
||
| export interface ReplacementTransition { | ||
| state: ReplacementState | ||
| commands: ReplacementCommand[] |
There was a problem hiding this comment.
suggestion: commands is a mutable array on a type the module header describes as pure data handed to the driver.
commands: ReplacementCommand[] lets a driver push/splice the list it was given. Each transition builds a fresh array so a mutation wouldn't corrupt shared state — it would just silently change what that one driver executes — but the contract on lines 32-34 is that the driver runs them in array order, unconditionally, and that reads better if the array says it isn't the driver's to edit. readonly ReplacementCommand[] (and readonly on ReplacementTransition's fields) turns the convention into a type error. Non-blocking, and equally fine to leave until PR-2 when there's a real driver to type against.
There was a problem hiding this comment.
Taken now rather than waiting for the driver wiring step, in 1e9b5c9d22: ReplacementTransition fields are readonly, commands is readonly ReplacementCommand[], and each command variant's fields are readonly too.
Full context for agent readers
- Doing it here means the wiring step types its driver loop against the frozen shape from the start instead of loosening it later.
- The test file's
legaltable andreportCauses()helper acceptreadonly ReplacementCommand[]so they compile against the narrowed type; no test asserted mutability.
The table is the only place that knows whether an add failure was recovered (cleanup succeeded) or degraded (cleanup failed), so the report command now carries that tag alongside errorType. The driver owns the reporting context; the header says so. Transition fields and the command list are readonly so a driver cannot edit what it was handed. Addresses #18150 (comment) and #18150 (comment)
dante01yoon
left a comment
There was a problem hiding this comment.
Re-review at 1e9b5c9 (I last looked at bebce8c). Both of my points landed, the single new commit is exactly the change I asked for and nothing else, and I checked the telemetry mapping against main rather than against the commit message. Approving. Still a draft, so this approves the module as written — it is not a request to land it ahead of the rewiring step.
Prior findings
Finding (at bebce8c) |
Verdict | Evidence at 1e9b5c9 |
|---|---|---|
issue: report cannot express the outcome tag main computes, so the PR-2 driver could not reproduce today's add-failure split without the look-ahead inference the contract on lines 32-38 forbids |
Resolved | ReplacementCommand's report variant now carries outcome: ReplacementOutcome, and the report() helper takes it as a required positional argument, so no arm can omit it. The two add_failed commands are no longer byte-identical: the cleanup-succeeded arm emits recovered, the cleanup-failed arm degraded. The distinction is decided by the arm that knows it, which is what I was asking for. |
issue: (secondary) context: { graphId, nodeId } absent — driver-recoverable, but the split wanted stating |
Resolved | The module header now says the table owns errorType and outcome while the driver owns the reporting context, so PR-2 does not have to re-derive that boundary. |
suggestion: commands: ReplacementCommand[] is mutable on a type the header describes as pure driver data |
Resolved | ReplacementTransition's three fields are readonly, commands is readonly ReplacementCommand[], and each command variant's fields are readonly too. Taking it now rather than deferring to PR-2 is the better order — the driver types against the frozen shape from the start instead of being loosened later. |
Parity re-checked against main
I re-read materialize() at the live main tip (2f47188) rather than trusting the mapping in your reply. Worth recording why: the main checkout I had to hand was four days stale and predates the outcome tags entirely, which would have made this whole finding look like it had no premise. Against live main:
main |
this table |
|---|---|
add_failed, outcome: cleanupFailed ? 'degraded' : 'recovered' (:319-325) |
cleanup-succeeded → recovered, cleanup-failed → degraded ✓ |
rollback_failed, outcome: 'degraded' (:328-331) |
degraded ✓ |
configure_failed, outcome: 'degraded' (:360-362) |
degraded ✓ |
| no counterpart | restore_failed → degraded, which is right: stranded is by definition the graph and stores disagreeing |
The test that makes this stick is the right one. Comparing the two add_failed commands against each other — so the suite fails if they ever collapse back to identical — catches the regression that actually matters here, which asserting each arm in isolation would not. Encoding report:<errorType>:<outcome> in the drive() trace is a good second line on the same property.
ReplacementOutcome being module-private to satisfy knip is fine; Extract<ReplacementCommand, { kind: 'report' }>['outcome'] is a reasonable bridge until PR-2 imports it.
Draft status
Confirmed isDraft: true at this head. DrJKL's open P2 — not merging a second complete policy owner while agentNodeMaterializer.materialize() still carries the same policy inline — is honoured by the draft, and it is their thread to close, not mine.
Validation
Read-only: I read nodeReplacement.ts and nodeReplacement.test.ts at 1e9b5c9, and agentNodeMaterializer.ts at the live main tip. I did not run the Vitest suite. CI at this head: 86 passing, 16 skipped, 0 failing.
|
Closing as superseded by #18700 (the merged graph-first CRDT follower), which removes the materializer/reconciliation layer this stopgap targets. |
Adds
nodeReplacement.ts, a pure state machine for Agent node replacement: eight phases, nine events,transition(state, event)returns the next state, infalliblecommands, and at most one falliblestep;stepEvent(step, result)is the only mapping from a step outcome to the next event. An event with no meaning in the current phase returns the state untouched with no commands and no step. Nothing is wired yet; the materializer is untouched. Held as draft until the rewiring step (the third PR of the Agent/litegraph boundary redesign, Linear ticket linked below) replaces the inline policy inmaterialize(), so the codebase never has two owners of the same policy.Full context for agent readers
Summary
Introduce
src/workbench/extensions/agent/crdt/nodeReplacement.tsand its test as the single place that decides what happens at each step of replacing a node (release records, add successor, configure, remove on failure, restore records, report). Second step of the Linear ticket PM-1293, redesign widget ownership and node replacement at the Agent/litegraph boundary; see the kickoff comment for the four-step plan and the open questions for @DrJKL.This PR is independent of the widget codec-boundary PR (the first step, #18149); both branch from the same
mainhead and touch disjoint files.Status: stacked, not standalone
Per review, this module should not merge while
agentNodeMaterializer.materialize()still carries the same policy inline. It stays a draft and lands in the same merge unit as the rewiring step that drives the materializer through this table.Changes
ReplacementState(phasespending,released,committed,settled,removing,restoring,restored,stranded),ReplacementEvent(release,add-succeeded,add-failed,configure-succeeded,configure-failed,cleanup-succeeded,cleanup-failed,restore-succeeded,restore-failed),ReplacementCommand(release-records,report),ReplacementStep(add-successor,configure-successor,remove-successor,restore-records),StepResult,transition(),stepEvent(),initialReplacementState(),isTerminal().commandsand at most onestep. Commands are infallible bookkeeping; the driver runs them in array order, unconditionally, before the step, and they never produce an event. The step is the one fallible effect the machine is waiting on; its outcome, fed throughstepEvent(), is the next event, and nothing else is. Every non-terminal target state has exactly one step; a transition into a terminal state has none. The rewiring step's loop is thereforerun commands; if step, run it and feed stepEvent(step, result), with no branching on which event to emit.maintoday): the commit point isaddsuccess; a configure failure is reported (agent_node_materialize_configure_failed) but does not roll back; on add failure the successor removal is best-effort (cleanup-failedreported asagent_node_materialize_rollback_failed) and the records are always restored.main: reports precede the restore step. In the inlinematerialize(), a throwingrestore()escapes before the add and cleanup failures are reported, so those facts are lost. Hereremoving -> restoringemits theadd_failed(androllback_failed) reports as commands, then runsrestore-recordsas the step, and a restore failure addsrestore_failedon top. Telemetry order is add, cleanup, restore in every outcome. Flagged in Review Focus for veto.restoringis nonterminal; the driver feeds backrestore-succeeded(terminalrestored) orrestore-failed(terminalstranded, reported asagent_node_materialize_restore_failed).restoredis therefore never observable before the records are actually back.mainpropagates a restore failure today; whether the driver also rethrows onstrandedis decided in the rewiring step.removingcarries its required add cause; every other failure cause is emitted as areportcommand at the transition that learns about it.docs/guidance/state-and-effects.mdsection 2; duplicate or stale delivery is harmless.IllegalReplacementTransitionis gone.Review Focus
addsucceeds, and a laterconfigurefailure leaves the successor in place. That is whatmaindoes now; if the intended contract is instead "configure failure rolls back", that is a one-row change here and a behaviour change downstream, and I would rather decide it on the ticket before the rewiring step.main(see Changes). If the preferred contract is instead "restore first, report only what survives", that is a reorder of one row plus the module-header note.Tests
nodeReplacement.test.tsenumerates the full 8x9 state-by-event cross product: the nine legal rows assert next state, exact command order and step; the other 63 pairs assert the same state object is returned (toBe) with no commands and no step. Adding a phase or event without deciding its row fails the test.stepEvent()is asserted for all four steps in both outcomes, with the failure cause carried by identity.toBechecks thatremoving.causeand everyreport.causeare the original error objects (add cause after cleanup, cleanup cause on rollback, configure cause, restore cause).drive()loop in the test runs the contract end to end and asserts the trace order (commands, then step) for the happy path, configure failure, add failure with clean rollback, add failure with rollback failure, and restore failure (stranded), plus not-terminal-until-restore-result and duplicate/stale event idempotency.vue-tsc --noEmit,oxlint,eslint,oxfmt --check,knip,vitest(31 passed).Screenshots
Not applicable; no UI change.