mobile-debug-mcp 0.34.0 → 0.36.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/.agents/skills/mcp-builder/SKILL.md +44 -64
- package/.agents/skills/mcp-builder/references/build-flags.md +44 -43
- package/.agents/skills/mcp-builder/references/diagnostics-schema.md +4 -1
- package/.agents/skills/mcp-builder/references/toolchain-details.md +49 -62
- package/.agents/skills/spec-review/references/spec-review-checklist.md +7 -0
- package/.agents/skills/test-authoring/SKILL.md +7 -6
- package/.agents/skills/test-authoring/references/repo-test-layout.md +3 -1
- package/.agents/skills/test-authoring/references/test-authoring-workflow.md +16 -7
- package/.agents/skills/test-authoring/references/test-quality-checklist.md +2 -1
- package/.cursor-plugin/marketplace.json +1 -1
- package/.github/copilot-instructions.md +14 -36
- package/.github/workflows/ci.yml +4 -4
- package/AGENTS.md +12 -3
- package/CONTRIBUTING.md +79 -0
- package/README.md +218 -129
- package/agent-plugin/.antigravity-plugin/README.md +48 -0
- package/agent-plugin/.antigravity-plugin/plugin.json +18 -0
- package/agent-plugin/.claude-plugin/plugin.json +2 -2
- package/agent-plugin/.codex-plugin/plugin.json +1 -1
- package/agent-plugin/.cursor-plugin/plugin.json +2 -2
- package/agent-plugin/.mcp.json +1 -1
- package/agent-plugin/README.md +50 -11
- package/agent-plugin/cursor/.cursor-plugin/plugin.json +23 -0
- package/agent-plugin/cursor/LICENSE +201 -0
- package/agent-plugin/cursor/README.md +9 -0
- package/agent-plugin/cursor/skills/mobile-debug-mcp/SKILL.md +253 -0
- package/agent-plugin/mcp.json +1 -1
- package/agent-plugin/mcp_config.json +13 -0
- package/agent-plugin/plugin.json +1 -1
- package/agent-plugin/skills/mobile-debug-mcp/SKILL.md +62 -17
- package/dist/contracts/execution-controls.js +24 -0
- package/dist/contracts/selector.js +8 -0
- package/dist/contracts/target.js +15 -0
- package/dist/contracts/ui.js +1 -0
- package/dist/debugger/android.js +2 -1
- package/dist/debugger/diagnostics.js +54 -0
- package/dist/debugger/guard.js +4 -4
- package/dist/debugger/ios-worker.js +62 -0
- package/dist/debugger/ios.js +57 -0
- package/dist/debugger/protocol.js +33 -0
- package/dist/debugger/sessions.js +133 -74
- package/dist/debugger/worker.js +59 -46
- package/dist/interact/adjustment/adjustment-context.js +41 -0
- package/dist/interact/adjustment/adjustment-gestures.js +55 -0
- package/dist/interact/adjustment/adjustment-plan.js +18 -0
- package/dist/interact/adjustment/adjustment-resolution.js +127 -0
- package/dist/interact/adjustment/adjustment-result.js +19 -0
- package/dist/interact/adjustment/adjustment-semantic.js +64 -0
- package/dist/interact/adjustment/adjustment-verification.js +35 -0
- package/dist/interact/adjustment/adjustment.js +52 -0
- package/dist/interact/adjustment/control-geometry.js +87 -0
- package/dist/interact/adjustment/control-values.js +136 -0
- package/dist/interact/adjustment/slider-labels.js +84 -0
- package/dist/interact/assertions/screen-assertion.js +37 -0
- package/dist/interact/assertions/state-assertion-context.js +35 -0
- package/dist/interact/assertions/state-assertion.js +76 -0
- package/dist/interact/assertions/state-comparison.js +141 -0
- package/dist/interact/assertions/visibility-assertion.js +34 -0
- package/dist/interact/conditional-action.js +12 -7
- package/dist/interact/index.js +77 -3092
- package/dist/interact/input-service.js +1 -0
- package/dist/interact/interaction-trace.js +21 -0
- package/dist/interact/model.js +1 -0
- package/dist/interact/observation.js +1 -0
- package/dist/interact/targeting/candidate-ancestor.js +58 -0
- package/dist/interact/targeting/candidate-result.js +23 -0
- package/dist/interact/targeting/candidate-scoring.js +50 -0
- package/dist/interact/targeting/element-helpers.js +216 -0
- package/dist/interact/targeting/find-element.js +65 -0
- package/dist/interact/targeting/nearby-control.js +56 -0
- package/dist/interact/targeting/resolved-elements.js +21 -0
- package/dist/interact/targeting/tap-target.js +17 -0
- package/dist/interact/targeting/target-scope.js +104 -0
- package/dist/interact/waits/legacy-log-wait.js +38 -0
- package/dist/interact/waits/legacy-wait-observations.js +103 -0
- package/dist/interact/waits/legacy-wait-state.js +34 -0
- package/dist/interact/waits/legacy-wait.js +48 -0
- package/dist/interact/waits/screen-wait.js +49 -0
- package/dist/interact/waits/ui-change-helpers.js +157 -0
- package/dist/interact/waits/ui-change-state.js +18 -0
- package/dist/interact/waits/ui-change-wait.js +77 -0
- package/dist/interact/waits/ui-wait-condition.js +56 -0
- package/dist/interact/waits/ui-wait-state.js +38 -0
- package/dist/interact/waits/ui-wait.js +106 -0
- package/dist/manage/android.js +55 -51
- package/dist/manage/index.js +38 -75
- package/dist/manage/ios/build-types.js +1 -0
- package/dist/manage/ios/build.js +210 -0
- package/dist/manage/ios/project-discovery.js +29 -0
- package/dist/manage/ios/scheme.js +18 -0
- package/dist/manage/ios.js +44 -256
- package/dist/observe/android/context.js +1 -0
- package/dist/observe/android/current-screen.js +55 -0
- package/dist/observe/android/fingerprint.js +13 -0
- package/dist/observe/android/log-stream.js +132 -0
- package/dist/observe/android/logs.js +107 -0
- package/dist/observe/android/screenshot.js +70 -0
- package/dist/observe/android/ui-tree.js +107 -0
- package/dist/observe/android.js +16 -520
- package/dist/observe/evidence.js +114 -75
- package/dist/observe/index.js +16 -263
- package/dist/observe/ios/context.js +16 -0
- package/dist/observe/ios/fingerprint.js +12 -0
- package/dist/observe/ios/log-stream.js +105 -0
- package/dist/observe/ios/logs.js +168 -0
- package/dist/observe/ios/screenshot.js +22 -0
- package/dist/observe/ios/ui-elements.js +241 -0
- package/dist/observe/ios/ui-tree.js +137 -0
- package/dist/observe/ios-trace/artifact.js +63 -0
- package/dist/observe/ios-trace/capabilities.js +86 -0
- package/dist/observe/ios-trace/native.js +93 -0
- package/dist/observe/ios-trace/notification.js +35 -0
- package/dist/observe/ios-trace/process.js +98 -0
- package/dist/observe/ios-trace/sessions.js +244 -0
- package/dist/observe/ios.js +17 -715
- package/dist/observe/logs/model.js +1 -0
- package/dist/{network → observe/network}/index.js +2 -2
- package/dist/observe/readiness-service.js +5 -3
- package/dist/observe/readiness.js +33 -14
- package/dist/observe/screenshot-encoding.js +41 -0
- package/dist/observe/snapshot-collection.js +79 -0
- package/dist/observe/snapshot-logs.js +30 -0
- package/dist/observe/snapshot-metadata.js +43 -31
- package/dist/observe/snapshot-semantic.js +115 -0
- package/dist/observe/system-trace-error.js +7 -0
- package/dist/observe/system-trace-router.js +81 -0
- package/dist/observe/system-trace.js +26 -21
- package/dist/runtime/action-results.js +270 -0
- package/dist/runtime/clock.js +4 -0
- package/dist/server/common.js +1 -256
- package/dist/server/definitions/assert.js +162 -0
- package/dist/server/definitions/diagnostic.js +118 -0
- package/dist/server/definitions/input.js +274 -0
- package/dist/server/definitions/manage.js +194 -0
- package/dist/server/definitions/observe.js +149 -0
- package/dist/server/definitions/target.js +138 -0
- package/dist/server/definitions/wait.js +105 -0
- package/dist/server/handlers/action-execution.js +163 -0
- package/dist/server/handlers/correlation.js +23 -0
- package/dist/server/handlers/debugger-handlers.js +67 -0
- package/dist/server/handlers/debugger-response.js +9 -0
- package/dist/server/handlers/diagnostic.js +77 -0
- package/dist/server/handlers/handler-types.js +1 -0
- package/dist/server/handlers/input.js +154 -0
- package/dist/server/handlers/interact.js +113 -0
- package/dist/server/handlers/journey-assertions.js +35 -0
- package/dist/server/handlers/journey.js +147 -0
- package/dist/server/handlers/manage.js +119 -0
- package/dist/server/handlers/observe.js +95 -0
- package/dist/server/handlers/payload.js +4 -0
- package/dist/server/handlers/tool-handlers.js +170 -0
- package/dist/server/schemas/condition-schema.js +2 -0
- package/dist/server/{debugger-schema.js → schemas/debugger-schema.js} +20 -12
- package/dist/server/{journey-schema.js → schemas/journey-schema.js} +7 -22
- package/dist/server/schemas/system-trace-schema.js +22 -0
- package/dist/server/tool-definitions.js +58 -1135
- package/dist/server-core.js +2 -2
- package/dist/server.js +4 -4
- package/dist/system/android-status.js +101 -0
- package/dist/system/android.js +37 -27
- package/dist/system/index.js +13 -439
- package/dist/system/ios-status.js +132 -0
- package/dist/system/ios.js +11 -8
- package/dist/system/model.js +1 -0
- package/dist/system/probes.js +105 -0
- package/dist/system/status-summary.js +43 -0
- package/dist/system/unsupported-status.js +52 -0
- package/dist/utils/android/commands.js +89 -0
- package/dist/utils/android/gradle.js +139 -0
- package/dist/utils/android/logs.js +103 -0
- package/dist/utils/android/ui-tree.js +233 -0
- package/dist/utils/android/utils.js +6 -564
- package/dist/utils/cli/idb/idb-helper.js +4 -6
- package/dist/utils/cli/idb/install-idb.js +13 -9
- package/dist/utils/cli/ios/preflight-ios.js +42 -38
- package/dist/utils/ios/utils.js +48 -46
- package/dist/utils/java.js +65 -49
- package/dist/utils/resolve-device.js +4 -2
- package/dist/utils/ui/index.js +26 -26
- package/docs/CHANGELOG.md +67 -1
- package/docs/README.md +38 -0
- package/docs/agent-plugin-installation-verification.md +39 -0
- package/docs/benchmarks/README.md +18 -0
- package/docs/benchmarks/interaction-latency/README.md +14 -0
- package/docs/benchmarks/interaction-latency/final.md +4 -1
- package/docs/benchmarks/interaction-latency/ios-validation.md +2 -0
- package/docs/benchmarks/ui-tree-performance/README.md +24 -16
- package/docs/benchmarks/ui-tree-performance/comparison.md +11 -10
- package/docs/code-structure.md +120 -0
- package/docs/specs/001-state-verification/spec.md +16 -14
- package/docs/specs/002-richer-element-identity/spec.md +12 -10
- package/docs/specs/003-wait-and-synchronization-reliability/spec.md +12 -10
- package/docs/specs/004-action-verification-routing/spec.md +3 -3
- package/docs/specs/005-unified-action-execution-and-verification-model/spec.md +2 -0
- package/docs/specs/006-runtime-action-instrumentation-and-binding-layer/spec.md +2 -0
- package/docs/specs/007-actionability-resolution-and-executable-target-selection/spec.md +3 -1
- package/docs/specs/008-adjustable-control-support-and-semantic-value-manipulation/spec.md +3 -4
- package/docs/specs/009-semantic-control-modeling-for-custom-and-composite-controls/spec.md +2 -0
- package/docs/specs/010-verification-stabilization-and-temporal-convergence/spec.md +2 -2
- package/docs/specs/011-recovery-and-replanning-for-failed-or-ambiguous-interaction-flows/spec.md +2 -2
- package/docs/specs/011.1-recovery-contract-types-and-runtime-wiring-spec/spec.md +2 -0
- package/docs/specs/012-action-trace-and-xecution-observability/spec.md +2 -3
- package/docs/specs/013-wait-and-synchronization-reliability/spec.md +19 -19
- package/docs/specs/014-actionability-resolution/spec.md +20 -18
- package/docs/specs/015-adjustable-control-support/spec.md +17 -15
- package/docs/specs/016-environment-tools/spec.md +20 -20
- package/docs/specs/018-interaction-latency-and-batched-journeys/spec.md +2 -0
- package/docs/specs/019-ui-tree-observation-performance/spec.md +3 -1
- package/docs/specs/020-conditional-actions/intent.md +5 -3
- package/docs/specs/020-conditional-actions/plan.md +8 -9
- package/docs/specs/020-conditional-actions/spec.md +4 -2
- package/docs/specs/021-app-readiness-signals/intent.md +4 -2
- package/docs/specs/021-app-readiness-signals/plan.md +7 -6
- package/docs/specs/021-app-readiness-signals/spec.md +3 -1
- package/docs/specs/022-correlated-evidence/intent.md +4 -4
- package/docs/specs/022-correlated-evidence/plan.md +10 -11
- package/docs/specs/022-correlated-evidence/spec.md +3 -1
- package/docs/specs/023-android-system-traces/intent.md +3 -2
- package/docs/specs/023-android-system-traces/plan.md +5 -7
- package/docs/specs/023-android-system-traces/spec.md +3 -1
- package/docs/specs/024-android-heap-dump-capture/intent.md +3 -1
- package/docs/specs/025-android-runtime-debugger/intent.md +4 -3
- package/docs/specs/025-android-runtime-debugger/plan.md +3 -1
- package/docs/specs/025-android-runtime-debugger/spec.md +4 -3
- package/docs/specs/026-code-structure-and-quality-gates/health-plan.md +88 -0
- package/docs/specs/026-code-structure-and-quality-gates/intent.md +47 -0
- package/docs/specs/026-code-structure-and-quality-gates/plan.md +191 -0
- package/docs/specs/026-code-structure-and-quality-gates/spec.md +138 -0
- package/docs/specs/026-code-structure-and-quality-gates/verification-final.json +200 -0
- package/docs/specs/026-code-structure-and-quality-gates/verification-thin-facade.json +154 -0
- package/docs/specs/026-code-structure-and-quality-gates/verification.json +136 -0
- package/docs/specs/027-debugger-failure-diagnostics/intent.md +43 -0
- package/docs/specs/027-debugger-failure-diagnostics/plan.md +86 -0
- package/docs/specs/027-debugger-failure-diagnostics/spec.md +133 -0
- package/docs/specs/028-compact-debugger-responses/intent.md +41 -0
- package/docs/specs/028-compact-debugger-responses/plan.md +112 -0
- package/docs/specs/028-compact-debugger-responses/spec.md +108 -0
- package/docs/specs/029-kotlin-locals-validation/report.md +119 -0
- package/docs/specs/030-android-coroutine-validation/evidence.json +475 -0
- package/docs/specs/030-android-coroutine-validation/intent.md +47 -0
- package/docs/specs/030-android-coroutine-validation/plan.md +147 -0
- package/docs/specs/030-android-coroutine-validation/report.md +240 -0
- package/docs/specs/030-android-coroutine-validation/spec.md +107 -0
- package/docs/specs/031-ios-system-traces/intent.md +38 -0
- package/docs/specs/031-ios-system-traces/investigation.md +92 -0
- package/docs/specs/031-ios-system-traces/late-run-failure-evidence.json +32 -0
- package/docs/specs/031-ios-system-traces/plan.md +138 -0
- package/docs/specs/031-ios-system-traces/pr102-monitor-evidence.json +22 -0
- package/docs/specs/031-ios-system-traces/simulator-evidence.json +47 -0
- package/docs/specs/031-ios-system-traces/spec.md +135 -0
- package/docs/specs/032-ios-runtime-debugger/evidence.json +176 -0
- package/docs/specs/032-ios-runtime-debugger/intent.md +38 -0
- package/docs/specs/032-ios-runtime-debugger/plan.md +95 -0
- package/docs/specs/032-ios-runtime-debugger/report.md +205 -0
- package/docs/specs/032-ios-runtime-debugger/spec.md +153 -0
- package/docs/tools/TOOLS.md +31 -18
- package/docs/tools/{evidence.md → correlated-evidence.md} +9 -1
- package/docs/tools/debugger.md +120 -4
- package/docs/tools/interact.md +42 -20
- package/docs/tools/manage.md +25 -44
- package/docs/tools/observe.md +55 -23
- package/docs/tools/system-traces.md +89 -14
- package/docs/tools/system.md +12 -5
- package/package.json +12 -8
- package/scripts/agent-plugin.mjs +55 -5
- package/scripts/architecture-graph.mjs +69 -0
- package/scripts/check-architecture.mjs +47 -0
- package/scripts/code-quality-baseline.json +1 -0
- package/scripts/code-quality.mjs +161 -0
- package/src/contracts/execution-controls.ts +26 -0
- package/src/contracts/selector.ts +17 -0
- package/src/contracts/target.ts +19 -0
- package/src/contracts/ui.ts +94 -0
- package/src/debugger/android.ts +3 -2
- package/src/debugger/diagnostics.ts +43 -0
- package/src/debugger/guard.ts +10 -5
- package/src/debugger/ios-worker.ts +49 -0
- package/src/debugger/ios.ts +45 -0
- package/{worker → src/debugger/java}/DebuggerWorker.java +9 -3
- package/src/debugger/lldb/breakpoints.py +51 -0
- package/src/debugger/lldb/inspection.py +109 -0
- package/src/debugger/lldb/worker.py +203 -0
- package/src/debugger/protocol.ts +37 -0
- package/src/debugger/sessions.ts +326 -155
- package/src/debugger/worker.ts +57 -41
- package/src/interact/adjustment/adjustment-context.ts +83 -0
- package/src/interact/adjustment/adjustment-gestures.ts +48 -0
- package/src/interact/adjustment/adjustment-plan.ts +23 -0
- package/src/interact/adjustment/adjustment-resolution.ts +104 -0
- package/src/interact/adjustment/adjustment-result.ts +34 -0
- package/src/interact/adjustment/adjustment-semantic.ts +53 -0
- package/src/interact/adjustment/adjustment-verification.ts +60 -0
- package/src/interact/adjustment/adjustment.ts +49 -0
- package/src/interact/adjustment/control-geometry.ts +120 -0
- package/src/interact/adjustment/control-values.ts +141 -0
- package/src/interact/adjustment/slider-labels.ts +84 -0
- package/src/interact/assertions/screen-assertion.ts +39 -0
- package/src/interact/assertions/state-assertion-context.ts +48 -0
- package/src/interact/assertions/state-assertion.ts +64 -0
- package/src/interact/assertions/state-comparison.ts +168 -0
- package/src/interact/assertions/visibility-assertion.ts +41 -0
- package/src/interact/conditional-action.ts +18 -12
- package/src/interact/index.ts +89 -3494
- package/src/interact/input-service.ts +11 -0
- package/src/interact/interaction-trace.ts +36 -0
- package/src/interact/model.ts +109 -0
- package/src/interact/observation.ts +7 -0
- package/src/interact/targeting/candidate-ancestor.ts +49 -0
- package/src/interact/targeting/candidate-result.ts +24 -0
- package/src/interact/targeting/candidate-scoring.ts +42 -0
- package/src/interact/targeting/element-helpers.ts +243 -0
- package/src/interact/targeting/find-element.ts +47 -0
- package/src/interact/targeting/nearby-control.ts +46 -0
- package/src/interact/targeting/resolved-elements.ts +20 -0
- package/src/interact/targeting/tap-target.ts +22 -0
- package/src/interact/targeting/target-scope.ts +121 -0
- package/src/interact/waits/legacy-log-wait.ts +30 -0
- package/src/interact/waits/legacy-wait-observations.ts +55 -0
- package/src/interact/waits/legacy-wait-state.ts +48 -0
- package/src/interact/waits/legacy-wait.ts +34 -0
- package/src/interact/waits/screen-wait.ts +37 -0
- package/src/interact/waits/ui-change-helpers.ts +184 -0
- package/src/interact/waits/ui-change-state.ts +26 -0
- package/src/interact/waits/ui-change-wait.ts +59 -0
- package/src/interact/waits/ui-wait-condition.ts +52 -0
- package/src/interact/waits/ui-wait-state.ts +55 -0
- package/src/interact/waits/ui-wait.ts +84 -0
- package/src/manage/android.ts +56 -50
- package/src/manage/index.ts +63 -93
- package/src/manage/ios/build-types.ts +14 -0
- package/src/manage/ios/build.ts +230 -0
- package/src/manage/ios/project-discovery.ts +26 -0
- package/src/manage/ios/scheme.ts +16 -0
- package/src/manage/ios.ts +67 -298
- package/src/observe/android/context.ts +1 -0
- package/src/observe/android/current-screen.ts +63 -0
- package/src/observe/android/fingerprint.ts +13 -0
- package/src/observe/android/log-stream.ts +127 -0
- package/src/observe/android/logs.ts +110 -0
- package/src/observe/android/screenshot.ts +79 -0
- package/src/observe/android/ui-tree.ts +113 -0
- package/src/observe/android.ts +17 -531
- package/src/observe/evidence.ts +122 -70
- package/src/observe/index.ts +24 -286
- package/src/observe/ios/context.ts +22 -0
- package/src/observe/ios/fingerprint.ts +12 -0
- package/src/observe/ios/log-stream.ts +103 -0
- package/src/observe/ios/logs.ts +179 -0
- package/src/observe/ios/screenshot.ts +26 -0
- package/src/observe/ios/ui-elements.ts +266 -0
- package/src/observe/ios/ui-tree.ts +143 -0
- package/src/observe/ios-trace/artifact.ts +55 -0
- package/src/observe/ios-trace/capabilities.ts +74 -0
- package/src/observe/ios-trace/native.ts +72 -0
- package/src/observe/ios-trace/notification.ts +30 -0
- package/src/observe/ios-trace/process.ts +82 -0
- package/src/observe/ios-trace/sessions.ts +204 -0
- package/src/observe/ios.ts +18 -749
- package/src/observe/logs/model.ts +11 -0
- package/src/{network → observe/network}/index.ts +2 -2
- package/src/observe/readiness-service.ts +6 -4
- package/src/observe/readiness.ts +42 -21
- package/src/observe/screenshot-encoding.ts +32 -0
- package/src/observe/snapshot-collection.ts +69 -0
- package/src/observe/snapshot-logs.ts +26 -0
- package/src/observe/snapshot-metadata.ts +51 -31
- package/src/observe/snapshot-semantic.ts +153 -0
- package/src/observe/system-trace-error.ts +3 -0
- package/src/observe/system-trace-router.ts +61 -0
- package/src/observe/system-trace.ts +28 -19
- package/src/runtime/action-results.ts +376 -0
- package/src/runtime/clock.ts +9 -0
- package/src/server/common.ts +9 -359
- package/src/server/definitions/assert.ts +164 -0
- package/src/server/definitions/diagnostic.ts +120 -0
- package/src/server/definitions/input.ts +276 -0
- package/src/server/definitions/manage.ts +196 -0
- package/src/server/definitions/observe.ts +151 -0
- package/src/server/definitions/target.ts +140 -0
- package/src/server/definitions/wait.ts +107 -0
- package/src/server/handlers/action-execution.ts +164 -0
- package/src/server/handlers/correlation.ts +20 -0
- package/src/server/handlers/debugger-handlers.ts +58 -0
- package/src/server/handlers/debugger-response.ts +7 -0
- package/src/server/handlers/diagnostic.ts +86 -0
- package/src/server/handlers/handler-types.ts +7 -0
- package/src/server/handlers/input.ts +173 -0
- package/src/server/handlers/interact.ts +135 -0
- package/src/server/handlers/journey-assertions.ts +39 -0
- package/src/server/handlers/journey.ts +132 -0
- package/src/server/handlers/manage.ts +141 -0
- package/src/server/handlers/observe.ts +116 -0
- package/src/server/handlers/payload.ts +36 -0
- package/src/server/handlers/tool-handlers.ts +170 -0
- package/src/server/schemas/condition-schema.ts +2 -0
- package/src/server/schemas/debugger-schema.ts +46 -0
- package/src/server/{journey-schema.ts → schemas/journey-schema.ts} +7 -22
- package/src/server/schemas/system-trace-schema.ts +23 -0
- package/src/server/tool-definitions.ts +67 -1143
- package/src/server-core.ts +2 -2
- package/src/server.ts +4 -4
- package/src/system/android-status.ts +124 -0
- package/src/system/android.ts +33 -21
- package/src/system/index.ts +21 -525
- package/src/system/ios-status.ts +147 -0
- package/src/system/ios.ts +14 -10
- package/src/system/model.ts +41 -0
- package/src/system/probes.ts +114 -0
- package/src/system/status-summary.ts +47 -0
- package/src/system/unsupported-status.ts +55 -0
- package/src/types.ts +16 -106
- package/src/utils/android/commands.ts +81 -0
- package/src/utils/android/gradle.ts +132 -0
- package/src/utils/android/logs.ts +103 -0
- package/src/utils/android/ui-tree.ts +239 -0
- package/src/utils/android/utils.ts +16 -556
- package/src/utils/cli/idb/check-idb.ts +4 -4
- package/src/utils/cli/idb/idb-helper.ts +6 -8
- package/src/utils/cli/idb/install-idb.ts +15 -9
- package/src/utils/cli/ios/preflight-ios.ts +39 -31
- package/src/utils/cli/ios/run-ios-ui-tree-tap.ts +4 -4
- package/src/utils/ios/utils.ts +60 -61
- package/src/utils/java.ts +62 -43
- package/src/utils/resolve-device.ts +9 -6
- package/src/utils/ui/index.ts +28 -28
- package/test/device/automated/debugger/coroutine-lifecycle.ts +27 -0
- package/test/device/automated/debugger/coroutine-support.ts +140 -0
- package/test/device/automated/debugger/coroutine.android.test.ts +169 -0
- package/test/device/automated/debugger/kotlin.android.test.ts +127 -0
- package/test/device/automated/debugger/runtime.android.test.ts +19 -3
- package/test/device/automated/debugger/runtime.ios.test.ts +221 -0
- package/test/device/automated/interact/interaction.android.test.ts +56 -0
- package/test/device/automated/observe/ios-system-trace.smoke.ts +119 -0
- package/test/device/automated/observe/system-trace.smoke.ts +1 -1
- package/test/device/manual/interact/modul8_selector_tap.manual.ts +1 -1
- package/test/fixtures/contracts/tool-definitions.json +3696 -0
- package/test/fixtures/coroutine-app/MainActivity.kt +100 -0
- package/test/fixtures/coroutine-app/README.md +48 -0
- package/test/fixtures/coroutine-app/build.ts +35 -0
- package/test/fixtures/debugger-app/MainActivity.java +21 -0
- package/test/fixtures/debugger-app/MainActivity.kt +32 -0
- package/test/fixtures/debugger-app/README.md +52 -0
- package/test/fixtures/debugger-app/build.ts +25 -15
- package/test/fixtures/ios-debugger-app/Main.swift +95 -0
- package/test/fixtures/ios-debugger-app/README.md +27 -0
- package/test/fixtures/ios-debugger-app/build.ts +21 -0
- package/test/fixtures/latency-journey-app/README.md +2 -0
- package/test/fixtures/readiness-app/README.md +2 -0
- package/test/helpers/ios-trace-shutdown.ts +29 -0
- package/test/unit/debugger/coroutine-lifecycle.test.ts +43 -0
- package/test/unit/debugger/diagnostic-sessions.test.ts +67 -0
- package/test/unit/debugger/diagnostics.test.ts +80 -0
- package/test/unit/debugger/guards.test.ts +4 -0
- package/test/unit/debugger/handle-guards.test.ts +88 -0
- package/test/unit/debugger/ios-preparation.test.ts +57 -0
- package/test/unit/debugger/ios.test.ts +104 -0
- package/test/unit/debugger/lldb-worker.py +166 -0
- package/test/unit/debugger/lldb-worker.test.ts +10 -0
- package/test/unit/debugger/preparation.test.ts +32 -0
- package/test/unit/debugger/protocol.test.ts +15 -0
- package/test/unit/debugger/sessions.test.ts +1 -1
- package/test/unit/interact/adjustment_service.test.ts +42 -0
- package/test/unit/interact/adjustment_verification.test.ts +35 -0
- package/test/unit/interact/clock_dependencies.test.ts +63 -0
- package/test/unit/interact/element_helpers.test.ts +19 -0
- package/test/unit/interact/legacy_wait_service.test.ts +17 -0
- package/test/unit/interact/state_comparison.test.ts +20 -0
- package/test/unit/interact/target_scope.test.ts +35 -0
- package/test/unit/network/get_network_activity.test.ts +1 -1
- package/test/unit/observe/ios-trace-native.test.ts +90 -0
- package/test/unit/observe/ios-trace-sessions.test.ts +131 -0
- package/test/unit/observe/readiness.test.ts +1 -1
- package/test/unit/observe/screenshot-encoding.test.ts +30 -0
- package/test/unit/observe/snapshot-logs.test.ts +14 -0
- package/test/unit/observe/system-trace-router.test.ts +49 -0
- package/test/unit/quality/agent-plugin-export.test.ts +38 -0
- package/test/unit/quality/architecture.test.ts +60 -0
- package/test/unit/quality/code-quality.test.ts +58 -0
- package/test/unit/quality/interaction_boundaries.test.ts +24 -0
- package/test/unit/server/conditional_actions.test.ts +1 -1
- package/test/unit/server/conditional_schema.test.ts +2 -2
- package/test/unit/server/debugger-response.test.ts +63 -0
- package/test/unit/server/system-trace.test.ts +12 -3
- package/test/unit/server/tool_definitions_parity.test.ts +8 -0
- package/dist/server/debugger-handlers.js +0 -38
- package/dist/server/system-trace-schema.js +0 -17
- package/dist/server/tool-handlers.js +0 -1000
- package/docs/ROADMAP.md +0 -646
- package/docs/benchmarks/ui-tree-performance/bridge-probe.json +0 -29
- package/docs/benchmarks/ui-tree-performance/initial-baseline.json +0 -59560
- package/docs/specs/baseline-spec-v0.md +0 -312
- package/docs/specs/mcp-tooling-spec-v1.md +0 -446
- package/src/server/debugger-handlers.ts +0 -29
- package/src/server/debugger-schema.ts +0 -37
- package/src/server/system-trace-schema.ts +0 -17
- package/src/server/tool-handlers.ts +0 -1008
- /package/dist/{server/condition-schema.js → contracts/condition.js} +0 -0
- /package/dist/server/{readiness-schema.js → schemas/readiness-schema.js} +0 -0
- /package/src/{server/condition-schema.ts → contracts/condition.ts} +0 -0
- /package/src/server/{readiness-schema.ts → schemas/readiness-schema.ts} +0 -0
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
# Plan: code structure and quality gates
|
|
2
|
+
|
|
3
|
+
[Intent](intent.md) · [Specification](spec.md) · [Verification metadata](verification.json)
|
|
4
|
+
|
|
5
|
+
Status: complete — implementation and required local verification passed.
|
|
6
|
+
Additional environment coverage remains explicitly unrun below.
|
|
7
|
+
The maintainer approved the specification with “ok, lets do it” on 2026-10-30,
|
|
8
|
+
and subsequently requested the folder cleanup and ArchUnitTS trial.
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
## Implementation
|
|
12
|
+
|
|
13
|
+
- [x] Capture complete public tool definitions and existing structural metrics.
|
|
14
|
+
- [x] Add structural/type/boundary checks to lint and CI, with per-symbol legacy
|
|
15
|
+
ceilings and rejection of growth, stale entries, duplicate identities and
|
|
16
|
+
inline suppression. No baseline rewrite command runs in lint or CI.
|
|
17
|
+
- [x] Extract shared runtime action-result/trace helpers and selector/condition
|
|
18
|
+
contracts, preserving server compatibility exports.
|
|
19
|
+
- [x] Extract typed element, control-value, geometry, label and UI-change helpers;
|
|
20
|
+
bounded handle storage; injected subtree lookup and adjustment verification;
|
|
21
|
+
adjustment planning/results; and readable-state comparison.
|
|
22
|
+
- [x] Complete the thin `ToolsInteract` facade: adjustment, resolution, polling,
|
|
23
|
+
assertion and legacy wait orchestration now live in typed services meeting
|
|
24
|
+
default limits without legacy exceptions. Existing handler/test seams remain.
|
|
25
|
+
- [x] Consolidate clock/delay dependencies across interaction polling services;
|
|
26
|
+
production timer and readiness-budget semantics remain intact, with deterministic
|
|
27
|
+
injected-clock coverage for stability, retries, deadlines and trace timestamps.
|
|
28
|
+
- [x] Split typed tool definitions by capability and retain exact registration order.
|
|
29
|
+
- [x] Split server handler orchestration by capability and separate action
|
|
30
|
+
dispatch, conditional rejection, verification, evidence and journey phases.
|
|
31
|
+
- [x] Share target-selection and execution-control contracts across TypeScript,
|
|
32
|
+
runtime validation and public schemas without changing permissive legacy parsing.
|
|
33
|
+
- [x] Organise interaction helpers by responsibility and place network
|
|
34
|
+
observations under `observe/network/`.
|
|
35
|
+
- [x] Add the explicitly approved ArchUnitTS development checks, including
|
|
36
|
+
negative controls for dynamic imports, re-exports, aliases and runtime cycles.
|
|
37
|
+
- [x] Type debugger session/event/result boundaries, validate worker messages and
|
|
38
|
+
separate command targeting, execution and error recovery. The refactored
|
|
39
|
+
session manager meets default limits without exceptions.
|
|
40
|
+
- [x] Add quality-gate failure cases, public contract baseline, and focused
|
|
41
|
+
helper/injection/protocol compatibility tests.
|
|
42
|
+
- [x] Document limits, ownership and exception review; verify this checkpoint.
|
|
43
|
+
|
|
44
|
+
## First-stage verification — 2026-10-30
|
|
45
|
+
|
|
46
|
+
| Criterion | Check | Result |
|
|
47
|
+
| --- | --- | --- |
|
|
48
|
+
| Contract parity | Complete before/after definitions and checked-in compatibility fixture | **Pass**: all 52 tool definitions, schemas, defaults, descriptions and order unchanged |
|
|
49
|
+
| Gate correctness | Size, complexity, nesting, types, boundaries, suppression and baseline fixtures | **Pass**: includes move/rename rejection, type-declaration isolation, obsolete entries and reductions |
|
|
50
|
+
| Interaction compatibility | Existing interaction/server tests plus helper, scope, state-comparison and injected-verification tests | **Pass** for extracted behaviour; remaining orchestration refactor is pending |
|
|
51
|
+
| Debugger lifecycle | Session/native/guard/protocol unit tests | **Pass**: serialization, stop references, event concurrency, expiry boundaries and cleanup |
|
|
52
|
+
| Maintainer checks | `npm run verify` | **Pass**: lint, quality gate, build, 78 unit files and plugin consistency on Node 23.11.0 |
|
|
53
|
+
| Native suite | `MCP_DEBUGGER_DEVICE=emulator-5554 npm run test:device` | **Pass**: 9 device files; Android debugger fixture, Android/iOS observation and correlation, Android Perfetto journeys |
|
|
54
|
+
| Java/package | `javac --release 17 --add-modules jdk.jdi`; built worker preparation; `npm pack --dry-run --json` | **Pass**: shell Java 23; package includes worker source, protocol, runtime and definition modules |
|
|
55
|
+
| Docs | Relative links/anchors, JSON and whitespace checks | **Pass** |
|
|
56
|
+
|
|
57
|
+
The first device attempt failed before app interaction because the test's build
|
|
58
|
+
fingerprint still referenced the removed `worker/` directory. Updated that
|
|
59
|
+
fingerprint to `src/debugger/java/`; the complete rerun passed without weakening
|
|
60
|
+
assertions or changing fixture behaviour.
|
|
61
|
+
|
|
62
|
+
Android debugger evidence uses emulator-5554, API 36, server 0.34.0 over MCP
|
|
63
|
+
stdio. It covers explicit attach, exact source stops, stack/known locals,
|
|
64
|
+
into/over/out, stale references, resume with UI evidence, paused-operation guards,
|
|
65
|
+
detach and forwarding ownership. Its complete dist/Java fingerprint is in the
|
|
66
|
+
linked metadata. The fixture and owned resources were removed. The optional
|
|
67
|
+
60-second expiry extension was **unrun**; deterministic expiry checks passed.
|
|
68
|
+
|
|
69
|
+
Correlation journeys pin the Android emulator and the iPhone 17 Pro simulator
|
|
70
|
+
(iOS 26.4). They launch Settings, capture referenced screenshots/logs/trees and
|
|
71
|
+
check freshness and unavailable references. No settings or app data changed;
|
|
72
|
+
Settings remains foreground. Older standalone observation wrappers use automatic
|
|
73
|
+
target selection; their results do not establish which physical device was read.
|
|
74
|
+
Perfetto checks pin the emulator and remove device/host trace artifacts.
|
|
75
|
+
|
|
76
|
+
Real-device adjustable-control convergence is **unrun**: the current automated
|
|
77
|
+
fixtures do not provide that journey. Adjustment behaviour has existing mock-
|
|
78
|
+
adapter coverage and new injected-verification tests. Physical-device debugger,
|
|
79
|
+
local Node 18, JDK 17 runtime execution, and hosted CI remain **unrun**. Existing
|
|
80
|
+
CI retains Node 18 and Java 17; successful local checks do not establish hosted
|
|
81
|
+
results or installed/published-package behaviour.
|
|
82
|
+
|
|
83
|
+
## ToolsInteract continuation — 2026-10-30
|
|
84
|
+
|
|
85
|
+
The maintainer requested continuing until the class met the 300-line limit.
|
|
86
|
+
The class now contains **189 counted lines**, in a 267-line file, with no legacy
|
|
87
|
+
exceptions. All 41 refactored interaction modules meet default file, function,
|
|
88
|
+
complexity, nesting, type and dependency rules. A permanent unit check rejects
|
|
89
|
+
exceptions for these modules, including future nested directories.
|
|
90
|
+
|
|
91
|
+
The facade composes observation and input dependencies and preserves existing
|
|
92
|
+
entrypoints. Adjustment stages cover resolution, planning, semantic strategies,
|
|
93
|
+
coordinate/gesture fallback and verification. Candidate search separates scoring,
|
|
94
|
+
ancestor preference and result construction. UI waits and assertions separate
|
|
95
|
+
state, observation, stability and result handling. Legacy wait modes retain their
|
|
96
|
+
baseline collection, polling and failure-snapshot behaviour.
|
|
97
|
+
|
|
98
|
+
| Check | Result |
|
|
99
|
+
| --- | --- |
|
|
100
|
+
| `npm run verify` | **Pass**: lint, quality gate, build, 81 unit files, plugin consistency |
|
|
101
|
+
| Default interaction budgets | **Pass**: 41 modules; no interaction-facade/service exceptions |
|
|
102
|
+
| Public tool definitions | **Pass**: all 52 definitions unchanged against the captured fixture |
|
|
103
|
+
| Native suite | **Pass**: 10 device files, including the new interaction journey |
|
|
104
|
+
| Package dry run | **Pass**: Java source and all runtime/service modules included |
|
|
105
|
+
| Documentation/JSON/whitespace | **Pass** |
|
|
106
|
+
|
|
107
|
+
[Continuation verification metadata](verification-thin-facade.json) records native
|
|
108
|
+
results and their build identities. Android API 36 emulator verification through
|
|
109
|
+
the built MCP server covers clickable waits, resolved-handle taps, selector taps,
|
|
110
|
+
visible assertions and stable enabled-state assertions on the isolated fixture.
|
|
111
|
+
Fresh hierarchy assertions establish Result 43 and enabled=true; dispatch alone
|
|
112
|
+
is not used as success evidence. The fixture is removed in `finally`, and the
|
|
113
|
+
suite subsequently leaves system Settings foreground. Debugger, Android/iOS
|
|
114
|
+
observation/correlation and Android trace journeys also pass. General older
|
|
115
|
+
observation wrappers still use automatic device targeting.
|
|
116
|
+
|
|
117
|
+
The earlier [verification record](verification.json) is retained for the first
|
|
118
|
+
checkpoint. At that point the class was 2,161 counted lines; it is superseded by
|
|
119
|
+
the current facade result above. Legacy exceptions elsewhere fell from 205 to
|
|
120
|
+
162 without transferring exceptions to extracted code. Real-device adjustable
|
|
121
|
+
control convergence and interactive iOS navigation remain **unrun**; existing
|
|
122
|
+
mock/native-adapter and injected-strategy tests establish those covered contracts,
|
|
123
|
+
not device outcomes. Hosted CI, local Node 18 and physical-device journeys remain
|
|
124
|
+
separate from the passing local/emulator checks.
|
|
125
|
+
|
|
126
|
+
## Final implementation continuation — 2026-10-30
|
|
127
|
+
|
|
128
|
+
The central server handler is now a 159-line registration/dispatch module.
|
|
129
|
+
Capability handlers cover management, observations, interactions, input, journeys
|
|
130
|
+
and diagnostics. Action execution separates budgeted delivery, conditional
|
|
131
|
+
rejection, result normalization, verification and serialization. Journey execution
|
|
132
|
+
separates assertions, step dispatch, shared light-verification evidence, compact
|
|
133
|
+
results and final response construction. These modules meet default quality limits
|
|
134
|
+
without exceptions; 26 obsolete server allowances were removed, leaving 136
|
|
135
|
+
reviewed legacy allowances elsewhere.
|
|
136
|
+
|
|
137
|
+
Target fields, mutually exclusive target validation, wait controls and execution
|
|
138
|
+
modes now have shared contracts. Existing legacy argument readers and control
|
|
139
|
+
clamping/error semantics are retained. The complete 52-tool compatibility fixture
|
|
140
|
+
still passes. Interaction services receive optional clocks; default composition
|
|
141
|
+
uses the existing wall clock and delays, including readiness-aware budget delays.
|
|
142
|
+
No process-global clock replacement is required by the new timing tests.
|
|
143
|
+
|
|
144
|
+
The Android fixture now contains a labelled SeekBar, closing the adjustable-control
|
|
145
|
+
convergence coverage gap. The updated journey has passed convergence and a fresh
|
|
146
|
+
hierarchy assertion for the displayed value. Final checks and their results
|
|
147
|
+
are recorded in [final verification metadata](verification-final.json).
|
|
148
|
+
|
|
149
|
+
Earlier verification tables and metadata are dated checkpoints; they do not
|
|
150
|
+
represent the final source layout or coverage. No commit, push, release or
|
|
151
|
+
publication was performed. Existing unrelated edits and user removals were
|
|
152
|
+
preserved.
|
|
153
|
+
|
|
154
|
+
### Final verification results
|
|
155
|
+
|
|
156
|
+
| Check | Result |
|
|
157
|
+
| --- | --- |
|
|
158
|
+
| `npm run verify` on Node 18.20.8 | **Pass**: lint, structural and architecture gates, build, 83 unit files and plugin consistency |
|
|
159
|
+
| `npm run test:device` on Node 23.11.0 | **Pass**: all 10 device files; Android debugger, selector/wait/assertion/adjustment journeys, Android/iOS observation and correlation, Android Perfetto |
|
|
160
|
+
| Public contract fixture | **Pass**: all 52 definitions unchanged |
|
|
161
|
+
| Worker Java compilation | **Pass**: `javac --release 17 --add-modules jdk.jdi` on Java 23 |
|
|
162
|
+
| Package dry run | **Pass**: all 121 compiled TypeScript modules and Java worker source included |
|
|
163
|
+
| Documentation and whitespace | **Pass**: relative links/anchors, metadata JSON and diff checks |
|
|
164
|
+
|
|
165
|
+
The final complete dist/Java build fingerprint is
|
|
166
|
+
`2791c7ff502e7e60c9e053307ffb8afe3ad100afcbb4a7e68df5c85efa8d3041`.
|
|
167
|
+
Trace-specific fingerprints cover a different subset of modules and are retained
|
|
168
|
+
in the metadata as separate records. The Android interaction fixture starts at
|
|
169
|
+
25 and verifies adjustment toward 75 within tolerance 5, followed by a fresh
|
|
170
|
+
hierarchy assertion of the displayed value. Both fixture journeys remove their
|
|
171
|
+
owned app/build data; Perfetto removes owned traces and host artifacts. System
|
|
172
|
+
Settings remains foreground after observation checks without settings changes.
|
|
173
|
+
|
|
174
|
+
Review identified and corrected an asynchronous error-handling difference while
|
|
175
|
+
extracting debugger guards. A regression test now verifies that device-resolution
|
|
176
|
+
failures retain the existing MCP error envelope. The final full Node 18 and native
|
|
177
|
+
runs were repeated after that correction; the fingerprint above matches the final
|
|
178
|
+
build.
|
|
179
|
+
|
|
180
|
+
Hosted CI, physical-device interaction/debugger journeys, interactive iOS
|
|
181
|
+
navigation/state/adjustment, the optional extended debugger expiry device journey,
|
|
182
|
+
and execution under a JDK 17 runtime remain **unrun**. The metadata records the
|
|
183
|
+
scope and reason for each. These are additional environment coverage limits,
|
|
184
|
+
not passing device evidence or remaining implementation tasks. Local Node 18 and
|
|
185
|
+
Android adjustable-control convergence are now verified, superseding those
|
|
186
|
+
unrun entries in earlier checkpoints.
|
|
187
|
+
|
|
188
|
+
## Follow-on maintenance
|
|
189
|
+
|
|
190
|
+
See the [codebase health cleanup](health-plan.md) for subsequent debt removal,
|
|
191
|
+
Node 22 support and verification. The results above describe the original change.
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
# Specification: code structure and quality gates
|
|
2
|
+
|
|
3
|
+
[Documentation](../../README.md) · [Approved intent](intent.md) · [Development process](../process.md)
|
|
4
|
+
|
|
5
|
+
Date: 2026-10-30. Status: approved on 2026-10-30.
|
|
6
|
+
The maintainer approved the intent with “looks good” on 2026-10-30.
|
|
7
|
+
|
|
8
|
+
## Outcome and compatibility
|
|
9
|
+
|
|
10
|
+
Make the interaction implementation and debugger lifecycle easier to change and
|
|
11
|
+
review, and prevent new structural debt through failing local and CI checks.
|
|
12
|
+
This is an internal refactor: preserve tool names, schemas, accepted and rejected
|
|
13
|
+
inputs, defaults, error codes, response content blocks, targeting, retries,
|
|
14
|
+
deadlines, cancellation, observation freshness, pause guards, and resource cleanup.
|
|
15
|
+
Preserve exported handler entrypoints and existing test seams during migration.
|
|
16
|
+
No new capabilities, dependencies, transport changes, or framework migration.
|
|
17
|
+
|
|
18
|
+
## Module boundaries
|
|
19
|
+
|
|
20
|
+
Replace the large interaction implementation with a thin `ToolsInteract` facade
|
|
21
|
+
and cohesive modules under `src/interact/`:
|
|
22
|
+
|
|
23
|
+
- Shared types and pure UI helpers: normalized elements, selectors, bounds,
|
|
24
|
+
identities, control values, and resolution results.
|
|
25
|
+
- Target resolution and a bounded resolved-element store: matching, actionable
|
|
26
|
+
ancestors, ambiguity, handle freshness, and existing retention policy.
|
|
27
|
+
- Control adjustment: numeric planning/quantization, gesture strategy, and bounded
|
|
28
|
+
adjustment orchestration as separate responsibilities.
|
|
29
|
+
- Synchronization: screen/UI change detection, polling and stability checks.
|
|
30
|
+
- Assertions: screen, visibility and readable-state verification.
|
|
31
|
+
|
|
32
|
+
Keep native input in existing Android/iOS adapters. Extracted services receive
|
|
33
|
+
narrow typed dependencies for observations, native delivery, clocks/delays, and
|
|
34
|
+
resolved-element access. Production composition supplies existing implementations;
|
|
35
|
+
unit tests can supply fakes without modifying unrelated static methods. Do not
|
|
36
|
+
create one universal service interface or move the monolith into another class.
|
|
37
|
+
The facade retains compatibility by forwarding calls through these services.
|
|
38
|
+
|
|
39
|
+
Move action-result and trace construction out of `server/common.ts` into a shared
|
|
40
|
+
runtime module. Domain services must not depend on MCP registration, handlers, or
|
|
41
|
+
serialization. Add an import-boundary check preventing such dependencies in the
|
|
42
|
+
extracted modules; compatibility re-exports may remain in the server layer.
|
|
43
|
+
|
|
44
|
+
Group server handlers and definitions by capability, with a central registration
|
|
45
|
+
index. For contracts touched by the extraction, define selector, targeting and
|
|
46
|
+
execution-control shapes once and reuse them in schema construction, runtime
|
|
47
|
+
validation and TypeScript types where compatible. Preserve existing validation
|
|
48
|
+
strictness and errors; do not replace permissive legacy parsing with strict
|
|
49
|
+
schemas incidentally. Keep documentation handwritten, backed by parity checks.
|
|
50
|
+
|
|
51
|
+
In `DebuggerSessions`, replace untyped stop/event/result boundaries with explicit
|
|
52
|
+
unions and validated worker-message shapes. Extract event buffering, expiry and
|
|
53
|
+
cleanup helpers where cohesive. Expand compressed transitions into readable
|
|
54
|
+
steps; preserve serialization, ownership, suspension and uncertain-outcome rules.
|
|
55
|
+
Java worker protocol and source behaviour remain unchanged.
|
|
56
|
+
|
|
57
|
+
## Enforced quality limits
|
|
58
|
+
|
|
59
|
+
Use the installed ESLint and TypeScript tooling, with no new package dependency.
|
|
60
|
+
Run structural checks as part of `npm run lint`, so both `npm run verify` and
|
|
61
|
+
existing CI enforce them. Failures must exit nonzero, regardless of `--quiet`.
|
|
62
|
+
|
|
63
|
+
| Metric | Default for production TypeScript |
|
|
64
|
+
| --- | --- |
|
|
65
|
+
| File length | 500 nonblank, noncomment lines |
|
|
66
|
+
| Class length | 300 nonblank, noncomment lines |
|
|
67
|
+
| Function/method length | 80 nonblank, noncomment lines |
|
|
68
|
+
| Cyclomatic complexity | 20, using ESLint's classic calculation |
|
|
69
|
+
| Nested control-flow depth | 4, using ESLint's calculation |
|
|
70
|
+
| Explicit `any` | No new occurrences |
|
|
71
|
+
|
|
72
|
+
Count classes, methods, declarations, expressions and arrow functions using syntax
|
|
73
|
+
trees, not regular expressions. Use consistent counting in checks and diagnostics.
|
|
74
|
+
Java source receives the 500-line file limit; class/function/complexity/type rules
|
|
75
|
+
apply to TypeScript only. Test fixtures are outside production structural limits;
|
|
76
|
+
existing lint still applies to tests. Do not apply mechanical production limits
|
|
77
|
+
to large fixture tables or self-running test scripts.
|
|
78
|
+
|
|
79
|
+
Record necessary legacy exceptions in a versioned, reviewed baseline with file,
|
|
80
|
+
rule, stable symbol identity and current metric ceiling. File metrics use a
|
|
81
|
+
file identity; explicit-any exceptions identify their enclosing symbol and count.
|
|
82
|
+
New files and symbols receive no inherited allowance. Existing exceptions cannot
|
|
83
|
+
exceed their recorded ceilings; unrelated improvements cannot offset regression
|
|
84
|
+
elsewhere. Renames or moved code do not automatically inherit exceptions.
|
|
85
|
+
|
|
86
|
+
The checker must reject missing or duplicate identities and obsolete entries;
|
|
87
|
+
reductions require lowering or deleting the corresponding baseline entry. No
|
|
88
|
+
automatic baseline rewrite in lint, verification or CI. Any explicit maintenance
|
|
89
|
+
command only proposes changes for review; it cannot silently accept debt.
|
|
90
|
+
Disallow inline suppression of these gates in production files. Exceptions belong
|
|
91
|
+
in the reviewed baseline, with a reason. Extracted interaction modules and the
|
|
92
|
+
refactored debugger session manager must meet defaults without new exceptions.
|
|
93
|
+
Do not add suppression comments, compress code, or invent trivial wrappers to
|
|
94
|
+
satisfy limits.
|
|
95
|
+
|
|
96
|
+
## Acceptance and verification
|
|
97
|
+
|
|
98
|
+
- `ToolsInteract` becomes a facade within the default file/class/function limits;
|
|
99
|
+
control adjustment is divided by responsibility, not merely relocated.
|
|
100
|
+
- Extracted interfaces have no explicit `any`; schemas and handler types reuse
|
|
101
|
+
shared definitions, and domain imports respect the new boundary.
|
|
102
|
+
- Deterministic tests establish that new/moved oversized classes and functions,
|
|
103
|
+
complex/nested functions, explicit-any additions, forbidden imports and inline
|
|
104
|
+
suppressions fail; valid code and unchanged legitimate baseline debt pass.
|
|
105
|
+
Cover growth, identity collision, stale entries and reductions in the baseline.
|
|
106
|
+
- Capture public tool definitions before refactoring and compare after it. Exercise
|
|
107
|
+
handler input/error and response parity, timeout/cancellation, ambiguity, stale
|
|
108
|
+
handles, conditional rejection, pause guards, and ownership/cleanup. Normalize
|
|
109
|
+
only nondeterministic identifiers and timestamps in comparisons.
|
|
110
|
+
- Existing unit coverage and new focused injection/contract tests pass, followed
|
|
111
|
+
by `npm run verify`. Use Node 18 as the CI compatibility target; record actual
|
|
112
|
+
local Node/JDK versions. Check Java compilation and npm package contents.
|
|
113
|
+
- Run `npm run test:device` and focused selector/adjustment/wait/debugger journeys
|
|
114
|
+
on available fixtures. Record device/server identity, expected and observed
|
|
115
|
+
outcomes, cleanup, and pass/fail/blocked/unrun status separately by platform.
|
|
116
|
+
Missing devices or fixtures must be reported, not replaced with claims based
|
|
117
|
+
on mocked adapters.
|
|
118
|
+
|
|
119
|
+
## Risks and rollout
|
|
120
|
+
|
|
121
|
+
The main risks are changed observation order, circular imports, lost receiver
|
|
122
|
+
binding, global state ownership, stricter accidental validation, and timeout or
|
|
123
|
+
cleanup drift. Implement in reviewable steps with focused checks after each;
|
|
124
|
+
retain public adapters until parity is established. Update the contribution guide
|
|
125
|
+
with limits, exception review and module ownership. Record remaining legacy debt
|
|
126
|
+
without describing the entire repository as fully refactored.
|
|
127
|
+
|
|
128
|
+
## Approval
|
|
129
|
+
|
|
130
|
+
The maintainer accepted this specification with “ok, lets do it” on 2026-10-30.
|
|
131
|
+
Implementation is authorised within this scope; see the [plan](plan.md).
|
|
132
|
+
|
|
133
|
+
## Subsequent maintainer decision — architectural checks
|
|
134
|
+
|
|
135
|
+
On 2026-10-30 the maintainer approved trying ArchUnitTS with “ok, lets try it”.
|
|
136
|
+
This explicitly extends the original dependency constraint to permit the pinned
|
|
137
|
+
`archunit` development dependency. Its checks complement the existing structural
|
|
138
|
+
limits and preserve the existing test runner and production dependencies.
|
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
{
|
|
2
|
+
"date": "2026-10-30",
|
|
3
|
+
"scope": "Spec 026 final server/contracts/clock continuation and approved architectural-check extension",
|
|
4
|
+
"status": "pass",
|
|
5
|
+
"maintainer": {
|
|
6
|
+
"command": "PATH=/tmp/mobile-debug-node18/node_modules/node/bin:$PATH npm run verify",
|
|
7
|
+
"status": "pass",
|
|
8
|
+
"node": "v18.20.8",
|
|
9
|
+
"unit_files": 83
|
|
10
|
+
},
|
|
11
|
+
"device": {
|
|
12
|
+
"command": "MCP_INTERACTION_DEVICE=emulator-5554 MCP_DEBUGGER_DEVICE=emulator-5554 ADB_PATH=/Users/clivejefferies/Library/Android/sdk/platform-tools/adb npm run test:device",
|
|
13
|
+
"status": "pass",
|
|
14
|
+
"node": "v23.11.0",
|
|
15
|
+
"device_files": 10,
|
|
16
|
+
"records": [
|
|
17
|
+
{
|
|
18
|
+
"status": "PASS",
|
|
19
|
+
"build_sha256": "2791c7ff502e7e60c9e053307ffb8afe3ad100afcbb4a7e68df5c85efa8d3041",
|
|
20
|
+
"device": "emulator-5554",
|
|
21
|
+
"api": "36",
|
|
22
|
+
"runtime": "v23.11.0",
|
|
23
|
+
"transport": "MCP stdio",
|
|
24
|
+
"extended": false
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"status": "PASS",
|
|
28
|
+
"server": {
|
|
29
|
+
"name": "mobile-debug-mcp",
|
|
30
|
+
"version": "0.34.0"
|
|
31
|
+
},
|
|
32
|
+
"device": "emulator-5554",
|
|
33
|
+
"api": "36",
|
|
34
|
+
"runtime": "v23.11.0",
|
|
35
|
+
"journey": "clickable wait, resolved-handle tap, visible assertion, selector journey and stable enabled-state assertion and labelled SeekBar convergence",
|
|
36
|
+
"evidence": "Result 43, enabled=true and adjusted slider label established by fresh hierarchy assertions",
|
|
37
|
+
"cleanup": "Owned fixture removed in finally; no other app data or device settings changed",
|
|
38
|
+
"build_sha256": "2791c7ff502e7e60c9e053307ffb8afe3ad100afcbb4a7e68df5c85efa8d3041"
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
"status": "PASS",
|
|
42
|
+
"server": {
|
|
43
|
+
"name": "mobile-debug-mcp",
|
|
44
|
+
"version": "0.34.0"
|
|
45
|
+
},
|
|
46
|
+
"platform": "android",
|
|
47
|
+
"device": "emulator-5554",
|
|
48
|
+
"osVersion": "16",
|
|
49
|
+
"startingApp": "com.android.settings",
|
|
50
|
+
"actionId": "7f4de94a-1b4b-4da5-9abb-4ba60c379bfd",
|
|
51
|
+
"phases": {
|
|
52
|
+
"dispatchStarted": 1793393215121,
|
|
53
|
+
"dispatchCompleted": 1793393215463,
|
|
54
|
+
"screenshotStarted": 1793393216323,
|
|
55
|
+
"screenshotCompleted": 1793393216648
|
|
56
|
+
},
|
|
57
|
+
"screenshot": "captured",
|
|
58
|
+
"logs": "captured",
|
|
59
|
+
"uiTree": "captured",
|
|
60
|
+
"disabledComponents": "omitted",
|
|
61
|
+
"foreignReference": "unavailable",
|
|
62
|
+
"cleanup": "No settings, app data or streams changed; Settings remains foreground. No content artifacts saved."
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
"status": "PASS",
|
|
66
|
+
"server": {
|
|
67
|
+
"name": "mobile-debug-mcp",
|
|
68
|
+
"version": "0.34.0"
|
|
69
|
+
},
|
|
70
|
+
"platform": "ios",
|
|
71
|
+
"device": "F9243BAF-62A8-4990-8A99-17F527F56FDA",
|
|
72
|
+
"osVersion": "iOS 26.4",
|
|
73
|
+
"startingApp": "com.apple.Preferences",
|
|
74
|
+
"actionId": "25de0b20-a80b-4b8d-bc2b-80e5fa468698",
|
|
75
|
+
"phases": {
|
|
76
|
+
"dispatchStarted": 1793393224322,
|
|
77
|
+
"dispatchCompleted": 1793393224681,
|
|
78
|
+
"screenshotStarted": 1793393225133,
|
|
79
|
+
"screenshotCompleted": 1793393225638
|
|
80
|
+
},
|
|
81
|
+
"screenshot": "captured",
|
|
82
|
+
"logs": "captured",
|
|
83
|
+
"uiTree": "captured",
|
|
84
|
+
"disabledComponents": "omitted",
|
|
85
|
+
"foreignReference": "unavailable",
|
|
86
|
+
"cleanup": "No settings, app data or streams changed; Settings remains foreground. No content artifacts saved."
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
"status": "PASS",
|
|
90
|
+
"build_sha256": "39f8d1143f53a0c84330e8c204835b38f2fd337d2e949cca50344f94654ff063",
|
|
91
|
+
"runtime": "v23.11.0",
|
|
92
|
+
"server": {
|
|
93
|
+
"name": "mobile-debug-mcp",
|
|
94
|
+
"version": "0.34.0"
|
|
95
|
+
},
|
|
96
|
+
"device": "emulator-5554",
|
|
97
|
+
"osVersion": "16",
|
|
98
|
+
"starting_state": "System Settings fixture",
|
|
99
|
+
"journey": "start Settings, assert baseline Settings-owned resource visible in UI tree; explicit trace association",
|
|
100
|
+
"trace_id": "827af8fb-4f35-4571-bdf0-1d69a2c02df8",
|
|
101
|
+
"correlation_id": "a5633929-8d66-4f65-8634-f6ffc2fd1704",
|
|
102
|
+
"phases": {
|
|
103
|
+
"capture_started_at_ms": 1793393260410,
|
|
104
|
+
"capture_completed_at_ms": 1793393266930
|
|
105
|
+
},
|
|
106
|
+
"artifact_bytes": 1115506,
|
|
107
|
+
"content": {
|
|
108
|
+
"packets": 249,
|
|
109
|
+
"ftrace_bundles": 232,
|
|
110
|
+
"events": 26658,
|
|
111
|
+
"compact_sched_bundles": 232,
|
|
112
|
+
"validation": "local protobuf structure, trace config duration and timestamped ftrace/compact scheduler content; not full Perfetto analysis"
|
|
113
|
+
},
|
|
114
|
+
"durationContent": {
|
|
115
|
+
"packets": 52,
|
|
116
|
+
"ftrace_bundles": 36,
|
|
117
|
+
"events": 2849,
|
|
118
|
+
"compact_sched_bundles": 36,
|
|
119
|
+
"validation": "local protobuf structure, trace config duration and timestamped ftrace/compact scheduler content; not full Perfetto analysis"
|
|
120
|
+
},
|
|
121
|
+
"cancel": "PASS",
|
|
122
|
+
"expired_journey": "PASS",
|
|
123
|
+
"active_shutdown": "PASS",
|
|
124
|
+
"cleanup": "Device capture files removed; test host artifacts removed in finally. No settings or app data changed. Settings remains foreground."
|
|
125
|
+
}
|
|
126
|
+
]
|
|
127
|
+
},
|
|
128
|
+
"contracts": {
|
|
129
|
+
"status": "pass",
|
|
130
|
+
"tool_definitions": 52,
|
|
131
|
+
"comparison": "Complete captured public fixture: names, schemas, defaults, descriptions and registration order"
|
|
132
|
+
},
|
|
133
|
+
"quality": {
|
|
134
|
+
"status": "pass",
|
|
135
|
+
"legacy_allowances_remaining": 136,
|
|
136
|
+
"server_handler_physical_lines": 159,
|
|
137
|
+
"new_server_and_interaction_exceptions": 0,
|
|
138
|
+
"architecture_rules": 4,
|
|
139
|
+
"architecture_dependency_edges": 549,
|
|
140
|
+
"runtime_cycles": 0
|
|
141
|
+
},
|
|
142
|
+
"deterministic_timing": {
|
|
143
|
+
"status": "pass",
|
|
144
|
+
"coverage": [
|
|
145
|
+
"stable UI wait",
|
|
146
|
+
"retry/backoff and inclusive deadlines",
|
|
147
|
+
"screen fingerprint confirmation",
|
|
148
|
+
"search expiry",
|
|
149
|
+
"state assertion stability and trace timestamps"
|
|
150
|
+
],
|
|
151
|
+
"global_timer_replacement": false
|
|
152
|
+
},
|
|
153
|
+
"review": {
|
|
154
|
+
"status": "pass",
|
|
155
|
+
"notes": [
|
|
156
|
+
"Capability extraction preserves central registration and handler/test seams.",
|
|
157
|
+
"Removed 26 obsolete server debt allowances without transferring them.",
|
|
158
|
+
"Preserved legacy input permissiveness and exact execution-control clamping/error semantics.",
|
|
159
|
+
"Corrected and regression-tested the extraction of device-resolution errors into the existing MCP error envelope.",
|
|
160
|
+
"Production readiness delays and native input adapters remain in use."
|
|
161
|
+
]
|
|
162
|
+
},
|
|
163
|
+
"java": {
|
|
164
|
+
"status": "pass",
|
|
165
|
+
"command": "javac --release 17 --add-modules jdk.jdi -d /tmp/mobile-debug-spec026-java17 src/debugger/java/DebuggerWorker.java",
|
|
166
|
+
"local_java": "23",
|
|
167
|
+
"production_worker_source_changed": false
|
|
168
|
+
},
|
|
169
|
+
"package": {
|
|
170
|
+
"status": "pass",
|
|
171
|
+
"command": "npm pack --dry-run --json",
|
|
172
|
+
"compiled_modules": 121,
|
|
173
|
+
"worker_source_included": true,
|
|
174
|
+
"installed_or_published_package_tested": false
|
|
175
|
+
},
|
|
176
|
+
"unrun": [
|
|
177
|
+
{
|
|
178
|
+
"check": "Hosted CI",
|
|
179
|
+
"reason": "Local verification ran on the CI Node 18 target; no commit or push was requested."
|
|
180
|
+
},
|
|
181
|
+
{
|
|
182
|
+
"check": "Physical-device interaction/debugger journeys",
|
|
183
|
+
"reason": "The isolated native fixture journeys target emulator-5554; general observation wrappers can select connected devices automatically."
|
|
184
|
+
},
|
|
185
|
+
{
|
|
186
|
+
"check": "Interactive iOS navigation/state and adjustable-control journeys",
|
|
187
|
+
"reason": "No isolated iOS interaction fixture is provided; iOS screenshot/log/tree and correlated-evidence checks are covered separately."
|
|
188
|
+
},
|
|
189
|
+
{
|
|
190
|
+
"check": "Optional 60-second debugger expiry device extension",
|
|
191
|
+
"reason": "Default debugger journey ran without the opt-in extension; deterministic expiry coverage passed."
|
|
192
|
+
},
|
|
193
|
+
{
|
|
194
|
+
"check": "JDK 17 runtime execution",
|
|
195
|
+
"reason": "The worker was compiled with --release 17 on Java 23; native fixture execution uses the configured Android Studio JBR."
|
|
196
|
+
}
|
|
197
|
+
],
|
|
198
|
+
"build_sha256": "2791c7ff502e7e60c9e053307ffb8afe3ad100afcbb4a7e68df5c85efa8d3041",
|
|
199
|
+
"build_fingerprint_scope": "All files under dist/ and src/debugger/java/, sorted recursively, hashing each repository-relative path and file bytes."
|
|
200
|
+
}
|