feat: support standalone Maestro clearState command - #2366
Conversation
Accept '- clearState' / '- clearState: <appId>' in Maestro YAML flows. Unlike launchApp.clearState (clear-then-open), the standalone form clears app state without relaunching, projecting to 'settings clear-app-state' on the daemon. Covers the Rocket.Chat login-with-deeplink helper, which previously failed with 'Maestro command "clearState" is not supported'.
|
The implementation at ea4b179 reuses the existing clear-app-state operation without relaunching, and the focused tests cover the new dispatch path. Please replace the UNVERIFIED_COMMANDS exemption with an authored clear-state corpus flow and regenerated upstream parser fixture. The corpus already supports these coverage gaps; tests of our own parser do not verify Maestro compatibility. This head also needs CI and a live Android/iOS Simulator flow showing that explicit and default app IDs clear the intended app without reopening it. No live evidence or checks are reported yet. |
Replace the UNVERIFIED_COMMANDS exemption with an authored clear-state flow exercising default and explicit appIds, plus the regenerated upstream parser fixture proving Maestro compatibility. Live iOS Simulator evidence (iPhone 16, com.apple.mobilesafari): - marker files in the data container, then replay '- clearState' (default) and '- clearState: <appId>' (explicit) via 'replay --maestro'; both replay 1/1, wipe the container, and leave MobileSafari not running (no reopen).
|
Reviewed 7acf98e. The authored corpus and upstream fixture resolve the compatibility finding, and the reported iOS runs cover default and explicit app IDs without reopening the app. No remaining code finding. Please add the equivalent Android replay evidence; that is the remaining human-readiness gap. CI is not reported on this head. |
|
Android evidence on 7acf98e (Pixel 9 emulator, com.callstack.agentdevicelab, local 0.20.11-dev build): marker file in the data container, then Gates on this head: typecheck clean, test:maestro-compat 331 pass, maestro:conformance 57 pass, check:affected --run all runnable checks passed. gh pr checks still reports no CI on this branch. |
|
The reported Android runs on 7acf98e resolve the remaining validation gap: explicit and default app IDs both clear data without reopening the app, alongside the earlier iOS evidence. No remaining code findings; ready for human review. CI still has no reported checks, so this is not a CI-green merge verdict. |
|
Coverage now reports failures in the eager-closure approval, screenshot-crop, and iOS runner-prewarm tests, plus a slow-test limit. These appear unrelated to the clearState change, but the run is not green. The code and device-evidence verdict is unchanged; ready-for-human stays applied. |
Summary
Maestro YAML flows using standalone
clearState(- clearState/- clearState: <appId>) no longer fail withMaestro command "clearState" is not supported. Previously onlylaunchApp.clearState(clear-then-open) existed.Before: any flow with a bare
clearStatestep (e.g. a login helper doingstopApp→ conditionalclearState: ${APP_ID}→setPermissions→ open deeplink) was rejected at parse time.After: the step parses, resolves
${VAR}/config appId likestopApp, and clears app state without relaunching — the daemon projects it tosettings clear-app-state <app>(session app when the id is omitted).Examples a reviewer can run:
Scope stayed inside the Maestro command family (
packages/maestro+ its daemon adapter + the generated-help/user-docs strings the sync test enforces): 16 files, +201/−20, no new packages or registries.Validation
Evidence gathered at
ea4b179a9:pnpm typecheckclean;pnpm test:maestro-compat331 pass;pnpm maestro:conformance57 pass (coverage gate satisfied viaUNVERIFIED_COMMANDS, unit-tested by other means); fuzz-arbitraries, help/docs-sync, export, and daemon-adapter suites green.pnpm check:affected --run: all runnable checks passed on a solo run. One full-gate run under concurrent load showed 2 subprocess-backed flakes (session-open-runtimemetro-port) that pass in isolation; unrelated files, untouched by this diff.Claim: published and reported — branch is pushed, CI on the head is still to come.