Repository navigation
feat(agent): resolve skipped duplicates on a covering projection (s3-opt-2) - #16671
Conversation
…opt-2) When the host acks an op as `skipped` (already applied on a prior delivery), no later `doc_update` will ever carry that op id, so the pending shadow used to linger until reset. Re-expresses the outcome reconciliation from #16332 onto the main-based s3-opt-6 tracker: - `OpsResultView.seq` mirrors the host `doc_ops_result.seq` (`cloud/common/websocket/messages/crdt.go` `DocOpsResultFrame`). - `PendingOpTracker` parks skipped ids keyed by the ack seq and clears them once `onAuthoritativeState(seq)` observes a projection at or past that seq; a seq-less ack clears on the next projection. If the effect frame does arrive first, `onDocEffect` still wins. - `useAgentCrdtFollower` feeds `bridge.lastSequence` as `currentSeq` and calls `onAuthoritativeState(update.seq)` after each applied update. - New dev-panel events `skipped_awaiting` / `skipped_cleared`.
|
Important Approval pendingCodeRabbit has no unresolved comments, but it has not reviewed the latest commit. Use the checkbox below to review the latest commit. CodeRabbit will approve the changes if it finds no blocking issues.
Comment |
🎭 Playwright: ✅ 1894 passed, 0 failed · 2 flaky📊 Browser Reports
🎨 Storybook: ✅ Built — View Storybook📦 Bundle Size
⚡ Performance Report
Absolute values
Raw data{
"timestamp": "2026-09-02T17:30:09.113Z",
"gitSha": "12c76931d6eb6c0899e56adb9aa3435c4ca2cf92",
"branch": "fix/s3opt2-skipped-seq-gate",
"measurements": [
{
"name": "canvas-idle",
"durationMs": 2069.6660000000406,
"styleRecalcs": 7,
"styleRecalcDurationMs": 7.078999999999999,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 554.08,
"heapDeltaBytes": -12137452,
"heapUsedBytes": 57194664,
"domNodes": -280,
"jsHeapTotalBytes": 4972544,
"scriptDurationMs": 8.937999999999999,
"eventListeners": -157,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66999999999998,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "canvas-idle",
"durationMs": 2020.3890000000229,
"styleRecalcs": 9,
"styleRecalcDurationMs": 8.76,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 490.51,
"heapDeltaBytes": -12158016,
"heapUsedBytes": 57617800,
"domNodes": -281,
"jsHeapTotalBytes": 5234688,
"scriptDurationMs": 8.629000000000001,
"eventListeners": -155,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "canvas-mouse-sweep",
"durationMs": 1909.4330000000355,
"styleRecalcs": 81,
"styleRecalcDurationMs": 41.71900000000001,
"layouts": 14,
"layoutDurationMs": 4.33,
"taskDurationMs": 902.8669999999998,
"heapDeltaBytes": -8885444,
"heapUsedBytes": 61701200,
"domNodes": -283,
"jsHeapTotalBytes": 5758976,
"scriptDurationMs": 160.08,
"eventListeners": -155,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "canvas-mouse-sweep",
"durationMs": 1876.229999999964,
"styleRecalcs": 76,
"styleRecalcDurationMs": 39.588,
"layouts": 14,
"layoutDurationMs": 4.484999999999999,
"taskDurationMs": 889.6659999999998,
"heapDeltaBytes": 4385780,
"heapUsedBytes": 75037968,
"domNodes": -281,
"jsHeapTotalBytes": 6545408,
"scriptDurationMs": 162.678,
"eventListeners": -187,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.670000000000012,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "canvas-zoom-sweep",
"durationMs": 1737.7329999999915,
"styleRecalcs": 32,
"styleRecalcDurationMs": 17.666,
"layouts": 6,
"layoutDurationMs": 1.0790000000000002,
"taskDurationMs": 377.02900000000005,
"heapDeltaBytes": 4456308,
"heapUsedBytes": 74646360,
"domNodes": 78,
"jsHeapTotalBytes": 5767168,
"scriptDurationMs": 11.261000000000001,
"eventListeners": 19,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "canvas-zoom-sweep",
"durationMs": 1690.1790000000574,
"styleRecalcs": 30,
"styleRecalcDurationMs": 17.559,
"layouts": 6,
"layoutDurationMs": 1.171,
"taskDurationMs": 354.649,
"heapDeltaBytes": 4448628,
"heapUsedBytes": 73975436,
"domNodes": 77,
"jsHeapTotalBytes": 5242880,
"scriptDurationMs": 10.872,
"eventListeners": 19,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "dom-widget-clipping",
"durationMs": 689.0720000000101,
"styleRecalcs": 11,
"styleRecalcDurationMs": 7.3629999999999995,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 471.895,
"heapDeltaBytes": -7789768,
"heapUsedBytes": 62899764,
"domNodes": 18,
"jsHeapTotalBytes": 5767168,
"scriptDurationMs": 167.039,
"eventListeners": 0,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333335,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "dom-widget-clipping",
"durationMs": 658.6490000000822,
"styleRecalcs": 11,
"styleRecalcDurationMs": 8.095,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 461.14200000000005,
"heapDeltaBytes": 17792424,
"heapUsedBytes": 87482608,
"domNodes": 18,
"jsHeapTotalBytes": 5242880,
"scriptDurationMs": 165.09500000000003,
"eventListeners": 2,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.699999999999818
},
{
"name": "large-graph-idle",
"durationMs": 2011.5129999999795,
"styleRecalcs": 1,
"styleRecalcDurationMs": 0.6470000000000018,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 560.6729999999999,
"heapDeltaBytes": 22108268,
"heapUsedBytes": 87192224,
"domNodes": -278,
"jsHeapTotalBytes": 0,
"scriptDurationMs": 32.913,
"eventListeners": 6,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66999999999998,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "large-graph-idle",
"durationMs": 2044.8559999999816,
"styleRecalcs": 6,
"styleRecalcDurationMs": 5.786,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 599.0219999999999,
"heapDeltaBytes": -13412696,
"heapUsedBytes": 86627100,
"domNodes": -266,
"jsHeapTotalBytes": -1097728,
"scriptDurationMs": 34.778000000000006,
"eventListeners": -153,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "large-graph-pan",
"durationMs": 2265.291999999988,
"styleRecalcs": 63,
"styleRecalcDurationMs": 8.828,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 1591.1359999999997,
"heapDeltaBytes": 22131516,
"heapUsedBytes": 88088756,
"domNodes": 2,
"jsHeapTotalBytes": 225280,
"scriptDurationMs": 801.726,
"eventListeners": 6,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "large-graph-pan",
"durationMs": 2246.007000000077,
"styleRecalcs": 67,
"styleRecalcDurationMs": 13.371,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 1639.602,
"heapDeltaBytes": 27601532,
"heapUsedBytes": 92848076,
"domNodes": -268,
"jsHeapTotalBytes": 225280,
"scriptDurationMs": 825.8570000000001,
"eventListeners": -153,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "large-graph-zoom",
"durationMs": 3629.6649999999886,
"styleRecalcs": 61,
"styleRecalcDurationMs": 11.395,
"layouts": 60,
"layoutDurationMs": 12.868,
"taskDurationMs": 1742.0610000000001,
"heapDeltaBytes": 9901928,
"heapUsedBytes": 76226228,
"domNodes": -279,
"jsHeapTotalBytes": 0,
"scriptDurationMs": 792.944,
"eventListeners": 10,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "large-graph-zoom",
"durationMs": 3621.9650000000456,
"styleRecalcs": 60,
"styleRecalcDurationMs": 9.870000000000001,
"layouts": 60,
"layoutDurationMs": 11.938999999999998,
"taskDurationMs": 1684.768,
"heapDeltaBytes": 12030420,
"heapUsedBytes": 79531500,
"domNodes": 0,
"jsHeapTotalBytes": 0,
"scriptDurationMs": 779.4859999999999,
"eventListeners": 8,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "legacy-node-drag",
"durationMs": 3201.9449999999665,
"styleRecalcs": 40,
"styleRecalcDurationMs": 5.229000000000001,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 1967.746,
"heapDeltaBytes": 22246660,
"heapUsedBytes": 89617988,
"domNodes": 0,
"jsHeapTotalBytes": 417792,
"scriptDurationMs": 983.1880000000001,
"eventListeners": 188,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666696,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "legacy-node-drag",
"durationMs": 3044.956999999954,
"styleRecalcs": 40,
"styleRecalcDurationMs": 4.864,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 1898.12,
"heapDeltaBytes": 17329588,
"heapUsedBytes": 84314412,
"domNodes": 0,
"jsHeapTotalBytes": 417792,
"scriptDurationMs": 945.281,
"eventListeners": 188,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333335,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "minimap-idle",
"durationMs": 2034.0750000000298,
"styleRecalcs": 4,
"styleRecalcDurationMs": 3.602000000000001,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 607.2859999999998,
"heapDeltaBytes": -15328272,
"heapUsedBytes": 87463996,
"domNodes": -270,
"jsHeapTotalBytes": -1884160,
"scriptDurationMs": 34.84100000000001,
"eventListeners": -153,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333335,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "minimap-idle",
"durationMs": 2001.6150000000152,
"styleRecalcs": 2,
"styleRecalcDurationMs": 1.8260000000000012,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 529.385,
"heapDeltaBytes": 22098056,
"heapUsedBytes": 88155728,
"domNodes": 4,
"jsHeapTotalBytes": 0,
"scriptDurationMs": 33.06500000000001,
"eventListeners": 4,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "subgraph-dom-widget-clipping",
"durationMs": 588.8820000000123,
"styleRecalcs": 46,
"styleRecalcDurationMs": 9.672,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 408.6820000000001,
"heapDeltaBytes": 15130536,
"heapUsedBytes": 87844048,
"domNodes": 18,
"jsHeapTotalBytes": 4718592,
"scriptDurationMs": 140.69500000000002,
"eventListeners": 8,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "subgraph-dom-widget-clipping",
"durationMs": 622.9849999999715,
"styleRecalcs": 46,
"styleRecalcDurationMs": 10.661,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 422.0900000000001,
"heapDeltaBytes": 15027040,
"heapUsedBytes": 86975100,
"domNodes": 18,
"jsHeapTotalBytes": 6029312,
"scriptDurationMs": 150.024,
"eventListeners": 6,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333335,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "subgraph-idle",
"durationMs": 2013.530000000003,
"styleRecalcs": 9,
"styleRecalcDurationMs": 7.837999999999997,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 510.4869999999999,
"heapDeltaBytes": -8188380,
"heapUsedBytes": 64573124,
"domNodes": -297,
"jsHeapTotalBytes": 6283264,
"scriptDurationMs": 7.8210000000000015,
"eventListeners": -201,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "subgraph-idle",
"durationMs": 2016.2709999999606,
"styleRecalcs": 9,
"styleRecalcDurationMs": 8.4,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 487.567,
"heapDeltaBytes": -7072860,
"heapUsedBytes": 65582052,
"domNodes": -298,
"jsHeapTotalBytes": 4710400,
"scriptDurationMs": 8.309000000000001,
"eventListeners": -199,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.670000000000012,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "subgraph-mouse-sweep",
"durationMs": 1724.5770000000107,
"styleRecalcs": 77,
"styleRecalcDurationMs": 41.608,
"layouts": 18,
"layoutDurationMs": 6.236999999999999,
"taskDurationMs": 873.168,
"heapDeltaBytes": -12598148,
"heapUsedBytes": 60179436,
"domNodes": -297,
"jsHeapTotalBytes": 6021120,
"scriptDurationMs": 116.312,
"eventListeners": -201,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "subgraph-mouse-sweep",
"durationMs": 1695.8680000000186,
"styleRecalcs": 77,
"styleRecalcDurationMs": 35.939,
"layouts": 18,
"layoutDurationMs": 4.993,
"taskDurationMs": 820.034,
"heapDeltaBytes": -10633988,
"heapUsedBytes": 61747536,
"domNodes": -297,
"jsHeapTotalBytes": 4972544,
"scriptDurationMs": 108.711,
"eventListeners": -201,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333335,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "subgraph-transition-enter",
"durationMs": 1400.5730000000085,
"styleRecalcs": 20,
"styleRecalcDurationMs": 31.531999999999996,
"layouts": 16,
"layoutDurationMs": 15.445,
"taskDurationMs": 907.2860000000003,
"heapDeltaBytes": -5444368,
"heapUsedBytes": 86865348,
"domNodes": 13751,
"jsHeapTotalBytes": 10747904,
"scriptDurationMs": 30.485,
"eventListeners": 2381,
"totalBlockingTimeMs": 134,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "viewport-pan-sweep",
"durationMs": 8390.705000000025,
"styleRecalcs": 247,
"styleRecalcDurationMs": 37.782999999999994,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 5887.544,
"heapDeltaBytes": 8874276,
"heapUsedBytes": 84408056,
"domNodes": -270,
"jsHeapTotalBytes": -647168,
"scriptDurationMs": 2727.7239999999997,
"eventListeners": -169,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "viewport-pan-sweep",
"durationMs": 8541.478999999981,
"styleRecalcs": 248,
"styleRecalcDurationMs": 40.06399999999999,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 5927.78,
"heapDeltaBytes": -19636712,
"heapUsedBytes": 80803492,
"domNodes": -267,
"jsHeapTotalBytes": -872448,
"scriptDurationMs": 2734.788,
"eventListeners": -137,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.670000000000012,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "vue-large-graph-idle",
"durationMs": 17604.529000000013,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 16920.109999999997,
"heapDeltaBytes": -38519288,
"heapUsedBytes": 174808076,
"domNodes": -6548,
"jsHeapTotalBytes": -9629696,
"scriptDurationMs": 306.09799999999996,
"eventListeners": -7475,
"totalBlockingTimeMs": 0,
"frameDurationMs": 17.779999999999927,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "vue-large-graph-idle",
"durationMs": 17086.13600000001,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 16600.101000000002,
"heapDeltaBytes": -30438692,
"heapUsedBytes": 179754244,
"domNodes": -6548,
"jsHeapTotalBytes": 7385088,
"scriptDurationMs": 280.15000000000003,
"eventListeners": -7473,
"totalBlockingTimeMs": 0,
"frameDurationMs": 17.776666666666763,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "vue-large-graph-pan",
"durationMs": 21196.438000000002,
"styleRecalcs": 171,
"styleRecalcDurationMs": 17.900000000000027,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 20771.891,
"heapDeltaBytes": -32433384,
"heapUsedBytes": 176290096,
"domNodes": -6548,
"jsHeapTotalBytes": -5378048,
"scriptDurationMs": 961.127,
"eventListeners": -7471,
"totalBlockingTimeMs": 117,
"frameDurationMs": 17.779999999999927,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "vue-large-graph-pan",
"durationMs": 21651.429000000007,
"styleRecalcs": 169,
"styleRecalcDurationMs": 18.513999999999974,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 21307.734,
"heapDeltaBytes": -47007236,
"heapUsedBytes": 162485368,
"domNodes": -6548,
"jsHeapTotalBytes": -5099520,
"scriptDurationMs": 989.208,
"eventListeners": -7469,
"totalBlockingTimeMs": 49,
"frameDurationMs": 17.776666666666642,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "vue-node-resize-workload",
"durationMs": 6304.7579999999925,
"styleRecalcs": 20,
"styleRecalcDurationMs": 86.81,
"layouts": 20,
"layoutDurationMs": 32.00699999999999,
"taskDurationMs": 6201.244000000001,
"heapDeltaBytes": -34654552,
"heapUsedBytes": 168181156,
"domNodes": -6548,
"jsHeapTotalBytes": 9342976,
"scriptDurationMs": 108.293,
"eventListeners": -7469,
"totalBlockingTimeMs": 615,
"frameDurationMs": 17.776666666666642,
"p95FrameDurationMs": 16.80000000000109
},
{
"name": "vue-node-resize-workload",
"durationMs": 6341.497000000004,
"styleRecalcs": 20,
"styleRecalcDurationMs": 81.26699999999998,
"layouts": 20,
"layoutDurationMs": 22.757999999999985,
"taskDurationMs": 6198.578,
"heapDeltaBytes": -33425540,
"heapUsedBytes": 175363004,
"domNodes": -6548,
"jsHeapTotalBytes": 6799360,
"scriptDurationMs": 114.923,
"eventListeners": -7468,
"totalBlockingTimeMs": 425,
"frameDurationMs": 17.776666666666703,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "workflow-execution",
"durationMs": 101.84100000003582,
"styleRecalcs": 7,
"styleRecalcDurationMs": 15.559,
"layouts": 2,
"layoutDurationMs": 1.4110000000000003,
"taskDurationMs": 71.173,
"heapDeltaBytes": 3163692,
"heapUsedBytes": 71822476,
"domNodes": 108,
"jsHeapTotalBytes": 262144,
"scriptDurationMs": 4.934000000000001,
"eventListeners": 49,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66999999999998,
"p95FrameDurationMs": 16.699999999999818
},
{
"name": "workflow-execution",
"durationMs": 458.00499999995736,
"styleRecalcs": 12,
"styleRecalcDurationMs": 19.139999999999997,
"layouts": 3,
"layoutDurationMs": 0.9719999999999998,
"taskDurationMs": 107.12600000000002,
"heapDeltaBytes": 5045928,
"heapUsedBytes": 73267200,
"domNodes": 123,
"jsHeapTotalBytes": 262144,
"scriptDurationMs": 8.334999999999999,
"eventListeners": 99,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333335,
"p95FrameDurationMs": 16.700000000000728
}
]
}🔬 E2E Coverage
Top 10 files by uncovered lines
|
christian-byrne
left a comment
There was a problem hiding this comment.
Reviewed at 678fc7e against base fix/s3opt6-dispatch-wiring. Ran the crdt vitest dir locally (252/252 green) and read the bridge, ledger, docwire and relay sides to check the seq premise.
One correctness finding: the immediate-clear branch reads bridge.lastSequence, which falls back to the subscribe ack seq before any update has been applied, so in the reconnect window a skipped result clears the shadow before the catch-up frame has been projected. Details and a proposed fix inline. Two smaller notes on the doc comments.
Full context for agent readers
PR adds seq to OpsResultView, a currentSeq dep on the pending-op tracker, an awaitingSkipped map, and onAuthoritativeState(seq) called from the follower's doc_update handler after adapter.applyFrame. The stated invariant is that a skipped entry is never cleared on the ack itself; it clears only when the follower has projected doc state at or beyond the ack seq.
Checked: DocOpsResultFrame.Seq in cloud/common/websocket/messages/crdt.go is int64 with omitempty and docwire.go returns ApplyOutcome.Seq as the row seq after the batch (row.Seq on the NoOp all-duplicate path, the Advance result otherwise), so the seq semantics the PR relies on hold. The ledger keeps skipped entries in state skipped and take() removes them, so clearSkipped composes with the existing per-attempt gate. reset() paths (doc_reset, follower_replaced, unmount) clear awaitingSkipped. DocUpdate.seq is typed number, so the null branch of onAuthoritativeState is unreachable from the follower today.
The finding: LayoutFollowerBridge.lastSequence is this.lastSeq ?? this.ackSeq ?? 0, and reconcile() resets lastSeq and ackSeq to null on every successful subscribe send. The bridge's own doc comment on ackSeq says it is not an applied baseline because the catch-up doc_update(seq=N) may still be in flight (the relay joins fanout before acking). So after a reconnect resubscribe, once doc_subscribed{seq:N} lands and before doc_update{seq:N} is applied, currentSeq() returns N and a doc_ops_result{skipped:[id], seq:S<=N} takes the immediate-clear branch. That is a clear on the ack, and the canvas at that moment still shows the pre-op state the follower had before the reconnect (which is exactly why the op is a resend and comes back skipped). The pending styling disappears, the old value shows, then the catch-up lands and the effect appears. The follower test cannot see this because FakeBridge pins lastSequence = 41.
Codecov Report✅ All modified and coverable lines are covered by tests. @@ Coverage Diff @@
## fix/s3opt6-dispatch-wiring #16671 +/- ##
==============================================================
- Coverage 82.37% 82.34% -0.04%
==============================================================
Files 2032 2026 -6
Lines 117341 117117 -224
Branches 31485 31500 +15
==============================================================
- Hits 96663 96435 -228
- Misses 20500 20505 +5
+ Partials 178 177 -1
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 32 files with indirect coverage changes 🚀 New features to boost your workflow:
|
… the ack
`currentSeq` fed the pending-op tracker `bridge.lastSequence`, which falls
back to the subscribe ack seq. Between `doc_subscribed{seq:N}` and the
catch-up `doc_update{seq:N}` nothing has landed in the doc, so a
`doc_ops_result{skipped, seq<=N}` cleared the optimistic shadow while the
canvas still showed pre-op state. Expose `lastAppliedSequence` (null until a
frame is applied, reset on every subscribe send) and gate on that; the
outbound `baseVersion` keeps using the ack-aware `lastSequence`.
Also reword the tracker doc: `skipped` covers both host-deduped and
LWW-dropped ops (docwire appends applier `Skipped`), and note the
`onAuthoritativeState` null branch is unreachable from DocUpdate frames.
|
Review fixes pushed in 053cba6. Skipped-duplicate resolution now gates on the applied seq, not the subscribe ack. Three new tests, 255/255 green locally. Full context for agent readersReview: #16671 (review) (three threads, all replied to and resolved by the reviewer). Commit 053cba6 on
Verification: Trade-off accepted: an already-current follower (ack, no catch-up) parks a skipped entry until the next applied frame. A pending skipped entry means the op's effect frame never arrived, so the shadow staying up until real state lands is the safe side. |
DrJKL
left a comment
There was a problem hiding this comment.
Reviewed the top diff against fix/s3opt6-dispatch-wiring. The applied-only sequence fix is sound: subscription acknowledgements cannot clear skipped shadows before projection, while an already-applied covering sequence clears immediately. The tests cover the acknowledgement window, covering and non-covering updates, all-skipped batches, absent sequences, effect-first handling, redelivery, reset, and LWW-skipped semantics. CRDT tests passed 255/255, with typecheck, scoped ESLint/format, and Knip clean. No new blocker in this top diff. The base has advanced with the workflow-switch reset fix, so this branch should rebase onto it; the graph-scope identity blocker from #16302 remains inherited and must be resolved before the full stack merges.
CodeJuggernaut
left a comment
There was a problem hiding this comment.
The covering-projection resolution reads correctly end to end; no issues.
|
Inherited blocker queued. Full context for agent readersThe approval says the graph-scope identity blocker from #16302 remains inherited and must be resolved before the full stack merges. No open or merged follow-up PR back-references #16671. Queued as |
Shadow identity omitted graph scope, but node/link ids are graph-local and widget identity is graphId:nodeId:name (FE-1904 convention). Two subgraphs minting the same local node/link/widget id therefore shared one shadow key and refcount, so clearing/reverting an op in one subgraph could silently unstyle a different subgraph's pending entity with the same local id. ShadowTarget now carries graphId on every kind; targetKey/cloneTarget scope the key by graphId first. Adds 3 tests for cross-graph-scope collisions on node/widget targets and pendingTargets() dedup. Fixes the graph-scope identity blocker DrJKL flagged on #16302 review comment #16302 (comment) and reiterated as an inherited blocker on #16671's approval: #16671 (review) Evidence: - pnpm exec vitest run src/workbench/extensions/agent/crdt/pendingOpShadow.test.ts -> 21/21 (was 18) - pnpm exec vitest run src/workbench/extensions/agent/crdt -> 207/207 - pnpm exec vue-tsc --noEmit -> clean - pnpm exec oxlint / eslint on touched files -> clean - pnpm exec oxfmt --check -> clean - pnpm exec knip --cache -> no findings for touched modules <!-- authored-by:agent lane-act-fe-16671-followup -->
|
Follow-up for the inherited blocker from @DrJKL's approval note ("the graph-scope identity blocker from #16302 remains inherited and must be resolved before the full stack merges"): fixed directly on #16302 at |
Shadow identity omitted graph scope, but node/link ids are graph-local and widget identity is graphId:nodeId:name (FE-1904 convention). Two subgraphs minting the same local node/link/widget id therefore shared one shadow key and refcount, so clearing/reverting an op in one subgraph could silently unstyle a different subgraph's pending entity with the same local id. ShadowTarget now carries graphId on every kind; targetKey/cloneTarget scope the key by graphId first. Adds 3 tests for cross-graph-scope collisions on node/widget targets and pendingTargets() dedup. Fixes the graph-scope identity blocker DrJKL flagged on #16302 review comment #16302 (comment) and reiterated as an inherited blocker on #16671's approval: #16671 (review) Evidence: - pnpm exec vitest run src/workbench/extensions/agent/crdt/pendingOpShadow.test.ts -> 21/21 (was 18) - pnpm exec vitest run src/workbench/extensions/agent/crdt -> 207/207 - pnpm exec vue-tsc --noEmit -> clean - pnpm exec oxlint / eslint on touched files -> clean - pnpm exec oxfmt --check -> clean - pnpm exec knip --cache -> no findings for touched modules <!-- authored-by:agent lane-act-fe-16671-followup -->
…opt-2) (#16671) - Skipped-duplicate shadows now clear on a covering projection (host `doc_ops_result.seq` ≤ projected `doc_update.seq`), never on the ack itself; failed/unprocessed rollback from #16309 is unchanged - Re-expresses the skipped policy of #16332 (base branch `nathaniel/agent-panel-v1`, now closed lineage) onto the main-based tracker; #16332 stays as source history - Green: 252/252 crdt suite (7 new tests), typecheck, oxlint/eslint, oxfmt, knip <details><summary>Full context for agent readers</summary> ## What The s3-opt-6 tracker (#16309) already handles `applied` (keep until effect), `failed` (revert), and unprocessed suffix (revert). The one outcome it could not finish was `skipped`: the host had already applied that op on a previous delivery, so **no later `doc_update` will ever carry its op id** and the shadow lingered until reset. This PR closes that gap. **Stack:** cut from `fix/s3opt6-dispatch-wiring` (#16309, head `d49dcaa1ba`). Review only the top commit, `678fc7e177`. ## Policy | Situation | Behavior | |---|---| | ack `skipped:[id]` with `seq`, and `bridge.lastSequence >= seq` | clear shadow + take ledger entry immediately (authoritative state already on screen) | | ack `skipped:[id]` with `seq`, projection behind | park id keyed by `seq`; clear on the first applied `doc_update` whose `seq >= ack.seq` | | ack `skipped:[id]` without `seq` | park with `null`; cleared by the next applied `doc_update` | | effect frame carrying the id arrives first | `onDocEffect` still wins; the parked entry is dropped | | `doc_reset` / unmount | parked ids dropped (seqs belong to the dead lineage) | | redelivered ack | no double-resolve; ledger `take` is idempotent | ## Files - `opSender.ts`: `OpsResultView.seq?: number` (mirrors host `DocOpsResultFrame.Seq` in `cloud/common/websocket/messages/crdt.go`; FE `docFrameClient.ts` already parsed it). - `pendingOpTracker.ts`: `currentSeq()` dep, `onAuthoritativeState(seq)`, `awaitingSkipped` map, `drop()`/`clearSkipped()` helpers; dev events `skipped_awaiting` / `skipped_cleared`. - `useAgentCrdtFollower.ts`: passes `currentSeq: () => bridge.lastSequence`, maps `detail.seq` into the ack view, calls `onAuthoritativeState(update.seq)` after each applied update. - Tests: `pendingOpTracker.test.ts` (`describe('s3-opt-2: ...')`, 6 tests + reworked skipped test), `useAgentCrdtFollower.test.ts` (1 follower-level test through the real frame dispatch path). ## Re-expression of #16332 Source commit `9fdd7bb544` (`opsResultReconciler.ts`) implemented this as a separate pure reconciler over `sentBatches()`. #16309 later folded the reconciliation into `PendingOpTracker`, so the reconciler module would duplicate it; this PR instead adds only the missing skipped→covering-seq gate to the tracker. The policy table in #16332 is preserved verbatim for `skipped`; the other rows were already landed by #16309. ## Diagram ``` doc_ops_result{skipped:[id], seq:S} │ ▼ currentSeq() >= S ? ──yes──▶ clear shadow + ledger.take(id) → skipped_cleared │no ▼ awaitingSkipped[id] = S → skipped_awaiting │ │ doc_update{seq:U} applied ──▶ onAuthoritativeState(U) │ U >= S ? clear : keep waiting │ └─ doc_update{opIds:[id]} ──▶ onDocEffect(id) wins, drops parked entry ``` ## Evidence - Branch `fix/s3opt2-skipped-seq-gate` @ `678fc7e1770495d827d96a2a6e569049e3f3ef13`, base `fix/s3opt6-dispatch-wiring` @ `d49dcaa1bad961684cbaedf4f06035deccdad857` - `pnpm exec vitest run src/workbench/extensions/agent/crdt` → 21 files, **252 passed** (was 245 on base) - `pnpm exec vue-tsc --noEmit` → clean - `oxfmt --check`, `oxlint`, `eslint` on the 5 touched files → 0 warnings / 0 errors - `knip --cache` → no findings for touched modules; pre-commit lint-staged (oxfmt, oxlint type-aware, eslint, typecheck) passed - Source of policy: #16332 head `a49ac021f1`, commit `9fdd7bb544` ## Glossary - **s3-opt-2 / s3-opt-6**: program work items for outcome reconciliation (skipped duplicates) and dispatch wiring of the pending ledger/shadow. - **projection**: an applied `doc_update` frame; its `seq` is the host's authoritative document sequence. - **covering seq**: a projected `seq` ≥ the `seq` reported on a `doc_ops_result`, meaning the projected state already includes that batch. - **shadow**: the local pending overlay drawn for an op that has been sent but not yet confirmed by an effect frame. - **ledger**: `PendingOpLedger` entries tracking sent op ids until resolved. </details> <!-- authored-by:agent role-hard-problem -->
doc_ops_result.seq≤ projecteddoc_update.seq), never on the ack itself; failed/unprocessed rollback from feat(agent): optimistic-overlay pending ledger + shadow (retargeted to main) #16309 is unchangednathaniel/agent-panel-v1, now closed lineage) onto the main-based tracker; feat(agent): outcome-aware doc_ops_result reconciliation for the pending overlay #16332 stays as source historyFull context for agent readers
What
The s3-opt-6 tracker (#16309) already handles
applied(keep until effect),failed(revert), and unprocessed suffix (revert). The one outcome it could not finish wasskipped: the host had already applied that op on a previous delivery, so no laterdoc_updatewill ever carry its op id and the shadow lingered until reset. This PR closes that gap.Stack: cut from
fix/s3opt6-dispatch-wiring(#16309, headd49dcaa1ba). Review only the top commit,678fc7e177.Policy
skipped:[id]withseq, andbridge.lastSequence >= seqskipped:[id]withseq, projection behindseq; clear on the first applieddoc_updatewhoseseq >= ack.seqskipped:[id]withoutseqnull; cleared by the next applieddoc_updateonDocEffectstill wins; the parked entry is droppeddoc_reset/ unmounttakeis idempotentFiles
opSender.ts:OpsResultView.seq?: number(mirrors hostDocOpsResultFrame.Seqincloud/common/websocket/messages/crdt.go; FEdocFrameClient.tsalready parsed it).pendingOpTracker.ts:currentSeq()dep,onAuthoritativeState(seq),awaitingSkippedmap,drop()/clearSkipped()helpers; dev eventsskipped_awaiting/skipped_cleared.useAgentCrdtFollower.ts: passescurrentSeq: () => bridge.lastSequence, mapsdetail.seqinto the ack view, callsonAuthoritativeState(update.seq)after each applied update.pendingOpTracker.test.ts(describe('s3-opt-2: ...'), 6 tests + reworked skipped test),useAgentCrdtFollower.test.ts(1 follower-level test through the real frame dispatch path).Re-expression of #16332
Source commit
9fdd7bb544(opsResultReconciler.ts) implemented this as a separate pure reconciler oversentBatches(). #16309 later folded the reconciliation intoPendingOpTracker, so the reconciler module would duplicate it; this PR instead adds only the missing skipped→covering-seq gate to the tracker. The policy table in #16332 is preserved verbatim forskipped; the other rows were already landed by #16309.Diagram
Evidence
fix/s3opt2-skipped-seq-gate@678fc7e1770495d827d96a2a6e569049e3f3ef13, basefix/s3opt6-dispatch-wiring@d49dcaa1bad961684cbaedf4f06035deccdad857pnpm exec vitest run src/workbench/extensions/agent/crdt→ 21 files, 252 passed (was 245 on base)pnpm exec vue-tsc --noEmit→ cleanoxfmt --check,oxlint,eslinton the 5 touched files → 0 warnings / 0 errorsknip --cache→ no findings for touched modules; pre-commit lint-staged (oxfmt, oxlint type-aware, eslint, typecheck) passeda49ac021f1, commit9fdd7bb544Glossary
doc_updateframe; itsseqis the host's authoritative document sequence.seq≥ theseqreported on adoc_ops_result, meaning the projected state already includes that batch.PendingOpLedgerentries tracking sent op ids until resolved.