Commit Graph
187 Commits
Author SHA1 Message Date
pj d9800b648f chore(sidecar): wire grpc + protobuf-gradle-plugin + maestro
Generates Java stubs from proto/driverpb/driver.proto via the
protobuf plugin (sourceSets points at the shared root proto dir).
Pulls in dev.mobile:maestro-client:1.40.0, grpc-netty-shaded,
slf4j-simple, and the JUnit vintage engine so the gRPC test rules
work alongside JUnit Jupiter.
2026-04-18 00:02:06 +07:00
pj d856c40d7c feat(permissions): grant dangerous permissions via aapt + adb
Inspector parses uses-permission entries from `aapt dump permissions`
and the granter shells out to `adb shell pm grant`. Both are pluggable
so tests can drive logic without aapt or a device. Granter failures
become warnings rather than errors — Android refuses non-runtime
permissions and we'd rather keep going than abort the run.
2026-04-17 23:57:17 +07:00
pj b6b18c3681 feat(cli): real doctor subcommand with adb/emulator/java checks
Each check is a value so tests can swap in fakes. Java check parses
both legacy (1.8) and modern (17+) version strings. Emulator check
falls back to ANDROID_HOME/emulator/emulator since the brew cask
ships it without putting it on PATH.
2026-04-17 23:56:00 +07:00
pj 63796fbd42 chore(build): add Makefile with bootstrap, sidecar, sdk, uatu, test targets 2026-04-17 23:54:41 +07:00
pj d4a6e33aa6 feat(runner): pause-snapshot-evaluate-resume loop
Wires agent.Conn + driver.Driver + verifier.Verifier + trace.Writer
into the v0.1 step cycle: snapshot the SDK, push to verifier,
evaluate properties, write the trace step (with violations), release
the SDK pause, apply the next action via the driver, wait for idle.

Driver.Launch happens once before the loop and Terminate runs in
defer so even an early error tears down the app cleanly. Summary
returns step count and per-step violation records for the caller
to print or persist.
2026-04-17 23:54:05 +07:00
pj d2fae427f9 feat(driver): add TapSelector and make mock WaitForIdle honor duration
Real maestro driver will resolve selectors itself rather than
forcing the runner to look up coordinates from the hierarchy. Mock
now waits the requested duration so tests don't busy-spin and
starve the SDK fixture goroutine.
2026-04-17 23:54:00 +07:00
pj abeded0b19 test(verifier): cover spec lifecycle and weighted action selection 2026-04-17 23:48:59 +07:00
pj 72175bb13c feat(verifier): goja runtime hosting the spec API
Installs globalThis.__uatu__ with extract, always, actions,
weighted, tap, inputText, and stub taps/swipes. Load runs the
bundled spec, then pulls properties + actions out of globalThis.
PushSnapshot rebuilds state.snapshots and refreshes every
extractor handle's current/previous in registration order so
chained extractors observe up-to-date values.

Properties are wired through internal/ltl as Always(Thunk(...)),
so verdicts latch to violated as soon as a predicate returns
false. NextAction resolves actions/weighted recursively with a
seedable rand source for reproducible runs.
2026-04-17 23:48:58 +07:00
pj 29c6ea4842 test(spec-api): cover runtime delegation for every public function 2026-04-17 23:45:37 +07:00
pj 4a1f8cb522 feat(spec-api): typed surface for spec authors
Thin wrappers over a globalThis.__uatu__ runtime that the verifier
provides as host bindings. Spec authors get IntelliSense for
extract/always/Tap/InputText/actions/weighted/taps/swipes, but the
bundle stays small because runtime logic lives in goja.
2026-04-17 23:45:36 +07:00
pj 5988e93057 chore(spec-api): scaffold @uatu/spec package metadata
TypeScript 5.6 with strict mode, bundler module resolution. Tests
run via node --test --experimental-strip-types so we don't need
vitest or a build step. Adds node_modules to .gitignore.
2026-04-17 23:45:32 +07:00
pj 72c4e4c4d3 feat(trace): JSONL writer for steps + meta + screenshots
Each WriteStep appends one JSON object per line so the trace can
be filtered with jq directly. Screenshots land under screenshots/
with zero-padded indexes. Writer is concurrency-safe; Close is
idempotent and a write after Close errors loudly rather than
silently dropping.
2026-04-17 23:43:45 +07:00
pj 0c277b2833 feat(ltl): formula AST and step evaluator for v0.1
Supports Always over Pure/Thunk leaves; eventually/next/bounds
deferred. Once a thunk returns false under an Always, the verdict
latches to violated so the runner can surface the offending step
without later observations masking it.
2026-04-17 23:42:44 +07:00
pj cee90694da feat(bundler): esbuild wrapper for spec compilation
Bundles a TypeScript entry into an IIFE ES2020 blob with optional
inline sourcemaps. process.env defines are JSON-quoted before being
fed to esbuild so values with quotes/backslashes survive correctly.
Returns the bundle's SHA-256 for trace meta.json.
2026-04-17 23:41:43 +07:00
pj 6353afdf83 feat(driver/mock): in-memory Driver for unit tests
Records every call as an Action and lets tests program hierarchy,
screenshot, health, and per-method failures. Actions() returns a
copy so test code can't mutate the driver's history.
2026-04-17 23:40:28 +07:00
pj d533aef04b feat(driver): Driver interface for v0.1 RPC surface
Mirrors proto/driverpb/driver.proto: Launch, Terminate, Tap,
InputText, Hierarchy, Screenshot, WaitForIdle, Health. Keeps
Image/Health as dedicated structs so callers don't depend on
generated proto types.
2026-04-17 23:40:28 +07:00
pj 123cbf06e7 fix(sdk-android): post frame callbacks via main looper
Choreographer.getInstance() is per-thread and throws on threads
without a Looper. The previous impl called it from the SocketClient
reader thread, which surfaced as snapshot failures with empty
state during the sample-app round trip. Now the reader thread
posts a Runnable to the main Handler that, on the main thread,
gets the Choreographer and posts the frame callback.
2026-04-17 23:39:11 +07:00
pj d991d99e0f feat: uatu-sample-harness for SDK round-trip validation
Listens on TCP, runs adb reverse to expose the host port as the
device's localabstract:uatu-agent socket, then drives N PAUSE/STATE
/RESUME cycles against the connected SDK. Cleanly removes the adb
forward on exit.
2026-04-17 23:39:07 +07:00
pj 8961aadda8 feat(sdk-android): throwaway sample app for SDK validation
Single-activity Android app that calls Uatu.start() in
SampleApplication.onCreate and registers three extractors
(app_state, click_count, uptime_millis). MainActivity has a
button so click_count exercises non-trivial state.
2026-04-17 23:39:05 +07:00
pj 1700160077 feat(sdk-android): Uatu public API over SocketClient + Pauser
Uatu singleton owns an internal UatuRuntime that wires the socket
client, pauser, and extractor registry. start() sends HELLO on
connect, responds to PAUSE by running extractors inside the pause
window and replying with STATE, and releases the gate on RESUME.

LinkedHashMap preserves extractor registration order so trace
output is deterministic. Failed extractors log a warning and
record null rather than aborting the whole snapshot.
2026-04-17 22:57:12 +07:00
pj 8560d32cfe chore(sdk-android): return default values for Android stubs in unit tests 2026-04-17 22:57:08 +07:00
pj 52944b1aa6 feat(sdk-android): Pauser with frame-callback-gated extractors
Worker thread calls pauseAndSnapshot with an extractor closure;
the Pauser posts a frame callback that runs extractors on the
main thread and then blocks that thread on a semaphore until
release() fires. FrameCallbackPoster abstracts Choreographer so
JVM unit tests drive it with a single-thread executor, while the
Android runtime uses ChoreographerPoster.
2026-04-17 22:55:06 +07:00
pj ac49818283 feat(sdk-android): SocketClient with reconnect + LocalSocket transport
SocketClient owns a background reader thread, dispatches incoming
messages to a handler, and auto-reconnects with exponential backoff
when the transport drops. AgentTransport abstracts the socket so
JVM unit tests drive the client through piped streams while the
Android runtime uses LocalSocket over the abstract namespace.

Send is exposed to consumers via a MessageSender passed to
onConnected. Writes are serialized under the output stream lock.
2026-04-17 22:53:13 +07:00
pj b9511c0718 feat(agent): socket server with PAUSE/STATE/RESUME flow
Accept waits for an SDK HELLO then hands back a Conn. Conn.Snapshot
sends a PAUSE, blocks on the matching STATE (id-correlated), and
leaves the SDK paused until Release sends RESUME. Conn.Close sends
GOODBYE best-effort.

v0.1 supports one client at a time; transport is left to the caller
so tests can use TCP loopback while production wires via adb reverse
to localabstract:uatu-agent.
2026-04-17 22:50:54 +07:00
pj 2cc7617590 feat(sdk-android): Kotlin wire protocol matching the Go encoder
Uses org.json (already on Android; org.json:json test dep for JVM
unit tests). Field names and framing mirror internal/agent/protocol.go
so Go-encoded frames decode on the SDK without a shared schema file.
2026-04-17 22:48:10 +07:00
pj ca92bb1492 feat(agent): Go wire protocol with length-prefixed JSON framing
Six message types: HELLO, PAUSE, RESUME, STATE, EXTRACT_RESULT,
GOODBYE. 4-byte big-endian length + JSON payload. 16MB frame cap.
Typed constructors per message; snapshots carry json.RawMessage so
downstream goja evaluation sees exact types.
2026-04-17 22:48:07 +07:00
pj 9cea3b66f0 feat(sdk-android): scaffold Android library module
AGP 8.11.0, Kotlin 2.1.21, minSdk 24, compileSdk 35, JDK 17
bytecode, no Compose dep. Uatu object exposes start/extract as
stubs; real implementation in tasks #6–8.
2026-04-17 22:38:04 +07:00
pj 9a792e20ce feat(sidecar): scaffold Kotlin JVM module with Shadow fat JAR
Kotlin 2.1.21 (deviation from plan's 1.9, forced by Gradle 9
compatibility), JDK 17 toolchain, application plugin with main
entry dev.uatu.sidecar.MainKt. Shadow 9.0.0-rc2 for the fat JAR.
Actual gRPC server wires in with task #10.
2026-04-17 22:38:01 +07:00
pj b594108595 chore(gradle): add root settings for uatu multi-project build
Links :sidecar and :sdk-android under one wrapper. Root build.gradle
provides a clean task that wipes the root build dir.
2026-04-17 22:37:53 +07:00
pj ac80114b2d chore(gradle): add Gradle wrapper 9.4.1
Committed so the repo builds reproducibly without a host gradle.
2026-04-17 22:37:51 +07:00
pj 32cd729f9d chore: add .gitignore for gradle, IDE, and run outputs 2026-04-17 22:37:46 +07:00
pj 1c4b0dd00f feat(cli): scaffold uatu CLI with test and doctor subcommands
Wires the flag surface from plan §3 (--spec, --bundle-id, --platform,
--avd, --duration, --seed, --output). Subcommand bodies are stubs;
actual work lands with runner/doctor tasks.
2026-04-17 22:29:09 +07:00
pj d73192b235 test(proto): cover driver service surface
Asserts the eight v0.1 RPCs are exactly the ones present and
that message fields round-trip through generated getters.
2026-04-17 22:27:32 +07:00
pj 7c988b53dd chore(proto): generate Go stubs for driver service
Brings in google.golang.org/grpc and protobuf dependencies.
2026-04-17 22:27:31 +07:00
pj 9d62ba963d feat(proto): define driver v0.1 service contract
Eight RPCs needed for v0.1 per plan: Launch, Terminate, Tap,
InputText, Screenshot, Hierarchy, WaitForIdle, Health.
Defers Swipe/LongPress/OpenLink/etc until a spec needs them.
2026-04-17 22:27:27 +07:00
pj ee78371566 chore(proto): add buf config for codegen and lint
Relaxes STANDARD lint rules that conflict with the terse service
shape from ARCHITECTURE.md §7.2 (shared Empty, no Service suffix).
2026-04-17 22:26:23 +07:00
pj 8d5b32c10b init project with readme 2026-04-17 22:07:09 +07:00