Repository navigation
Conversation
Pins behavior that the existing suite left uncovered and that a state machine refactor could silently change: workspace suspension, the 30s action cadence, the 23 hour authentication budget, terminal precedence at the deadline, processing toast removal on every terminal edge, and backoff continuity across network errors. Each test was mutation-checked against the current implementation. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
🎨 Storybook: ✅ Built — View Storybook🎭 Playwright: ✅ 1771 passed, 0 failed📊 Browser Reports
📦 Bundle: 8.2 MB gzip 🔴 +26.7 kBDetailsSummary
Category Glance App Entry Points — 3.62 kB (baseline 3.62 kB) • ⚪ 0 BMain entry bundles and manifests
Status: 1 added / 1 removed Graph Workspace — 1.29 MB (baseline 1.29 MB) • ⚪ 0 BGraph editor runtime, canvas, workflow orchestration
Status: 1 added / 1 removed / 1 unchanged Views & Navigation — 111 kB (baseline 111 kB) • ⚪ 0 BTop-level views, pages, and routed surfaces
Status: 14 added / 14 removed / 2 unchanged Panels & Settings — 552 kB (baseline 552 kB) • ⚪ 0 BConfiguration panels, inspectors, and settings screens
Status: 11 added / 11 removed / 15 unchanged User & Accounts — 28.7 kB (baseline 28.7 kB) • ⚪ 0 BAuthentication, profile, and account management bundles
Status: 7 added / 7 removed / 3 unchanged Editors & Dialogs — 124 kB (baseline 124 kB) • ⚪ 0 BModals, dialogs, drawers, and in-app editors
Status: 7 added / 7 removed UI Components — 70 kB (baseline 70 kB) • ⚪ 0 BReusable component library chunks
Status: 14 added / 14 removed / 1 unchanged Data & Services — 3.43 MB (baseline 3.43 MB) • 🔴 +6.08 kBStores, services, APIs, and repositories
Status: 15 added / 15 removed / 2 unchanged Utilities & Hooks — 385 kB (baseline 385 kB) • 🔴 +4 BHelpers, composables, and utility bundles
Status: 16 added / 16 removed / 20 unchanged Vendor & Third-Party — 15.8 MB (baseline 15.7 MB) • 🔴 +103 kBExternal libraries and shared vendor chunks
Status: 1 added / 1 removed / 15 unchanged Other — 12.6 MB (baseline 12.6 MB) • ⚪ 0 BBundles that do not match a named category
Status: 99 added / 99 removed / 179 unchanged ⚡ Performance Report
Show regressions
All metrics
Historical variance (last 15 runs)
Trend (last 15 commits on main)
Raw data{
"timestamp": "2026-07-30T21:18:44.990Z",
"gitSha": "c136031fea8675749209a57c2cdd8ee816417a9d",
"branch": "cc/billing-operation-fsm-c42b1f",
"measurements": [
{
"name": "canvas-idle",
"durationMs": 2068.2199999999966,
"styleRecalcs": 9,
"styleRecalcDurationMs": 8.733999999999998,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 642.547,
"heapDeltaBytes": 5017792,
"heapUsedBytes": 72967200,
"domNodes": 18,
"jsHeapTotalBytes": 20574208,
"scriptDurationMs": 26.559,
"eventListeners": 6,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "canvas-idle",
"durationMs": 2050.2389999999764,
"styleRecalcs": 8,
"styleRecalcDurationMs": 7.088000000000001,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 524.955,
"heapDeltaBytes": 4835276,
"heapUsedBytes": 72838876,
"domNodes": 16,
"jsHeapTotalBytes": 20312064,
"scriptDurationMs": 23.633,
"eventListeners": 4,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "canvas-mouse-sweep",
"durationMs": 2004.7869999999932,
"styleRecalcs": 78,
"styleRecalcDurationMs": 45.395,
"layouts": 12,
"layoutDurationMs": 3.9909999999999997,
"taskDurationMs": 1045.4199999999998,
"heapDeltaBytes": -17631772,
"heapUsedBytes": 50542884,
"domNodes": -284,
"jsHeapTotalBytes": 21225472,
"scriptDurationMs": 134.1,
"eventListeners": -148,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "canvas-mouse-sweep",
"durationMs": 1887.7630000000067,
"styleRecalcs": 75,
"styleRecalcDurationMs": 42.254,
"layouts": 12,
"layoutDurationMs": 3.8589999999999995,
"taskDurationMs": 936.1400000000001,
"heapDeltaBytes": -311456,
"heapUsedBytes": 67593764,
"domNodes": 57,
"jsHeapTotalBytes": 21360640,
"scriptDurationMs": 129.154,
"eventListeners": 4,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333335,
"p95FrameDurationMs": 16.699999999999818
},
{
"name": "canvas-zoom-sweep",
"durationMs": 1745.5739999999764,
"styleRecalcs": 30,
"styleRecalcDurationMs": 17.822999999999997,
"layouts": 6,
"layoutDurationMs": 0.6130000000000001,
"taskDurationMs": 425.08000000000004,
"heapDeltaBytes": 7893640,
"heapUsedBytes": 75949856,
"domNodes": 75,
"jsHeapTotalBytes": 20312064,
"scriptDurationMs": 25.182999999999996,
"eventListeners": 19,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "canvas-zoom-sweep",
"durationMs": 1756.7189999999755,
"styleRecalcs": 32,
"styleRecalcDurationMs": 20.124000000000002,
"layouts": 6,
"layoutDurationMs": 0.7159999999999999,
"taskDurationMs": 418.18700000000007,
"heapDeltaBytes": 7784468,
"heapUsedBytes": 75863832,
"domNodes": 77,
"jsHeapTotalBytes": 20574208,
"scriptDurationMs": 24.902,
"eventListeners": 19,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.699999999999818
},
{
"name": "dom-widget-clipping",
"durationMs": 592.3669999999959,
"styleRecalcs": 10,
"styleRecalcDurationMs": 6.886000000000002,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 406.381,
"heapDeltaBytes": -12580784,
"heapUsedBytes": 55588156,
"domNodes": 16,
"jsHeapTotalBytes": 21360640,
"scriptDurationMs": 61.58100000000001,
"eventListeners": 0,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.699999999999818
},
{
"name": "dom-widget-clipping",
"durationMs": 637.7710000000434,
"styleRecalcs": 10,
"styleRecalcDurationMs": 7.266,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 407.231,
"heapDeltaBytes": -12489996,
"heapUsedBytes": 55587580,
"domNodes": 16,
"jsHeapTotalBytes": 21622784,
"scriptDurationMs": 63.04600000000001,
"eventListeners": 2,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "large-graph-idle",
"durationMs": 2024.9790000000303,
"styleRecalcs": 9,
"styleRecalcDurationMs": 8.338999999999999,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 782.2479999999999,
"heapDeltaBytes": 7228252,
"heapUsedBytes": 66834196,
"domNodes": -279,
"jsHeapTotalBytes": 5042176,
"scriptDurationMs": 121.61600000000001,
"eventListeners": -146,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333335,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "large-graph-idle",
"durationMs": 2028.0269999999518,
"styleRecalcs": 7,
"styleRecalcDurationMs": 6.674000000000003,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 763.1389999999999,
"heapDeltaBytes": 7965828,
"heapUsedBytes": 67502896,
"domNodes": -281,
"jsHeapTotalBytes": 3731456,
"scriptDurationMs": 124.663,
"eventListeners": -142,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "large-graph-pan",
"durationMs": 2185.8629999999835,
"styleRecalcs": 68,
"styleRecalcDurationMs": 14.785999999999998,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 1406.6290000000001,
"heapDeltaBytes": 5471352,
"heapUsedBytes": 65457988,
"domNodes": -285,
"jsHeapTotalBytes": 5267456,
"scriptDurationMs": 450.00600000000003,
"eventListeners": -142,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "large-graph-pan",
"durationMs": 2197.0700000000534,
"styleRecalcs": 69,
"styleRecalcDurationMs": 16.240000000000002,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 1351.78,
"heapDeltaBytes": 5741364,
"heapUsedBytes": 66172160,
"domNodes": -284,
"jsHeapTotalBytes": 4743168,
"scriptDurationMs": 430.0079999999999,
"eventListeners": -144,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "large-graph-zoom",
"durationMs": 3395.700999999974,
"styleRecalcs": 65,
"styleRecalcDurationMs": 17.118000000000002,
"layouts": 60,
"layoutDurationMs": 9.087,
"taskDurationMs": 1717.9140000000002,
"heapDeltaBytes": 6685916,
"heapUsedBytes": 68649252,
"domNodes": -288,
"jsHeapTotalBytes": 8187904,
"scriptDurationMs": 584.874,
"eventListeners": -148,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "large-graph-zoom",
"durationMs": 3264.4940000000133,
"styleRecalcs": 65,
"styleRecalcDurationMs": 17.153000000000002,
"layouts": 60,
"layoutDurationMs": 8.737,
"taskDurationMs": 1648.5949999999998,
"heapDeltaBytes": 1887996,
"heapUsedBytes": 63330248,
"domNodes": -289,
"jsHeapTotalBytes": 7139328,
"scriptDurationMs": 571.079,
"eventListeners": -148,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "minimap-idle",
"durationMs": 2057.711999999981,
"styleRecalcs": 7,
"styleRecalcDurationMs": 6.597000000000002,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 849.8469999999999,
"heapDeltaBytes": 8056044,
"heapUsedBytes": 69136024,
"domNodes": -286,
"jsHeapTotalBytes": 5042176,
"scriptDurationMs": 135.45000000000002,
"eventListeners": -146,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "minimap-idle",
"durationMs": 2041.4319999999861,
"styleRecalcs": 7,
"styleRecalcDurationMs": 6.571000000000001,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 819.346,
"heapDeltaBytes": 8079712,
"heapUsedBytes": 68716740,
"domNodes": -285,
"jsHeapTotalBytes": 4780032,
"scriptDurationMs": 125.48599999999999,
"eventListeners": -142,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "subgraph-dom-widget-clipping",
"durationMs": 628.2339999999635,
"styleRecalcs": 48,
"styleRecalcDurationMs": 13.199,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 438.0539999999999,
"heapDeltaBytes": -12246500,
"heapUsedBytes": 55887832,
"domNodes": 22,
"jsHeapTotalBytes": 22147072,
"scriptDurationMs": 129.10399999999998,
"eventListeners": 8,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "subgraph-dom-widget-clipping",
"durationMs": 658.5189999999557,
"styleRecalcs": 46,
"styleRecalcDurationMs": 11.889000000000001,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 448.0799999999999,
"heapDeltaBytes": -11136064,
"heapUsedBytes": 57243824,
"domNodes": 18,
"jsHeapTotalBytes": 20836352,
"scriptDurationMs": 130.486,
"eventListeners": 8,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.699999999999818
},
{
"name": "subgraph-idle",
"durationMs": 2004.9700000000144,
"styleRecalcs": 11,
"styleRecalcDurationMs": 10.971,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 545.927,
"heapDeltaBytes": 4376608,
"heapUsedBytes": 72462056,
"domNodes": 22,
"jsHeapTotalBytes": 21098496,
"scriptDurationMs": 19.963,
"eventListeners": 4,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "subgraph-idle",
"durationMs": 2022.7590000000646,
"styleRecalcs": 10,
"styleRecalcDurationMs": 9.892999999999999,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 533.0089999999999,
"heapDeltaBytes": 4459264,
"heapUsedBytes": 72649140,
"domNodes": 20,
"jsHeapTotalBytes": 21360640,
"scriptDurationMs": 20.144999999999996,
"eventListeners": 4,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "subgraph-mouse-sweep",
"durationMs": 1735.8299999999645,
"styleRecalcs": 74,
"styleRecalcDurationMs": 40.328,
"layouts": 16,
"layoutDurationMs": 5.1419999999999995,
"taskDurationMs": 844.993,
"heapDeltaBytes": -4697788,
"heapUsedBytes": 63187440,
"domNodes": 60,
"jsHeapTotalBytes": 21622784,
"scriptDurationMs": 101.38699999999999,
"eventListeners": 4,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.699999999999818
},
{
"name": "subgraph-mouse-sweep",
"durationMs": 1774.0580000000818,
"styleRecalcs": 77,
"styleRecalcDurationMs": 42.454,
"layouts": 16,
"layoutDurationMs": 4.877,
"taskDurationMs": 840.74,
"heapDeltaBytes": -4327428,
"heapUsedBytes": 63825756,
"domNodes": 64,
"jsHeapTotalBytes": 20836352,
"scriptDurationMs": 99.647,
"eventListeners": 4,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "subgraph-transition-enter",
"durationMs": 1385.4949999999917,
"styleRecalcs": 18,
"styleRecalcDurationMs": 30.549999999999994,
"layouts": 14,
"layoutDurationMs": 11.888000000000003,
"taskDurationMs": 1034.695,
"heapDeltaBytes": 4971988,
"heapUsedBytes": 97699028,
"domNodes": 13673,
"jsHeapTotalBytes": 10223616,
"scriptDurationMs": 38.97200000000001,
"eventListeners": 2371,
"totalBlockingTimeMs": 120,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "viewport-pan-sweep",
"durationMs": 8341.804999999966,
"styleRecalcs": 249,
"styleRecalcDurationMs": 44.591,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 4889.232000000001,
"heapDeltaBytes": 9489004,
"heapUsedBytes": 68285084,
"domNodes": -282,
"jsHeapTotalBytes": 6283264,
"scriptDurationMs": 1434.45,
"eventListeners": -128,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.670000000000012,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "viewport-pan-sweep",
"durationMs": 8428.713000000016,
"styleRecalcs": 250,
"styleRecalcDurationMs": 44.626,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 4972.3009999999995,
"heapDeltaBytes": 10419312,
"heapUsedBytes": 69333324,
"domNodes": -281,
"jsHeapTotalBytes": 7069696,
"scriptDurationMs": 1449.075,
"eventListeners": -126,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "vue-large-graph-idle",
"durationMs": 18807.485999999983,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 18750.269,
"heapDeltaBytes": -63581220,
"heapUsedBytes": 168713148,
"domNodes": -8341,
"jsHeapTotalBytes": -11476992,
"scriptDurationMs": 600.0490000000001,
"eventListeners": -16385,
"totalBlockingTimeMs": 0,
"frameDurationMs": 17.776666666666642,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "vue-large-graph-idle",
"durationMs": 18330.834999999977,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 18306.693000000003,
"heapDeltaBytes": -43124912,
"heapUsedBytes": 166023904,
"domNodes": -8312,
"jsHeapTotalBytes": -16195584,
"scriptDurationMs": 577.231,
"eventListeners": -16385,
"totalBlockingTimeMs": 0,
"frameDurationMs": 18.333333333333332,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "vue-large-graph-pan",
"durationMs": 23750.487000000023,
"styleRecalcs": 179,
"styleRecalcDurationMs": 28.081000000000024,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 23667.203999999998,
"heapDeltaBytes": -49331768,
"heapUsedBytes": 177187008,
"domNodes": -8312,
"jsHeapTotalBytes": -10756096,
"scriptDurationMs": 939.094,
"eventListeners": -16379,
"totalBlockingTimeMs": 957,
"frameDurationMs": 17.776666666666642,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "vue-large-graph-pan",
"durationMs": 24180.849999999962,
"styleRecalcs": 180,
"styleRecalcDurationMs": 29.793999999999986,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 24132.328,
"heapDeltaBytes": -59952472,
"heapUsedBytes": 166830556,
"domNodes": -8312,
"jsHeapTotalBytes": -5967872,
"scriptDurationMs": 1033.368,
"eventListeners": -16381,
"totalBlockingTimeMs": 1389,
"frameDurationMs": 17.776666666666763,
"p95FrameDurationMs": 16.799999999995634
},
{
"name": "workflow-execution",
"durationMs": 465.6999999999698,
"styleRecalcs": 18,
"styleRecalcDurationMs": 25.751000000000005,
"layouts": 3,
"layoutDurationMs": 1.2080000000000004,
"taskDurationMs": 130.24399999999997,
"heapDeltaBytes": -15591988,
"heapUsedBytes": 51464312,
"domNodes": 154,
"jsHeapTotalBytes": 7729152,
"scriptDurationMs": 12.379000000000001,
"eventListeners": 67,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "workflow-execution",
"durationMs": 493.7169999999469,
"styleRecalcs": 12,
"styleRecalcDurationMs": 20.992,
"layouts": 3,
"layoutDurationMs": 0.6410000000000001,
"taskDurationMs": 126.68199999999999,
"heapDeltaBytes": -16115260,
"heapUsedBytes": 50916216,
"domNodes": 117,
"jsHeapTotalBytes": 7204864,
"scriptDurationMs": 11.162999999999998,
"eventListeners": 65,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.800000000000182
}
]
} |
🌐 Website E2ETip All tests passed.
|
📝 WalkthroughWalkthroughChangesBilling operation polling
Estimated code review effort: 4 (Complex) | ~45 minutes Sequence Diagram(s)sequenceDiagram
participant BillingOperationStore
participant BillingOperationMachine
participant WorkspaceAPI
BillingOperationStore->>BillingOperationMachine: Start operation actor
BillingOperationMachine->>WorkspaceAPI: Fetch billing operation status
WorkspaceAPI-->>BillingOperationMachine: Return status or error
BillingOperationMachine-->>BillingOperationStore: Publish snapshot or terminal state
BillingOperationStore->>BillingOperationStore: Project model and finalize effects
Suggested reviewers: 🚥 Pre-merge checks | ✅ 6✅ Passed checks (6 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
There was a problem hiding this comment.
Actionable comments posted: 4
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/platform/workspace/machines/billingOperationMachine.test.ts`:
- Around line 173-185: Update the test “starts a recovered operation already
authenticated” to count each snapshot matching polling: 'waiting' while
traversing the generated paths, then assert that at least one waiting snapshot
was observed in addition to validating intervalMs. Keep the existing interval
assertion for every matching snapshot so the test cannot pass when the waiting
state is never reached.
In `@src/platform/workspace/machines/billingOperationMachine.ts`:
- Line 24: Remove readNow from BillingOperationContext and keep clock access
outside the actor snapshot so the context remains JSON-serializable. Update the
billing operation machine’s timeout logic to use an injected or provided
hasTimedOut guard, refreshing any now value through an action as needed, while
preserving existing test overrides and timeout behavior.
In
`@src/platform/workspace/stores/billingOperationStore.characterization.test.ts`:
- Around line 104-109: Update the beforeEach setup in billingOperationStore
characterization tests to call vi.resetAllMocks() instead of vi.clearAllMocks(),
ensuring queued once-value mock implementations are removed between tests while
preserving the existing timer and workspace setup.
In `@src/platform/workspace/stores/billingOperationStore.ts`:
- Around line 213-237: Update finalize to remove the completed operation’s entry
from actors after cleanup and terminal handling, while preserving metadataById
until the operation is removed. Use the existing opId-based actor map and ensure
terminal resolution still occurs for every finalized operation.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 2d4abf5b-ea8a-4fc4-a068-c9930fb1ba45
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (6)
package.jsonpnpm-workspace.yamlsrc/platform/workspace/machines/billingOperationMachine.test.tssrc/platform/workspace/machines/billingOperationMachine.tssrc/platform/workspace/stores/billingOperationStore.characterization.test.tssrc/platform/workspace/stores/billingOperationStore.ts
| it('starts a recovered operation already authenticated', () => { | ||
| const paths = pathsFor({ ...withinBudget, initialActionUrl: ACTION_URL }) | ||
|
|
||
| for (const path of paths) { | ||
| for (const step of path.steps) { | ||
| if (step.state.matches({ polling: 'waiting' })) { | ||
| expect(step.state.context.intervalMs).toBe( | ||
| ACTION_REQUIRED_INTERVAL_MS | ||
| ) | ||
| } | ||
| } | ||
| } | ||
| }) |
There was a problem hiding this comment.
📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win
This test passes vacuously if no path reaches waiting.
The assertion only runs inside the matches({ polling: 'waiting' }) branch, so a traversal regression that stops producing waiting steps turns this into a green no-op. Count the observed waiting snapshots and assert at least one.
As per path instructions, .agents/checks/test-quality.md requires avoiding tests that don't drive real behavior/invariants.
♻️ Proposed fix
const paths = pathsFor({ ...withinBudget, initialActionUrl: ACTION_URL })
+ let waitingSeen = 0
for (const path of paths) {
for (const step of path.steps) {
if (step.state.matches({ polling: 'waiting' })) {
+ waitingSeen++
expect(step.state.context.intervalMs).toBe(
ACTION_REQUIRED_INTERVAL_MS
)
}
}
}
+ expect(waitingSeen).toBeGreaterThan(0)📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| it('starts a recovered operation already authenticated', () => { | |
| const paths = pathsFor({ ...withinBudget, initialActionUrl: ACTION_URL }) | |
| for (const path of paths) { | |
| for (const step of path.steps) { | |
| if (step.state.matches({ polling: 'waiting' })) { | |
| expect(step.state.context.intervalMs).toBe( | |
| ACTION_REQUIRED_INTERVAL_MS | |
| ) | |
| } | |
| } | |
| } | |
| }) | |
| it('starts a recovered operation already authenticated', () => { | |
| const paths = pathsFor({ ...withinBudget, initialActionUrl: ACTION_URL }) | |
| let waitingSeen = 0 | |
| for (const path of paths) { | |
| for (const step of path.steps) { | |
| if (step.state.matches({ polling: 'waiting' })) { | |
| waitingSeen++ | |
| expect(step.state.context.intervalMs).toBe( | |
| ACTION_REQUIRED_INTERVAL_MS | |
| ) | |
| } | |
| } | |
| } | |
| expect(waitingSeen).toBeGreaterThan(0) | |
| }) |
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@src/platform/workspace/machines/billingOperationMachine.test.ts` around lines
173 - 185, Update the test “starts a recovered operation already authenticated”
to count each snapshot matching polling: 'waiting' while traversing the
generated paths, then assert that at least one waiting snapshot was observed in
addition to validating intervalMs. Keep the existing interval assertion for
every matching snapshot so the test cannot pass when the waiting state is never
reached.
Source: Path instructions
| beforeEach(() => { | ||
| setActivePinia(createPinia()) | ||
| vi.clearAllMocks() | ||
| vi.useFakeTimers() | ||
| mockActiveWorkspaceId.value = 'workspace-1' | ||
| }) |
There was a problem hiding this comment.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
Use vi.resetAllMocks() so unconsumed *Once queues can't leak between tests.
clearAllMocks only clears call records; queued mockResolvedValueOnce/mockRejectedValueOnce implementations survive into the next test, making this suite order-dependent (several tests queue once-values that are not guaranteed to be fully consumed). Note the mock factories at lines 19-78 return fresh objects per call, so resetting implementations is safe here.
As per path instructions, docs/testing/vitest-patterns.md says to "prefer vi.resetAllMocks() in beforeEach", and .agents/checks/test-quality.md requires keeping tests isolated with mocks reset per test.
🧪 Proposed fix
setActivePinia(createPinia())
- vi.clearAllMocks()
+ vi.resetAllMocks()
vi.useFakeTimers()📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| beforeEach(() => { | |
| setActivePinia(createPinia()) | |
| vi.clearAllMocks() | |
| vi.useFakeTimers() | |
| mockActiveWorkspaceId.value = 'workspace-1' | |
| }) | |
| beforeEach(() => { | |
| setActivePinia(createPinia()) | |
| vi.resetAllMocks() | |
| vi.useFakeTimers() | |
| mockActiveWorkspaceId.value = 'workspace-1' | |
| }) |
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@src/platform/workspace/stores/billingOperationStore.characterization.test.ts`
around lines 104 - 109, Update the beforeEach setup in billingOperationStore
characterization tests to call vi.resetAllMocks() instead of vi.clearAllMocks(),
ensuring queued once-value mock implementations are removed between tests while
preserving the existing timer and workspace setup.
Source: Path instructions
| actor.subscribe((snapshot) => { | ||
| commit(snapshot) | ||
| if (snapshot.status === 'done') { | ||
| void finalize(opId, snapshot.context.backendErrorMessage) | ||
| } | ||
| }) | ||
|
|
||
| if (stopIfTimedOut(opId, operation)) return | ||
| actor.start() | ||
|
|
||
| updateOperationActionUrl(opId, validateActionUrl(response.action_url)) | ||
| scheduleNextPoll(opId) | ||
| } catch { | ||
| const currentOperation = operations.value.get(opId) | ||
| if (currentOperation !== operation) return | ||
| if (stopIfTimedOut(opId, currentOperation)) return | ||
| scheduleNextPoll(opId) | ||
| } | ||
| return terminal | ||
| } | ||
|
|
||
| function scheduleNextPoll(opId: string) { | ||
| async function finalize(opId: string, backendErrorMessage: string | null) { | ||
| const operation = operations.value.get(opId) | ||
| if (!operation || operation.status !== 'pending') return | ||
| const nextInterval = operation.authenticationRequiredSeen | ||
| ? ACTION_REQUIRED_INTERVAL_MS | ||
| : Math.min( | ||
| (intervals.get(opId) ?? INITIAL_INTERVAL_MS) * BACKOFF_MULTIPLIER, | ||
| MAX_INTERVAL_MS | ||
| ) | ||
| intervals.set(opId, nextInterval) | ||
|
|
||
| const timeoutId = setTimeout(() => void poll(opId), nextInterval) | ||
| timeouts.set(opId, timeoutId) | ||
| } | ||
|
|
||
| function validateActionUrl(value: string | undefined): string | null { | ||
| if (!value) return null | ||
| try { | ||
| const url = new URL(value) | ||
| return url.protocol === 'https:' ? value : null | ||
| } catch { | ||
| return null | ||
| } | ||
| } | ||
| if (!operation) return | ||
|
|
||
| function hasTimedOut(operation: BillingOperation): boolean { | ||
| const elapsed = Date.now() - operation.startedAt | ||
| if (operation.type !== 'subscription') return elapsed > TIMEOUT_MS | ||
| return operation.authenticationRequiredSeen | ||
| ? elapsed > SUBSCRIPTION_AUTHENTICATION_TIMEOUT_MS | ||
| : elapsed > SUBSCRIPTION_ACTION_DISCOVERY_TIMEOUT_MS | ||
| } | ||
| cleanup(opId) | ||
|
|
||
| function stopIfTimedOut(opId: string, operation: BillingOperation): boolean { | ||
| if (!hasTimedOut(operation)) return false | ||
| handleTimeout(opId) | ||
| return true | ||
| } | ||
| if (operation.status === 'succeeded') await handleSuccess(operation) | ||
| else if (operation.status === 'failed') | ||
| handleFailure(operation, backendErrorMessage) | ||
| else handleTimeout(operation) | ||
|
|
||
| function updateOperationActionUrl(opId: string, actionUrl: string | null) { | ||
| const operation = operations.value.get(opId) | ||
| if (!operation || operation.status !== 'pending') return | ||
| operations.value = new Map(operations.value).set(opId, { | ||
| ...operation, | ||
| actionUrl, | ||
| authenticationRequiredSeen: | ||
| operation.authenticationRequiredSeen || actionUrl !== null | ||
| }) | ||
| resolveTerminal(opId) | ||
| } |
There was a problem hiding this comment.
🩺 Stability & Availability | 🟡 Minor | ⚡ Quick win
Terminal operations leave their actor and metadata entries behind.
actors and metadataById are only pruned in clearOperation. An operation that reaches a final state and is never explicitly cleared keeps a stopped-actor reference plus its metadata for the lifetime of the store, so both maps grow monotonically across a session. finalize is the natural place to drop the actor reference (the machine already stops itself on the final state); keep metadataById until the operation entry itself is removed so late projections stay intact.
🧹 Proposed fix
async function finalize(opId: string, backendErrorMessage: string | null) {
const operation = operations.value.get(opId)
if (!operation) return
cleanup(opId)
+ actors.delete(opId)📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| actor.subscribe((snapshot) => { | |
| commit(snapshot) | |
| if (snapshot.status === 'done') { | |
| void finalize(opId, snapshot.context.backendErrorMessage) | |
| } | |
| }) | |
| if (stopIfTimedOut(opId, operation)) return | |
| actor.start() | |
| updateOperationActionUrl(opId, validateActionUrl(response.action_url)) | |
| scheduleNextPoll(opId) | |
| } catch { | |
| const currentOperation = operations.value.get(opId) | |
| if (currentOperation !== operation) return | |
| if (stopIfTimedOut(opId, currentOperation)) return | |
| scheduleNextPoll(opId) | |
| } | |
| return terminal | |
| } | |
| function scheduleNextPoll(opId: string) { | |
| async function finalize(opId: string, backendErrorMessage: string | null) { | |
| const operation = operations.value.get(opId) | |
| if (!operation || operation.status !== 'pending') return | |
| const nextInterval = operation.authenticationRequiredSeen | |
| ? ACTION_REQUIRED_INTERVAL_MS | |
| : Math.min( | |
| (intervals.get(opId) ?? INITIAL_INTERVAL_MS) * BACKOFF_MULTIPLIER, | |
| MAX_INTERVAL_MS | |
| ) | |
| intervals.set(opId, nextInterval) | |
| const timeoutId = setTimeout(() => void poll(opId), nextInterval) | |
| timeouts.set(opId, timeoutId) | |
| } | |
| function validateActionUrl(value: string | undefined): string | null { | |
| if (!value) return null | |
| try { | |
| const url = new URL(value) | |
| return url.protocol === 'https:' ? value : null | |
| } catch { | |
| return null | |
| } | |
| } | |
| if (!operation) return | |
| function hasTimedOut(operation: BillingOperation): boolean { | |
| const elapsed = Date.now() - operation.startedAt | |
| if (operation.type !== 'subscription') return elapsed > TIMEOUT_MS | |
| return operation.authenticationRequiredSeen | |
| ? elapsed > SUBSCRIPTION_AUTHENTICATION_TIMEOUT_MS | |
| : elapsed > SUBSCRIPTION_ACTION_DISCOVERY_TIMEOUT_MS | |
| } | |
| cleanup(opId) | |
| function stopIfTimedOut(opId: string, operation: BillingOperation): boolean { | |
| if (!hasTimedOut(operation)) return false | |
| handleTimeout(opId) | |
| return true | |
| } | |
| if (operation.status === 'succeeded') await handleSuccess(operation) | |
| else if (operation.status === 'failed') | |
| handleFailure(operation, backendErrorMessage) | |
| else handleTimeout(operation) | |
| function updateOperationActionUrl(opId: string, actionUrl: string | null) { | |
| const operation = operations.value.get(opId) | |
| if (!operation || operation.status !== 'pending') return | |
| operations.value = new Map(operations.value).set(opId, { | |
| ...operation, | |
| actionUrl, | |
| authenticationRequiredSeen: | |
| operation.authenticationRequiredSeen || actionUrl !== null | |
| }) | |
| resolveTerminal(opId) | |
| } | |
| async function finalize(opId: string, backendErrorMessage: string | null) { | |
| const operation = operations.value.get(opId) | |
| if (!operation) return | |
| cleanup(opId) | |
| actors.delete(opId) | |
| if (operation.status === 'succeeded') await handleSuccess(operation) | |
| else if (operation.status === 'failed') | |
| handleFailure(operation, backendErrorMessage) | |
| else handleTimeout(operation) | |
| resolveTerminal(opId) | |
| } |
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@src/platform/workspace/stores/billingOperationStore.ts` around lines 213 -
237, Update finalize to remove the completed operation’s entry from actors after
cleanup and terminal handling, while preserving metadataById until the operation
is removed. Use the existing opId-based actor map and ensure terminal resolution
still occurs for every finalized operation.
Codecov Report❌ Patch coverage is @@ Coverage Diff @@
## main #14410 +/- ##
==========================================
- Coverage 79.87% 79.72% -0.16%
==========================================
Files 1761 1765 +4
Lines 98489 98844 +355
Branches 34072 33366 -706
==========================================
+ Hits 78673 78803 +130
- Misses 19453 19670 +217
- Partials 363 371 +8
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 13 files with indirect coverage changes 🚀 New features to boost your workflow:
|
Adds xstate and @xstate/graph (dev) to the catalog ahead of modelling the billing operation lifecycle as a state machine. No source changes. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Names the context a billing operation carries and the two context updates the polling lifecycle performs: the poll cadence, which backs off until an action URL appears and then settles into a flat interval, and the sticky record of that action URL. readNow is part of the context so the budget can later be driven without fake timers. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Collects the predicates that decide a billing operation's fate. The timeout budget was previously recomputed inline and consulted from four call sites in poll(); it is one function here, shaped so both the store and the machine can ask it the same question. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Wires the actions and guards into the state graph. Two states were previously implicit in the pending status: polling with backoff under a short discovery budget, and awaiting a payment action at a flat cadence under a long one. Guard order in onDone is load-bearing and is where the old ordering rule from poll() becomes explicit: a response arriving after a workspace switch is discarded, then a terminal response wins over a spent budget, then the budget is enforced before any late action URL is recorded. Not yet reachable; the store still uses its own polling loop. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
startOperation now picks a polling driver. The machine driver projects actor snapshots into the same BillingOperation shape the store already exposed; the legacy driver keeps its own loop. Both converge on one terminal effect path, so telemetry, toasts, dialogs and the billing context refresh are written once and cannot drift between drivers. The legacy loop now shares the machine's timeout budget and cadence functions rather than duplicating them. USE_BILLING_OPERATION_MACHINE defaults to false: behavior is unchanged by this commit. It is scaffolding for a real feature flag and is removed with the legacy driver once the migration lands. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Flips USE_BILLING_OPERATION_MACHINE to true. The 44 existing store tests and the 16 characterization tests pass unchanged on the machine driver, as do the 1053 tests across the workspace and billing suites. Reverting this one line restores the legacy driver. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Generates every path the state graph admits from a declared response space and asserts invariants at each state visited, rather than enumerating scenarios by hand. Covers the invariant the store used to uphold manually on every terminal write (a terminal operation never retains an action URL), each operation type timing out exactly at its own budget, the long authentication budget a recovered subscription inherits, that no request is issued on any path while the workspace is inactive, and that the poll interval never shortens along a path. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
f938587 to
08e3cf6
Compare
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
src/platform/workspace/stores/billingOperationStore.ts (1)
474-546: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winDuplicate telemetry-tracking logic between
handleFailureandhandleTimeout.Both functions build the same
operation/downgrade_to_personaltelemetry payload shape, differing only instage/failure_category. Consider extracting a sharedtrackFailureTelemetry(operation, stage, failureCategory)helper to avoid the two blocks drifting independently.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/platform/workspace/stores/billingOperationStore.ts` around lines 474 - 546, The telemetry payload construction in handleFailure and handleTimeout is duplicated and can drift. Extract a shared trackFailureTelemetry helper that accepts operation, stage, and failureCategory, then use it from both handlers while preserving their existing stage and category values and keeping their toast behavior unchanged.
♻️ Duplicate comments (1)
src/platform/workspace/stores/billingOperationStore.ts (1)
383-395: 🩺 Stability & Availability | 🟠 Major | ⚡ Quick win
finalizecan leak actors and hang the caller's promise on any handler failure.Two related gaps in this centralized terminal path:
actors.get(opId)is never deleted here — onlyclearOperationdoes that (line 589). An operation that reaches a final state without the caller explicitly callingclearOperation(e.g. background top-up completing after the user navigates away) leaves its stoppedActorreference inactorsfor the store's lifetime.- There's no
try/finallyaround the success/failure/timeout dispatch. IfhandleSuccess's awaited calls (or any of the telemetry/dialog/toast calls in the other branches) throw,resolveTerminal(opId)never executes, so thePromisereturned tostartOperation()'s caller never resolves.🩹 Proposed fix
async function finalize(opId: string, backendErrorMessage: string | null) { const operation = operations.value.get(opId) if (!operation) return cleanup(opId) + actors.delete(opId) - if (operation.status === 'succeeded') await handleSuccess(operation) - else if (operation.status === 'failed') - handleFailure(operation, backendErrorMessage) - else handleTimeout(operation) - - resolveTerminal(opId) + try { + if (operation.status === 'succeeded') await handleSuccess(operation) + else if (operation.status === 'failed') + handleFailure(operation, backendErrorMessage) + else handleTimeout(operation) + } finally { + resolveTerminal(opId) + } }🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/platform/workspace/stores/billingOperationStore.ts` around lines 383 - 395, Update finalize to delete the operation’s actor entry from actors using opId, then wrap the terminal handler dispatch in try/finally so resolveTerminal(opId) always executes even when handleSuccess, handleFailure, or handleTimeout throws. Preserve the existing status-based dispatch and cleanup behavior.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Outside diff comments:
In `@src/platform/workspace/stores/billingOperationStore.ts`:
- Around line 474-546: The telemetry payload construction in handleFailure and
handleTimeout is duplicated and can drift. Extract a shared
trackFailureTelemetry helper that accepts operation, stage, and failureCategory,
then use it from both handlers while preserving their existing stage and
category values and keeping their toast behavior unchanged.
---
Duplicate comments:
In `@src/platform/workspace/stores/billingOperationStore.ts`:
- Around line 383-395: Update finalize to delete the operation’s actor entry
from actors using opId, then wrap the terminal handler dispatch in try/finally
so resolveTerminal(opId) always executes even when handleSuccess, handleFailure,
or handleTimeout throws. Preserve the existing status-based dispatch and cleanup
behavior.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 14abc4cc-4131-42db-82f0-3c0b74b4ae50
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (8)
package.jsonpnpm-workspace.yamlsrc/platform/workspace/machines/billingOperationActions.tssrc/platform/workspace/machines/billingOperationContext.tssrc/platform/workspace/machines/billingOperationGuards.tssrc/platform/workspace/machines/billingOperationMachine.test.tssrc/platform/workspace/machines/billingOperationMachine.tssrc/platform/workspace/stores/billingOperationStore.ts
|
Flagging a direction conflict rather than a code issue, wanted to surface it before this gets further along. This models billing operation polling as an XState machine. The Slack thread that originally motivated the plain-TS discriminated-union approach on To be clear, this isn't a "no state machines ever" position — the state-and-effects guidance ( But two implementations of the same store's core lifecycle logic diverging (plain union on |
|
Assigning @dante01yoon rather than re-pinging huang47 — Cloud billing ownership on the frontend moved to you as of Aug 13 (see #14964), so this direction question is now yours to weigh in on rather than mine to broker. For context on what's being decided: this PR proposes modeling billing operation polling as an XState machine, which conflicts with the plain-discriminated-union direction Not asking you to review the whole diff — just: does this supersede where |
|
please resolve conflict and assign me again |
|
@huang47 However, I don't think the current state machine yet justifies introducing XState as a new runtime dependency. The observable lifecycle is still relatively small ( The branch has also diverged significantly from If we want to introduce a new library in order to establish state-machine architecture in this repository, please create a Technical Design Document first. It should describe the problems that cannot be addressed adequately with the existing plain-TypeScript approach, expected adoption beyond this one store, state/transition ownership, effect boundaries, serialization and replay requirements, bundle impact and loading strategy, testing strategy, migration/rollback plan, and the maintenance/onboarding cost. That would let us make the dependency and architectural direction a deliberate repository-level decision rather than having it arrive through one store refactor. |
|
Closing per the billing owner’s direction: preserve the characterization and precedence tests when implementing the latest store as a plain TypeScript discriminated union; do not add XState for this lifecycle. |
Summary
Models the billing operation polling lifecycle as an XState machine, introduced behind a flag so the switch is one revertible line.
Changes
pendingwas hiding three distinct behaviors encoded acrossauthenticationRequiredSeen,actionUrland an inline workspace comparison, each with its own poll cadence and timeout budget. The budget guard was consulted at four call sites inpoll(), and the rule that a terminal response beats a spent budget while a lateaction_urldoes not existed only as statement ordering. The machine owns state, timing and guard precedence; the store keeps its public surface and the ordered terminal effects.xstate(~13 kB gzip),@xstate/graph(dev)Eight commits, each green, meant to be read in order:
test:characterize existing storebuild:add xstatefeat:machine context + actionsfeat:machine guardsfeat:machine definitionfeat:integrate behind flag, default offfeat:enable the machinetest:model-based testsDemo URL
https://stately.ai/registry/editor/embed/ab1e4e70-38e6-44e7-babb-db42b100947f?machineId=a6f56597-63ec-4468-8779-40517bf5afd1
Review Focus
USE_BILLING_OPERATION_MACHINEis scaffolding for a real feature flag; reverting it restores the legacy driver, which commit 6 leaves fully intact. The legacy loop and the machine share one terminal effect path and one timeout budget function, so they cannot drift.onDoneis load-bearing and is where the old ordering rule becomes explicit: workspace check, then terminal responses, then budget, thenaction_url. Reordering any two changes behavior; each ordering is covered.polling.evaluatingis transient by design — itsalwayscascade mirrors the old guard order and resolves within one microstep, so it is never an observable snapshot. Commit 8 asserts this rather than treating it as dead state.xstatelands in the main chunk, not a lazy one:router.ts→services/dialogService.ts→TopUpCreditsDialogContentWorkspace.vue→ this store is a fully static import chain.SubscriptionPanel.vueusesdefineAsyncComponent, butWorkspacePanelContent.vueandPlanCreditsPanelContent.vueimport the same component statically and defeat it. Worth fixing separately.Testing
pnpm typecheck,pnpm knip,pnpm lint(0 errors): cleanpnpm test:unit: 14288 passed / 1071 files. Two runs each surfaced a different unrelated intermittent failure (GraphView.test.ts,onboardingCloudRoutes.test.ts); both pass in isolation and the same code produced a clean 14284/0 run, so they are load flakes rather than regressions. CI is the arbiter.pricingTableDeepLink.spec.ts,@cloud) fails all 14 tests in this environment and fails identically on base commite0ef062918, so it is environment-gated (no cloud config), not a regression. Needs CI.