Repository navigation
fix(agent-crdt): pending-op tracker survives tab switches and gates echo handling - #18210
claude[bot] wants to merge 95 commits into
Conversation
Restack of the s3-opt-6 wiring onto main's AgentCrdtProjection / AgentCrdtDocLifecycle split, folding the branch's evolution of the same wiring into one step: - opSender gains observation-only onBatchMinted / onBatchTransmitted hooks and parks unacknowledged batches so an identified late result settles them instead of leaking - pendingOpTracker glues the pure ledger to the follower: minted ops enqueue, transmissions count attempts, settles reconcile or revert, doc_update effects clear - skipped duplicates park keyed by the ack seq and resolve on the first projection that covers it (s3-opt-2), via lastAppliedSequence - the follower resets the tracker on doc_reset, follower replacement, watcher unbind/switch, and teardown - a frame whose ECS batch did not commit stays pending and is retried on graph readiness or resubscribe (retryPending), so pending ops are only retired from a successfully projected revision
A human-authored add_node the CRDT host rejects stays on the canvas: the mint ports apply it optimistically via the normal LiteGraph flow, and useAgentCrdtFollower only forwards the pendingOpTracker's `reverted` event to the dev panel, never to the graph. Adds a Vitest test that wires the real attachMintPortWiring/opSender/pendingOpTracker together over a fake graph, and a Playwright e2e test that binds the CRDT doc through a real agent turn, adds a LoadImage node via the search box, rejects its doc_ops frame the way the reported host failure did, and screenshots the ghost node still selectable on canvas. Both are marked as expected failures until the revert path is wired in.
A human add_node the doc host rejects stayed on the canvas forever: the pending-op tracker computed the reverted outcome but only the dev panel consumed it. The reverted event now carries the dropped ops, a revert applier removes each reverted add_node's node under layoutStore.withActor plus runMintPortsSuppressed so the teardown's microtask-deferred layout deleteNode cannot re-mint, and the user gets one warn toast per settle. Recorded as ADR-CRDT-PENDING-0030.
Review feedback on the pending-op wiring, each with a regression test: - reset the projected-seq watermark with every pending-correlation reset: each subscription is its own sequence lineage, so workflow A's watermark could clear workflow B's parked skipped duplicate before B projects - drop pending correlation on schema_error: the read path is closed, so no doc_update effect can retire what is pending - report only still-tracked ops as delivery_unknown; a partial doc effect had already retired the rest - keep late-settled op identity in the sender so the resend's repeated identified result drains its stale credit instead of leaving it armed to swallow a newer batch's anonymous result - pin that a validation-rejected incremental frame re-reads the doc on retryPending instead of committing an empty delta - replace the duplicated markInFlight ledger test with the missing positive single-id transition case
The fallow audit gates error-severity CRAP findings introduced in changed files, and the late-credit handling pushed the sender's result listener to cyclomatic 20 while the binding watcher sat at 16. Extract the identified late-result settlement, anonymous-result settlement, and stale-credit drain into named helpers, and fold the watcher's three binding outcomes into releaseBinding/bindTo. No behavior change; the existing sender and follower suites cover every extracted path.
fallow gates ANY complexity finding introduced in changed files, and the delivery-unknown ledger filter pushed the tracker's onBatchSettled to CRAP 43.1. Split the acknowledged path into reconcileAcknowledged and parkOrClearSkipped; behavior is unchanged and covered by the existing tracker suite. Also drop the rejected-add spec's own test.setTimeout(30s): it overrode the video-walkthrough job's deliberate 180s budget, so the recording run (SLOW_MO=250) timed out where the project default would have passed.
…turn The panel gained a workflow picker after the spec was written: a turn binds a doc only once a workflow is chosen, so the spec's send never produced a doc_subscribe and 'await subscribed' hung to the full test timeout. Drive the flow through the AgentPanel fixture (open, select the active tab's workflow, send), matching agentPanel.spec.ts.
The spec double-clicked page-absolute (10, 10) via canvasOps.doubleClick, which lands on topbar chrome in the cloud layout, so the node search container never appeared and fillAndSelectFirstNode waited out the whole test timeout. Double-click the canonical empty canvas position with canvas-relative coordinates instead (mouseDblclickAt), the same seam the other layout-sensitive specs use.
The cloud project never opens the node search from a canvas double-click, so the spec drives nodeOps.addNode instead. The fixture's graph.add lands an actor-less createNode that the layout store stamps with this session's human actor, minting the same add_node op as UI insertion; the asserted behavior (optimistic add reverted on host rejection) is unchanged.
The agent boot mocks stub /api/object_info to {}, so no node types
register and LiteGraph.createNode('LoadImage') returns null. Thread the
cloud boot mocks' objectInfo option through agentTest as agentObjectInfo
(default unchanged: stubbed) and have the rejected-add spec opt into the
server's definitions, as agentConversationFixture already does.
Closing the panel unmounts AgentPanelRoot, which disposes the CRDT follower and unbinds the doc, so the human add_node never minted and the spec hung awaiting the host rejection. The close step only existed for the removed canvas double-click; the fixture insertion needs no canvas access, so the panel stays open.
The mocked host rejects the add_node frame synchronously, so the revert can remove the optimistic node within milliseconds of graph.add - the one-node canvas is a transient state the poll loses to. Pin the round-trip instead: the add succeeded (addNode returned an id), the host received and rejected the minted add_node (its op id resolves), and the node the host never accepted is gone. Same behavior asserted, no race on an unobservable intermediate state.
Both sides extended useAgentCrdtFollower: this branch's pending-op correlation (watermark, retryPendingProjection, resetPendingCorrelation) merged into main's graph-activity events and binding helpers. onProjected now owns only the watermark and settlement; each call path reconciles the live graph exactly once through applyAndReconcile or reconcileAndReportPending, and every unbind site resets the pending correlation. AgentPanelRoot passes both the activity events and the layout actor scope.
Picks up the two-turn wire cloud snapshot refresh that turned the cloud suite green on main.
Keeps both ADR index rows, supplies the inert placement fixture to the one rollback test that constructs createGraphMutations without the port #18084 made a required dependency, and folds the branch's agentObjectInfo option into the objectInfo option main added for the same purpose.
…rim rollout detail Address review feedback on PR #18106: own the pending-op ledger per bound workflow/document instead of per follower mount so it survives panel close/reopen, not just tab deactivation; separate the durable no-silent-discard/collision-reported guarantee from the interim removeMissing/reconcile compensators and name what a future semantic-apply direction would delete; correct the define_subgraph prerequisite chain now that #16644 closed unmerged with no verified successor; and trim the Sequencing section to dependency order and behavior-level acceptance criteria, moving file/test-level detail out of the architecture record.
State the durable-vs-interim boundary as four mechanism-independent behavior requirements (no silent discard of unresolved intent, host rejections reported, unknown-delivery outcomes resolved at catch-up, collisions reported with the document winning) instead of tying them to the current ledger. Note that the current store-first path satisfies them with the workflow/document-scoped ledger plus the ledger-aware compensators, and that a later semantic-apply direction could replace the ledger itself (not just the compensators) with command-carried provenance and ingress echo filtering, naming pendingOpLedger.ts and the ledger-gated echo check in the deleted-or-replaced list alongside the existing compensators.
…g-op revert The transmitted-batch settle main split out of undeliverable keeps firing the transmitted hook, and the tracker reverts an unconfirmed batch the same way the pre-split undeliverable settle did.
Tab activation flips after the incoming tab's graph configures, so its load-time createNode changes reached the mint gate while the doc was still bound to the outgoing workflow. The leaked add_node ops entered the wrong doc, the host refused the colliding one, and the pending-op revert then deleted the user's own node on the new tab. The layout mint port now requires the change's graphId to match the bound workflow's root graph id.
…e the retry tests
…cho handling (cherry picked from commit 04244b4)
|
Important Review skippedBot user detected. To trigger a single review, invoke the ⚙️ Run configuration
You can disable this status message by setting the Use the checkbox below for a quick retry:
Comment |
🎭 Playwright: ✅ 2128 passed, 0 failed · 2 flaky📊 Browser Reports
🎨 Storybook: ✅ Built — View Storybook🌾 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 5a543d3ebfb962f7844dad06e38034ca5861368a
Full docs: ADR-DEVEX-LINT-0015 📦 Bundle Size
⚡ Performance Report
Absolute values
Raw data{
"timestamp": "2026-09-25T16:45:17.524Z",
"gitSha": "c0ab62b93c88022901e8e3ba000c553582c33c7d",
"branch": "claude/pending-op-tracker-survives-tab-switch",
"measurements": [
{
"name": "canvas-idle",
"durationMs": 2003.0679999999847,
"styleRecalcs": 10,
"styleRecalcDurationMs": 2.941,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 328.307,
"heapDeltaBytes": -7823976,
"heapUsedBytes": 54540844,
"domNodes": 0,
"jsHeapTotalBytes": 4448256,
"scriptDurationMs": 8.195999999999998,
"eventListeners": 0,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333335,
"p95FrameDurationMs": 16.699999999999818
},
{
"name": "canvas-idle",
"durationMs": 1990.1149999999461,
"styleRecalcs": 10,
"styleRecalcDurationMs": 2.1929999999999987,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 328.518,
"heapDeltaBytes": 8849104,
"heapUsedBytes": 71104260,
"domNodes": -228,
"jsHeapTotalBytes": 4972544,
"scriptDurationMs": 6.649000000000002,
"eventListeners": -142,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.699999999999818
},
{
"name": "canvas-mouse-sweep",
"durationMs": 1693.9120000000685,
"styleRecalcs": 72,
"styleRecalcDurationMs": 15.068999999999999,
"layouts": 12,
"layoutDurationMs": 4.19,
"taskDurationMs": 606.1829999999999,
"heapDeltaBytes": 8701728,
"heapUsedBytes": 71146860,
"domNodes": -228,
"jsHeapTotalBytes": 5758976,
"scriptDurationMs": 107.933,
"eventListeners": -142,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.699999999999818
},
{
"name": "canvas-mouse-sweep",
"durationMs": 1694.7649999999612,
"styleRecalcs": 71,
"styleRecalcDurationMs": 12.044000000000002,
"layouts": 12,
"layoutDurationMs": 3.0359999999999996,
"taskDurationMs": 563.986,
"heapDeltaBytes": -2489076,
"heapUsedBytes": 59558152,
"domNodes": -228,
"jsHeapTotalBytes": 6021120,
"scriptDurationMs": 101.532,
"eventListeners": -164,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "canvas-zoom-sweep",
"durationMs": 1693.66500000001,
"styleRecalcs": 28,
"styleRecalcDurationMs": 7.736,
"layouts": 6,
"layoutDurationMs": 1.248,
"taskDurationMs": 235.20200000000003,
"heapDeltaBytes": 2141092,
"heapUsedBytes": 64682664,
"domNodes": 53,
"jsHeapTotalBytes": 4980736,
"scriptDurationMs": 9.385000000000002,
"eventListeners": 15,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "canvas-zoom-sweep",
"durationMs": 1694.071000000008,
"styleRecalcs": 30,
"styleRecalcDurationMs": 7.53,
"layouts": 6,
"layoutDurationMs": 1.1800000000000002,
"taskDurationMs": 236.584,
"heapDeltaBytes": 2339872,
"heapUsedBytes": 64810500,
"domNodes": 53,
"jsHeapTotalBytes": 4980736,
"scriptDurationMs": 9.049000000000001,
"eventListeners": 15,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333335,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "dom-widget-clipping",
"durationMs": 517.67899999993,
"styleRecalcs": 13,
"styleRecalcDurationMs": 2.921,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 325.609,
"heapDeltaBytes": 18367340,
"heapUsedBytes": 80645280,
"domNodes": 0,
"jsHeapTotalBytes": 5242880,
"scriptDurationMs": 116.25999999999999,
"eventListeners": 0,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "dom-widget-clipping",
"durationMs": 515.6100000000379,
"styleRecalcs": 13,
"styleRecalcDurationMs": 2.581,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 312.47700000000003,
"heapDeltaBytes": 18455448,
"heapUsedBytes": 81060516,
"domNodes": 0,
"jsHeapTotalBytes": 4980736,
"scriptDurationMs": 111.691,
"eventListeners": 0,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.663333333333338,
"p95FrameDurationMs": 16.700000000000273
},
{
"name": "dom-widget-order-dense-n200-w200-i120",
"durationMs": 1036.5560000000187,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 698.9609999999999,
"heapDeltaBytes": -18486504,
"heapUsedBytes": 72380468,
"domNodes": -259,
"jsHeapTotalBytes": 19005440,
"scriptDurationMs": 46.085,
"eventListeners": -207,
"totalBlockingTimeMs": 394,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "dom-widget-order-dense-n200-w200-i120",
"durationMs": 1136.8830000000116,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 748.0669999999999,
"heapDeltaBytes": 10344816,
"heapUsedBytes": 98500432,
"domNodes": -259,
"jsHeapTotalBytes": 26365952,
"scriptDurationMs": 43.76999999999999,
"eventListeners": -185,
"totalBlockingTimeMs": 509,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "dom-widget-order-sparse-n1000-w20-i120",
"durationMs": 702.036000000021,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 291.4349999999999,
"heapDeltaBytes": 14130116,
"heapUsedBytes": 90842272,
"domNodes": 0,
"jsHeapTotalBytes": 0,
"scriptDurationMs": 96.10999999999997,
"eventListeners": 0,
"totalBlockingTimeMs": 99,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "dom-widget-order-sparse-n1000-w20-i120",
"durationMs": 716.2929999999506,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 305.158,
"heapDeltaBytes": 14698584,
"heapUsedBytes": 91237348,
"domNodes": 0,
"jsHeapTotalBytes": 0,
"scriptDurationMs": 96.39399999999998,
"eventListeners": 0,
"totalBlockingTimeMs": 111,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.699999999999818
},
{
"name": "extension-clean-combined-draw",
"durationMs": 6579.519000000005,
"styleRecalcs": 1,
"styleRecalcDurationMs": 0.35199999999999987,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 5728.767000000001,
"heapDeltaBytes": 8834256,
"heapUsedBytes": 85645436,
"domNodes": -228,
"jsHeapTotalBytes": 3661824,
"scriptDurationMs": 4425.916,
"eventListeners": -164,
"totalBlockingTimeMs": 104,
"frameDurationMs": 17.776666666666642,
"p95FrameDurationMs": 33.29999999999927
},
{
"name": "extension-clean-combined-draw",
"durationMs": 5670.644000000038,
"styleRecalcs": 1,
"styleRecalcDurationMs": 0.2360000000000001,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 4971.976,
"heapDeltaBytes": 4479440,
"heapUsedBytes": 87158412,
"domNodes": 0,
"jsHeapTotalBytes": 7077888,
"scriptDurationMs": 3966.4250000000006,
"eventListeners": 0,
"totalBlockingTimeMs": 0,
"frameDurationMs": 17.220000000000013,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "extension-rgthree-prototype-draw",
"durationMs": 6422.343999999953,
"styleRecalcs": 2,
"styleRecalcDurationMs": 0.579999999999999,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 5642.709999999999,
"heapDeltaBytes": -1412612,
"heapUsedBytes": 76726660,
"domNodes": -228,
"jsHeapTotalBytes": 7331840,
"scriptDurationMs": 4340.713999999999,
"eventListeners": -164,
"totalBlockingTimeMs": 84,
"frameDurationMs": 17.776666666666642,
"p95FrameDurationMs": 33.29999999999927
},
{
"name": "extension-rgthree-prototype-draw",
"durationMs": 5520.1829999999745,
"styleRecalcs": 2,
"styleRecalcDurationMs": 0.5400000000000006,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 4950.298,
"heapDeltaBytes": 20171672,
"heapUsedBytes": 98131160,
"domNodes": -228,
"jsHeapTotalBytes": 3923968,
"scriptDurationMs": 3856.792,
"eventListeners": -164,
"totalBlockingTimeMs": 22,
"frameDurationMs": 17.219999999999953,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "large-graph-idle",
"durationMs": 2024.8850000000402,
"styleRecalcs": 11,
"styleRecalcDurationMs": 2.3939999999999984,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 442.1029999999999,
"heapDeltaBytes": -8252824,
"heapUsedBytes": 72080228,
"domNodes": -228,
"jsHeapTotalBytes": -270336,
"scriptDurationMs": 27.860999999999997,
"eventListeners": -164,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "large-graph-idle",
"durationMs": 2008.7649999999257,
"styleRecalcs": 10,
"styleRecalcDurationMs": 2.299000000000001,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 424.198,
"heapDeltaBytes": -10165984,
"heapUsedBytes": 71718180,
"domNodes": -228,
"jsHeapTotalBytes": 290816,
"scriptDurationMs": 24.459999999999997,
"eventListeners": -164,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "large-graph-pan",
"durationMs": 2121.210000000019,
"styleRecalcs": 69,
"styleRecalcDurationMs": 11.333,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 1244.671,
"heapDeltaBytes": -17031620,
"heapUsedBytes": 65549308,
"domNodes": -228,
"jsHeapTotalBytes": 552960,
"scriptDurationMs": 590.519,
"eventListeners": -164,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "large-graph-pan",
"durationMs": 2119.5679999999584,
"styleRecalcs": 69,
"styleRecalcDurationMs": 8.161999999999999,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 1127.1139999999998,
"heapDeltaBytes": -17076052,
"heapUsedBytes": 65739300,
"domNodes": -228,
"jsHeapTotalBytes": 1339392,
"scriptDurationMs": 534.397,
"eventListeners": -164,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "large-graph-zoom",
"durationMs": 3239.0850000000455,
"styleRecalcs": 67,
"styleRecalcDurationMs": 12.709,
"layouts": 60,
"layoutDurationMs": 15.456999999999999,
"taskDurationMs": 1389.226,
"heapDeltaBytes": -7611016,
"heapUsedBytes": 76359444,
"domNodes": -228,
"jsHeapTotalBytes": 4222976,
"scriptDurationMs": 593.201,
"eventListeners": -164,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "large-graph-zoom",
"durationMs": 3133.336999999983,
"styleRecalcs": 64,
"styleRecalcDurationMs": 10.199000000000002,
"layouts": 60,
"layoutDurationMs": 13.183,
"taskDurationMs": 1202.5869999999998,
"heapDeltaBytes": 9530836,
"heapUsedBytes": 75403236,
"domNodes": 0,
"jsHeapTotalBytes": 524288,
"scriptDurationMs": 527.663,
"eventListeners": 0,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "legacy-node-drag",
"durationMs": 2094.414000000029,
"styleRecalcs": 44,
"styleRecalcDurationMs": 5.997000000000001,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 1340.004,
"heapDeltaBytes": 17851588,
"heapUsedBytes": 86193540,
"domNodes": 0,
"jsHeapTotalBytes": 942080,
"scriptDurationMs": 646.0229999999999,
"eventListeners": 180,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "legacy-node-drag",
"durationMs": 2182.613999999944,
"styleRecalcs": 46,
"styleRecalcDurationMs": 5.273999999999999,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 1389.9840000000002,
"heapDeltaBytes": 7561064,
"heapUsedBytes": 73717276,
"domNodes": 0,
"jsHeapTotalBytes": 192512,
"scriptDurationMs": 680.5550000000001,
"eventListeners": 180,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "minimap-idle",
"durationMs": 2020.0609999999415,
"styleRecalcs": 9,
"styleRecalcDurationMs": 2.524,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 430.338,
"heapDeltaBytes": -13289072,
"heapUsedBytes": 76213312,
"domNodes": -228,
"jsHeapTotalBytes": 3436544,
"scriptDurationMs": 30.319,
"eventListeners": -164,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "minimap-idle",
"durationMs": 2006.426999999917,
"styleRecalcs": 8,
"styleRecalcDurationMs": 1.9070000000000007,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 382.055,
"heapDeltaBytes": -4235752,
"heapUsedBytes": 84682432,
"domNodes": -228,
"jsHeapTotalBytes": -495616,
"scriptDurationMs": 26.186,
"eventListeners": -142,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "subgraph-dom-widget-clipping",
"durationMs": 449.85400000007303,
"styleRecalcs": 49,
"styleRecalcDurationMs": 4.324,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 272.648,
"heapDeltaBytes": 13376636,
"heapUsedBytes": 76765332,
"domNodes": 0,
"jsHeapTotalBytes": 6029312,
"scriptDurationMs": 92.172,
"eventListeners": 6,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "subgraph-dom-widget-clipping",
"durationMs": 449.0899999999556,
"styleRecalcs": 48,
"styleRecalcDurationMs": 4.31,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 273.517,
"heapDeltaBytes": 12969956,
"heapUsedBytes": 76591248,
"domNodes": 0,
"jsHeapTotalBytes": 6029312,
"scriptDurationMs": 93.081,
"eventListeners": 6,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000273
},
{
"name": "subgraph-idle",
"durationMs": 1993.161999999984,
"styleRecalcs": 11,
"styleRecalcDurationMs": 2.508999999999999,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 332.01899999999995,
"heapDeltaBytes": -4887232,
"heapUsedBytes": 58556412,
"domNodes": -244,
"jsHeapTotalBytes": 5234688,
"scriptDurationMs": 7.510000000000001,
"eventListeners": -210,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "subgraph-idle",
"durationMs": 1993.265000000065,
"styleRecalcs": 11,
"styleRecalcDurationMs": 2.836,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 336.071,
"heapDeltaBytes": -11274144,
"heapUsedBytes": 58551904,
"domNodes": -244,
"jsHeapTotalBytes": 5496832,
"scriptDurationMs": 6.397000000000002,
"eventListeners": -210,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "subgraph-mouse-sweep",
"durationMs": 1672.8180000000066,
"styleRecalcs": 74,
"styleRecalcDurationMs": 13.716,
"layouts": 16,
"layoutDurationMs": 4.128,
"taskDurationMs": 574.0289999999999,
"heapDeltaBytes": -2987868,
"heapUsedBytes": 60735104,
"domNodes": -244,
"jsHeapTotalBytes": 4710400,
"scriptDurationMs": 72.837,
"eventListeners": -210,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "subgraph-mouse-sweep",
"durationMs": 1711.6589999999405,
"styleRecalcs": 75,
"styleRecalcDurationMs": 12.719,
"layouts": 16,
"layoutDurationMs": 4.016,
"taskDurationMs": 500.4000000000001,
"heapDeltaBytes": 11870228,
"heapUsedBytes": 75001584,
"domNodes": -244,
"jsHeapTotalBytes": 4710400,
"scriptDurationMs": 70.54100000000001,
"eventListeners": -188,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "subgraph-transition-enter",
"durationMs": 816.1039999999957,
"styleRecalcs": 19,
"styleRecalcDurationMs": 18.604999999999997,
"layouts": 5,
"layoutDurationMs": 7.642000000000001,
"taskDurationMs": 592.9330000000001,
"heapDeltaBytes": -1122052,
"heapUsedBytes": 95009548,
"domNodes": 13667,
"jsHeapTotalBytes": 6553600,
"scriptDurationMs": 19.219999999999995,
"eventListeners": 2383,
"totalBlockingTimeMs": 78,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "viewport-pan-sweep",
"durationMs": 8160.392999999999,
"styleRecalcs": 250,
"styleRecalcDurationMs": 34.422999999999995,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 3714.3740000000003,
"heapDeltaBytes": 3410884,
"heapUsedBytes": 84663972,
"domNodes": -228,
"jsHeapTotalBytes": 253952,
"scriptDurationMs": 1865.807,
"eventListeners": -142,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.670000000000012,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "viewport-pan-sweep",
"durationMs": 8144.0520000001015,
"styleRecalcs": 251,
"styleRecalcDurationMs": 30.898999999999997,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 4029.4550000000004,
"heapDeltaBytes": 3574952,
"heapUsedBytes": 85041900,
"domNodes": -228,
"jsHeapTotalBytes": 4972544,
"scriptDurationMs": 1820.0179999999998,
"eventListeners": -164,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.80000000000109
},
{
"name": "vue-large-graph-idle",
"durationMs": 11148.35400000004,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 10275.853000000001,
"heapDeltaBytes": -54096232,
"heapUsedBytes": 173613004,
"domNodes": -8049,
"jsHeapTotalBytes": -14618624,
"scriptDurationMs": 140.903,
"eventListeners": -14923,
"totalBlockingTimeMs": 0,
"frameDurationMs": 17.220000000000073,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "vue-large-graph-idle",
"durationMs": 11009.996000000001,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 10253.124,
"heapDeltaBytes": -41958696,
"heapUsedBytes": 178062168,
"domNodes": -8049,
"jsHeapTotalBytes": -21102592,
"scriptDurationMs": 146.51500000000001,
"eventListeners": -14923,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.670000000000073,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "vue-large-graph-pan",
"durationMs": 13711.821999999984,
"styleRecalcs": 67,
"styleRecalcDurationMs": 13.469000000000008,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 13106.652,
"heapDeltaBytes": -44955600,
"heapUsedBytes": 180570412,
"domNodes": -8049,
"jsHeapTotalBytes": -20455424,
"scriptDurationMs": 665.836,
"eventListeners": -14923,
"totalBlockingTimeMs": 76,
"frameDurationMs": 17.223333333333358,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "vue-large-graph-pan",
"durationMs": 10537.435999999958,
"styleRecalcs": 66,
"styleRecalcDurationMs": 12.882000000000005,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 9742.331,
"heapDeltaBytes": -37695060,
"heapUsedBytes": 195473628,
"domNodes": -8049,
"jsHeapTotalBytes": -4771840,
"scriptDurationMs": 584.82,
"eventListeners": -14923,
"totalBlockingTimeMs": 0,
"frameDurationMs": 17.220000000000073,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "vue-node-resize-workload",
"durationMs": 3522.605999999996,
"styleRecalcs": 20,
"styleRecalcDurationMs": 50.55300000000001,
"layouts": 20,
"layoutDurationMs": 18.795999999999992,
"taskDurationMs": 3364.2139999999995,
"heapDeltaBytes": -44667840,
"heapUsedBytes": 195720452,
"domNodes": -6529,
"jsHeapTotalBytes": 12120064,
"scriptDurationMs": 53.77900000000001,
"eventListeners": -14923,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "vue-node-resize-workload",
"durationMs": 4017.3039999999673,
"styleRecalcs": 20,
"styleRecalcDurationMs": 56.20700000000001,
"layouts": 20,
"layoutDurationMs": 22.392000000000003,
"taskDurationMs": 3881.654,
"heapDeltaBytes": -24014244,
"heapUsedBytes": 196400968,
"domNodes": -8049,
"jsHeapTotalBytes": 15400960,
"scriptDurationMs": 61.498,
"eventListeners": -14923,
"totalBlockingTimeMs": 80,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "vue-zoom-out-idle",
"durationMs": 5273.302000000058,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 4713.464,
"heapDeltaBytes": -18036084,
"heapUsedBytes": 171352800,
"domNodes": 0,
"jsHeapTotalBytes": -22020096,
"scriptDurationMs": 61.740000000000016,
"eventListeners": 0,
"totalBlockingTimeMs": 0,
"frameDurationMs": 17.220000000000073,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "vue-zoom-out-idle",
"durationMs": 4395.407000000091,
"styleRecalcs": 1,
"styleRecalcDurationMs": 0.13599999999999723,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 4063.4449999999997,
"heapDeltaBytes": -13179172,
"heapUsedBytes": 183722528,
"domNodes": 0,
"jsHeapTotalBytes": -17825792,
"scriptDurationMs": 66.25000000000003,
"eventListeners": 0,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "workflow-execution",
"durationMs": 427.34599999994316,
"styleRecalcs": 15,
"styleRecalcDurationMs": 12.466999999999999,
"layouts": 4,
"layoutDurationMs": 1.725,
"taskDurationMs": 93.23,
"heapDeltaBytes": 5038776,
"heapUsedBytes": 66988868,
"domNodes": 104,
"jsHeapTotalBytes": 0,
"scriptDurationMs": 8.867999999999999,
"eventListeners": 81,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.663333333333338,
"p95FrameDurationMs": 16.799999999999727
},
{
"name": "workflow-execution",
"durationMs": 73.53899999998248,
"styleRecalcs": 6,
"styleRecalcDurationMs": 7.5729999999999995,
"layouts": 4,
"layoutDurationMs": 1.568,
"taskDurationMs": 46.104000000000006,
"heapDeltaBytes": 2923576,
"heapUsedBytes": 65072184,
"domNodes": 113,
"jsHeapTotalBytes": 0,
"scriptDurationMs": 3.9819999999999993,
"eventListeners": 17,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.663333333333338,
"p95FrameDurationMs": 16.800000000000182
}
]
}🔬 E2E Coverage
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 🌐 Website E2ETip All tests passed.
🔗 Website PreviewWebsite Preview: https://comfy-website-preview-pr-18210.vercel.app Models is built and gated by PostHog (workshop-enabled), using staging Cloud. This commit: https://website-frontend-ise72fbr3-comfyui.vercel.app Last updated: 2026-09-22T22:49:49Z for |
Codecov Report❌ Patch coverage is @@ Coverage Diff @@
## main #18210 +/- ##
==========================================
+ Coverage 83.94% 84.97% +1.02%
==========================================
Files 3067 2312 -755
Lines 151775 133171 -18604
Branches 41213 34827 -6386
==========================================
- Hits 127406 113156 -14250
+ Misses 22923 19708 -3215
+ Partials 1446 307 -1139
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 766 files with indirect coverage changes 🚀 New features to boost your workflow:
|
…ow ack dedup claim - Reactivation seq mismatch no longer bulk-reverts parked ledger entries; they stay parked and resolve by the existing per-kind document check, with destructive revert-on-absence gated on the (already-listed) backend lineage token. - Narrow the ack-dedup claim to what the wire actually lets the client detect (no newer subscribe sent since the last consumed ack); note the early-release case is tolerable because barrier release never reverts on absence. List echoed subscribe identity as a backend follow-up. - Inline a "Dependency contract" section summarizing CRDT-PENDING-0030 (open on #16309) so this ADR is reviewable while that ADR is unlanded, and point its link at the GitHub blob on that branch. - Drop the obsolete comfy-multi-player@0.2.1 premise for (d); the package actually consumed (0.3.3) already ships DefineSubgraphOp and its applier, so the only remaining gap is that layoutMintPort.ts has no define_subgraph mint path. - Trim Rollout status back to architectural dependency order, removing the PR/branch/SHA/package-version status facts that had gone stale again.
…0 reference The GitHub blob URL to the not-yet-landed CRDT-PENDING-0030 file embedded a docs/adr/*.md-shaped path that scripts/cicd/check-adr-links.sh treats as a local reference and checks for existence, which fails since that file isn't on this branch. Link to the open PR (#16309) instead of the blob path; the prose still says plainly that the ADR is stacked, unlanded work.
…corrected barrier rule A changed seq at reactivation no longer proves a parked op is absent, so these tests stop asserting destructive invalidation (revert-on-mismatch, sender abort, blocked resend) and instead cover: presence resolves a parked add applied, absence leaves it parked, a later same-lineage doc_update or an explicit host rejection still resolve it, and an ordinary subsequent catch-up still reverts on absence as before.
A resubscribe after a tab-inactive hold that reports a changed seq is ordinary same-lineage progress, not proof any parked op is absent, so it must not bulk-revert the ledger. Drop the destructive invalidate-and-abort path on that mismatch; route resolution through the same per-kind document-presence check the catch-up barrier already runs, with reverting on absence disabled for exactly the one catch-up that mismatch implies. An entry the check still finds present resolves applied either way; one it finds absent now stays parked and resolves at the next same-lineage doc_update, an explicit host rejection, or the next ordinary catch-up.
…al path Round-7 review fixes for CRDT-RECONCILE-0035: a doc_subscribed acknowledgement never settles a delivery_unknown ledger entry (the wire carries no echoed subscribe identity, so a duplicate ack is undecidable from a fresh one). Settlement now comes only from per-kind document presence, an explicit host rejection, or a new bounded ledger terminal path with three quiescence conditions. Also: the identity-clearing boundary is target-session/document destruction, not workflow close (GRAPH-DOCUMENT-0024 permits a detached session to survive close); the CRDT-PENDING-0030 dependency-contract summary is now mechanism-independent instead of contradicting the durable/interim section; and all pinned comfy-multi-player version numbers are removed in favor of a version-independent capability statement.
…destruction settles as abandoned Removes the max-ack-seq precondition and quiescence gate from the pending ledger's terminal path: an unidentified doc_subscribed acknowledgement's seq is not proof of causality, and unrelated frames must not keep resetting an idle timeout. The terminal path is now an absolute per-entry lifetime counted from park time; on expiry it settles to a non-destructive unresolved outcome (local projection retained, unconfirmed-edit notification) rather than a revert, since only an explicit host rejection may revert an entry. Also fixes: destruction settles still-parked entries as abandoned rather than reverting them with a rejection notification; the absence rule is restated precisely (absence never reverts, and only settles an entry when absence is that entry's own success condition, e.g. delete_node); and the round-7/8 deltas are reworded as a proposed revision for the implementation carrier to adopt rather than already-landed behavior.
…d ledger terminal path ADR-CRDT-RECONCILE-0035 (a), rounds 7-8: - Remove the doc_subscribed generation FIFO (resolveAckGeneration, pendingGenerations, lastConsumptionHadNewerSend) from LayoutFollowerBridge. The wire carries no echoed subscribe identity, so a duplicate ack can never be proven distinct from a fresh one, and nothing downstream needs that proof: an ack never settles a parked ledger entry by itself. - Absence never reverts a delivery_unknown entry, on any frame or at reactivation, for any op kind. Only delete_node settles on absence (its own success condition); add_node/connect/set_widget settle only on presence. An explicit host rejection is the only revert path. - set_widget presence now compares the target widget's current value to the op's value instead of clearing unconditionally. - Add a bounded, non-destructive ledger terminal path (LEDGER_SETTLE_TIMEOUT_MS, 15s): an absolute per-entry deadline armed once at park time, never extended by traffic. On expiry the entry settles `unresolved` (local projection retained, no revert) and fires a distinct "could not confirm this edit synced" notification instead of the standard rejected-operation toast; its identity stays registered so a late echo or explicit rejection can still resolve it. - Destruction (composable teardown) settles any still-parked entries as `abandoned` (dropped, no revert, no toast) instead of leaving them to a silent reset; a lineage break keeps its existing silent-drop handling. Simplifies pendingCorrelation.ts accordingly: drops the subscribe generation dedup and the one-shot consumeCatchUpRevertOnAbsent flag, since absence never settles regardless of reactivation continuity.
…rules - pendingCorrelation.test.ts (new): subscribe1/ack1/dup-ack1 and subscribe1/subscribe2/ack1/dup-ack1/ack2 leave an absent entry parked and settle a present one exactly once; no ack ever reverts. - pendingOpTracker.test.ts: redirect the add_node/delete_node absence-reverts cases to assert they stay parked; set_widget now consults the value-equality check instead of clearing unconditionally; add the bounded terminal-path suite (unresolved notification at the absolute deadline, unaffected by intervening frames, routed through the existing lineage-break handling on doc_reset, still reconcilable by a later explicit rejection) and the destroy()-abandons-parked- entries suite. - useAgentCrdtFollower.test.ts: redirect F8/F9 collision-mismatch cases and the reactivation-seq-mismatch case to assert they stay parked (never reverted) and are notified `unresolved` once the terminal path's deadline elapses; add a set_widget value-equality case through the real docEffectPresent check. - followerSubscription.test.ts / useAgentCrdtFollowerLineageBoundary.test.ts: drop the removed generation-dedup coverage; a duplicate ack now simply re-runs the same already-current reconcile, harmlessly.
applyPendingOpRevert's OR-chain grew past the Fallow complexity gate once `abandoned` joined the release-only event types; a lookup set keeps the branch count flat as more non-revert event types are added.
The host echoes every accepted human batch back as a doc_update stamped with the sending tab's actor. The follower merged that frame into the doc and then re-applied it to the live graph as an agent-remote patch, so every local edit round-tripped through the applier (FE-2509, the frame source behind #18089's lost keystrokes and #18375's null-origin hand-wired link). The follower now recognises its own actor before projection: the frame is still merged into the doc, but the collected changes are discarded instead of applied, and the frame counts as skipped. Catch-up frames are never skipped, since a resubscribe can replay state this tab wrote but whose graph was since replaced. Supersedes the echo-gating half of #18210. Amp-Thread-ID: https://ampcode.com/threads/T-01a0d248-f130-743a-a0a7-d90e3334772b
…-Org/comfyui_frontend into claude/pending-op-tracker-survives-tab-switch # Conflicts: # src/workbench/extensions/agent/crdt/ecsFollowerAdapter.ts # src/workbench/extensions/agent/crdt/useAgentCrdtFollower.test.ts
CI status after merging the base (b5dd2dd)Update: the base has since taken both test changes itself (5a543d3, "align containment cases with recovery behavior"), merged in here as a0e1c3c. Both checks below should now be green on that head; the analysis is kept for the record. Two checks are red on 38de5fe, both from tests that landed on
Generated by Claude Code |
…ending-op-tracker-survives-tab-switch
…ending-op-tracker-survives-tab-switch
|
Closing: main's #18700 replaced the store-first remote apply with the LGraph API and deleted the reconcile layer this PR extends (the pending-op ledger, follower adapter and graph mutations), so there is no longer a landing path for this change. The branch stays in place for reference. The original tab-switch report is being re-tested against current main; a fresh PR will follow only if it still reproduces there. Generated by Claude Code |
Extracted from superseded #18210, whose pending-ledger/full-reconcile implementation #18700 deleted. One user story in it survives the pivot and had no black-box owner on `main`: a human node add the doc host REFUSES must leave the canvas and tell the person it was refused. `main` covers the two halves separately and below the UI only — `useAgentCrdtFollower.rejectedHumanAdd.test.ts` for the telemetry report and `agentCrdtProjection.localEdits.test.ts` for `revertRejected` through the graph API. The one existing black-box rejection case, `agentDuplicateInsertOpaqueWidgetWrite.spec.ts`, covers a refused `set_widget`: different op, different notice copy, no node removal. The rejection is the real applier's own verdict, not an injected wire frame: the fake host's pinned catalog omits `CLIPTextEncode`, `wireNodeSnapshot` mints name-keyed `widgets_values` for a non-virtual class, and `rejectUnprojectableWidgets` raises `uncatalogued_widget_write`. The batch is parked (`humanOpsHost: 'hold'`) so the added node is observable before the verdict, then released down the same relay/applier/verdict path — #18210's version raced its own assertion because the rejection landed synchronously. No `pendingOpTracker`, `pendingOpRevert`, layout-actor suppression or reconcile pass is reconstructed. Mutation-proved red against `useAgentCrdtFollower.ts` on current main: dropping `revertRejectedOps(outcome)` fails the canvas-removal assertion; dropping `rejectedOpNotifier.notify(...)` fails the toast assertion. Green 4/4 under `--repeat-each=4`. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Extracted from superseded #18210, whose pending-ledger/full-reconcile implementation #18700 deleted. One user story in it survives the pivot and had no black-box owner on `main`: a human node add the doc host REFUSES must leave the canvas and tell the person it was refused. `main` covers the two halves separately and below the UI only — `useAgentCrdtFollower.rejectedHumanAdd.test.ts` for the telemetry report and `agentCrdtProjection.localEdits.test.ts` for `revertRejected` through the graph API. The one existing black-box rejection case, `agentDuplicateInsertOpaqueWidgetWrite.spec.ts`, covers a refused `set_widget`: different op, different notice copy, no node removal. The rejection is the real applier's own verdict, not an injected wire frame: the fake host's pinned catalog omits `CLIPTextEncode`, `wireNodeSnapshot` mints name-keyed `widgets_values` for a non-virtual class, and `rejectUnprojectableWidgets` raises `uncatalogued_widget_write`. The batch is parked (`humanOpsHost: 'hold'`) so the added node is observable before the verdict, then released down the same relay/applier/verdict path — #18210's version raced its own assertion because the rejection landed synchronously. No `pendingOpTracker`, `pendingOpRevert`, layout-actor suppression or reconcile pass is reconstructed. Mutation-proved red against `useAgentCrdtFollower.ts` on current main: dropping `revertRejectedOps(outcome)` fails the canvas-removal assertion; dropping `rejectedOpNotifier.notify(...)` fails the toast assertion. Green 4/4 under `--repeat-each=4`. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
…#20038) ## Summary Adds the one durable black-box case extracted from superseded #18210: a human node add that the agent doc host **refuses** must leave the canvas and tell the person it was refused. ## Changes - **What**: one new spec, `browser_tests/tests/agent/agentCrdtRejectedNodeAdd.spec.ts`. No production code, no fixture changes. #18210's implementation was the pre-pivot pending-ledger / full-reconcile design that #18700 deliberately deleted, and it should not be rebased or merged. But one user story in it survives the pivot unchanged and had no black-box owner on `main`. The two halves are covered separately and below the UI only: - `useAgentCrdtFollower.rejectedHumanAdd.test.ts` asserts the telemetry report for a refused `add_node`. - `agentCrdtProjection.localEdits.test.ts` asserts `revertRejected` goes through the graph API. - `agentDuplicateInsertOpaqueWidgetWrite.spec.ts` is the only black-box rejection case, and it covers a refused `set_widget` — different op, different notice copy, value rollback rather than node removal. Nothing asserted that the person watching the canvas sees the node go away, or that they are told why. Nothing from #18210's machinery is reconstructed: no `pendingOpTracker`, no `pendingOpRevert`, no layout-actor suppression, no reconcile pass. ## Review Focus **The rejection is the real applier's verdict, not an injected wire frame.** The fake host's pinned catalog describes `KSampler` and omits `CLIPTextEncode`; `wireNodeSnapshot` mints NAME-KEYED `widgets_values` for any non-virtual class; `rejectUnprojectableWidgets` then raises `uncatalogued_widget_write` because accepting it would make the whole document unprojectable on every later read. A browser talking to a newer server than the sha-pinned catalog is the real-world shape of that gap. The spec asserts the code on the outcome, so a future applier change that stops rejecting this payload surfaces here rather than silently passing. **Why the batch is parked rather than judged on arrival.** `humanOpsHost: 'hold'` keeps the page's `doc_ops` in flight so the added node is *observable* on the canvas before the verdict lands, then `releaseHeldClientOps()` sends it down the identical path (relay gate → real applier → verdict frame → delta). #18210's version of this case judged at send time and raced its own assertion — its comment says so: "the synchronous rejection can remove the node before it is observable." **Coordinates are measured, not hard-coded.** `loadIntoBootWorkflow` runs `FitView`, and a single seed node fits by filling the viewport, so a fixed screen point lands on the seed node's own `seed` widget. The spec pins the canvas transform after the panel has taken its side of the window, then derives the search-box point from the node's measured box and throws if no empty canvas is left. **Assertions are user-visible only**: the node's DOM presence on canvas, the seed node still being there, the host projection agreeing with the canvas again, and the *graph-edit* rejection toast (not the widget-write copy — `rejectedOpNotice` reserves that for a refused `set_widget`). ### Evidence Against current `main` (`edbc7def50d0ddbf2aa8056f1c1f10e65da732d1`), `--project=cloud`: - Green, and green 4/4 under `--repeat-each=4`. - Mutation-proved red, each mutation hitting its own assertion: - dropping `revertRejectedOps(outcome)` in `useAgentCrdtFollower.ts` → `expect(locator).toBeHidden()` fails, the refused node stays visible. - dropping `rejectedOpNotifier.notify(...)` → the toast assertion fails, element not found. Local run: `DISTRIBUTION=cloud` dev server on 6210 against a ComfyUI e2e container on 8190, per `docs/env-and-harness-traps.md`. ### Suggested disposition for #18210 Close it as superseded, pointing at #18700 and this PR. The rest of its behaviours are either already consolidated on `main` or belong to the deleted seam. --------- Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com> Co-authored-by: christian-byrne <christian@comfy.org>
Requested by Christian Byrne · Slack thread
Summary
Before: the pending-op tracker resets on every target deactivation (e.g. switching workflow tabs while the Agent panel is open), so a host rejection that arrives after the switch is silently swallowed, and the echo of the page's own accepted
add_nodeis misread as a fresh, unrecognized add.After: the tracker survives target deactivation (a tab switch) and resets on a genuine document lineage break (
doc_reset,follower_replaced, or a bind to a different workflow) as well as on scope disposal (e.g. closing the agent panel) — this PR keeps the ledger follower-scoped; hoisting it to survive a panel close/reopen is the next stacked PR (see Follow-up). A batch whose delivery outcome is unknown at the time of settlement parks and resolves per op kind at the next same-lineage catch-up, and echo handling of the page's own operations is gated on the ledger instead of guessed from the doc alone.This keeps a human edit's pending state alive across a tab switch and reports every host rejection instead of letting one disappear.
Changes
What: implements ADR-CRDT-RECONCILE-0035 ("PR A" of its sequence) on top of #16309's own
pendingOpTracker/useAgentCrdtFollowerwork.pendingOpTracker.ts: addsresolveDeliveryUnknown, the'diverged'revert reason, andreportHumanOpRejected(every host rejection now callsreportError, including an anonymous batch-levelok:falseunder a syntheticunattributedcode); theunacknowledgedbranch marks non-clearopsdelivery_unknownin the ledger instead of only emitting an event, andunconfirmednow joins it in the parked set instead of reverting. Adds a connect-link-id index (pendingConnectLinkIds) and a delete-node-id index (pendingDeleteNodeIds) alongside the existing add-node-id index; all three indexes track every pending op id per entity, not just the latest one, so a second pending op for the same node/link id cannot evict an older one still in flight.pendingDeleteNodeIdsis now the single source forLocalIntent.pendingDeletes, replacing the composable's separateconfirmedDeletesset and itssender.pendingOps()scan.pendingOpLedger.ts: adds themarkDeliveryUnknowntransition anddelivery_unknownstate.pendingCorrelation.ts: owns the pending-op ledger's lineage tracking and the settlement pass that runs after an "already current"doc_subscribedack (extracted fromuseAgentCrdtFollower.ts, which was accumulating synchronized branches across tracker state, projection watermarks and activation handlers for the same concern). Takes the already-constructed tracker and plain watermark get/set closures as dependencies rather than building them itself. A resubscribe that follows a paused subscription checks continuity against an immutable baseline snapshotted at the hold's start (beginReactivation()), never the live watermark a same-lineagedoc_updatethat outraces the ack can otherwise advance. Rounds 7-8 correction (see below): the subscribe-generation dedup this bullet used to describe here is removed — adoc_subscribedack never settles a parked entry by itself, so there is no barrier left to protect from a duplicate. Every ack instead re-runs the same presence-only resolution pass an ordinary catch-up frame runs (a harmless no-op on a duplicate: presence checks and the reconcile they force are idempotent), and absence never reverts through this path either, reactivation or not — see the Rounds 7-8 section for the full settlement rules.resolveIfAlreadyCurrenttakes the caller's resume as a callback and calls it on every classified ack. The already-current retry, when a forced reconcile defers, is owned end-to-end here: the bounded timer (ALREADY_CURRENT_RETRY_INTERVAL_MS), its attempt count, and their cleanup, andreset()cancels the timer instead of only orphaning its callback.layoutFollowerBridge.ts:onDocResetis a no-op for a repeat delivery of the same reset (same workflow id and seq): a duplicate no longer re-drops the just-reminted doc or re-sends a redundantdoc_subscribe. Rounds 7-8 correction: the per-session subscribe-generation FIFO this bullet used to describe (tagging eachdoc_subscribedack with the generation of the send it answers, to protect an ack-based settlement barrier from a duplicate) is removed along with the barrier it protected — see thependingCorrelation.tsbullet above and the Rounds 7-8 section below.linkTuple.ts:validateLinkEndpointsparses a link tuple's connect-relevant fields into a schema-validated shape, requiring the complete 6-element tuple and integer, finite slot numbers, instead of coercing a missing/malformed tuple into a wildcard match.useAgentCrdtFollower.ts: delegates lineage adoption/invalidation and catch-up settlement topendingCorrelation, sodeactivateTargetno longer resets the tracker at all, and reactivation resets it only when the lineage actually changed. An already-current subscribe ack now runs the adapter's authoritative full reconcile (EcsFollowerAdapter.reconcileFromDoc, viaAgentCrdtProjection.reconcileFromDoc) before settling parked entries, retried by the bounded timer above rather than settling on a busy attempt. Per-frame order is resolve (delivery-unknown against the catch-up doc), then apply, then clear, matching the ADR. Scope disposal now callssender.abortAll()beforesender.detach()so queued/in-flight batches settle instead of being dropped.LocalIntent.pendingAdds/pendingConnects/pendingDeletesall go empty while a reactivation's continuity is still unknown.resumeHeldOpsIfSubscribedno longer releases the hold while that continuity check is outstanding, andreleaseHeldOpsclearsawaitingReactivationContinuitytogether withheldForWorkflowIdwherever it runs.ecsFollowerAdapter.ts/ecsFullReconcile.ts/ecsSemanticReaders.ts/graphMutations.ts: the echo of the page's own acceptedadd_nodeis gated on the ledger; an unrecognized collision reports (agent_crdt_node_id_collision) and the document wins instead of the client guessing.LocalIntentgainspendingAddsandpendingConnects, symmetric topendingDeletes: a full reconcile no longer deletes a live node, or drops a live edge, whoseadd_node/connectis still queued or in flight just because the doc does not have it yet. The full-reconcile/LocalIntentconcern (and the low-level semantic doc readers it shares with the incremental path) is now split out ofEcsFollowerAdapterintoecsFullReconcile.ts/ecsSemanticReaders.ts, taking an explicitFullReconcileContextobject instead of readingTargetSession/adapter state through a shared closure;EcsFollowerAdaptercomposes both as an orchestrator.agentCrdtProjection.ts: wires the above into the projection's catch-up path, and now materializes the forced reconcile onto the live graph (reconcileLiveGraph) exactly as the frame/retry paths do.pendingOpTracker.test.ts,pendingOpLedger.test.ts,pendingOpRevert.test.ts,linkTuple.test.ts,useAgentCrdtFollower.test.ts,useAgentCrdtFollowerLineageBoundary.test.ts,ecsFollowerAdapter.integration.test.ts,agentCrdtProjection.tabReturn.test.ts,agentDeleteTabSwitchRace.test.ts,followerSubscription.test.ts(including the duplicate-doc_resetand duplicate-ack regressions),agentCrdtProjection.integration.test.ts.Testing
Verified at
8ae67111(superseded — see the Round 5 verification below for the current head):pnpm vitest run src/workbench/extensions/agent/crdt: 904 passed, 3 expected failures (it.fails), 907 total, 57 files. The 3 remainingit.fails(ingraphMutations.test.ts,followerProductGate.test.ts,ecsFollowerAdapter.promptReconcile.test.ts) are pre-existing on the stacked base (fix/s3opt6-dispatch-wiring) and untouched by this PR.pnpm eslint,pnpm oxfmt --check, and the full-workspacepnpm typecheck(vue-tscplus the account-core/billing-web/account-ui/billing-contract sub-projects): all clean.pnpm knip: no new unused exports or files.npx fallow audit --changed-since ba7c7a024d8bc14262e32aa4240f34764175c33c: zero new introduced dead-code findings. Complexity: the earlier cyclomatic-10 finding onreadSemanticLinkstays fixed by theparseLinkScalarFieldsextraction (now inecsSemanticReaders.ts). Locally,fallow auditalso reportsonNodesChanged(cyclomatic 18) inecsFollowerAdapter.tsandonDocUpdate(cyclomatic 11) inlayoutFollowerBridge.tsas high-complexity; neither is touched by this round's diff (their code is unchanged, onlyonNodesChanged's line number shifted from the reconcile extraction below) and CI's own Fallow gate has not flagged either as introduced against this same base — noting the discrepancy here rather than acting on an unconfirmed local reading.delivery_unknownis swept too, where a red falsifier reproduced it surviving under the old order;doc_subscribedack for an earlier resubscribe is tagged with the generation of the send it answers, from a FIFO queue, not the counter's value at receipt — a red falsifier reproduced the old code relabeling it[2, 2]instead of[1, 2];ALREADY_CURRENT_RETRY_INTERVAL_MS) with no further frame dispatched, instead of a syntheticdoc_update;pendingOpTracker's add/connect indexes retain an older pending op when a second one for the same node/link id settles first;onBatchMinted, and the lineage-boundary continuity-unknown regression now coverspendingConnectsalongsidependingAdds.LocalIntentextraction (ecsFullReconcile.ts/ecsSemanticReaders.ts) DrJKL's review asked for is done, not deferred; the sixuseAgentCrdtFollower.test.tscases this PR added that assigned into a hoistedlet enqueue!: ...now read it offmountFollower()'s return value instead (the ~16 pre-existing sites elsewhere in that file are left for a repo-wide pass);ProjectedSequenceWatermark's getter/setter box is gone in favor of plain closures; two duplicated/inconsistent JSDoc blocks and a doubled test-cleanup owner are cleaned up; and the duplicate-doc_resetidempotency fix described below.LayoutFollowerBridge/DocFrameClientboundary (useAgentCrdtFollowerLineageBoundary.test.ts), proving a same-workflowdoc_resetdelivered while a tab is inactive does not reach this composable today. Detecting that break on return would need a signal the current wire protocol does not carry — the subscribe acknowledgement and the reset frame both carry only a workflow id, a sequence number and a status, and the sequence is monotonic, so an ordinary resubscribe and one that follows a missed reset look identical on the wire. This round adds a frontend-only mitigation on top of that known gap (see the reactivation-continuity rule above) rather than closing it; closing it for real needs a backend protocol addition, out of scope for this frontend PR and recorded as a named dependency in the ADR.doc_resetlives in a private (backend) repo this public PR cannot cite. Instead,followerSubscription.test.tsdrives the realLayoutFollowerBridge/DocFrameClientboundary with the SAME reset (identical workflow id and seq) delivered twice in a row: against the code as reviewed this was a real bug (the second delivery re-dropped the just-reminted doc and sent a redundantdoc_subscribe), confirmed red before the fix and green after.layoutFollowerBridge.ts'sonDocResetnow no-ops when the reset'sseqequals the last APPLIED reset'sseqfor the current lineage — never "any reset within a window" — so a later, genuinely new reset for the same lineage (a different seq, e.g. after a remint) still processes normally; the test covers that case too.Round 5 verification (head
a60d80a2, addressing DrJKL's fifth review, review 5284988677)pnpm vitest run src/workbench/extensions/agent/crdt src/composables: 2924 passed, 2 expected failures, 2926 total, 192 files (the 2 remainingit.failsare pre-existing on the stacked base and untouched by this PR).pnpm typecheck, changed-filepnpm eslint,pnpm oxfmt --check, andpnpm knip: all clean.npx fallow audit --changed-since 6d13942b620138c0dc40498ca43670d585f4f818: no function this round's diff touches exceeds the cyclomatic-9 gate —layoutFollowerBridge.ts'sonDocSubscribedbriefly did after the duplicate-ack fix (cyclomatic 12) and was brought back under the gate by extractingresolveAckGeneration.bash .github/scripts/check-ai-co-authors.sh: no AI co-author trailers.[ack1, duplicate ack1, ack2]) steal a still-outstanding newer generation's barrier — an ack repeating the identity just consumed, while a newer generation was already outstanding at that consumption, now reuses the prior generation instead;doc_updatelanding before its own reactivation ack could advance the live watermark before that ack is checked, letting the ack pass continuity against its own stray update —PendingCorrelation.beginReactivation()now snapshots an immutable baseline at the hold's start for the ack to compare against instead.PendingCorrelation, withreset()now cancelling the timer (proven with aclearTimeoutspy, not just an absence of further calls); pending deletes now read through the pending-op tracker'spendingDeleteNodeIds()alone, replacingconfirmedDeletesand thesender.pendingOps()scan; and the redundantbeforeEachmock-cleanup already owned by the repo's global Vitest setup is dropped from the new reactivation-test suite, the lineage-boundary suite, andpendingOpRevert.test.ts.ecsFullReconcile.ts's doc comments; the dynamicimport()inside one test now reads the suite's already-imported module binding; and the abort-invalidation revert test now asserts therevertedevent and the node's actual removal, not only that the tracker's lookup went empty.Rounds 7-8 (ADR-CRDT-RECONCILE-0035 (a) review corrections)
DrJKL's rounds 7 and 8 review of the ADR (#18106) found the ack-based settlement barrier this PR originally shipped, and its later revert-on-absence conservatism, both unsound — corrected here on the same head:
doc_subscribedcarries only the workflow id, status andseq— no echoed request or generation id — so a duplicate ack is undecidable from a fresh one; no local counter or generation FIFO can safely tell them apart. The subscribe-generation FIFO (resolveAckGeneration,pendingGenerations,lastConsumptionHadNewerSend) is removed fromLayoutFollowerBridge, andpendingCorrelation.ts's matching one-shot dedup goes with it. An ack now only (i) re-establishes the subscription, and (ii), when no catch-updoc_updateis coming at all (ack.seq === watermark), runs the same presence-only resolution pass a catch-up frame runs — safe to run again on a duplicate ack, since it only ever settles a PRESENT entry.delivery_unknownentry, on any frame, at reactivation, or at the terminal path's expiry — for any op kind. Onlydelete_nodesettles on absence, because absence is its own success condition;add_node/connect/set_widgetsettle only on presence (set_widgetby value equality, not an unconditional clear). The one-shotconsumeCatchUpRevertOnAbsentflag this PR's round 6 added is removed along with the revert-on-absence path it gated — an entry that reads as absent simply stays parked, indefinitely, until an explicit host rejection, a lineage break, or the terminal path below.LEDGER_SETTLE_TIMEOUT_MS(15s, on the order of the existing subscribe-retry bound), counted from the moment it parks and never extended by later traffic — an idle-timeout shape would let frequent unrelated activity keep a lost op ambiguous forever. On expiry the entry settles a non-destructiveunresolvedoutcome: the optimistic projection stays on the canvas, there is no revert and no rejected-operation toast, and instead a distinct notification tells the user this edit could not be confirmed as synced. The entry's identity stays registered — nowunresolvedin the ledger — so a late echo or an explicit host response can still resolve it toappliedorrevertedafterward, until a lineage break or destruction clears it.abandoned, not a rejection. Composable teardown (pendingCorrelation.destroy()→pendingOpTracker.destroy()) drops any still-parked entry with a distinctabandonedevent — no revert, no rejection toast, since destruction proves only that this client is abandoning correlation, not that the host rejected anything. A lineage break (doc_reset/follower_replaced) keeps its existing silent-drop handling, unchanged.348af8509b9b09e7dee6ecc3a9920a5df98abde2(DrJKL) aligned settlement with the ADR on this head.unresolvedis now a real ledger state (markUnresolved), not just a notification on an entry still recorded asdelivery_unknown: an entry that reaches its bounded lifetime settlesunresolvedin the ledger yet remains reconcilable, exactly as the ADR requires — a later matching effect or an explicitdoc_ops_resultcan still clear it.resolveDeliveryUnknownalso runs on every same-lineage frame now, not only acatchUpone, so effect presence on any such frame — live delta included — settles a parked entry, per the ADR's "again on every subsequent same-lineage frame, until resolved."Verified at
eaa41fbe:pnpm vitest run src/workbench/extensions/agent/crdt: 999 passed, 13 expected failures, 1012 total, 62 files — all green, including a newpendingCorrelation.test.tscoveringsubscribe1, ack1, dup ack1andsubscribe1, subscribe2, ack1, dup ack1, ack2(an absent entry never settles by an ack; a present one settles exactly once), the bounded terminal-path suite (unresolvedat the absolute deadline, unaffected by intervening frames, routed through the existing lineage-break handling ondoc_reset, still reconcilable by a later explicit rejection), and thedestroy()-abandons-parked-entries suite.pnpm typecheck, changed-filepnpm eslint/oxlint/oxfmt --check: all clean.npx fallow audit --changed-since bada9c5f7110c0f4e5b284ef5b7040d003afdd66:complexity_introducedis 3, down from this branch's pre-existing 4 (a small extraction inpendingOpRevert.ts—REGISTRY_RELEASE_ONLY_EVENTS— keepsapplyPendingOpRevertunder the gate after the newabandonedcase).bash .github/scripts/check-ai-co-authors.sh: no AI co-author trailers.Stacked on #16309 (
fix/s3opt6-dispatch-wiring).Follow-up
The ledger stays follower-scoped here, which covers tab switches; hoisting its ownership to the bound workflow/document so it also survives closing and reopening the agent panel is the next stacked PR. Detecting a lineage break missed while inactive (see Testing above) needs a backend wire-protocol addition and is tracked separately.
🤖 Generated with Claude Code
https://claude.ai/code/session_01NQVcfKhCKjLstqo3mJS7fc