mobile-debug-mcp 0.27.0 → 0.29.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.
- package/dist/interact/index.js +238 -11
- package/dist/server/common.js +134 -3
- package/dist/server-core.js +12 -2
- package/dist/server.js +5 -3
- package/docs/CHANGELOG.md +7 -0
- package/docs/ROADMAP.md +19 -22
- package/docs/rfcs/{012.md → 012-action-trace-and-xecution-observability.md} +43 -4
- package/docs/specs/mcp-tooling-spec-v1.md +14 -0
- package/docs/tools/interact.md +44 -0
- package/package.json +1 -1
- package/src/interact/index.ts +268 -12
- package/src/server/common.ts +194 -4
- package/src/server-core.ts +17 -1
- package/src/server.ts +5 -3
- package/src/types.ts +23 -0
- package/test/device/manual/observe/rfc012_trace.manual.ts +51 -0
- package/test/unit/interact/expect_tools.test.ts +57 -25
- package/test/unit/server/common.test.ts +24 -0
package/docs/ROADMAP.md
CHANGED
|
@@ -45,25 +45,22 @@ Higher task success with fewer retries.
|
|
|
45
45
|
- Stronger State Verification — Complete (Foundational verification layer shipped)
|
|
46
46
|
- Richer Element Identity — Complete (Identity and selector confidence foundations shipped)
|
|
47
47
|
- Better Compose / Custom Control Semantics — Complete (Semantic role enrichment and custom-adjustable inference shipped)
|
|
48
|
+
- Verification Stabilization and Temporal Convergence — Complete (Temporal verification and convergence logic shipped)
|
|
49
|
+
- Action Trace and Execution Observability — Complete (Structured execution trace model shipped)
|
|
48
50
|
|
|
49
51
|
## Current Focus
|
|
50
52
|
|
|
51
|
-
- Wait and Synchronization Reliability
|
|
53
|
+
- Wait and Synchronization Reliability (implementation + tuning)
|
|
52
54
|
- Actionability Resolution
|
|
53
|
-
-
|
|
55
|
+
- Adjustable Control Precision Hardening
|
|
54
56
|
|
|
55
57
|
## Upcoming Work
|
|
56
58
|
|
|
57
59
|
- Adjustable Control Precision Hardening
|
|
58
60
|
- Environment Auto-Configuration and Toolchain Discovery
|
|
59
61
|
- Adjustable Control Support
|
|
60
|
-
- Verification Stabilization and Temporal Convergence
|
|
61
62
|
- Signal-Oriented Diagnostic Filtering
|
|
62
63
|
- Long Press Gesture
|
|
63
|
-
# Stronger State Verification
|
|
64
|
-
# Richer Element Identity
|
|
65
|
-
# Wait and Synchronization Reliability
|
|
66
|
-
# Environment Auto-Configuration and Toolchain Discovery
|
|
67
64
|
|
|
68
65
|
## Rationale
|
|
69
66
|
Reduce onboarding friction and improve developer experience by minimizing manual setup dependencies.
|
|
@@ -115,7 +112,7 @@ Strengthens:
|
|
|
115
112
|
## Later Horizon
|
|
116
113
|
|
|
117
114
|
- Pinch to Zoom
|
|
118
|
-
-
|
|
115
|
+
- Advanced Trace Correlation and Analysis
|
|
119
116
|
|
|
120
117
|
---
|
|
121
118
|
|
|
@@ -251,7 +248,7 @@ Blocks or strengthens:
|
|
|
251
248
|
## Rationale
|
|
252
249
|
Real-world feedback exposed false-negative readiness failures caused by transient UI timing, even when target state had actually converged.
|
|
253
250
|
|
|
254
|
-
**Status:**
|
|
251
|
+
**Status:** Completed
|
|
255
252
|
|
|
256
253
|
Addresses friction where agents:
|
|
257
254
|
- fail readiness checks on transient timing races
|
|
@@ -615,12 +612,14 @@ Depends on:
|
|
|
615
612
|
|
|
616
613
|
---
|
|
617
614
|
|
|
618
|
-
#
|
|
615
|
+
# Advanced Trace Correlation
|
|
619
616
|
|
|
620
617
|
## Rationale
|
|
621
618
|
Very valuable for debugging,
|
|
622
619
|
but less critical than improving control success first.
|
|
623
620
|
|
|
621
|
+
Builds on the foundational Action Trace and Execution Observability capability by linking traces across UI, network, and logs.
|
|
622
|
+
|
|
624
623
|
**Status:** Planned
|
|
625
624
|
|
|
626
625
|
Improves diagnosis more than task completion.
|
|
@@ -695,7 +694,6 @@ Make core loop reliable and reduce onboarding friction.
|
|
|
695
694
|
- Adjustable Control Precision Hardening
|
|
696
695
|
- Better Compose / Custom Control Semantics
|
|
697
696
|
- Signal-Oriented Diagnostic Filtering
|
|
698
|
-
- Verification Stabilization and Temporal Convergence
|
|
699
697
|
|
|
700
698
|
Focus:
|
|
701
699
|
Improve control precision, verification convergence, custom control reliability, and signal observability.
|
|
@@ -712,7 +710,7 @@ Expand interaction capability after core control reliability is improved.
|
|
|
712
710
|
|
|
713
711
|
## Wave 4 (Advanced Gestures + Deep Observability)
|
|
714
712
|
- Pinch to Zoom
|
|
715
|
-
-
|
|
713
|
+
- Advanced Trace Correlation and Analysis
|
|
716
714
|
|
|
717
715
|
Focus:
|
|
718
716
|
Advanced gestures + deep observability.
|
|
@@ -725,16 +723,15 @@ Roadmap Ordering:
|
|
|
725
723
|
1. Stronger State Verification
|
|
726
724
|
2. Richer Element Identity
|
|
727
725
|
3. Wait and Synchronization Reliability
|
|
728
|
-
4.
|
|
729
|
-
5.
|
|
730
|
-
6.
|
|
731
|
-
7.
|
|
732
|
-
8.
|
|
733
|
-
9.
|
|
734
|
-
10.
|
|
735
|
-
11.
|
|
736
|
-
12.
|
|
737
|
-
13. Action Trace Correlation
|
|
726
|
+
4. Actionability Resolution
|
|
727
|
+
5. Adjustable Control Support
|
|
728
|
+
6. Adjustable Control Precision Hardening
|
|
729
|
+
7. Environment Auto-Configuration and Toolchain Discovery
|
|
730
|
+
8. Better Compose / Custom Control Semantics
|
|
731
|
+
9. Signal-Oriented Diagnostic Filtering
|
|
732
|
+
10. Long Press Gesture
|
|
733
|
+
11. Pinch to Zoom
|
|
734
|
+
12. Advanced Trace Correlation and Analysis
|
|
738
735
|
|
|
739
736
|
Rationale:
|
|
740
737
|
- Early roadmap items harden state, targeting, synchronization, environment readiness, and action execution.
|
|
@@ -68,7 +68,7 @@ interface ActionTrace {
|
|
|
68
68
|
action_id: string;
|
|
69
69
|
steps: TraceStep[];
|
|
70
70
|
final_outcome: "success" | "failure";
|
|
71
|
-
attempts: number;
|
|
71
|
+
attempts: number; // total execution attempts including recovery-triggered retries
|
|
72
72
|
}
|
|
73
73
|
```
|
|
74
74
|
|
|
@@ -79,10 +79,25 @@ interface TraceStep {
|
|
|
79
79
|
stage: "resolve" | "execute" | "verify" | "stabilize" | "recover";
|
|
80
80
|
timestamp: number;
|
|
81
81
|
result: "success" | "failure" | "retry";
|
|
82
|
+
attempt_index: number; // monotonic per action execution
|
|
83
|
+
cycle_id?: number; // groups steps within a recovery cycle
|
|
82
84
|
metadata?: Record<string, any>;
|
|
83
85
|
}
|
|
84
86
|
```
|
|
85
87
|
|
|
88
|
+
### 6.3 Partial Trace Requirements
|
|
89
|
+
|
|
90
|
+
For actions that do not traverse the full lifecycle (resolve → execute → verify → stabilize → recover), implementations MUST emit a partial trace.
|
|
91
|
+
|
|
92
|
+
A partial trace MUST:
|
|
93
|
+
- include a valid action_id
|
|
94
|
+
- include final_outcome
|
|
95
|
+
- include at least one TraceStep with a valid stage and timestamp
|
|
96
|
+
|
|
97
|
+
Partial traces MUST still respect attempt_index semantics.
|
|
98
|
+
|
|
99
|
+
This ensures observability coverage even for legacy or bypass execution paths.
|
|
100
|
+
|
|
86
101
|
---
|
|
87
102
|
|
|
88
103
|
## 7. Stage Emission Rules
|
|
@@ -158,13 +173,32 @@ Metadata MUST remain lightweight.
|
|
|
158
173
|
- RFC 010: stabilization emits stabilize stage
|
|
159
174
|
- RFC 011: recovery emits recover stage
|
|
160
175
|
|
|
161
|
-
|
|
176
|
+
### 10.1 Compatibility with RFC 006 Observability Model
|
|
177
|
+
|
|
178
|
+
RFC 006 defines traceability as being assembled from distributed signals rather than a centralized event system.
|
|
179
|
+
|
|
180
|
+
This RFC does NOT replace that model; it standardizes a unified projection layer over those signals.
|
|
181
|
+
|
|
182
|
+
- Existing emitters (server, interact, stabilization, recovery) remain the source of truth
|
|
183
|
+
- RFC 012 defines how those signals are composed into a single ActionTrace
|
|
184
|
+
- Actions that bypass parts of the lifecycle MUST still emit partial traces reflecting the stages they execute
|
|
185
|
+
|
|
186
|
+
This ensures backward compatibility while enabling a coherent trace surface.
|
|
162
187
|
|
|
163
188
|
---
|
|
164
189
|
|
|
165
190
|
## 11. Output Behavior
|
|
166
191
|
|
|
167
|
-
Trace
|
|
192
|
+
Trace MUST be produced for all action flows (full or partial, depending on runtime capability).
|
|
193
|
+
|
|
194
|
+
Canonical contract:
|
|
195
|
+
- Trace SHOULD be included in ActionExecutionResult when the runtime path supports full trace emission
|
|
196
|
+
- Trace MAY also be stored internally for diagnostics
|
|
197
|
+
|
|
198
|
+
If a runtime path cannot yet emit a full trace (e.g. legacy or bypass actions), it MUST emit a partial trace containing at least:
|
|
199
|
+
- action_id
|
|
200
|
+
- final_outcome
|
|
201
|
+
- at least one TraceStep representing the executed stage
|
|
168
202
|
|
|
169
203
|
Example:
|
|
170
204
|
|
|
@@ -172,10 +206,15 @@ Example:
|
|
|
172
206
|
interface ActionExecutionResult {
|
|
173
207
|
success: boolean;
|
|
174
208
|
failure_code?: string;
|
|
175
|
-
trace?: ActionTrace;
|
|
209
|
+
trace?: ActionTrace; // optional in type, required by RFC behavior (full or partial)
|
|
176
210
|
}
|
|
177
211
|
```
|
|
178
212
|
|
|
213
|
+
|
|
214
|
+
Implementations MUST treat the absence of `trace` in the runtime type as a temporary compatibility constraint, not as an absence of trace generation. All execution paths MUST still generate a trace internally, even if only a partial trace is returned externally.
|
|
215
|
+
|
|
216
|
+
The optionality of `trace` in ActionExecutionResult is transitional. Implementations MUST treat the absence of `trace` as a compatibility constraint rather than a valid steady-state. Future versions of the runtime MAY require `trace` to be present on all ActionExecutionResult values once all execution paths support full trace emission.
|
|
217
|
+
|
|
179
218
|
---
|
|
180
219
|
|
|
181
220
|
## 12. Failure Analysis
|
|
@@ -80,6 +80,19 @@ MUST be returned in this structure:
|
|
|
80
80
|
ui_fingerprint_after: string | null,
|
|
81
81
|
failure_code?: string,
|
|
82
82
|
retryable?: boolean,
|
|
83
|
+
trace: {
|
|
84
|
+
action_id: string,
|
|
85
|
+
steps: Array<{
|
|
86
|
+
stage: 'resolve' | 'execute' | 'verify' | 'stabilize' | 'recover',
|
|
87
|
+
timestamp: number,
|
|
88
|
+
result: 'success' | 'failure' | 'retry',
|
|
89
|
+
attempt_index: number,
|
|
90
|
+
cycle_id?: number,
|
|
91
|
+
metadata?: Record<string, unknown>
|
|
92
|
+
}>,
|
|
93
|
+
final_outcome: 'success' | 'failure',
|
|
94
|
+
attempts: number
|
|
95
|
+
},
|
|
83
96
|
recovery?: {
|
|
84
97
|
failure_class: string,
|
|
85
98
|
runtime_code: string,
|
|
@@ -104,6 +117,7 @@ Rules:
|
|
|
104
117
|
- `source_module` identifies where the envelope was produced
|
|
105
118
|
- fingerprints represent observed pre/post UI state on a best-effort basis
|
|
106
119
|
- `failure_code` is optional but MUST be used when a structured mapping exists
|
|
120
|
+
- `trace` is required and carries the observable execution path
|
|
107
121
|
- `recovery` MAY be attached to failed actions to carry typed recovery metadata
|
|
108
122
|
|
|
109
123
|
### 4.4 Allowed Deviations
|
package/docs/tools/interact.md
CHANGED
|
@@ -40,6 +40,25 @@ Example response:
|
|
|
40
40
|
"source_module": "server",
|
|
41
41
|
"target": { "selector": { "x": 100, "y": 200 }, "resolved": null },
|
|
42
42
|
"success": true,
|
|
43
|
+
"trace": {
|
|
44
|
+
"action_id": "tap_element_1710000000002_3",
|
|
45
|
+
"steps": [
|
|
46
|
+
{
|
|
47
|
+
"stage": "resolve",
|
|
48
|
+
"timestamp": 1710000000002,
|
|
49
|
+
"result": "success",
|
|
50
|
+
"attempt_index": 0
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
"stage": "execute",
|
|
54
|
+
"timestamp": 1710000000003,
|
|
55
|
+
"result": "success",
|
|
56
|
+
"attempt_index": 1
|
|
57
|
+
}
|
|
58
|
+
],
|
|
59
|
+
"final_outcome": "success",
|
|
60
|
+
"attempts": 1
|
|
61
|
+
},
|
|
43
62
|
"ui_fingerprint_before": "fp_before",
|
|
44
63
|
"ui_fingerprint_after": "fp_after"
|
|
45
64
|
}
|
|
@@ -395,6 +414,31 @@ Failure response:
|
|
|
395
414
|
"success": false,
|
|
396
415
|
"failure_code": "STALE_REFERENCE",
|
|
397
416
|
"retryable": true,
|
|
417
|
+
"trace": {
|
|
418
|
+
"action_id": "tap_element_1710000000003_4",
|
|
419
|
+
"steps": [
|
|
420
|
+
{
|
|
421
|
+
"stage": "resolve",
|
|
422
|
+
"timestamp": 1710000000003,
|
|
423
|
+
"result": "failure",
|
|
424
|
+
"attempt_index": 0
|
|
425
|
+
},
|
|
426
|
+
{
|
|
427
|
+
"stage": "execute",
|
|
428
|
+
"timestamp": 1710000000004,
|
|
429
|
+
"result": "failure",
|
|
430
|
+
"attempt_index": 1
|
|
431
|
+
},
|
|
432
|
+
{
|
|
433
|
+
"stage": "recover",
|
|
434
|
+
"timestamp": 1710000000005,
|
|
435
|
+
"result": "retry",
|
|
436
|
+
"attempt_index": 2
|
|
437
|
+
}
|
|
438
|
+
],
|
|
439
|
+
"final_outcome": "failure",
|
|
440
|
+
"attempts": 1
|
|
441
|
+
},
|
|
398
442
|
"recovery": {
|
|
399
443
|
"failure_class": "TargetResolutionFailure",
|
|
400
444
|
"runtime_code": "STALE_REFERENCE",
|