Skip to content

MM-002 return typed no-device layout errors - #3

Draft
himattm wants to merge 1 commit into
agent/mm-001-normalize-layout-outputfrom
agent/mm-002-no-device-error
Draft

MM-002 return typed no-device layout errors#3
himattm wants to merge 1 commit into
agent/mm-001-normalize-layout-outputfrom
agent/mm-002-no-device-error

Conversation

@himattm

@himattm himattm commented Jul 17, 2026

Copy link
Copy Markdown
Owner

What changed

Add an ADB device preflight before any layout capture. No-device, missing selected device, offline/unauthorized device, and no-ready-device cases now return structured device_unavailable results with stable codes, attempted serial, attached device states, recovery guidance, an empty layout array, and exit code 6.

Why

With no emulator connected, Minimap previously reported success with an empty-string layout, making an unavailable device indistinguishable from a valid empty hierarchy.

Impact

Automation can reliably stop or recover before invoking Android CLI, and the same command succeeds normally once a device becomes available.

Validation

  • Stop-device then start-device end-to-end contract
  • Missing selected serial contract
  • Assertion that Android layout is never invoked during failed preflight
  • Full workspace tests, Clippy, formatting, and binary build

Stack

Depends on #2; base branch: agent/mm-001-normalize-layout-output.

Reproduction: with zero devices, minimap layout previously invoked Android layout and could return status ok with an empty-string layout.

Preflight ADB devices before cache or capture, return device_unavailable with a stable code, attempted serial, attached device states, recovery guidance, and exit code 6, then allow the same command to succeed when a device becomes ready.

Verified with zero-device-to-healthy and missing-selected-serial CLI regressions, cargo test --workspace, cargo clippy --all-targets -- -D warnings, cargo fmt --check, and the minimap-cli binary build.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant