mobile-debug-mcp 0.25.1 → 0.26.1
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.
- package/dist/interact/classify.js +48 -11
- package/dist/interact/index.js +113 -0
- package/dist/observe/android.js +10 -1
- package/dist/observe/index.js +19 -1
- package/dist/observe/ios.js +15 -1
- package/dist/observe/snapshot-metadata.js +88 -0
- package/dist/server/tool-definitions.js +49 -14
- package/dist/server/tool-handlers.js +12 -0
- package/dist/server-core.js +1 -1
- package/docs/CHANGELOG.md +9 -0
- package/docs/ROADMAP.md +66 -38
- package/docs/rfcs/003-wait-and-synchronization-reliability.md +296 -0
- package/docs/rfcs/004-action-verification-routing.md +342 -0
- package/docs/specs/mcp-tooling-spec-v1.md +11 -3
- package/docs/tools/interact.md +31 -8
- package/docs/tools/observe.md +4 -2
- package/package.json +1 -1
- package/skills/rfc-review/SKILL.md +52 -0
- package/skills/rfc-review/references/rfc-review-checklist.md +12 -0
- package/skills/rfc-review/references/rfc-review-template.md +28 -0
- package/src/interact/classify.ts +53 -13
- package/src/interact/index.ts +151 -0
- package/src/observe/android.ts +11 -1
- package/src/observe/index.ts +26 -1
- package/src/observe/ios.ts +28 -13
- package/src/observe/snapshot-metadata.ts +107 -0
- package/src/server/tool-definitions.ts +49 -14
- package/src/server/tool-handlers.ts +13 -0
- package/src/server-core.ts +1 -1
- package/src/types.ts +23 -0
- package/test/unit/interact/classify_action_outcome.test.ts +44 -25
- package/test/unit/interact/wait_for_ui_change.test.ts +76 -0
- package/test/unit/server/contract.test.ts +8 -6
- package/test/unit/server/response_shapes.test.ts +37 -3
- package/docs/rfcs/003-wait-and-synchronization-reliability +0 -232
|
@@ -0,0 +1,342 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
# RFC 004: Verification Routing for Local and Side-Effect Actions
|
|
4
|
+
|
|
5
|
+
## Status
|
|
6
|
+
Draft
|
|
7
|
+
|
|
8
|
+
## Summary
|
|
9
|
+
|
|
10
|
+
This RFC corrects a specification flaw in action verification routing where agents may treat lack of obvious UI change as a trigger to inspect network activity by default.
|
|
11
|
+
|
|
12
|
+
The current fallback can cause unnecessary network calls during purely local UI interactions (for example sliders, pickers, toggles, text entry), creating noise and reinforcing incorrect agent behavior.
|
|
13
|
+
|
|
14
|
+
This RFC separates:
|
|
15
|
+
- action verification
|
|
16
|
+
- failure diagnosis
|
|
17
|
+
- backend signal inspection
|
|
18
|
+
|
|
19
|
+
And introduces context-aware routing based on action type.
|
|
20
|
+
|
|
21
|
+
## Motivation
|
|
22
|
+
|
|
23
|
+
Observed agent sessions showed `get_network_activity` being invoked during local UI manipulation solely because an action produced no coarse-grained UI diff.
|
|
24
|
+
|
|
25
|
+
Current implicit reasoning resembles:
|
|
26
|
+
|
|
27
|
+
```text
|
|
28
|
+
if uiChanged == false:
|
|
29
|
+
inspect network activity
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
This is overly broad.
|
|
33
|
+
|
|
34
|
+
For many interactions, absence of obvious snapshot change does not imply backend ambiguity. It often means verification used the wrong signals.
|
|
35
|
+
|
|
36
|
+
Examples:
|
|
37
|
+
- Slider value changed but tree structure did not.
|
|
38
|
+
- Picker selection updated in-place.
|
|
39
|
+
- Toggle changed checked state only.
|
|
40
|
+
- Text field value changed without large snapshot delta.
|
|
41
|
+
- Tab or accordion state changed through selection metadata.
|
|
42
|
+
|
|
43
|
+
In these cases network inspection is diagnostic noise, not evidence.
|
|
44
|
+
|
|
45
|
+
## Problem Statement
|
|
46
|
+
|
|
47
|
+
The current model conflates:
|
|
48
|
+
|
|
49
|
+
1. Verifying whether an action succeeded.
|
|
50
|
+
2. Diagnosing why an action may have failed.
|
|
51
|
+
|
|
52
|
+
These are distinct phases.
|
|
53
|
+
|
|
54
|
+
As a result:
|
|
55
|
+
- agents overuse network inspection
|
|
56
|
+
- verification costs increase
|
|
57
|
+
- local-state actions are treated as ambiguous too often
|
|
58
|
+
- network hints can be elevated beyond their intended role
|
|
59
|
+
|
|
60
|
+
## Goals
|
|
61
|
+
|
|
62
|
+
This RFC:
|
|
63
|
+
- Prevents default network fallbacks for local-state actions.
|
|
64
|
+
- Makes verification primarily state-driven.
|
|
65
|
+
- Restricts network activity inspection to side-effect actions where ambiguity remains.
|
|
66
|
+
- Refines `classify_action_outcome` decision routing.
|
|
67
|
+
|
|
68
|
+
## Non-Goals
|
|
69
|
+
|
|
70
|
+
This RFC does not:
|
|
71
|
+
- change raw snapshot precedence (raw remains authoritative)
|
|
72
|
+
- redefine expect_* ownership of verification
|
|
73
|
+
- make network activity mandatory evidence
|
|
74
|
+
- expand semantic hints into executable truth
|
|
75
|
+
|
|
76
|
+
## Action Categories
|
|
77
|
+
|
|
78
|
+
### Category A: Local-State Actions
|
|
79
|
+
|
|
80
|
+
Actions expected to modify client-side UI state.
|
|
81
|
+
|
|
82
|
+
Examples:
|
|
83
|
+
- tap toggle
|
|
84
|
+
- drag slider
|
|
85
|
+
- picker selection
|
|
86
|
+
- text entry
|
|
87
|
+
- scrolling
|
|
88
|
+
- tab switching
|
|
89
|
+
- expand/collapse
|
|
90
|
+
- local navigation controls
|
|
91
|
+
|
|
92
|
+
### Category B: Side-Effect Actions
|
|
93
|
+
|
|
94
|
+
Actions that may trigger backend or asynchronous side effects.
|
|
95
|
+
|
|
96
|
+
Examples:
|
|
97
|
+
- submit
|
|
98
|
+
- save
|
|
99
|
+
- sync
|
|
100
|
+
- search
|
|
101
|
+
- refresh
|
|
102
|
+
- login
|
|
103
|
+
- purchase flows
|
|
104
|
+
|
|
105
|
+
## Action Classification Source of Truth
|
|
106
|
+
|
|
107
|
+
## Action Type Emission (Runtime Contract)
|
|
108
|
+
|
|
109
|
+
`action_type` MUST be emitted by the runtime layer that produces or executes actions. It is not inferred by the agent.
|
|
110
|
+
|
|
111
|
+
There are three valid sources of truth, in order of precedence:
|
|
112
|
+
|
|
113
|
+
### 1. Tool Schema Annotation (preferred)
|
|
114
|
+
|
|
115
|
+
If the action originates from a tool invocation, `action_type` MUST be defined in the tool’s schema definition.
|
|
116
|
+
|
|
117
|
+
Example:
|
|
118
|
+
|
|
119
|
+
```json
|
|
120
|
+
{
|
|
121
|
+
"name": "toggle_switch",
|
|
122
|
+
"action_type": "local_state"
|
|
123
|
+
}
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
or
|
|
127
|
+
|
|
128
|
+
```json
|
|
129
|
+
{
|
|
130
|
+
"name": "submit_form",
|
|
131
|
+
"action_type": "side_effect"
|
|
132
|
+
}
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
This is the canonical source.
|
|
136
|
+
|
|
137
|
+
### 2. Handler Output (runtime execution layer)
|
|
138
|
+
|
|
139
|
+
If tool schema does not define `action_type`, the runtime handler that executes the action MUST attach it before returning the action result.
|
|
140
|
+
|
|
141
|
+
Example:
|
|
142
|
+
|
|
143
|
+
```json
|
|
144
|
+
{
|
|
145
|
+
"action": "click",
|
|
146
|
+
"target": "save_button",
|
|
147
|
+
"action_type": "side_effect"
|
|
148
|
+
}
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
This is valid only when schema-level annotation is absent.
|
|
152
|
+
|
|
153
|
+
### 3. Fallback Mapping Table (last resort, deterministic only)
|
|
154
|
+
|
|
155
|
+
If neither schema nor handler provides `action_type`, the system MUST use a deterministic mapping table maintained by the runtime.
|
|
156
|
+
|
|
157
|
+
This table MUST be:
|
|
158
|
+
- static (no runtime inference)
|
|
159
|
+
- versioned
|
|
160
|
+
- explicitly defined in implementation
|
|
161
|
+
|
|
162
|
+
Example mapping:
|
|
163
|
+
|
|
164
|
+
| action | action_type |
|
|
165
|
+
|--------|------------|
|
|
166
|
+
| tap_toggle | local_state |
|
|
167
|
+
| enter_text | local_state |
|
|
168
|
+
| submit | side_effect |
|
|
169
|
+
| refresh | side_effect |
|
|
170
|
+
|
|
171
|
+
If an action is not in the table, it MUST default to:
|
|
172
|
+
|
|
173
|
+
```
|
|
174
|
+
side_effect
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
### Hard Constraint
|
|
178
|
+
|
|
179
|
+
Agents MUST NOT infer or override `action_type` based on UI state changes, snapshot diffs, or network activity.
|
|
180
|
+
|
|
181
|
+
### Normative Interpretation
|
|
182
|
+
|
|
183
|
+
`action_type` is part of the execution contract, not the reasoning layer.
|
|
184
|
+
|
|
185
|
+
Action type MUST be explicitly defined by the action schema or tool output.
|
|
186
|
+
|
|
187
|
+
Valid values:
|
|
188
|
+
- local_state
|
|
189
|
+
- side_effect
|
|
190
|
+
|
|
191
|
+
Agents MUST NOT infer action type from UI changes.
|
|
192
|
+
|
|
193
|
+
If action type is missing, agents MUST treat it as side_effect only if backend interaction is plausible; otherwise classify as local_state.
|
|
194
|
+
|
|
195
|
+
## Revised Verification Routing
|
|
196
|
+
|
|
197
|
+
### For Local-State Actions
|
|
198
|
+
|
|
199
|
+
Verification priority:
|
|
200
|
+
|
|
201
|
+
1. Expected state assertions
|
|
202
|
+
2. Refreshed snapshot comparison
|
|
203
|
+
3. Element property checks
|
|
204
|
+
4. Targeted expect_* verification
|
|
205
|
+
|
|
206
|
+
Signals may include:
|
|
207
|
+
- value changes
|
|
208
|
+
- selected state
|
|
209
|
+
- checked state
|
|
210
|
+
- focus changes
|
|
211
|
+
- labels/text
|
|
212
|
+
- enabled/disabled transitions
|
|
213
|
+
- position/state metadata
|
|
214
|
+
|
|
215
|
+
Network activity should not be used as default fallback.
|
|
216
|
+
|
|
217
|
+
## For Side-Effect Actions
|
|
218
|
+
|
|
219
|
+
Verification priority:
|
|
220
|
+
|
|
221
|
+
1. Expected UI/state verification first
|
|
222
|
+
2. Retry richer local verification if ambiguous
|
|
223
|
+
3. Only then optionally inspect network or log signals
|
|
224
|
+
|
|
225
|
+
Network signals are supporting hints, not primary proof of success.
|
|
226
|
+
|
|
227
|
+
## Decision Logic Update
|
|
228
|
+
|
|
229
|
+
Replace implied logic:
|
|
230
|
+
|
|
231
|
+
```text
|
|
232
|
+
if uiChanged == false:
|
|
233
|
+
get_network_activity()
|
|
234
|
+
```
|
|
235
|
+
|
|
236
|
+
With:
|
|
237
|
+
|
|
238
|
+
```text
|
|
239
|
+
if expected_state_verified:
|
|
240
|
+
success
|
|
241
|
+
|
|
242
|
+
elif action_type == local_state:
|
|
243
|
+
retry using richer state verification
|
|
244
|
+
|
|
245
|
+
elif action_type == side_effect and ambiguity_remains:
|
|
246
|
+
optionally inspect network activity
|
|
247
|
+
|
|
248
|
+
else:
|
|
249
|
+
inconclusive
|
|
250
|
+
```
|
|
251
|
+
|
|
252
|
+
## Definition of Ambiguity
|
|
253
|
+
|
|
254
|
+
Ambiguity exists only when:
|
|
255
|
+
|
|
256
|
+
- expected state cannot be evaluated from UI snapshot, AND
|
|
257
|
+
- no single deterministic state predicate can be computed from UI fields
|
|
258
|
+
|
|
259
|
+
Ambiguity does NOT include:
|
|
260
|
+
- absence of visual diff
|
|
261
|
+
- absence of network activity
|
|
262
|
+
- lack of large UI tree changes
|
|
263
|
+
|
|
264
|
+
## Normative Rules
|
|
265
|
+
|
|
266
|
+
### Rule 1
|
|
267
|
+
|
|
268
|
+
Agents MUST NOT use network activity inspection as a default fallback for local-state actions solely because coarse UI diffs are absent.
|
|
269
|
+
|
|
270
|
+
### Rule 2
|
|
271
|
+
|
|
272
|
+
Agents MUST prefer explicit state verification over backend diagnostics whenever the action is expected to be locally observable.
|
|
273
|
+
|
|
274
|
+
### Rule 3
|
|
275
|
+
|
|
276
|
+
Network activity MAY be consulted only when:
|
|
277
|
+
- the action plausibly triggers backend work, and
|
|
278
|
+
- local verification remains ambiguous under the defined ambiguity criteria.
|
|
279
|
+
|
|
280
|
+
### Rule 4
|
|
281
|
+
|
|
282
|
+
Network activity evidence MUST be treated as auxiliary signal, not authoritative proof of action success.
|
|
283
|
+
|
|
284
|
+
## Unified Diagnostic Signals
|
|
285
|
+
|
|
286
|
+
Network activity and log inspection are equivalent diagnostic signals.
|
|
287
|
+
|
|
288
|
+
Both:
|
|
289
|
+
- are secondary to UI state verification
|
|
290
|
+
- MUST NOT be used as default fallback for local-state actions
|
|
291
|
+
- follow the same escalation rules defined in this RFC
|
|
292
|
+
|
|
293
|
+
## Impact on classify_action_outcome
|
|
294
|
+
|
|
295
|
+
`classify_action_outcome` should be interpreted as routing logic, not a mandatory network escalation path.
|
|
296
|
+
|
|
297
|
+
For `uiChanged=false`, action category determines next step.
|
|
298
|
+
|
|
299
|
+
No automatic implication:
|
|
300
|
+
|
|
301
|
+
```text
|
|
302
|
+
uiChanged=false => inspect network
|
|
303
|
+
```
|
|
304
|
+
|
|
305
|
+
## Expected Benefits
|
|
306
|
+
|
|
307
|
+
- Fewer unnecessary tool calls
|
|
308
|
+
- Cleaner verification traces
|
|
309
|
+
- Reduced cargo-cult network probing
|
|
310
|
+
- Better behavior for local UI interactions
|
|
311
|
+
- Stronger separation between verification and diagnosis
|
|
312
|
+
- More reliable agent reasoning
|
|
313
|
+
|
|
314
|
+
## Compatibility
|
|
315
|
+
|
|
316
|
+
This is a patch-level specification correction.
|
|
317
|
+
|
|
318
|
+
It refines routing semantics but does not break:
|
|
319
|
+
- existing expect_* semantics
|
|
320
|
+
- snapshot response shape
|
|
321
|
+
- raw-over-semantic precedence
|
|
322
|
+
- action execution model
|
|
323
|
+
|
|
324
|
+
## Implementation Notes
|
|
325
|
+
|
|
326
|
+
Follow-up work may include:
|
|
327
|
+
- prompt updates
|
|
328
|
+
- regression examples for sliders/toggles/pickers
|
|
329
|
+
- protocol examples showing correct routing
|
|
330
|
+
- telemetry on reduced unnecessary network inspections
|
|
331
|
+
|
|
332
|
+
## Open Questions
|
|
333
|
+
|
|
334
|
+
Questions for review:
|
|
335
|
+
|
|
336
|
+
1. Should action category be explicitly emitted as runtime metadata, or is heuristic inference acceptable only within the fallback mapping layer defined in the Action Type Emission contract?
|
|
337
|
+
2. Should side-effect actions permit optional log inspection alongside network hints?
|
|
338
|
+
3. Should local-state verification examples be added to core spec or examples appendix?
|
|
339
|
+
|
|
340
|
+
## Decision Requested
|
|
341
|
+
|
|
342
|
+
Adopt verification routing based on action type and remove implicit default escalation from missing UI diffs to network inspection.
|
|
@@ -41,7 +41,7 @@ Outcome-specific guidance:
|
|
|
41
41
|
- visible navigation expected -> `wait_for_screen_change` (optional) -> `expect_screen`
|
|
42
42
|
- local UI change expected -> `wait_for_ui` (optional) -> `expect_element_visible`
|
|
43
43
|
- readable element state expected -> `wait_for_ui` (optional) -> `expect_state`
|
|
44
|
-
- backend/API activity expected without a visible UI change -> compare `get_screen_fingerprint` before/after, then call `
|
|
44
|
+
- backend/API activity expected without a visible UI change -> compare `get_screen_fingerprint` before/after, then call `classify_action_outcome` with the runtime `action_type`; collect `get_network_activity` only if the result remains ambiguous
|
|
45
45
|
|
|
46
46
|
For backend/API activity, `wait_for_screen_change` is not the right verification tool unless a visible transition is also expected.
|
|
47
47
|
|
|
@@ -151,6 +151,7 @@ Examples:
|
|
|
151
151
|
|
|
152
152
|
- `wait_for_ui`
|
|
153
153
|
- `wait_for_screen_change`
|
|
154
|
+
- `wait_for_ui_change`
|
|
154
155
|
|
|
155
156
|
### 6.2 Rules
|
|
156
157
|
|
|
@@ -239,6 +240,8 @@ Raw layer contents include:
|
|
|
239
240
|
- UI hierarchy or accessibility tree
|
|
240
241
|
- normalized readable element state where exposed by the platform
|
|
241
242
|
- platform-native identity hints such as stable identifiers, roles, and test tags
|
|
243
|
+
- snapshot metadata such as `snapshot_revision` and `captured_at_ms`
|
|
244
|
+
- `loading_state` when a reliable loading signal is detectable
|
|
242
245
|
- screenshot when available
|
|
243
246
|
- element-level attributes
|
|
244
247
|
- logs and fingerprint/activity observations
|
|
@@ -291,11 +294,11 @@ Tool: `classify_action_outcome`
|
|
|
291
294
|
|
|
292
295
|
Rules:
|
|
293
296
|
|
|
294
|
-
- MAY use UI, network, and log signals
|
|
297
|
+
- MAY use UI, action, network, and log signals
|
|
295
298
|
- MUST be deterministic
|
|
296
299
|
- MUST NOT replace `expect_*` tools
|
|
297
300
|
- MUST be treated as a supplementary signal only
|
|
298
|
-
- SHOULD be used with `get_network_activity` when the
|
|
301
|
+
- SHOULD be used with `get_network_activity` only when the outcome is still ambiguous after routing by `action_type`
|
|
299
302
|
|
|
300
303
|
It is not a verification mechanism.
|
|
301
304
|
|
|
@@ -305,10 +308,15 @@ Canonical pattern:
|
|
|
305
308
|
|
|
306
309
|
`wait_for_ui -> tap_element -> wait_for_screen_change (optional) -> expect_screen`
|
|
307
310
|
|
|
311
|
+
For in-place UI mutations, agents SHOULD prefer:
|
|
312
|
+
|
|
313
|
+
`wait_for_ui_change -> expect_element_visible / expect_state`
|
|
314
|
+
|
|
308
315
|
Interpretation:
|
|
309
316
|
|
|
310
317
|
- `tap_element.success` = executed
|
|
311
318
|
- `wait_for_screen_change.success` = UI changed
|
|
319
|
+
- `wait_for_ui_change.success` = in-place UI mutation observed and stable
|
|
312
320
|
- `expect_screen.success` = correct outcome verified
|
|
313
321
|
|
|
314
322
|
## 12. Known Deviations
|
package/docs/tools/interact.md
CHANGED
|
@@ -17,6 +17,7 @@ Important:
|
|
|
17
17
|
|
|
18
18
|
- `wait_for_*` tools must not be used as the final verification of action success when an applicable `expect_*` tool exists.
|
|
19
19
|
- action tools report execution success, not outcome correctness.
|
|
20
|
+
- `classify_action_outcome` should receive the runtime `action_type` when you want routing to distinguish local-state and side-effect actions.
|
|
20
21
|
|
|
21
22
|
## tap / swipe / type_text / press_back
|
|
22
23
|
|
|
@@ -54,10 +55,11 @@ Preferred verification:
|
|
|
54
55
|
- navigation outcome known -> `expect_screen`
|
|
55
56
|
- local UI change known -> `expect_element_visible`
|
|
56
57
|
- readable element state known -> `expect_state`
|
|
57
|
-
- backend/API activity expected -> `classify_action_outcome` + `get_network_activity`
|
|
58
|
+
- backend/API activity expected -> `classify_action_outcome` + optional `get_network_activity` if the UI signal remains ambiguous
|
|
58
59
|
|
|
59
|
-
Use `wait_for_screen_change` only when a visible transition is the expected outcome. If a button should trigger an API request but the screen should stay the same, rely on
|
|
60
|
-
For backend-only actions, prefer comparing `get_screen_fingerprint` before/after and
|
|
60
|
+
Use `wait_for_screen_change` only when a visible transition is the expected outcome. If a button should trigger an API request but the screen should stay the same, rely on `action_type` plus classification first.
|
|
61
|
+
For backend-only actions, prefer comparing `get_screen_fingerprint` before/after and collect `get_network_activity` immediately after the action only if the result is still ambiguous; do not wait on `wait_for_screen_change` if no visible transition is expected.
|
|
62
|
+
Use `wait_for_ui_change` when the screen stays in place but visible text or element state should change.
|
|
61
63
|
|
|
62
64
|
---
|
|
63
65
|
|
|
@@ -148,6 +150,26 @@ Notes:
|
|
|
148
150
|
|
|
149
151
|
---
|
|
150
152
|
|
|
153
|
+
## wait_for_ui_change
|
|
154
|
+
|
|
155
|
+
Purpose:
|
|
156
|
+
|
|
157
|
+
- detect a stable in-place UI mutation without naming a target element first
|
|
158
|
+
|
|
159
|
+
Capabilities:
|
|
160
|
+
|
|
161
|
+
- waits for hierarchy, text, or state deltas
|
|
162
|
+
- uses snapshot revision metadata when available
|
|
163
|
+
- confirms the change remains stable before returning success
|
|
164
|
+
|
|
165
|
+
Guidance:
|
|
166
|
+
|
|
167
|
+
- prefer `wait_for_screen_change` for navigation
|
|
168
|
+
- prefer `wait_for_ui_change` for in-place updates and recomposition-style changes
|
|
169
|
+
- follow with `expect_*` when the expected final state is known
|
|
170
|
+
|
|
171
|
+
---
|
|
172
|
+
|
|
151
173
|
## find_element
|
|
152
174
|
|
|
153
175
|
Locate a UI element on the current screen using semantic matching and return an actionable element descriptor.
|
|
@@ -486,17 +508,18 @@ Notes:
|
|
|
486
508
|
|
|
487
509
|
## classify_action_outcome + get_network_activity
|
|
488
510
|
|
|
489
|
-
Use this pair when the action
|
|
511
|
+
Use this pair when the action may trigger network/backend work and the screen may not visibly change.
|
|
490
512
|
|
|
491
513
|
Pattern:
|
|
492
514
|
|
|
493
515
|
1. perform the action
|
|
494
516
|
2. call `classify_action_outcome` with `uiChanged` from `wait_for_screen_change` or a screen fingerprint comparison
|
|
495
|
-
3.
|
|
496
|
-
4.
|
|
517
|
+
3. pass the runtime `action_type` value as `actionType`
|
|
518
|
+
4. collect `get_network_activity` only if the action is side-effect oriented and the UI signal remains ambiguous
|
|
519
|
+
5. call `classify_action_outcome` again with `networkRequests` if you collected them
|
|
497
520
|
|
|
498
521
|
Guidance:
|
|
499
522
|
|
|
500
523
|
- `uiChanged=true` or `expectedElementVisible=true` means the action outcome is already verified
|
|
501
|
-
-
|
|
502
|
-
-
|
|
524
|
+
- local-state actions should prefer refreshed snapshots, `expect_state`, or `expect_element_visible` over default network inspection
|
|
525
|
+
- network activity is auxiliary evidence, not mandatory proof
|
package/docs/tools/observe.md
CHANGED
|
@@ -83,13 +83,14 @@ Input:
|
|
|
83
83
|
Response (example):
|
|
84
84
|
|
|
85
85
|
```json
|
|
86
|
-
{ "device": { "platform": "android", "id": "emulator-5554" }, "screen": "", "resolution": { "width": 1080, "height": 2400 }, "elements": [ { "text": "Sign in", "type": "android.widget.Button", "resourceId": "com.example:id/signin", "clickable": true, "bounds": [0,0,100,50], "state": { "enabled": true }, "stable_id": "com.example:id/signin", "role": "button", "test_tag": "com.example:id/signin", "selector": { "value": "com.example:id/signin", "confidence": { "score": 1, "reason": "resource_id" } }, "semantic": { "is_clickable": true, "is_container": false } } ] }
|
|
86
|
+
{ "device": { "platform": "android", "id": "emulator-5554" }, "screen": "", "resolution": { "width": 1080, "height": 2400 }, "snapshot_revision": 12, "captured_at_ms": 1710000000123, "loading_state": { "active": true, "signal": "spinner", "source": "ui_tree" }, "elements": [ { "text": "Sign in", "type": "android.widget.Button", "resourceId": "com.example:id/signin", "clickable": true, "bounds": [0,0,100,50], "state": { "enabled": true }, "stable_id": "com.example:id/signin", "role": "button", "test_tag": "com.example:id/signin", "selector": { "value": "com.example:id/signin", "confidence": { "score": 1, "reason": "resource_id" } }, "semantic": { "is_clickable": true, "is_container": false } } ] }
|
|
87
87
|
```
|
|
88
88
|
|
|
89
89
|
Notes:
|
|
90
90
|
- Useful for inspection, selector development, and fallback debugging.
|
|
91
91
|
- Elements may include a normalized `state` object when the platform exposes readable state such as checked, selected, focused, expanded, text input, or slider values.
|
|
92
92
|
- Elements may also include platform-native identity hints such as `stable_id`, `role`, `test_tag`, `selector`, and `semantic`.
|
|
93
|
+
- The tree response may include `snapshot_revision`, `captured_at_ms`, and `loading_state` when a reliable signal is available.
|
|
93
94
|
- Prefer `wait_for_ui` for deterministic element resolution in interactive flows.
|
|
94
95
|
|
|
95
96
|
---
|
|
@@ -136,7 +137,8 @@ Behavior:
|
|
|
136
137
|
- Fast by default: does not wait for new logs and avoids long blocking operations.
|
|
137
138
|
- Returns a dual-layer payload:
|
|
138
139
|
- `raw` is authoritative and contains the underlying observation data unchanged.
|
|
139
|
-
|
|
140
|
+
- `semantic` is optional, derived from `raw`, and intended for planning only.
|
|
141
|
+
- `raw` now includes `snapshot_revision`, `captured_at_ms`, and `loading_state` when detectable.
|
|
140
142
|
|
|
141
143
|
Response (example):
|
|
142
144
|
|
package/package.json
CHANGED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
# RFC Review skill
|
|
2
|
+
|
|
3
|
+
name: rfc-review
|
|
4
|
+
version: 0.1.1
|
|
5
|
+
summary: Reusable workflow for reviewing RFCs/specs in this repository with a consistent readiness rubric and output template.
|
|
6
|
+
|
|
7
|
+
# Purpose
|
|
8
|
+
Help an agent review an RFC for clarity, implementation readiness, and alignment with the current codebase. Use a common template so reviews stay consistent across documents and reviewers.
|
|
9
|
+
|
|
10
|
+
# Activation conditions
|
|
11
|
+
Activate when an agent needs to:
|
|
12
|
+
- review a new or revised RFC
|
|
13
|
+
- assess whether an RFC is implementation-ready
|
|
14
|
+
- identify whether feedback is an RFC issue or an implementation issue
|
|
15
|
+
- compare a spec against the current `src/` contract surface and docs
|
|
16
|
+
|
|
17
|
+
# Surface area (actions)
|
|
18
|
+
- locate-rfc
|
|
19
|
+
- compare-against-code
|
|
20
|
+
- assess-contract-completeness
|
|
21
|
+
- classify-gaps
|
|
22
|
+
- produce-review
|
|
23
|
+
|
|
24
|
+
# Core guidance
|
|
25
|
+
1. Read the RFC first, then compare it against the relevant code, docs, and tests.
|
|
26
|
+
2. Separate **spec gaps** from **implementation gaps**.
|
|
27
|
+
3. Check for: problem clarity, scope boundaries, explicit contracts, acceptance criteria, non-goals, and consistency with existing behavior.
|
|
28
|
+
4. Prefer precise feedback that names the missing contract, unclear rule, or inconsistent behavior.
|
|
29
|
+
5. Use the shared review template in `references/rfc-review-template.md` for the final output.
|
|
30
|
+
6. If the RFC is not ready, say exactly what must be clarified before implementation can start.
|
|
31
|
+
7. Classify each blocker as either a **spec gap** or an **implementation contract gap** and stop at that boundary.
|
|
32
|
+
|
|
33
|
+
# Inputs & outputs
|
|
34
|
+
- review-rfc(input: { rfcPath, relatedPaths?, focusAreas? }) -> { verdict, risks, specGaps, implementationGaps, recommendations }
|
|
35
|
+
- compare-against-code(input: { rfcPath, codePaths[] }) -> { matches, mismatches, notes }
|
|
36
|
+
- produce-review(input: { rfcPath, findings[] }) -> { summary, verdict, checklist, nextStep }
|
|
37
|
+
|
|
38
|
+
# Failure handling
|
|
39
|
+
- If the RFC file is missing, stop and report the missing path explicitly.
|
|
40
|
+
- If the RFC is ambiguous, classify each concern as either "spec" or "implementation" instead of blending them.
|
|
41
|
+
- If the review cannot be grounded in the current repo, state that the RFC is not reviewable yet.
|
|
42
|
+
|
|
43
|
+
# Progressive disclosure
|
|
44
|
+
- Keep this file short.
|
|
45
|
+
- Load the reference template only when writing the final review.
|
|
46
|
+
|
|
47
|
+
# References
|
|
48
|
+
- `references/rfc-review-template.md` — standard review format and verdict rubric
|
|
49
|
+
- `references/rfc-review-checklist.md` — questions to apply while reviewing an RFC
|
|
50
|
+
|
|
51
|
+
# License
|
|
52
|
+
Same as repository (MIT).
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
# RFC Review Checklist
|
|
2
|
+
|
|
3
|
+
Ask these questions while reviewing:
|
|
4
|
+
|
|
5
|
+
1. Is the problem statement specific and grounded in current failures?
|
|
6
|
+
2. Are non-goals explicit?
|
|
7
|
+
3. Are contracts concrete enough to implement?
|
|
8
|
+
4. Are acceptance criteria testable?
|
|
9
|
+
5. Does the RFC define the source of truth for new fields or behaviors?
|
|
10
|
+
6. Does it match existing code paths and public tool surfaces?
|
|
11
|
+
7. Can each open concern be classified as a spec issue or an implementation issue?
|
|
12
|
+
8. Is the RFC ready to implement without further interpretation?
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# RFC Review Template
|
|
2
|
+
|
|
3
|
+
Use this structure for every RFC review:
|
|
4
|
+
|
|
5
|
+
## Verdict
|
|
6
|
+
- Ready / Needs clarification / Needs implementation contract / Not ready
|
|
7
|
+
|
|
8
|
+
## Summary
|
|
9
|
+
- One short paragraph on the RFC's current quality.
|
|
10
|
+
|
|
11
|
+
## What is good
|
|
12
|
+
- List the strongest parts of the RFC.
|
|
13
|
+
|
|
14
|
+
## Issues
|
|
15
|
+
For each issue, include:
|
|
16
|
+
- **Type:** spec / implementation / implementation contract / doc
|
|
17
|
+
- **Severity:** low / medium / high
|
|
18
|
+
- **Why it matters:** one sentence
|
|
19
|
+
- **Fix:** exact change needed
|
|
20
|
+
|
|
21
|
+
## Missing contract surfaces
|
|
22
|
+
- List any API shapes, response fields, state transitions, or invariants that are still undefined.
|
|
23
|
+
|
|
24
|
+
## Codebase alignment
|
|
25
|
+
- Note whether the RFC matches current `src/`, docs, and tests.
|
|
26
|
+
|
|
27
|
+
## Next step
|
|
28
|
+
- State the smallest next action needed to move the RFC forward.
|