Skip to content

Commit 66ff69d

Browse files
authored
fix(recipe): align HUD intent guidance (#26)
1 parent 04ae17f commit 66ff69d

19 files changed

Lines changed: 403 additions & 182 deletions

File tree

domains/agentic/skills/recipe-cook/references/examples.md

Lines changed: 82 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@ For MetaMask Mobile PRs, compose existing flows instead of inventing raw evals:
1313
5. **Capture** — screenshot/video/log only after the assertion proves the screen settled.
1414
6. **Teardown** — reset wallet/app state when a run changes balances, permissions, txs, or network.
1515

16-
Good Mobile recipes compose the v1 manifest's semantic actions instead of shelling to scripts. Prefer, where the installed manifest advertises them:
16+
Good Mobile recipes compose the runner manifest's semantic actions instead of shelling to scripts. Prefer, where the installed manifest advertises them:
1717

1818
- `metamask.wallet.setup`, `metamask.wallet.ensure_unlocked`, `metamask.wallet.select_account`, `metamask.wallet.read_state` for wallet setup/start-state.
1919
- `metamask.perps.start_state`, `metamask.perps.ensure_positions`, `metamask.perps.ensure_orders`, `metamask.perps.place_order`, `metamask.perps.close_positions`, `metamask.perps.read_positions`, `metamask.perps.assert_positions` for Perps flows.
2020
- `ui.navigate`, `ui.wait_for`, `ui.press`, `ui.set_input`, `ui.scroll`, `ui.screenshot`, `app.status`, `app.hud` for the user path and evidence.
2121

22-
`call`/flow-catalog composition is valid only when the installed runner manifest advertises a flow catalog; do not point at in-repo flow files (the legacy `scripts/perps/agentic/teams/perps/flows/*` recipes are not part of the v1 model). When reusing an action or flow, state which proof target it covers and add only the nodes needed for the PR-specific claim.
22+
`call`/flow-catalog composition is valid only when the installed runner manifest advertises a flow catalog; do not point at in-repo flow files (the legacy `scripts/perps/agentic/teams/perps/flows/*` recipes are not part of the runner model). When reusing an action or flow, state which proof target it covers and add only the nodes needed for the PR-specific claim.
2323

2424
## Mobile Direct Smoke Recipe
2525

@@ -28,53 +28,61 @@ Use this for live-device validation of the recipe plumbing itself. It intentiona
2828
```json
2929
{
3030
"schema_version": 1,
31-
"title": "Mobile direct smoke reach a settled wallet screen",
32-
"description": "Proves the Mobile debug app is reachable and the v1 runner can drive the bridge to a settled wallet screen. Intentionally avoids wallet-specific assertions beyond reachability.",
31+
"title": "Mobile direct smoke \u2014 reach a settled wallet screen",
32+
"description": "Proves the Mobile debug app is reachable and the runner can drive the bridge to a settled wallet screen. Intentionally avoids wallet-specific assertions beyond reachability.",
3333
"validate": {
3434
"workflow": {
35-
"pre_conditions": ["Run from the metamask-mobile checkout", "Debug app is already running on the intended simulator"],
35+
"pre_conditions": [
36+
"Run from the metamask-mobile checkout",
37+
"Debug app is already running on the intended simulator"
38+
],
3639
"entry": "status",
3740
"nodes": {
3841
"status": {
3942
"action": "app.status",
40-
"description": "PT-1: read app route/device/platform through the v1 app.status action",
4143
"timeout_ms": 30000,
42-
"next": "ensure-unlocked"
44+
"next": "ensure-unlocked",
45+
"intent": "PT-1: read app route/device/platform through the app.status action"
4346
},
4447
"ensure-unlocked": {
4548
"action": "metamask.wallet.ensure_unlocked",
46-
"description": "PT-1: idempotently reach an unlocked wallet",
4749
"timeout_ms": 45000,
48-
"next": "navigate-wallet"
50+
"next": "navigate-wallet",
51+
"intent": "PT-1: idempotently reach an unlocked wallet"
4952
},
5053
"navigate-wallet": {
5154
"action": "ui.navigate",
52-
"description": "PT-2: open the wallet view through the navigation layer",
5355
"route": "WalletView",
5456
"timeout_ms": 30000,
55-
"next": "wait-wallet"
57+
"next": "wait-wallet",
58+
"intent": "PT-2: open the wallet view through the navigation layer"
5659
},
5760
"wait-wallet": {
5861
"action": "ui.wait_for",
59-
"description": "PT-2: the wallet screen is present after navigation settles",
6062
"test_id": "wallet-screen",
6163
"expected": "present",
6264
"timeout_ms": 30000,
63-
"next": "capture"
65+
"next": "capture",
66+
"intent": "PT-2: the wallet screen is present after navigation settles"
6467
},
6568
"capture": {
6669
"action": "ui.screenshot",
67-
"description": "PT-2: reviewer-visible settled wallet screen",
6870
"path": "screenshots/mobile-direct-smoke-wallet.png",
69-
"next": "index-artifacts"
71+
"next": "index-artifacts",
72+
"intent": "PT-2: reviewer-visible settled wallet screen"
7073
},
7174
"index-artifacts": {
7275
"action": "index_artifacts",
73-
"description": "Index the screenshot proof",
74-
"artifacts": ["screenshots/"],
75-
"next": "done"
76+
"artifacts": [
77+
"screenshots/"
78+
],
79+
"next": "done",
80+
"intent": "Index the screenshot proof"
7681
},
77-
"done": { "action": "end", "status": "pass" }
82+
"done": {
83+
"action": "end",
84+
"status": "pass"
85+
}
7886
},
7987
"teardown": []
8088
}
@@ -100,38 +108,50 @@ This pattern composes a real Mobile flow and adds a PR-specific assertion. It is
100108
},
101109
"validate": {
102110
"workflow": {
103-
"pre_conditions": ["wallet.unlocked", "perps.feature_enabled"],
111+
"pre_conditions": [
112+
"wallet.unlocked",
113+
"perps.feature_enabled"
114+
],
104115
"entry": "open-market",
105116
"nodes": {
106117
"open-market": {
107118
"action": "ui.navigate",
108-
"description": "PT-1: open the BTC market detail through the raw Perps market route",
109119
"route": "PerpsMarketDetails",
110-
"params": { "market": { "symbol": "{{symbol}}" } },
120+
"params": {
121+
"market": {
122+
"symbol": "{{symbol}}"
123+
}
124+
},
111125
"timeout_ms": 30000,
112-
"next": "wait-market"
126+
"next": "wait-market",
127+
"intent": "PT-1: open the BTC market detail through the raw Perps market route"
113128
},
114129
"wait-market": {
115130
"action": "ui.wait_for",
116-
"description": "PT-2: after navigation settles, the BTC market detail content is present",
117131
"text": "{{symbol}}",
118132
"expected": "present",
119133
"timeout_ms": 30000,
120-
"next": "capture-detail"
134+
"next": "capture-detail",
135+
"intent": "PT-2: after navigation settles, the BTC market detail content is present"
121136
},
122137
"capture-detail": {
123138
"action": "ui.screenshot",
124-
"description": "PT-2: reviewer-visible settled market detail screen",
125139
"path": "screenshots/perps-btc-detail.png",
126-
"next": "index-artifacts"
140+
"next": "index-artifacts",
141+
"intent": "PT-2: reviewer-visible settled market detail screen"
127142
},
128143
"index-artifacts": {
129144
"action": "index_artifacts",
130-
"description": "Index state and screenshot evidence",
131-
"artifacts": ["screenshots/"],
132-
"next": "done"
145+
"artifacts": [
146+
"screenshots/"
147+
],
148+
"next": "done",
149+
"intent": "Index state and screenshot evidence"
133150
},
134-
"done": { "action": "end", "status": "pass" }
151+
"done": {
152+
"action": "end",
153+
"status": "pass"
154+
}
135155
},
136156
"teardown": []
137157
}
@@ -151,31 +171,42 @@ Use command assertions when the PR claim is not user-facing.
151171
"inputs": {},
152172
"validate": {
153173
"workflow": {
154-
"pre_conditions": ["PR branch is checked out"],
174+
"pre_conditions": [
175+
"PR branch is checked out"
176+
],
155177
"setup": [],
156178
"entry": "run-focused-test",
157179
"nodes": {
158180
"run-focused-test": {
159181
"action": "command",
160-
"description": "PT-1: focused unit test covers malformed metadata",
161182
"cmd": "mkdir -p reports && yarn test --runInBand app/core/token-service/metadata.test.ts --json --outputFile reports/jest-token-metadata.json",
162183
"timeout_ms": 120000,
163-
"next": "assert-pass"
184+
"next": "assert-pass",
185+
"intent": "PT-1: focused unit test covers malformed metadata"
164186
},
165187
"assert-pass": {
166188
"action": "assert_json",
167-
"description": "PT-1: Jest reports zero failed tests",
168189
"path": "reports/jest-token-metadata.json",
169-
"assert": { "path": "$.numFailedTests", "operator": "eq", "value": 0 },
170-
"next": "index-artifacts"
190+
"assert": {
191+
"path": "$.numFailedTests",
192+
"operator": "eq",
193+
"value": 0
194+
},
195+
"next": "index-artifacts",
196+
"intent": "PT-1: Jest reports zero failed tests"
171197
},
172198
"index-artifacts": {
173199
"action": "index_artifacts",
174-
"description": "Index the test report",
175-
"artifacts": ["reports/jest-token-metadata.json"],
176-
"next": "done"
200+
"artifacts": [
201+
"reports/jest-token-metadata.json"
202+
],
203+
"next": "done",
204+
"intent": "Index the test report"
177205
},
178-
"done": { "action": "end", "status": "pass" }
206+
"done": {
207+
"action": "end",
208+
"status": "pass"
209+
}
179210
},
180211
"teardown": []
181212
}
@@ -193,8 +224,16 @@ Use command assertions when the PR claim is not user-facing.
193224
"workflow": {
194225
"entry": "test",
195226
"nodes": {
196-
"test": { "action": "wait", "duration_ms": 10000, "next": "done" },
197-
"done": { "action": "end", "status": "pass" }
227+
"test": {
228+
"action": "wait",
229+
"duration_ms": 10000,
230+
"next": "done",
231+
"intent": "Perform test for recipe proof"
232+
},
233+
"done": {
234+
"action": "end",
235+
"status": "pass"
236+
}
198237
}
199238
}
200239
}

domains/agentic/skills/recipe-cook/references/recipe-v1.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@ Use this shape unless the target repo already publishes a stricter schema.
77
```json
88
{
99
"schema_version": 1,
10-
"title": "Human-readable validation title",
11-
"description": "What this recipe proves",
1210
"inputs": {},
1311
"proofTargets": [
1412
{ "id": "PT-1", "claim": "The changed behavior is visible and settled." }
@@ -21,28 +19,28 @@ Use this shape unless the target repo already publishes a stricter schema.
2119
"nodes": {
2220
"start": {
2321
"action": "command",
24-
"description": "Run a project-native check",
22+
"intent": "Run a project-native check",
2523
"cmd": "mkdir -p logs && yarn test --runInBand path/to/test > logs/test.log 2>&1; status=$?; cat logs/test.log; exit $status",
2624
"timeout_ms": 120000,
2725
"next": "assert-result"
2826
},
2927
"assert-result": {
3028
"action": "assert_exit_code",
31-
"description": "Check the project-native check passed",
29+
"intent": "Check the project-native check passed",
3230
"expected": 0,
3331
"next": "assert-output"
3432
},
3533
"assert-output": {
3634
"action": "assert_output",
37-
"description": "Check the project-native output looked successful",
35+
"intent": "Check the project-native output looked successful",
3836
"source": "start",
3937
"stream": "stdout",
4038
"contains": "PASS",
4139
"next": "index-artifacts"
4240
},
4341
"index-artifacts": {
4442
"action": "index_artifacts",
45-
"description": "Write the artifact manifest",
43+
"intent": "Write the artifact manifest",
4644
"artifacts": ["logs/test.log"],
4745
"next": "done"
4846
},
@@ -57,7 +55,7 @@ Use this shape unless the target repo already publishes a stricter schema.
5755

5856
## Composition and start-state fields
5957

60-
Recipe v1 authoring should support reusable flow composition. When the installed runner publishes flow catalogs, prefer `call` nodes over repeated raw setup.
58+
Recipe authoring should support reusable flow composition. When the installed runner publishes flow catalogs, prefer `call` nodes over repeated raw setup.
6159

6260
Recommended metadata:
6361

@@ -71,6 +69,7 @@ Recommended current MetaMask setup action shape:
7169
```json
7270
{
7371
"action": "metamask.perps.start_state",
72+
"intent": "Converge Perps to the requested baseline before proof",
7473
"phase": "start_state",
7574
"network": "testnet",
7675
"provider": "hyperliquid",
@@ -86,21 +85,22 @@ An `ensure_*` or `start_state` action/flow is idempotent: it inspects the curren
8685
Minimum required fields:
8786

8887
- `schema_version: 1`
89-
- `title`
90-
- `description`
9188
- `validate.workflow.entry`
9289
- non-empty `validate.workflow.nodes`
90+
- `intent` on every non-terminal executable node
9391

9492
Node rules:
9593

9694
- Every node key is a stable id.
97-
- Every node has `action` and `description`, except a minimal terminal `end` node.
95+
- Every non-terminal node has `action` and `intent`, except a minimal terminal `end` node.
9896
- Every non-terminal node has `next`, `cases`, or `default`.
9997
- Transition targets exist.
10098
- At least one node reaches `action: "end"`.
101-
- Assertions name the proof target they validate, either in `description` or a `proofTarget` field.
99+
- Assertions name the proof target they validate with `proofTarget`.
102100
- Setup/start-state flows should be declared separately from proof nodes so evidence can focus on the AC interaction.
103101

102+
Every non-terminal recipe node needs `intent`: one short HUD/trace line for what the agent is doing now. Do not use generic/action/node/selector/test-id/title/description/note text, and do not author sub-intent/HUD fields.
103+
104104
Action classes:
105105

106106
- Portable/base: `command`, `wait`, `assert_json`, `assert_file`, `assert_exit_code`, `assert_output`, `watch_logs`, `index_artifacts`, `end`.

domains/agentic/skills/recipe-cook/repos/metamask-extension.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ Prefer repo-owned browser, extension, fixture, and mock helpers over raw CDP sni
4040

4141
## Common Action Mapping
4242

43-
Use only action names declared by the installed v1 action manifest. Typical Extension mappings are:
43+
Use only action names declared by the installed action manifest. Typical Extension mappings are:
4444

4545
- Launch extension: `/recipe-harness` live/verify flow or runner setup with `--launch-existing-dist`.
4646
- Open route/popup: `ui.navigate` with a raw extension `hash` route, e.g. `{ "hash": "#/?tab=perps" }`.

domains/agentic/skills/recipe-cook/repos/metamask-mobile.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ Do this especially on historical commits, where the checked-out runner may be st
4141

4242
## Common Action Mapping
4343

44-
Use only action names declared by the installed v1 action manifest. Typical Mobile mappings are:
44+
Use only action names declared by the installed action manifest. Typical Mobile mappings are:
4545

4646
- Open app area/screen: `ui.navigate` with a raw `route` (and optional `params`), e.g. `{ "route": "PerpsMarketListView" }` or `{ "route": "PerpsMarketDetails", "params": { "market": { "symbol": "ETH" } } }`.
4747
- Tap: `ui.press` with a stable `test_id`, text, or page-object target.

0 commit comments

Comments
 (0)