@deeeed/metamask-harness 0.18.0 → 0.19.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (79) hide show
  1. package/CHANGELOG.md +187 -0
  2. package/README.md +4 -7
  3. package/adapters/core/inject.sh +1 -6
  4. package/adapters/extension/inject.mjs +1 -4
  5. package/adapters/extension/verify.sh +1 -1
  6. package/adapters/mobile/inject.sh +5 -4
  7. package/adapters/mobile/verify.sh +15 -19
  8. package/adapters/shared/harness-source-fingerprint.mjs +14 -12
  9. package/dist/adapters/harness-freshness.js +49 -0
  10. package/dist/cli.js +0 -4
  11. package/dist/command-contract.js +51 -40
  12. package/dist/command-journal.js +50 -12
  13. package/dist/commands/call.js +95 -20
  14. package/dist/commands/check.js +1 -1
  15. package/dist/commands/completion-candidates.js +7 -19
  16. package/dist/commands/fixtures.js +50 -1
  17. package/dist/commands/last.js +9 -1
  18. package/dist/commands/launch/extension.js +2 -2
  19. package/dist/commands/launch/mobile.js +2 -0
  20. package/dist/commands/list-executables.js +56 -20
  21. package/dist/commands/manifest.js +28 -12
  22. package/dist/commands/parse-args.js +55 -3
  23. package/dist/commands/provision.js +0 -1
  24. package/dist/commands/run-engine.js +514 -336
  25. package/dist/commands/run.js +25 -37
  26. package/dist/commands/shared.js +1 -1
  27. package/dist/heal-bounds.js +5 -0
  28. package/dist/mm-harness-cli.js +22 -30
  29. package/dist/run-diagnostics.js +1 -1
  30. package/dist/run-recording.js +1 -1
  31. package/dist/runner.js +24 -2
  32. package/docs/CONTRIBUTING.md +2 -3
  33. package/docs/QA.md +0 -1
  34. package/docs/RECIPES.md +52 -91
  35. package/library/README.md +5 -5
  36. package/library/actions/core/perps/_controller.mjs +33 -1
  37. package/library/actions/core/perps/assert_orders.mjs +6 -7
  38. package/library/actions/core/perps/assert_positions.mjs +6 -7
  39. package/library/actions/core/perps/close_orders.mjs +2 -0
  40. package/library/actions/core/perps/close_positions.mjs +2 -0
  41. package/library/actions/core/perps/ensure_orders.mjs +4 -2
  42. package/library/actions/core/perps/ensure_positions.mjs +4 -2
  43. package/library/actions/core/perps/place_order.mjs +7 -3
  44. package/library/actions/extension/perps/assert_orders.mjs +2 -1
  45. package/library/actions/extension/perps/assert_positions.mjs +2 -1
  46. package/library/actions/extension/perps/perps.mjs +43 -14
  47. package/library/actions/mobile/perps/assert_orders.mjs +2 -1
  48. package/library/actions/mobile/perps/assert_positions.mjs +2 -1
  49. package/library/actions/mobile/perps/perps.mjs +40 -12
  50. package/library/library.json +1 -1
  51. package/library/manifests/core.action-manifest.json +1170 -413
  52. package/library/manifests/extension.action-manifest.json +1495 -641
  53. package/library/manifests/mobile.action-manifest.json +1704 -769
  54. package/library/recipes/app/lifecycle.android-smoke.mobile.recipe.json +63 -81
  55. package/library/recipes/perps/clean-market-testnet.core.recipe.json +44 -0
  56. package/library/recipes/perps/clean-market-testnet.recipe.json +49 -0
  57. package/library/recipes/perps/lifecycle.recipe.json +136 -180
  58. package/library/recipes/perps/order-lifecycle.core.recipe.json +71 -67
  59. package/library/recipes/perps/performance.background-resume.mobile.recipe.json +51 -67
  60. package/library/recipes/perps/performance.cold-start.mobile.recipe.json +51 -67
  61. package/library/recipes/perps/performance.mobile.recipe.json +37 -51
  62. package/library/recipes/perps/performance.warm-start.mobile.recipe.json +44 -59
  63. package/library/recipes/perps/read-markets.core.recipe.json +29 -31
  64. package/library/recipes/perps/smoke.core.recipe.json +29 -32
  65. package/library/recipes/perps/smoke.extension.recipe.json +41 -44
  66. package/library/recipes/perps/smoke.mobile.recipe.json +42 -44
  67. package/library/recipes/perps/trading-lifecycle.core.recipe.json +69 -65
  68. package/library/recipes/runner/action-validation.extension.recipe.json +312 -405
  69. package/library/recipes/runner/action-validation.mobile.recipe.json +316 -409
  70. package/library/recipes/runner/smoke.core.recipe.json +18 -20
  71. package/library/recipes/runner/smoke.extension.recipe.json +23 -24
  72. package/library/recipes/runner/smoke.mobile.recipe.json +23 -24
  73. package/library/recipes/wallet/smoke.extension.recipe.json +33 -35
  74. package/library/recipes/wallet/smoke.mobile.recipe.json +33 -35
  75. package/package.json +3 -3
  76. package/scripts/completions.sh +1 -4
  77. package/dist/adapters/extension/harness-freshness.js +0 -39
  78. package/dist/commands/flows.js +0 -91
  79. package/library/flows/perps.flows.json +0 -64
@@ -1,77 +1,81 @@
1
1
  {
2
- "schema_version": 1,
2
+ "$schema": "https://farmslot.io/schemas/recipe-v1.schema.json",
3
3
  "title": "MetaMask core headless Perps order lifecycle",
4
4
  "description": "Proves the headless `core` adapter places and cancels a REAL resting Perps LIMIT order on HyperLiquid testnet through the full signing path: a default viem signer backs the perps controller's wallet adapter, the active HyperLiquid testnet provider is initialized, a BTC limit BUY 30% below mid is placed (does not fill — rests on the book), asserted open, then canceled and asserted gone. Leaves the account FLAT — no open orders and no open positions. No CDP, bridge, or UI.",
5
- "validate": {
6
- "workflow": {
7
- "entry": "status",
8
- "nodes": {
9
- "status": {
10
- "action": "app.status",
11
- "next": "start_flat",
12
- "intent": "Resolve the core checkout and report headless compatibility mode"
5
+ "workflow": {
6
+ "entry": "status",
7
+ "nodes": {
8
+ "status": {
9
+ "action": "app.status",
10
+ "next": "start_flat",
11
+ "intent": "Resolve the core checkout and report headless compatibility mode"
12
+ },
13
+ "start_flat": {
14
+ "action": "metamask.perps.start_state",
15
+ "market": "BTC",
16
+ "positions": {
17
+ "state": "none"
13
18
  },
14
- "start_flat": {
15
- "action": "metamask.perps.start_state",
16
- "market": "BTC",
17
- "positions": { "state": "none" },
18
- "orders": { "state": "none" },
19
- "network": "testnet",
20
- "timeout_ms": 45000,
21
- "next": "place_order",
22
- "intent": "Converge BTC testnet baseline to flat (no positions, no orders) before the proof window"
19
+ "orders": {
20
+ "state": "none"
23
21
  },
24
- "place_order": {
25
- "action": "metamask.perps.place_order",
26
- "market": "BTC",
27
- "side": "long",
28
- "order_type": "limit",
29
- "offset_pct": -30,
30
- "notional": "11",
31
- "leverage": 2,
32
- "network": "testnet",
33
- "timeout_ms": 45000,
34
- "next": "assert_open",
35
- "intent": "Place a resting BTC limit BUY 30% below mid via the headless controller (real signed limit order to HL testnet; does not fill)"
22
+ "network": "testnet",
23
+ "timeout_ms": 45000,
24
+ "next": "place_order",
25
+ "intent": "Converge BTC testnet baseline to flat (no positions, no orders) before the proof window"
26
+ },
27
+ "place_order": {
28
+ "action": "metamask.perps.place_order",
29
+ "market": "BTC",
30
+ "side": "long",
31
+ "order_type": "limit",
32
+ "offset_pct": -30,
33
+ "notional": "11",
34
+ "leverage": 2,
35
+ "timeout_ms": 45000,
36
+ "next": "assert_open",
37
+ "intent": "Place a resting BTC limit BUY 30% below mid via the headless controller (real signed limit order to HL testnet; does not fill)"
38
+ },
39
+ "assert_open": {
40
+ "action": "metamask.perps.assert_orders",
41
+ "market": "BTC",
42
+ "state": "open",
43
+ "timeout_ms": 30000,
44
+ "next": "cancel_order",
45
+ "intent": "Assert the BTC resting limit order opened"
46
+ },
47
+ "cancel_order": {
48
+ "action": "metamask.perps.close_orders",
49
+ "market": "BTC",
50
+ "timeout_ms": 45000,
51
+ "next": "assert_none",
52
+ "intent": "Cancel the BTC resting limit order via the headless controller (real signed cancel to HL testnet)"
53
+ },
54
+ "assert_none": {
55
+ "action": "metamask.perps.assert_orders",
56
+ "market": "BTC",
57
+ "state": "none",
58
+ "timeout_ms": 30000,
59
+ "next": "teardown_flat",
60
+ "intent": "Assert the BTC order canceled — no open orders remain"
61
+ },
62
+ "teardown_flat": {
63
+ "action": "metamask.perps.teardown_state",
64
+ "market": "BTC",
65
+ "positions": {
66
+ "state": "none"
36
67
  },
37
- "assert_open": {
38
- "action": "metamask.perps.assert_orders",
39
- "market": "BTC",
40
- "state": "open",
41
- "timeout_ms": 30000,
42
- "next": "cancel_order",
43
- "intent": "Assert the BTC resting limit order opened"
68
+ "orders": {
69
+ "state": "none"
44
70
  },
45
- "cancel_order": {
46
- "action": "metamask.perps.close_orders",
47
- "market": "BTC",
48
- "network": "testnet",
49
- "timeout_ms": 45000,
50
- "next": "assert_none",
51
- "intent": "Cancel the BTC resting limit order via the headless controller (real signed cancel to HL testnet)"
52
- },
53
- "assert_none": {
54
- "action": "metamask.perps.assert_orders",
55
- "market": "BTC",
56
- "state": "none",
57
- "timeout_ms": 30000,
58
- "next": "teardown_flat",
59
- "intent": "Assert the BTC order canceled — no open orders remain"
60
- },
61
- "teardown_flat": {
62
- "action": "metamask.perps.teardown_state",
63
- "market": "BTC",
64
- "positions": { "state": "none" },
65
- "orders": { "state": "none" },
66
- "network": "testnet",
67
- "timeout_ms": 45000,
68
- "next": "done",
69
- "intent": "Restore BTC testnet baseline to flat after the proof (leave the shared account clean)"
70
- },
71
- "done": {
72
- "action": "end",
73
- "status": "pass"
74
- }
71
+ "network": "testnet",
72
+ "timeout_ms": 45000,
73
+ "next": "done",
74
+ "intent": "Restore BTC testnet baseline to flat after the proof (leave the shared account clean)"
75
+ },
76
+ "done": {
77
+ "action": "end",
78
+ "status": "pass"
75
79
  }
76
80
  }
77
81
  }
@@ -1,71 +1,55 @@
1
1
  {
2
- "schema_version": 1,
3
- "title": "MetaMask Mobile Perps performance flow - background resume",
4
- "description": "Measured Perps flow from a deterministic background-resume start state. Setup sends the installed app to the background, foregrounds it through the Expo dev-client deep link without rebuilding, and unlocks if needed. startState records the stable status. The measured workflow is only Perps list -> state -> BTC detail.",
5
- "startState": {
6
- "action": "app.status",
7
- "intent": "Record the stable run start status after background-resume setup",
8
- "detail": "Read-only start-state marker after lifecycle and wallet setup have completed."
9
- },
10
- "validate": {
11
- "workflow": {
12
- "setup": [
13
- {
14
- "id": "background-app",
15
- "action": "app.lifecycle",
16
- "command": "background",
17
- "settle_ms": 3000,
18
- "intent": "Put the installed app in the background before measuring resume",
19
- "detail": "On Android this sends HOME to the selected device. On iOS simulator this foregrounds Settings through the shared outer adapter."
20
- },
21
- {
22
- "id": "foreground-app",
23
- "action": "app.lifecycle",
24
- "command": "foreground",
25
- "settle_ms": 15000,
26
- "intent": "Foreground the installed app through the Expo dev-client deep link",
27
- "detail": "Uses the selected device, Metro port, and installed package; it does not rebuild."
28
- },
29
- {
30
- "id": "ensure-unlocked",
31
- "action": "metamask.wallet.ensure_unlocked",
32
- "intent": "Unlock the wallet before timing the Perps journey",
33
- "detail": "Unlock only if the app is currently locked so the first measured node starts from a stable, signed-in state."
34
- }
35
- ],
36
- "entry": "open-perps-list",
37
- "nodes": {
38
- "open-perps-list": {
39
- "action": "ui.navigate",
40
- "page": "perps",
41
- "intent": "Open the Perps market list screen",
42
- "detail": "Navigate to the Perps markets list via the stable page alias; its node duration measures market-list render time.",
43
- "flow": "perps",
44
- "next": "read-positions"
45
- },
46
- "read-positions": {
47
- "action": "metamask.perps.read_positions",
48
- "intent": "Read the live Perps positions shown on the market list",
49
- "detail": "Read live Perps positions through the controller; its node duration measures how long live account state takes to resolve.",
50
- "flow": "perps",
51
- "next": "open-market-detail"
52
- },
53
- "open-market-detail": {
54
- "action": "ui.navigate",
55
- "page": "perps-market",
56
- "market": "BTC",
57
- "intent": "Open the BTC Perps market detail screen",
58
- "detail": "Navigate to the BTC market detail via the stable page alias; its node duration measures market-detail render time.",
59
- "flow": "perps",
60
- "next": "end"
61
- },
62
- "end": {
63
- "action": "end",
64
- "status": "pass",
65
- "intent": "Finish the background-resume Perps performance flow",
66
- "detail": "Terminal node; trace.json holds setup plus measured Perps node durations.",
67
- "flow": "complete"
68
- }
2
+ "$schema": "https://farmslot.io/schemas/recipe-v1.schema.json",
3
+ "title": "MetaMask Mobile Perps performance recipe background resume",
4
+ "description": "Measured Perps recipe from a deterministic background-resume state. The graph backgrounds and foregrounds the installed app without rebuilding, unlocks if needed, then records Perps list, state, and BTC detail timings.",
5
+ "workflow": {
6
+ "entry": "background-app",
7
+ "nodes": {
8
+ "open-perps-list": {
9
+ "action": "ui.navigate",
10
+ "page": "perps",
11
+ "intent": "Open the Perps market list screen",
12
+ "next": "read-positions"
13
+ },
14
+ "read-positions": {
15
+ "action": "metamask.perps.read_positions",
16
+ "intent": "Read the live Perps positions shown on the market list",
17
+ "next": "open-market-detail"
18
+ },
19
+ "open-market-detail": {
20
+ "action": "ui.navigate",
21
+ "page": "perps-market",
22
+ "market": "BTC",
23
+ "intent": "Open the BTC Perps market detail screen",
24
+ "next": "end"
25
+ },
26
+ "end": {
27
+ "action": "end",
28
+ "status": "pass"
29
+ },
30
+ "start-state": {
31
+ "action": "app.status",
32
+ "intent": "Record the stable run start status after background-resume setup",
33
+ "next": "open-perps-list"
34
+ },
35
+ "ensure-unlocked": {
36
+ "action": "metamask.wallet.ensure_unlocked",
37
+ "intent": "Unlock the wallet before timing the Perps journey",
38
+ "next": "start-state"
39
+ },
40
+ "foreground-app": {
41
+ "action": "app.lifecycle",
42
+ "command": "foreground",
43
+ "settle_ms": 15000,
44
+ "intent": "Foreground the installed app through the Expo dev-client deep link",
45
+ "next": "ensure-unlocked"
46
+ },
47
+ "background-app": {
48
+ "action": "app.lifecycle",
49
+ "command": "background",
50
+ "settle_ms": 3000,
51
+ "intent": "Put the installed app in the background before measuring resume",
52
+ "next": "foreground-app"
69
53
  }
70
54
  }
71
55
  }
@@ -1,71 +1,55 @@
1
1
  {
2
- "schema_version": 1,
3
- "title": "MetaMask Mobile Perps performance flow - cold process start",
4
- "description": "Measured Perps flow from a deterministic cold-process start state. Setup force-stops/terminates the installed app, relaunches it through the Expo dev-client deep link without rebuilding, and unlocks if needed. startState records the stable status. The measured workflow is only Perps list -> state -> BTC detail.",
5
- "startState": {
6
- "action": "app.status",
7
- "intent": "Record the stable run start status after cold-start setup",
8
- "detail": "Read-only start-state marker after lifecycle and wallet setup have completed."
9
- },
10
- "validate": {
11
- "workflow": {
12
- "setup": [
13
- {
14
- "id": "terminate-app",
15
- "action": "app.lifecycle",
16
- "command": "terminate",
17
- "settle_ms": 3000,
18
- "intent": "Terminate the installed app process before measuring cold start",
19
- "detail": "Uses adb force-stop on Android or simctl terminate on iOS simulator; it does not uninstall or rebuild."
20
- },
21
- {
22
- "id": "launch-app",
23
- "action": "app.lifecycle",
24
- "command": "launch",
25
- "settle_ms": 15000,
26
- "intent": "Launch the installed app through the Expo dev-client deep link",
27
- "detail": "Uses the selected device, Metro port, and installed package; it does not rebuild."
28
- },
29
- {
30
- "id": "ensure-unlocked",
31
- "action": "metamask.wallet.ensure_unlocked",
32
- "intent": "Unlock the wallet before timing the Perps journey",
33
- "detail": "Unlock only if the app is currently locked so the first measured node starts from a stable, signed-in state."
34
- }
35
- ],
36
- "entry": "open-perps-list",
37
- "nodes": {
38
- "open-perps-list": {
39
- "action": "ui.navigate",
40
- "page": "perps",
41
- "intent": "Open the Perps market list screen",
42
- "detail": "Navigate to the Perps markets list via the stable page alias; its node duration measures market-list render time.",
43
- "flow": "perps",
44
- "next": "read-positions"
45
- },
46
- "read-positions": {
47
- "action": "metamask.perps.read_positions",
48
- "intent": "Read the live Perps positions shown on the market list",
49
- "detail": "Read live Perps positions through the controller; its node duration measures how long live account state takes to resolve.",
50
- "flow": "perps",
51
- "next": "open-market-detail"
52
- },
53
- "open-market-detail": {
54
- "action": "ui.navigate",
55
- "page": "perps-market",
56
- "market": "BTC",
57
- "intent": "Open the BTC Perps market detail screen",
58
- "detail": "Navigate to the BTC market detail via the stable page alias; its node duration measures market-detail render time.",
59
- "flow": "perps",
60
- "next": "end"
61
- },
62
- "end": {
63
- "action": "end",
64
- "status": "pass",
65
- "intent": "Finish the cold-start Perps performance flow",
66
- "detail": "Terminal node; trace.json holds setup plus measured Perps node durations.",
67
- "flow": "complete"
68
- }
2
+ "$schema": "https://farmslot.io/schemas/recipe-v1.schema.json",
3
+ "title": "MetaMask Mobile Perps performance recipe cold process start",
4
+ "description": "Measured Perps recipe from a deterministic cold-process state. The graph terminates and relaunches the installed app without rebuilding, unlocks if needed, then records Perps list, state, and BTC detail timings.",
5
+ "workflow": {
6
+ "entry": "terminate-app",
7
+ "nodes": {
8
+ "open-perps-list": {
9
+ "action": "ui.navigate",
10
+ "page": "perps",
11
+ "intent": "Open the Perps market list screen",
12
+ "next": "read-positions"
13
+ },
14
+ "read-positions": {
15
+ "action": "metamask.perps.read_positions",
16
+ "intent": "Read the live Perps positions shown on the market list",
17
+ "next": "open-market-detail"
18
+ },
19
+ "open-market-detail": {
20
+ "action": "ui.navigate",
21
+ "page": "perps-market",
22
+ "market": "BTC",
23
+ "intent": "Open the BTC Perps market detail screen",
24
+ "next": "end"
25
+ },
26
+ "end": {
27
+ "action": "end",
28
+ "status": "pass"
29
+ },
30
+ "start-state": {
31
+ "action": "app.status",
32
+ "intent": "Record the stable run start status after cold-start setup",
33
+ "next": "open-perps-list"
34
+ },
35
+ "ensure-unlocked": {
36
+ "action": "metamask.wallet.ensure_unlocked",
37
+ "intent": "Unlock the wallet before timing the Perps journey",
38
+ "next": "start-state"
39
+ },
40
+ "launch-app": {
41
+ "action": "app.lifecycle",
42
+ "command": "launch",
43
+ "settle_ms": 15000,
44
+ "intent": "Launch the installed app through the Expo dev-client deep link",
45
+ "next": "ensure-unlocked"
46
+ },
47
+ "terminate-app": {
48
+ "action": "app.lifecycle",
49
+ "command": "terminate",
50
+ "settle_ms": 3000,
51
+ "intent": "Terminate the installed app process before measuring cold start",
52
+ "next": "launch-app"
69
53
  }
70
54
  }
71
55
  }
@@ -1,55 +1,41 @@
1
1
  {
2
- "schema_version": 1,
3
- "title": "MetaMask Mobile Perps performance flow",
4
- "description": "Canonical measured flow for MetaMask Mobile Perps: setup unlocks the wallet, startState records the stable status, then the measured workflow opens the Perps market list, reads live state, and opens a market detail. Timings live in trace.json as each node's duration; there is no built-in benchmark verb. Run pinned so numbers are comparable: `mm-harness run perps.performance --device <serial> --heal off`. Optional testnet order placement is intentionally omitted because a live order would make the flow destructive and non-repeatable; add metamask.perps.place_order + close in a personal copy when you want to measure the trade path.",
5
- "startState": {
6
- "action": "app.status",
7
- "intent": "Record the stable run start status after wallet setup",
8
- "detail": "Read-only start-state marker so every trace states the adapter, checkout shape, and runner compatibility before measured Perps actions."
9
- },
10
- "validate": {
11
- "workflow": {
12
- "setup": [
13
- {
14
- "id": "ensure-unlocked",
15
- "action": "metamask.wallet.ensure_unlocked",
16
- "intent": "Unlock the wallet before timing the Perps journey",
17
- "detail": "Unlock only if the app is currently locked so the first measured node starts from a stable, signed-in state."
18
- }
19
- ],
20
- "entry": "open-perps-list",
21
- "nodes": {
22
- "open-perps-list": {
23
- "action": "ui.navigate",
24
- "page": "perps",
25
- "intent": "Open the Perps market list screen",
26
- "detail": "Navigate to the Perps markets list via the stable page alias; its node duration measures market-list render time.",
27
- "flow": "perps",
28
- "next": "read-positions"
29
- },
30
- "read-positions": {
31
- "action": "metamask.perps.read_positions",
32
- "intent": "Read the live Perps positions shown on the market list",
33
- "detail": "Read live Perps positions through the controller; its node duration measures how long live account state takes to resolve. Mobile has no read_markets action, so read_positions is the canonical read of on-screen live state.",
34
- "flow": "perps",
35
- "next": "open-market-detail"
36
- },
37
- "open-market-detail": {
38
- "action": "ui.navigate",
39
- "page": "perps-market",
40
- "market": "BTC",
41
- "intent": "Open the BTC Perps market detail screen",
42
- "detail": "Navigate to the BTC market detail via the stable page alias; its node duration measures market-detail render time.",
43
- "flow": "perps",
44
- "next": "end"
45
- },
46
- "end": {
47
- "action": "end",
48
- "status": "pass",
49
- "intent": "Finish the measured Perps performance flow",
50
- "detail": "Terminal node; the passing run's trace.json holds the setup, startState, and measured per-node durations to diff across runs.",
51
- "flow": "complete"
52
- }
2
+ "$schema": "https://farmslot.io/schemas/recipe-v1.schema.json",
3
+ "title": "MetaMask Mobile Perps performance recipe",
4
+ "description": "Canonical measured MetaMask Mobile Perps recipe. The graph unlocks the wallet, records stable status, opens the market list, reads live state, and opens market detail. Timings live in trace.json. Run pinned so numbers are comparable: `mm-harness run perps.performance --device <serial> --heal off`. Testnet order placement is omitted to keep the recipe repeatable and non-destructive.",
5
+ "workflow": {
6
+ "entry": "ensure-unlocked",
7
+ "nodes": {
8
+ "open-perps-list": {
9
+ "action": "ui.navigate",
10
+ "page": "perps",
11
+ "intent": "Open the Perps market list screen",
12
+ "next": "read-positions"
13
+ },
14
+ "read-positions": {
15
+ "action": "metamask.perps.read_positions",
16
+ "intent": "Read the live Perps positions shown on the market list",
17
+ "next": "open-market-detail"
18
+ },
19
+ "open-market-detail": {
20
+ "action": "ui.navigate",
21
+ "page": "perps-market",
22
+ "market": "BTC",
23
+ "intent": "Open the BTC Perps market detail screen",
24
+ "next": "end"
25
+ },
26
+ "end": {
27
+ "action": "end",
28
+ "status": "pass"
29
+ },
30
+ "start-state": {
31
+ "action": "app.status",
32
+ "intent": "Record the stable run start status after wallet setup",
33
+ "next": "open-perps-list"
34
+ },
35
+ "ensure-unlocked": {
36
+ "action": "metamask.wallet.ensure_unlocked",
37
+ "intent": "Unlock the wallet before timing the Perps journey",
38
+ "next": "start-state"
53
39
  }
54
40
  }
55
41
  }
@@ -1,63 +1,48 @@
1
1
  {
2
- "schema_version": 1,
3
- "title": "MetaMask Mobile Perps performance flow - warm foreground start",
4
- "description": "Measured Perps flow from a deterministic warm-foreground start state. Setup foregrounds the already installed app through the Expo dev-client deep link without rebuilding and unlocks if needed. startState records the stable status. The measured workflow is only Perps list -> state -> BTC detail.",
5
- "startState": {
6
- "action": "app.status",
7
- "intent": "Record the stable run start status after warm foreground setup",
8
- "detail": "Read-only start-state marker after lifecycle and wallet setup have completed."
9
- },
10
- "validate": {
11
- "workflow": {
12
- "setup": [
13
- {
14
- "id": "foreground-app",
15
- "action": "app.lifecycle",
16
- "command": "foreground",
17
- "settle_ms": 10000,
18
- "intent": "Foreground the installed app through the Expo dev-client deep link",
19
- "detail": "Uses the selected device, Metro port, and installed package; it does not rebuild."
20
- },
21
- {
22
- "id": "ensure-unlocked",
23
- "action": "metamask.wallet.ensure_unlocked",
24
- "intent": "Unlock the wallet before timing the Perps journey",
25
- "detail": "Unlock only if the app is currently locked so the first measured node starts from a stable, signed-in state."
26
- }
27
- ],
28
- "entry": "open-perps-list",
29
- "nodes": {
30
- "open-perps-list": {
31
- "action": "ui.navigate",
32
- "page": "perps",
33
- "intent": "Open the Perps market list screen",
34
- "detail": "Navigate to the Perps markets list via the stable page alias; its node duration measures market-list render time.",
35
- "flow": "perps",
36
- "next": "read-positions"
37
- },
38
- "read-positions": {
39
- "action": "metamask.perps.read_positions",
40
- "intent": "Read the live Perps positions shown on the market list",
41
- "detail": "Read live Perps positions through the controller; its node duration measures how long live account state takes to resolve.",
42
- "flow": "perps",
43
- "next": "open-market-detail"
44
- },
45
- "open-market-detail": {
46
- "action": "ui.navigate",
47
- "page": "perps-market",
48
- "market": "BTC",
49
- "intent": "Open the BTC Perps market detail screen",
50
- "detail": "Navigate to the BTC market detail via the stable page alias; its node duration measures market-detail render time.",
51
- "flow": "perps",
52
- "next": "end"
53
- },
54
- "end": {
55
- "action": "end",
56
- "status": "pass",
57
- "intent": "Finish the warm-start Perps performance flow",
58
- "detail": "Terminal node; trace.json holds setup plus measured Perps node durations.",
59
- "flow": "complete"
60
- }
2
+ "$schema": "https://farmslot.io/schemas/recipe-v1.schema.json",
3
+ "title": "MetaMask Mobile Perps performance recipe warm foreground start",
4
+ "description": "Measured Perps recipe from a deterministic warm foreground state. The graph foregrounds the installed app without rebuilding, unlocks if needed, then records Perps list, state, and BTC detail timings.",
5
+ "workflow": {
6
+ "entry": "foreground-app",
7
+ "nodes": {
8
+ "open-perps-list": {
9
+ "action": "ui.navigate",
10
+ "page": "perps",
11
+ "intent": "Open the Perps market list screen",
12
+ "next": "read-positions"
13
+ },
14
+ "read-positions": {
15
+ "action": "metamask.perps.read_positions",
16
+ "intent": "Read the live Perps positions shown on the market list",
17
+ "next": "open-market-detail"
18
+ },
19
+ "open-market-detail": {
20
+ "action": "ui.navigate",
21
+ "page": "perps-market",
22
+ "market": "BTC",
23
+ "intent": "Open the BTC Perps market detail screen",
24
+ "next": "end"
25
+ },
26
+ "end": {
27
+ "action": "end",
28
+ "status": "pass"
29
+ },
30
+ "start-state": {
31
+ "action": "app.status",
32
+ "intent": "Record the stable run start status after warm foreground setup",
33
+ "next": "open-perps-list"
34
+ },
35
+ "ensure-unlocked": {
36
+ "action": "metamask.wallet.ensure_unlocked",
37
+ "intent": "Unlock the wallet before timing the Perps journey",
38
+ "next": "start-state"
39
+ },
40
+ "foreground-app": {
41
+ "action": "app.lifecycle",
42
+ "command": "foreground",
43
+ "settle_ms": 10000,
44
+ "intent": "Foreground the installed app through the Expo dev-client deep link",
45
+ "next": "ensure-unlocked"
61
46
  }
62
47
  }
63
48
  }