@deeeed/metamask-harness 0.47.0 → 0.47.2

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.
@@ -1,697 +0,0 @@
1
- <!DOCTYPE html>
2
- <html lang="en">
3
- <head>
4
- <meta charset="utf-8">
5
- <meta name="viewport" content="width=device-width, initial-scale=1">
6
- <title>How it works — proving a change with a recipe</title>
7
- <meta name="description" content="How a recipe proves a change on a real MetaMask build, checks itself before handoff, and stays behind as a regression guard. The full walkthrough, step by step.">
8
- <link rel="icon" href="assets/metamask-fox.svg" type="image/svg+xml">
9
- <link rel="stylesheet" href="assets/style.css?v=4">
10
- </head>
11
- <body data-progress-page="start">
12
- <a class="skip" href="#steps">Skip to the walkthrough</a>
13
-
14
- <header class="topbar">
15
- <div class="wrap topbar-inner">
16
- <a class="brand" href="index.html">
17
- <img class="brand-mark" src="assets/metamask-fox.svg" alt="" width="22" height="22">
18
- <span class="brand-name">recipes</span>
19
- </a>
20
- <nav class="nav" aria-label="Main">
21
- <a class="nav-cta" href="index.html#prompt">Quick start</a>
22
- <a href="how-it-works.html" aria-current="page">How it works</a>
23
- <a href="perps.html">Team / Perps</a>
24
- <a href="cheatsheet.html">Cheatsheet</a>
25
- <a href="architecture.html">Architecture</a>
26
- <a href="tutorials/index.html">Tutorials</a>
27
- </nav>
28
- </div>
29
- </header>
30
-
31
- <div class="progress-rail">
32
- <div class="wrap progress-inner">
33
- <div class="progress-track" role="progressbar" aria-label="Walkthrough progress" aria-valuemin="0" aria-valuemax="100" aria-valuenow="0">
34
- <div class="progress-fill"></div>
35
- </div>
36
- <span class="progress-label">0/8 steps</span>
37
- <button type="button" class="progress-reset">Reset</button>
38
- </div>
39
- </div>
40
-
41
- <main>
42
- <section class="wrap hero">
43
- <span class="eyebrow">How it works</span>
44
- <h1>How a recipe earns trust.</h1>
45
- <p class="lede">
46
- A recipe is a graph of typed actions run against a real MetaMask build — Extension, Mobile, or
47
- Core. It runs while the change is being written, so the work is proven as it is made rather than
48
- hoped about and checked at the end. <code>mm-harness</code> is the runner. Everything below, in
49
- order.
50
- </p>
51
- <div class="hero-meta">
52
- <span>requires mm-harness 0.34+</span>
53
- <span>~20 minutes</span>
54
- <span>progress saves in this browser</span>
55
- </div>
56
- <p style="margin-top:.9rem;opacity:.7;font-size:.9rem;max-width:60ch">
57
- A proposal for how agents can code at MetaMask — offered for teams to try.
58
- </p>
59
- </section>
60
-
61
- <section class="wrap">
62
- <div class="note plain">
63
- <span class="note-title">Rather hand it to your agent?</span>
64
- <p style="margin-bottom:0">
65
- The <a href="index.html">front page</a> carries one prompt that goes further than this page:
66
- it sets up the harness and the skills, then drives a real ticket through one.
67
- </p>
68
- </div>
69
- </section>
70
-
71
- <section class="wrap">
72
- <h2 id="why">Why a recipe</h2>
73
- <p>
74
- <strong>Proof, as the change is made.</strong> The agent drives a real build, asserts what should
75
- be true, and leaves a trace: which actions ran, what they returned, how many times. On-device
76
- evidence, produced while the work is happening.
77
- </p>
78
- <p>
79
- <strong>Self-checked in the same context.</strong> Replaying a recipe needs no fresh session, no
80
- human, and no wait for CI. The agent does it mid-task, in the context it made the change in — so a
81
- broken step surfaces while it is still cheap to fix.
82
- </p>
83
- <p>
84
- <strong>Prevents regressions.</strong> The recipe outlives the change it was written for. Every
85
- later change has to pass it too, so the same bug cannot quietly come back: a one-time check becomes
86
- a permanent guard.
87
- </p>
88
- <p>
89
- <strong>Trust.</strong> Proven, self-checked, and still proving — so the change is trustworthy
90
- while it is being built, not hoped about and verified afterwards. Everything downstream, review
91
- included, inherits that.
92
- </p>
93
- </section>
94
-
95
- <section class="wrap">
96
- <h2 id="fit">How it fits your work</h2>
97
- <p>
98
- You use this through the skills. A <strong>skill</strong> is the interface — the packaged workflow
99
- an agent follows to fix a bug, build a feature, or review a pull request. The skill calls
100
- <code>mm-harness</code> underneath, and what the harness runs is a <strong>recipe</strong>: the
101
- executable proof that drives a real build, asserts, and leaves the evidence.
102
- </p>
103
- <p>You do not add proof to your work. Working through a skill is what produces it.</p>
104
-
105
- <p class="stack-caption">Top is how you interact; each layer calls the one below.</p>
106
- <div class="stack">
107
- <div class="layer layer-static">
108
- <span class="layer-n">1</span>
109
- <span class="layer-name">Skills</span>
110
- <span class="layer-sub">how you use it — fix a bug, build a feature, review a PR</span>
111
- </div>
112
- <div class="arrow" aria-hidden="true">↓</div>
113
- <div class="layer layer-static">
114
- <span class="layer-n">2</span>
115
- <span class="layer-name">mm-harness</span>
116
- <span class="layer-sub">what the skill calls underneath</span>
117
- </div>
118
- <div class="arrow" aria-hidden="true">↓</div>
119
- <div class="layer layer-static">
120
- <span class="layer-n">3</span>
121
- <span class="layer-name">Recipe</span>
122
- <span class="layer-sub">what the harness runs — on-device proof, kept as a regression guard</span>
123
- </div>
124
- </div>
125
-
126
- <p>
127
- So what you are adopting is not a testing tool. It is a way of working where the proof comes out
128
- of doing the work rather than out of a separate step afterwards.
129
- </p>
130
- <p>
131
- Skills come from two sources: the public <code>MetaMask/skills</code> repo, and the internal
132
- <code>Consensys/skills</code> overlay, which needs access to that org. Both are cloned locally and
133
- installed per checkout with <code>yarn skills</code>. You can drive the harness directly — the
134
- walkthrough below does, and uses no skill — but skills are the path day to day.
135
- <a href="architecture.html#stack">The full stack is on Architecture.</a>
136
- </p>
137
- </section>
138
-
139
- <section class="wrap">
140
- <h2 id="model">Two words</h2>
141
- <p>
142
- An <strong>action</strong> is one typed operation: unlock the wallet, press a button, read the
143
- account state. A <strong>recipe</strong> is a JSON graph of actions. The steps below follow
144
- <strong>discover → drive → prove</strong>, which is also the order you will work in from here on.
145
- <code>mm-harness</code> is the runner, and it implements a versioned recipe specification —
146
- <a href="architecture.html#spec">see Architecture</a>.
147
- </p>
148
-
149
- <div class="doctrine">
150
- <p>
151
- <span class="k">You never guess capabilities — you discover them.</span>
152
- <code>mm-harness actions</code> prints what this checkout can do, and that list is law. The tool
153
- refuses an invented action rather than improvising one, which is why its output is worth
154
- trusting.
155
- </p>
156
- </div>
157
- </section>
158
-
159
- <section class="wrap">
160
- <h2 id="steps">The walkthrough, step by step</h2>
161
- <p>Each piece on its own, from an empty terminal to an evidence bundle. Checkboxes persist in this browser, so you can close the tab and come back.</p>
162
-
163
- <ol class="steps">
164
-
165
- <li class="step" data-step="install">
166
- <div class="step-head">
167
- <input type="checkbox" class="step-check" id="c-install" aria-labelledby="t-install">
168
- <h3 class="step-title" id="t-install">Get the CLI</h3>
169
- </div>
170
- <p class="step-why">Both paths end with <code>mm-harness</code> on your PATH.</p>
171
-
172
- <div class="grid grid-2" style="margin:1.2rem 0">
173
- <div class="path-card">
174
- <div class="path-tag">Path A — from zero</div>
175
- <h4 style="margin:0 0 .5rem">No checkout yet</h4>
176
- <p style="font-size:.92rem;color:var(--text-dim)">
177
- Install below, then <code>mm-harness setup-base</code> clones the MetaMask product repos
178
- into one standard layout and runs each repo's own dependency install. Use
179
- <code>--dry-run</code> first to see the layout it would create.
180
- </p>
181
- <p style="margin-bottom:0"><span class="badge live">available now</span></p>
182
- </div>
183
- <div class="path-card">
184
- <div class="path-tag">Path B — you already have a checkout</div>
185
- <h4 style="margin:0 0 .5rem">Install and cd in</h4>
186
- <p style="font-size:.92rem;color:var(--text-dim)">
187
- Install globally, then work from inside the checkout. The product, ports, and runtime paths
188
- are detected from where you are standing; there is no config file to write.
189
- </p>
190
- <p style="margin-bottom:0"><span class="badge live">available now</span></p>
191
- </div>
192
- </div>
193
-
194
- <div class="cmd"><pre><code><span class="p">$ </span>npm i -g @deeeed/metamask-harness@latest
195
- <span class="p">$ </span>mm-harness --version</code></pre></div>
196
-
197
- <div class="note plain">
198
- <span class="note-title">Why @deeeed?</span>
199
- <p>Arthur publishes the pre-1.0 builds from his personal npm scope while MetaMask teams validate the workflows. Version 1.0 will move to a MetaMask-owned npm package.</p>
200
- </div>
201
-
202
- <div class="out-label">Expected</div>
203
- <div class="out">0.34.x <span class="dim">— any 0.34 or newer</span></div>
204
-
205
- <p class="step-why">Everything from here runs inside a product checkout:</p>
206
- <div class="cmd"><pre><code><span class="p">$ </span>cd ~/dev/metamask/metamask-extension <span class="dim"># or metamask-mobile, or core</span></code></pre></div>
207
-
208
- <details class="fail">
209
- <summary>If it fails</summary>
210
- <div class="fail-body">
211
- <p>
212
- <strong><code>mm-harness: command not found</code></strong> — your global npm bin is not on
213
- PATH. <code>npm prefix -g</code> prints the global prefix; add its <code>bin</code>
214
- directory to your shell profile.
215
- </p>
216
- <p>
217
- <strong>Older than 0.34</strong> — a stale global install is the most common source of
218
- "the docs don't match my terminal". Run <code>mm-harness update</code>, or
219
- <code>update --check</code> to look without installing.
220
- </p>
221
- </div>
222
- </details>
223
- </li>
224
-
225
- <li class="step" data-step="doctor">
226
- <div class="step-head">
227
- <input type="checkbox" class="step-check" id="c-doctor" aria-labelledby="t-doctor">
228
- <h3 class="step-title" id="t-doctor">Run doctor — and learn to read the errors</h3>
229
- </div>
230
- <p class="step-why">
231
- A read-only readiness check that launches nothing and names the exact command that fixes each
232
- finding.
233
- </p>
234
-
235
- <div class="cmd"><pre><code><span class="p">$ </span>mm-harness doctor</code></pre></div>
236
-
237
- <div class="out-label">Expected — a checkout that needs one repair</div>
238
- <div class="out"><span class="ok">pass</span> extension bridge present manifest=…/extension.action-manifest.json
239
- harness: @deeeed/metamask-harness@0.34.x
240
- runtime: decision=install (deps-missing) deps=missing webpack=down
241
- Dependencies are not installed (no yarn install-state markers).
242
- runtime-context: temp/recipe/runtime/agentic-runtime.json (<span class="bad">absent</span> — run mm-harness doctor --fix)
243
- capture: <span class="ok">pass</span> (screenshots: capture-helper → cdp; video: capture-helper)
244
- <span class="hint">Next: mm-harness launch --adapter extension --target '…'</span></div>
245
-
246
- <div class="note">
247
- <span class="note-title">The habit the toolchain is built around</span>
248
- <p>
249
- Every failure names one next action. Above, the finding tells you to run
250
- <code>doctor --fix</code> and the <code>Next:</code> line says where to go once it passes.
251
- Read the message and do what it says — that is also what lets an agent recover on its own
252
- instead of guessing.
253
- </p>
254
- </div>
255
-
256
- <p class="step-why">Do what it said:</p>
257
- <div class="cmd"><pre><code><span class="p">$ </span>mm-harness doctor --fix</code></pre></div>
258
-
259
- <div class="out-label">Expected — the finding is gone</div>
260
- <div class="out"><span class="ok">pass</span> extension bridge present ready=true <span class="ok">fixed=[runtime-context]</span> failed=[]</div>
261
-
262
- <p class="step-why">
263
- <code>--fix</code> repairs runtime state the harness owns. It will not launch the app, invent
264
- credentials, or pick a wallet fixture; those are your decisions, so it stops and asks.
265
- </p>
266
-
267
- <details class="fail">
268
- <summary>If it fails</summary>
269
- <div class="fail-body">
270
- <p>
271
- <strong><code>deps=missing</code></strong> — run <code>yarn install</code> as usual for
272
- that repo. The harness does not manage your product repo's dependencies.
273
- </p>
274
- <p>
275
- <strong>A finding you do not understand</strong> — <code>mm-harness doctor --json</code>
276
- carries the same findings with structured detail, and is the form to paste to an agent or a
277
- bug report.
278
- </p>
279
- <p>
280
- <strong>Still failing after <code>--fix</code></strong> — <code>fixed=[…] failed=[…]</code>
281
- separates the two. Anything in <code>failed</code> needs a human decision; the finding says
282
- which.
283
- </p>
284
- </div>
285
- </details>
286
- </li>
287
-
288
- <li class="step" data-step="launch">
289
- <div class="step-head">
290
- <input type="checkbox" class="step-check" id="c-launch" aria-labelledby="t-launch">
291
- <h3 class="step-title" id="t-launch">Launch the app under harness control</h3>
292
- </div>
293
- <p class="step-why">
294
- Starts the app and its dev server, installing the runtime overlay first if missing. Platform is
295
- auto-detected. On iOS, pin one simulator UUID through provisioning and launch so duplicate device
296
- names cannot select different simulators.
297
- </p>
298
-
299
- <div class="cmd"><pre><code><span class="p">$ </span>mm-harness launch --verify <span class="dim"># extension — fullscreen by default</span>
300
- <span class="p">$ </span>xcrun simctl list devices available <span class="dim"># choose one iPhone UUID</span>
301
- <span class="p">$ </span>mm-harness provision runway ios --device '&lt;UUID&gt;' --force
302
- <span class="p">$ </span>xcrun simctl get_app_container '&lt;UUID&gt;' io.metamask.MetaMask app
303
- <span class="p">$ </span>mm-harness launch ios --device '&lt;UUID&gt;' --verify
304
- <span class="p">$ </span>mm-harness launch android --verify</code></pre></div>
305
-
306
- <p class="step-why">
307
- Quick relaunch is the default and reuses a healthy runtime. <code>--build</code> is the escape
308
- hatch that always clean-builds; reach for it only when native or bundler output changed.
309
- </p>
310
-
311
- <div class="out-label">Core is headless — and says so</div>
312
- <div class="out"><span class="bad">✗</span> mm-harness launch: core is headless; there is nothing to launch.
313
- <span class="hint">Next: mm-harness verify</span></div>
314
- <p class="step-why">
315
- In <code>core</code> there is no UI to launch, so you get the equivalent step instead of a
316
- silent failure. Run <code>mm-harness verify</code> and continue.
317
- </p>
318
-
319
- <details class="fail">
320
- <summary>If it fails</summary>
321
- <div class="fail-body">
322
- <p>
323
- <strong>Mobile: more than one device</strong> — the harness lists what it found rather than
324
- guessing. Re-run with <code>--device &lt;udid|serial&gt;</code>. Prefer the iOS UUID over a name,
325
- because Xcode can contain several simulators with the same display name.
326
- </p>
327
- <p>
328
- <strong>iOS app missing after provisioning</strong> — repeat the provision command with
329
- <code>--force</code> and the same UUID. Do not use <code>--preflight-mode</code>; it is an
330
- internal adapter flag, not a public <code>mm-harness launch</code> option.
331
- </p>
332
- <p>
333
- <strong>Stuck</strong> — <code>mm-harness logs</code> tails the dev server and app logs;
334
- <code>mm-harness status</code> shows the adapter, devices, and next command.
335
- </p>
336
- <p>
337
- <strong>Clean slate</strong> — <code>mm-harness stop</code> stops only what this checkout
338
- owns, so parallel checkouts are untouched. Stopping nothing is success.
339
- </p>
340
- </div>
341
- </details>
342
- </li>
343
-
344
- <li class="step" data-step="actions">
345
- <div class="step-head">
346
- <input type="checkbox" class="step-check" id="c-actions" aria-labelledby="t-actions">
347
- <h3 class="step-title" id="t-actions">Discover what this checkout can do</h3>
348
- </div>
349
- <p class="step-why">
350
- Prints every typed operation available here, with its fields. The set differs per product:
351
- Mobile has UI actions, Core is headless and has none.
352
- </p>
353
-
354
- <div class="cmd"><pre><code><span class="p">$ </span>mm-harness actions --categories</code></pre></div>
355
-
356
- <div class="out-label">Expected — a mobile checkout, with its own counts</div>
357
- <div class="out">analytics (4)
358
- assertion (4)
359
- control (4)
360
- deeplink (1)
361
- evidence (2)
362
- perps (11)
363
- runtime (4)
364
- ui (13)
365
- utility (1)
366
- wallet (6)</div>
367
-
368
- <p class="step-why">
369
- Categories and counts move with the release and the adapter. Read yours from the command; the
370
- shape is the point, not the numbers.
371
- </p>
372
-
373
- <p class="step-why">Then look inside a category, search, or inspect one action's fields:</p>
374
- <div class="cmd"><pre><code><span class="p">$ </span>mm-harness actions --category ui
375
- <span class="p">$ </span>mm-harness actions positions
376
- <span class="p">$ </span>mm-harness actions --action read_state</code></pre></div>
377
-
378
- <div class="doctrine">
379
- <p>
380
- <span class="k">The discovered list is law.</span> It is the capability boundary, not a
381
- subset of some larger API. Call something not on it and the harness refuses, pointing you back
382
- at discovery:
383
- </p>
384
- </div>
385
-
386
- <div class="out"><span class="bad">✗</span> call: unknown action "totally_made_up" for the extension adapter.
387
- <span class="hint">Next: mm-harness actions --adapter extension --json</span></div>
388
-
389
- <p class="step-why">
390
- That refusal is why the evidence is worth reading: a tool that invents an action when asked for
391
- something impossible would also produce a plausible-looking result, and you would have no way to
392
- tell. Add <code>--json</code> when feeding this to an agent.
393
- </p>
394
-
395
- <details class="fail">
396
- <summary>If it fails</summary>
397
- <div class="fail-body">
398
- <p>
399
- <strong>Fewer actions than expected</strong> — you are seeing only the bundled set. Team
400
- libraries add domain actions and must be declared: <a href="tutorials/v3.html">V3</a>.
401
- </p>
402
- <p>
403
- <strong>Wrong product detected</strong> — pass <code>--adapter mobile|extension|core</code>
404
- explicitly, and check you are inside the checkout you meant.
405
- </p>
406
- </div>
407
- </details>
408
- </li>
409
-
410
- <li class="step" data-step="call-read">
411
- <div class="step-head">
412
- <input type="checkbox" class="step-check" id="c-call-read" aria-labelledby="t-call-read">
413
- <h3 class="step-title" id="t-call-read">Drive it: read product state</h3>
414
- </div>
415
- <p class="step-why">
416
- <code>call</code> runs one action as a one-node recipe through the real engine — same execution
417
- path, trace, and evidence as a full run. Start with a read; reads cannot break anything.
418
- </p>
419
-
420
- <div class="cmd"><pre><code><span class="p">$ </span>mm-harness call read_state</code></pre></div>
421
-
422
- <div class="note blue">
423
- <span class="note-title">Core branch</span>
424
- <p>
425
- Core has no wallet UI. Exercise its live controller boundary instead:
426
- <code>mm-harness call read_positions mode=all</code>.
427
- </p>
428
- </div>
429
-
430
- <p class="step-why">
431
- Short names resolve when unambiguous: <code>read_state</code> finds
432
- <code>metamask.wallet.read_state</code>. An ambiguous one stops and lists the candidates.
433
- </p>
434
-
435
- <div class="out-label">Expected — shape of the result</div>
436
- <div class="out">call read_state: <span class="ok">pass</span>
437
- Result:
438
- {
439
- "action": "metamask.wallet.read_state",
440
- "state": {
441
- "selectedAccount": { "name": "Account 1", "address": "0x…" },
442
- "completedOnboarding": true
443
- },
444
- "redacted": true
445
- }</div>
446
-
447
- <p class="step-why">
448
- Note <code>"redacted": true</code> — wallet state passes through redaction before reaching an
449
- artifact, because these bundles get attached to pull requests.
450
- </p>
451
-
452
- <details class="fail">
453
- <summary>If it fails</summary>
454
- <div class="fail-body">
455
- <p>
456
- <strong>Runtime health check failed / CDP not reachable</strong> — the app is not running.
457
- Complete the launch step; <code>mm-harness status</code> confirms what is live.
458
- </p>
459
- <p>
460
- <strong>Mobile: more than one device</strong> — <code>call</code> fails fast and lists
461
- them. Re-run with <code>--device</code>.
462
- </p>
463
- <p>
464
- <strong><code>unknown action</code></strong> — not in this adapter's set.
465
- <code>mm-harness call --list</code> shows what <code>call</code> accepts here.
466
- </p>
467
- </div>
468
- </details>
469
- </li>
470
-
471
- <li class="step" data-step="call-ui">
472
- <div class="step-head">
473
- <input type="checkbox" class="step-check" id="c-call-ui" aria-labelledby="t-call-ui">
474
- <h3 class="step-title" id="t-call-ui">Drive it again: UI or headless Core</h3>
475
- </div>
476
- <p class="step-why">Keep the app visible for this one.</p>
477
-
478
- <div class="cmd"><pre><code><span class="p">$ </span>mm-harness call navigate page=perps</code></pre></div>
479
-
480
- <div class="note blue">
481
- <span class="note-title">Core branch</span>
482
- <p>
483
- Prove a second headless action instead:
484
- <code>mm-harness call command cmd="echo core-ready"</code>.
485
- </p>
486
- </div>
487
-
488
- <p class="step-why">
489
- Fields are passed as <code>key=value</code>, or <code>--arg k=v</code> for the same effect.
490
- </p>
491
-
492
- <div class="note blue">
493
- <span class="note-title">Semantic intent, not coordinates</span>
494
- <p>
495
- You asked for a <em>page</em>, not a pixel or a route. The adapter owns the mapping and
496
- verifies where it landed, so a drifted route fails loudly instead of quietly doing nothing —
497
- which is why these actions survive redesigns.
498
- <code>mm-harness actions --action navigate</code> lists accepted values.
499
- </p>
500
- </div>
501
-
502
- <p class="step-why">Others worth trying, if your adapter lists them:</p>
503
- <div class="cmd"><pre><code><span class="p">$ </span>mm-harness call press text="Account 1"
504
- <span class="p">$ </span>mm-harness call screenshot path=proof.png</code></pre></div>
505
-
506
- <details class="fail">
507
- <summary>If it fails</summary>
508
- <div class="fail-body">
509
- <p>
510
- <strong>Target not found</strong> — the element is not on screen. Actions do not hunt
511
- blindly; use <code>wait_for</code> when something needs to mount first.
512
- </p>
513
- <p>
514
- <strong>Core has no UI actions</strong> — correct, it is headless. Try
515
- <code>mm-harness call command cmd="echo hello"</code> there instead.
516
- </p>
517
- </div>
518
- </details>
519
- </li>
520
-
521
- <li class="step" data-step="run">
522
- <div class="step-head">
523
- <input type="checkbox" class="step-check" id="c-run" aria-labelledby="t-run">
524
- <h3 class="step-title" id="t-run">Prove it: run your first recipe</h3>
525
- </div>
526
- <p class="step-why">
527
- Everything so far was driving by hand. A recipe composes the same operations into a graph that
528
- runs identically every time and records what happened. Start with what ships:
529
- </p>
530
-
531
- <div class="cmd"><pre><code><span class="p">$ </span>mm-harness run --list</code></pre></div>
532
-
533
- <div class="out-label">Expected — an extension checkout</div>
534
- <div class="out">runnable recipes (extension)
535
- Inspect: mm-harness run &lt;recipe&gt; --describe
536
- perps.clean-market-testnet [metamask] variant=all params=market — Converge one Perps testnet market…
537
- perps.lifecycle [metamask] variant=all — Opens a small ETH testnet position, verifies it, closes it…
538
- perps.smoke [metamask] variant=extension — Non-mutating Perps domain smoke…
539
- runner.action-validation [metamask] variant=extension — Exercises every manifest-declared action…
540
- runner.smoke [metamask] variant=extension — Proves the runner executes manifest-declared actions…
541
- wallet.smoke [metamask] variant=extension — Fixture-backed proof that the wallet is reachable…</div>
542
- <p class="step-why">
543
- The bundled set grows between releases; yours is whatever this command prints, not what is
544
- printed here.
545
- </p>
546
-
547
- <p class="step-why">
548
- Read one first. <code>--describe</code> shows its parameters and every action it composes:
549
- </p>
550
- <div class="cmd"><pre><code><span class="p">$ </span>mm-harness run wallet.smoke --describe
551
- <span class="p">$ </span>mm-harness run wallet.smoke --plan</code></pre></div>
552
-
553
- <p class="step-why">
554
- <code>--plan</code> validates and prints the execution plan while touching nothing, exiting 5 if
555
- the recipe is invalid. Cheap check before the expensive one.
556
- </p>
557
-
558
- <p class="step-why">Now for real, with the evidence somewhere you chose:</p>
559
- <div class="cmd"><pre><code><span class="p">$ </span>mm-harness run wallet.smoke --artifacts-dir ./first-recipe-artifacts</code></pre></div>
560
-
561
- <div class="out-label">Expected</div>
562
- <div class="out"><span class="ok">PASS</span> recipe run [extension]
563
- summary:
564
- <span class="ok">PASS</span> status (app.status, 9ms): platform=extension
565
- <span class="ok">PASS</span> fixture (metamask.wallet.fixture_status, 17ms): path=temp/recipe/runtime/wallet-fixture.json
566
- <span class="ok">PASS</span> unlock (metamask.wallet.ensure_unlocked, 100ms): proof=extension-unlocked-state
567
- <span class="ok">PASS</span> state (metamask.wallet.read_state, 94ms): proof=extension-wallet-state
568
- <span class="ok">PASS</span> screenshot (ui.screenshot, 6.0s): path=screenshots/wallet-smoke.png
569
- <span class="ok">PASS</span> done (end, 0ms)
570
- artifacts (6):
571
- Human run report: ./first-recipe-artifacts/report.md
572
- Run summary: ./first-recipe-artifacts/summary.json
573
- Execution trace: ./first-recipe-artifacts/trace.json
574
- Executed recipe: ./first-recipe-artifacts/recipe.json
575
- <span class="dim">…</span></div>
576
-
577
- <div class="note">
578
- <span class="note-title">Wallet fixtures</span>
579
- <p>
580
- Recipes needing a signed-in wallet read one canonical fixture per checkout; the password comes
581
- <em>from</em> the fixture and is never typed. On a missing fixture,
582
- <code>mm-harness fixtures</code> shows its status and the safe next command.
583
- <code>fixtures init --dev</code> creates a disposable public test wallet that must never hold
584
- real funds.
585
- </p>
586
- </div>
587
-
588
- <details class="fail">
589
- <summary>If it fails</summary>
590
- <div class="fail-body">
591
- <p>
592
- <strong>Exit 5</strong> — validation or trust failure. The recipe is the problem, not your
593
- environment; nothing executed. The message names the invalid part.
594
- </p>
595
- <p>
596
- <strong>Exit 1</strong> — it ran and an action failed. A real result, not a tooling
597
- problem: find the first node in <code>trace.json</code> with <code>"ok": false</code>.
598
- </p>
599
- <p>
600
- <strong>Exit 3</strong> — infrastructure, not your recipe: the app or dev server fell over.
601
- Try <code>mm-harness doctor</code> then <code>mm-harness logs</code>.
602
- </p>
603
- <p>
604
- <strong>Lost track</strong> — <code>mm-harness last</code> prints the last significant
605
- command with its verdict and evidence paths.
606
- </p>
607
- </div>
608
- </details>
609
- </li>
610
-
611
- <li class="step" data-step="evidence">
612
- <div class="step-head">
613
- <input type="checkbox" class="step-check" id="c-evidence" aria-labelledby="t-evidence">
614
- <h3 class="step-title" id="t-evidence">Open the evidence bundle</h3>
615
- </div>
616
- <p class="step-why">The run left a directory behind. This is the part that beats clicking through by hand.</p>
617
-
618
- <div class="cmd"><pre><code><span class="p">$ </span>ls first-recipe-artifacts
619
- <span class="p">$ </span>cat first-recipe-artifacts/summary.json
620
- <span class="p">$ </span>open first-recipe-artifacts/screenshots</code></pre></div>
621
-
622
- <div class="table-scroll">
623
- <table>
624
- <thead><tr><th>File</th><th>What it answers</th></tr></thead>
625
- <tbody>
626
- <tr><td><code>summary.json</code></td><td>Did it pass? How many nodes, how long, which libraries were in play. The verdict.</td></tr>
627
- <tr><td><code>trace.json</code></td><td>What happened at every step: per-node verdict, timing, inputs, outputs. Counts come from here.</td></tr>
628
- <tr><td><code>recipe.json</code></td><td>The graph that actually executed, including each node's stated intent.</td></tr>
629
- <tr><td><code>report.md</code></td><td>The same story in one readable page — the thing to skim first.</td></tr>
630
- <tr><td><code>screenshots/</code></td><td>Visual evidence captured during the run.</td></tr>
631
- <tr><td><code>diagnostics.json</code></td><td>Warnings and errors the app emitted, kept deliberately separate from the verdict.</td></tr>
632
- </tbody>
633
- </table>
634
- </div>
635
-
636
- <p class="step-why">
637
- Read them in that order: <code>report.md</code>, then <code>summary.json</code> for the verdict,
638
- then <code>trace.json</code> when you want to know why. Cite numbers from
639
- <code>trace.json</code>, never from prose written around it.
640
- </p>
641
-
642
- <div class="btn-row" style="margin-top:1.2rem">
643
- <a class="btn btn-primary" href="reviewers.html">Read a bundle line by line →</a>
644
- </div>
645
-
646
- <details class="fail">
647
- <summary>If it fails</summary>
648
- <div class="fail-body">
649
- <p>
650
- <strong>Cannot find the directory</strong> — without <code>--artifacts-dir</code> it goes
651
- to a checkout-local run directory. <code>mm-harness last</code> prints the path.
652
- </p>
653
- <p>
654
- <strong>No screenshots</strong> — capture differs per platform;
655
- <code>mm-harness doctor</code> reports it on a <code>capture:</code> line. A degraded
656
- fallback still succeeds and records that it degraded in the artifact metadata.
657
- </p>
658
- </div>
659
- </details>
660
- </li>
661
-
662
- </ol>
663
- </section>
664
-
665
- <section class="wrap">
666
- <hr class="sep">
667
- <h2>Next</h2>
668
- <div class="grid grid-3">
669
- <div class="card">
670
- <h3>Recipe anatomy</h3>
671
- <p>The graph, the intents, the assertions, and the test of whether yours is worth keeping.</p>
672
- <p><a href="recipes.html">Read the anatomy →</a></p>
673
- </div>
674
- <div class="card">
675
- <h3>Your team's library</h3>
676
- <p>Install the skills, declare your library, prove discovery sees it.</p>
677
- <p><a href="tutorials/v3.html">Tutorial V3 →</a></p>
678
- </div>
679
- <div class="card">
680
- <h3>Reviewing someone's proof</h3>
681
- <p>A real bundle annotated, including a degraded capture that stayed honest about it.</p>
682
- <p><a href="reviewers.html">For reviewers →</a></p>
683
- </div>
684
- </div>
685
- </section>
686
- </main>
687
-
688
- <footer class="footer">
689
- <div class="wrap">
690
- <p>Internal getting-started guide for proving MetaMask changes with recipes. Not official MetaMask product documentation.</p>
691
- <p>Commands here are checked against the CLI's own <code>--help</code>. If one disagrees with your terminal, your terminal is right: run <code>mm-harness update</code>, then trust <code>--help</code>.</p>
692
- </div>
693
- </footer>
694
-
695
- <script type="module" src="assets/progress.mjs?v=4"></script>
696
- </body>
697
- </html>