@deeeed/metamask-harness 0.40.0 → 0.41.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 (39) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/adapters/manifest.json +8 -0
  3. package/adapters/mobile/bridge-runtime/cdp-bridge.cjs +5 -4
  4. package/adapters/mobile/bridge-runtime/lib/target-discovery.cjs +24 -5
  5. package/adapters/mobile/metro-config.cjs +94 -0
  6. package/adapters/mobile/start-metro.sh +13 -1
  7. package/dist/commands/device-target.js +3 -0
  8. package/dist/commands/run-engine.js +4 -14
  9. package/dist/funding-execution-context.js +35 -28
  10. package/dist/heal-bounds.js +1 -0
  11. package/dist/live-adapter-contract.js +2 -1
  12. package/dist/mm-harness-cli.js +1 -1
  13. package/docs/RECIPES.md +25 -19
  14. package/library/actions/extension/perps/mutation-receipt.mjs +12 -8
  15. package/library/actions/extension/perps/select_activity_filter.mjs +1 -1
  16. package/library/actions/extension/perps/select_market_filter.mjs +1 -1
  17. package/library/actions/mobile/perps/capture_performance.mjs +2 -2
  18. package/library/actions/mobile/perps/performance-capture.mjs +375 -17
  19. package/library/actions/mobile/perps/perps.mjs +56 -10
  20. package/library/actions/mobile/platform/bridge.mjs +59 -1
  21. package/library/actions/mobile/wallet/ensure_unlocked.mjs +60 -26
  22. package/library/actions/mobile/wallet/import.mjs +2 -0
  23. package/library/actions/mobile/wallet/select_account.mjs +21 -2
  24. package/library/manifests/mobile.action-manifest.json +47 -6
  25. package/library/recipes/mobile/perps/performance.recipe.json +680 -26
  26. package/package.json +1 -1
  27. package/library/recipes/mobile/perps/performance.background-resume.recipe.json +0 -56
  28. package/library/recipes/mobile/perps/performance.cold-start.recipe.json +0 -56
  29. package/library/recipes/mobile/perps/performance.homepage.android-background-reconnect.recipe.json +0 -159
  30. package/library/recipes/mobile/perps/performance.homepage.android-background-short.recipe.json +0 -157
  31. package/library/recipes/mobile/perps/performance.homepage.android-cold-disk-cache.recipe.json +0 -165
  32. package/library/recipes/mobile/perps/performance.homepage.android-cold-no-cache.recipe.json +0 -139
  33. package/library/recipes/mobile/perps/performance.homepage.android-network-recovery.recipe.json +0 -149
  34. package/library/recipes/mobile/perps/performance.homepage.cold-position-sample.recipe.json +0 -120
  35. package/library/recipes/mobile/perps/performance.homepage.ios-background-reconnect.recipe.json +0 -111
  36. package/library/recipes/mobile/perps/performance.homepage.ios-background-short.recipe.json +0 -108
  37. package/library/recipes/mobile/perps/performance.homepage.ios-cold-disk-cache.recipe.json +0 -122
  38. package/library/recipes/mobile/perps/performance.homepage.ios-cold-no-cache.recipe.json +0 -95
  39. package/library/recipes/mobile/perps/performance.warm-start.recipe.json +0 -49
@@ -1,122 +0,0 @@
1
- {
2
- "$schema": "https://farmslot.io/schemas/recipe-v1.schema.json",
3
- "title": "iOS Homepage Perps cold disk-cache proof",
4
- "description": "Warms the Perps disk cache without creating exchange state, restarts the assigned iOS app, and validates disk hydration plus fresh trending content at the visible Homepage endpoint.",
5
- "workflow": {
6
- "entry": "ensure-wallet",
7
- "nodes": {
8
- "ensure-wallet": {
9
- "action": "metamask.wallet.ensure_unlocked",
10
- "intent": "Use the existing simulator fixture",
11
- "next": "open-wallet-home-before"
12
- },
13
- "open-wallet-home-before": {
14
- "action": "ui.navigate",
15
- "page": "home",
16
- "intent": "Open Wallet Home so current Perps streams are cached",
17
- "timeout_ms": 30000,
18
- "next": "wait-perps-before"
19
- },
20
- "wait-perps-before": {
21
- "action": "ui.wait_for",
22
- "test_id": "homepage-section-title-perps",
23
- "expected": "present",
24
- "intent": "Require Perps content before restart",
25
- "timeout_ms": 30000,
26
- "next": "show-perps-before"
27
- },
28
- "show-perps-before": {
29
- "action": "ui.scroll",
30
- "test_id": "homepage-section-title-perps",
31
- "scroll_into_view": true,
32
- "animated": true,
33
- "settle": true,
34
- "intent": "Make current Perps data visible and cacheable",
35
- "timeout_ms": 30000,
36
- "next": "warm-disk-cache"
37
- },
38
- "warm-disk-cache": {
39
- "action": "wait",
40
- "duration_ms": 2500,
41
- "intent": "Allow persisted stream cache writes to settle",
42
- "next": "start-performance-capture"
43
- },
44
- "start-performance-capture": {
45
- "action": "metamask.perps.capture_performance",
46
- "phase": "start",
47
- "intent": "Start evidence before cold process restart",
48
- "next": "restart-app"
49
- },
50
- "restart-app": {
51
- "action": "app.lifecycle",
52
- "command": "restart",
53
- "settle_ms": 15000,
54
- "runtime_ready_timeout_ms": 60000,
55
- "intent": "Cold-restart while preserving persisted app data",
56
- "next": "unlock-after-restart"
57
- },
58
- "unlock-after-restart": {
59
- "action": "metamask.wallet.ensure_unlocked",
60
- "intent": "Restore the same fixture after cold launch",
61
- "next": "open-wallet-home-after"
62
- },
63
- "open-wallet-home-after": {
64
- "action": "ui.navigate",
65
- "page": "home",
66
- "intent": "Return to Wallet Home after disk hydration",
67
- "timeout_ms": 30000,
68
- "next": "wait-perps-after"
69
- },
70
- "wait-perps-after": {
71
- "action": "ui.wait_for",
72
- "test_id": "homepage-section-title-perps",
73
- "expected": "present",
74
- "intent": "Require the Perps section after cold launch",
75
- "timeout_ms": 30000,
76
- "next": "show-perps-after"
77
- },
78
- "show-perps-after": {
79
- "action": "ui.scroll",
80
- "test_id": "homepage-section-title-perps",
81
- "scroll_into_view": true,
82
- "animated": true,
83
- "settle": true,
84
- "intent": "Bring disk-hydrated/fresh content into the viewport",
85
- "timeout_ms": 30000,
86
- "next": "capture-after"
87
- },
88
- "capture-after": {
89
- "action": "ui.screenshot",
90
- "path": "screenshots/ios-homepage-perps-cold-disk-cache.png",
91
- "intent": "Preserve visible cold disk-cache content",
92
- "next": "settle-frame"
93
- },
94
- "settle-frame": {
95
- "action": "wait",
96
- "duration_ms": 2500,
97
- "intent": "Allow the visible next-frame checkpoint to finish",
98
- "next": "finish-performance-capture"
99
- },
100
- "finish-performance-capture": {
101
- "action": "metamask.perps.capture_performance",
102
- "phase": "end",
103
- "required_stages": [
104
- "disk_cache_hydrated",
105
- "viewport_demand",
106
- "socket_received",
107
- "react_commit",
108
- "next_frame_checkpoint"
109
- ],
110
- "required_lifecycles": ["cold_disk_cache"],
111
- "required_sources": ["disk_cache", "fresh_socket"],
112
- "required_fresh_content_variants": ["trending"],
113
- "intent": "Require cold disk hydration and fresh visible content",
114
- "next": "done"
115
- },
116
- "done": {
117
- "action": "end",
118
- "status": "pass"
119
- }
120
- }
121
- }
122
- }
@@ -1,95 +0,0 @@
1
- {
2
- "$schema": "https://farmslot.io/schemas/recipe-v1.schema.json",
3
- "title": "iOS Homepage Perps cold start without cache proof",
4
- "description": "Clears only Perps performance caches, restarts the assigned iOS app without replacing wallet state, and validates fresh trending content at the visible Homepage endpoint.",
5
- "workflow": {
6
- "entry": "ensure-wallet",
7
- "nodes": {
8
- "ensure-wallet": {
9
- "action": "metamask.wallet.ensure_unlocked",
10
- "intent": "Preserve and unlock the existing simulator fixture",
11
- "next": "start-performance-capture"
12
- },
13
- "start-performance-capture": {
14
- "action": "metamask.perps.capture_performance",
15
- "phase": "start",
16
- "intent": "Start evidence before cache removal and process restart",
17
- "next": "clear-perps-caches"
18
- },
19
- "clear-perps-caches": {
20
- "action": "metamask.perps.clear_performance_caches",
21
- "intent": "Remove only Perps persisted market and user snapshots",
22
- "next": "restart-app"
23
- },
24
- "restart-app": {
25
- "action": "app.lifecycle",
26
- "command": "restart",
27
- "settle_ms": 15000,
28
- "runtime_ready_timeout_ms": 60000,
29
- "intent": "Cold-restart the assigned iOS app without deleting wallet state",
30
- "next": "unlock-after-restart"
31
- },
32
- "unlock-after-restart": {
33
- "action": "metamask.wallet.ensure_unlocked",
34
- "intent": "Restore the same fixture after the cold process launch",
35
- "next": "open-wallet-home"
36
- },
37
- "open-wallet-home": {
38
- "action": "ui.navigate",
39
- "page": "home",
40
- "intent": "Open Wallet Home after the no-cache cold launch",
41
- "timeout_ms": 30000,
42
- "next": "wait-perps-section"
43
- },
44
- "wait-perps-section": {
45
- "action": "ui.wait_for",
46
- "test_id": "homepage-perps-positions",
47
- "expected": "present",
48
- "intent": "Require the selected account's Perps position after cold launch",
49
- "timeout_ms": 30000,
50
- "next": "show-perps-section"
51
- },
52
- "show-perps-section": {
53
- "action": "ui.scroll",
54
- "test_id": "homepage-perps-positions",
55
- "scroll_into_view": true,
56
- "animated": true,
57
- "settle": true,
58
- "intent": "Bring fresh Perps content into the viewport",
59
- "timeout_ms": 30000,
60
- "next": "capture-after"
61
- },
62
- "capture-after": {
63
- "action": "ui.screenshot",
64
- "path": "screenshots/ios-homepage-perps-cold-no-cache.png",
65
- "intent": "Preserve visible cold-no-cache content",
66
- "next": "settle-frame"
67
- },
68
- "settle-frame": {
69
- "action": "wait",
70
- "duration_ms": 2500,
71
- "intent": "Allow the visible next-frame checkpoint to finish",
72
- "next": "finish-performance-capture"
73
- },
74
- "finish-performance-capture": {
75
- "action": "metamask.perps.capture_performance",
76
- "phase": "end",
77
- "required_stages": [
78
- "viewport_demand",
79
- "socket_received",
80
- "react_commit",
81
- "next_frame_checkpoint"
82
- ],
83
- "required_lifecycles": ["cold_no_cache"],
84
- "required_sources": ["fresh_socket"],
85
- "required_fresh_content_variants": ["positions"],
86
- "intent": "Require cold-no-cache lifecycle and the fresh visible position",
87
- "next": "done"
88
- },
89
- "done": {
90
- "action": "end",
91
- "status": "pass"
92
- }
93
- }
94
- }
95
- }
@@ -1,49 +0,0 @@
1
- {
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"
46
- }
47
- }
48
- }
49
- }