Skip to content

AndroidForge v0.9.4 - Safety and Repeatability

Choose a tag to compare

@github-actions github-actions released this 18 Nov 06:33
· 16 commits to main since this release

AndroidForge v0.9.4 (Alpha) - Safety and Repeatability

AndroidForge v0.9.4 closes the one product finding from the independent v0.9.3 long-horizon
certification and adds the safety, repeatability and compatibility work recommended before final UI
polish.

The v0.9.3 run reported 209 PASS, 1 FAIL, 1 BLOCKED and 7 N/A. The failure was
app uninstall succeeding without --yes. The run also produced operational recommendations:
full-spectrum receipt effects, SystemUI overlay handling, a snapshot list/save race, and heartbeat
documentation. All are addressed here.

Uninstall confirmation

app uninstall now refuses to run without --yes:

E_INVALID_ARGUMENT: uninstalling an app is destructive; pass --yes

--dry-run remains available without confirmation and reports requires_confirmation: true.
This matches app clear-data and app data-restore.

Physical-device safety

Physical devices are no longer treated like disposable emulators. Data-changing commands return
E_PHYSICAL_DEVICE_MUTATION_BLOCKED unless --allow-physical-mutation is supplied. The guard covers:

  • app install, uninstall, clear-data, file-push and data-restore;
  • permission grant/revoke and AppOps set/reset;
  • Doze force/unforce, standby set, battery unplug/reset, network changes and time set/restore;
  • notification clear and JobScheduler run/cancel;
  • snapshot save/load/delete.

--dry-run still works and reports whether the mutation flag is required. The guard is a safety
default, not authentication; a deliberate test can opt in.

Receipt effects are no longer blind beyond the compact cap

Action receipts previously classified effects from the same compact 24-actionable/16-context lists
that the user sees. A text change outside that cap could therefore be reported as
no_visible_change even when the postcondition was satisfied.

Receipts now collect complete actionable and context lists for classification while still returning
the compact diff. A unit test covers a change at node 25 of 30.

SystemUI overlay handling

Fresh AVDs can show the SystemUI immersive "Viewing full screen / Got it" overlay before the app.
ui dismiss-overlays now:

  • finds only clickable com.android.systemui nodes labelled Got it, OK, Dismiss or Close;
  • supports --dry-run and --max;
  • reports dismissed and remaining overlays;
  • never taps app content or permission decisions.

Snapshot save/list race

Two snapshot defects were fixed:

  1. snapshot list only accepted plain-name output, but the emulator returns a table
    (-- name size date clock). The parser now handles the table and still accepts plain names.
  2. snapshot save returned a failure if the snapshot was not listed immediately. The emulator
    acknowledges the save before it is fully visible, so AndroidForge now polls for up to 30 seconds.

AndroidForge-launched emulators still default to -no-snapshot-save so test state is not silently
preserved. Pass session start|ensure --snapshot-save to allow manual snapshots. Save/load/delete
was verified on a disposable API 36 AVD.

Recording duration

capture record stop reported the time spent stopping and pulling the file as duration_ms. It now
reports the actual recording duration computed from the stored start timestamp; the stop operation
duration is kept separately in the recording metadata.

Crash-safe state writes

On Windows, replacing an existing state file used remove-then-rename, which left a window where a
crash could lose the old file. write_atomic now uses MoveFileExW with
MOVEFILE_REPLACE_EXISTING | MOVEFILE_WRITE_THROUGH. Concurrent-write and truncated-JSON tests
cover the failure shape.

Privacy gate

report bundle --metadata-only emits the manifest, summary and explanation only. Every run artifact
is listed as excluded with the reason metadata-only bundle requested. This is the safe choice when
only workflow metadata can leave the machine.

Repeatable harnesses

The ad-hoc certification work is now reproducible:

  • tests/long-horizon.ps1 - sustained headless workload with screenshots, recording, health
    samples, performance, reports and a verified bundle;
  • tests/real-device.ps1 - read-only/safe physical-device pass with optional test-APK install;
  • tests/upgrade-rollback.ps1 - installer upgrade preserves state and uninstall leaves it intact;
  • tests/fault-injection.ps1 - stale locks, corrupt state, invalid config and concurrent writers;
  • tests/supply-chain.ps1 - license inventory, duplicates, wildcard scan and optional audit.

See tests/README.md and docs/ for usage and safety rules.

Supply chain

deny.toml defines the CI policy for advisories, licenses, wildcard dependencies and sources. The CI
workflow runs cargo deny check advisories bans licenses sources. Workspace crates now declare the
MIT license. Local inventory is 525 packages with 0 unlicensed entries.

Compatibility

  • Full JSON remains the default; existing fields are unchanged except the additive
    snapshot_save session field.
  • New error code: E_PHYSICAL_DEVICE_MUTATION_BLOCKED (exit 4, recoverable).
  • app uninstall now requires --yes; this is an intentional safety break.
  • --metadata-only and --allow-physical-mutation are additive.
  • session start|ensure --snapshot-save is additive; default behavior is unchanged.
  • Workspace, CLI, desktop, installer and compatibility version are 0.9.4.
  • v0.6.0-v0.9.3 releases, tags and assets remain untouched.

Validation

  • cargo fmt --check, clippy with -D warnings, full workspace tests and the release build passed.
  • Long-horizon harness: 0 failures with screenshots, a recording, performance samples and a
    checksum-verified bundle.
  • Real-device harness on Xiaomi HyperOS: 23 PASS, 0 FAIL, 1 N/A; debug install blocked by vendor
    policy and recorded as BLOCKED.
  • Upgrade/rollback from 0.9.2 to 0.9.4: state, config and run history preserved; uninstall clean.
  • Fault injection: stale locks, corrupt session/report JSON, invalid adapter fields and concurrent
    run writers all produced structured outcomes.
  • Exact commands and evidence are recorded in VERIFICATION.md.