feat: Phase 2 act primitives

Add the Artemis Go CLI and its packages:
- internal/adb: timeout-bounded adb wrapper, device list, wireless-debugging
  port scan and auto-connect (never hardcodes the moving port).
- internal/ui: uiautomator dump parsing, find-by-text, tap the centre of a
  text match (FR-4), type, swipe, scroll, back, home, launch, wake.
- cmd/artemis: CLI for the primitives plus 'demo', the Phase 2 DoD run.

Failures are loud: a missing or disabled element errors instead of tapping a
guessed coordinate. The screen is woken before acting, and every adb call has
a deadline.

Also record the section 13 Q4 decision (adb lives in the user profile on .13,
wireless ADB needs no udev rules; service packaging still open until Phase 6),
add unit tests, and document the phase evidence.
This commit is contained in:
Paperclip Builder
2026-10-16 11:36:03 +11:00
parent ecb8dd2c11
commit 1115531684
10 changed files with 1437 additions and 1 deletions

View File

@@ -170,10 +170,18 @@ Resolved:
2. **No UI in v1.** A recipes file replaces a UI.
3. **Find by text** from the UI dump, not screenshots or vision.
4. **Partition:** native actions → Kotlin app; in-app navigation → Artemis.
5. **ADB tooling lives in the user profile on `.13`**, installed with
`nix profile install nixpkgs#android-tools` — **not** a `nixos-rebuild`
system module. Wireless ADB over TCP needs **no udev rules**; `programs.adb`
was USB-only and is removed in this NixOS release anyway. Go is likewise run
from a one-off `nix shell nixpkgs#go`, not installed system-wide. Never run
`nixos-rebuild` on `.13`: it runs the Hub, MQTT and every service.
Remaining:
1. Which tasks after Spotify and maps? (WhatsApp message? Other music apps?)
2. Locked screen: must Artemis unlock it, or does Sam leave it awake?
3. Action API shape: one generic `/act`, or one endpoint per task?
4. Docker or a systemd service on `.13`? ADB can be awkward in a container.
4. **Service packaging** for Artemis on `.13` — container or systemd — is still
open. ADB can be awkward in a container, so this is decided in Phase 6. The
tooling-placement half of the old Q4 is resolved above.
5. Speed: what is an acceptable time for a 6-step recipe?