Skip to content

AndroidForge v0.9.3 - Contract and Coverage

Choose a tag to compare

@github-actions github-actions released this 17 Nov 20:35
· 18 commits to main since this release

AndroidForge v0.9.3 (Alpha) - Contract and Coverage

AndroidForge v0.9.3 is the pre-UI hardening release. It delivers all eight agreed items together:
formal schema validation, the missing certification coverage, a clean-avd product pass, configurable
observation retention with cross-process locking, empty-hierarchy recovery, a desktop render gate,
exit-code drift protection, and an explicit physical-device record.

Physical-device validation is the one item that could not be completed: the Poco X4 GT / HyperOS 2
device was not connected. It is recorded as BLOCKED, not passed. Emulator results are not
presented as a substitute.

1. Schemas are now executable tests

The repository publishes JSON Schema documents, but nothing proved that the binary still emitted
payloads those schemas accepted. v0.9.3 adds crates/androidforge-cli/tests/schema_validation.rs:

  • every schema/*.schema.json document is compiled as Draft 2020-12 with the jsonschema crate;
  • context is validated in full, compact and brief profiles;
  • agent brief is validated against agent-brief.schema.json;
  • agent test --dry-run is validated in full, compact and brief profiles;
  • representative observation, action-receipt, UI-diff, performance, diagnosis and bundle payloads are
    validated, including their compact/brief projections.

The test found two real contract mismatches, both fixed:

  • agent-test.schema.json required run_id to be a string, but the product emits null before a run
    exists. The schema now allows null.
  • brief agent test removed the schema-required command_argv field. Brief stages now keep it as an
    empty array instead of dropping it.

2. The 26 certification gaps were exercised

The v0.9.1/v0.9.2 certification record left 26 checks as NOT RUN. v0.9.3 exercises all of them on
the clean API 36 AVD af_cert_clean:

Area Checks
Session SESS-10
Context CTX-07, CTX-09
Observation/actions OBS-33, OBS-35, ACT-07
Fixtures/conformance FIX-07, CONF-06, CONF-07
Diagnostics/performance DIAG-14, DIAG-15, DIAG-16, DIAG-17
Reporting REP-08, REP-14, REP-15, REP-16, REP-17, REP-18, REP-19, REP-24
Negative cases NEG-09, NEG-12, NEG-13
Matrix/soak MATRIX-05, SOAK-04

The run produced expected results for each check, including E_POSTCONDITION_TIMEOUT for a failed
postcondition, E_SELECTOR_NOT_FOUND for an impossible fixture selector, exit 7 for a failing JUnit
import, E_MATRIX_TARGET_INVALID for a missing matrix serial and 10/10 successful
force-stop/launch cycles. Three inputs needed correction during the run (the emulator's
"About emulated device" label, re-observing after text entry, and a valid conformance manifest
shape). NEG-12 exposed a real product gap: nested unknown adapter fields were accepted, which led to
the strict-field fix below.

3. Clean-device product pass

A fresh API 36 AVD (af_cert_clean) was created. CalcSuite debug was installed for the first time,
the second --only-if-changed install skipped with an explicit package/version/hash reason,
apk diff reported same with zero changed fields, and a brief agent test --dry-run planned all
12 stages. This replaces the earlier assumption that a reused AVD was sufficient.

4. Physical device: BLOCKED

adb devices showed only emulator-5554 and emulator-5556; no PnP Android/POCO device was
present. No physical-device behavior, vendor-ROM behavior, USB transport behavior or HyperOS-specific
UI behavior is claimed for v0.9.3. The procedure and evidence template remain in
VERIFICATION.md; the item must be run when the device is connected.

5. Configurable, race-free observation retention

Observation retention was a hard-coded constant of 20. v0.9.3 adds:

[storage]
observation_retention = 20

The default remains 20; the valid range is 2..=1000. The generated project and global config files
include the section, and schema/adapter.schema.json publishes it.

Token allocation, observation writes and pruning now run under a cross-process StateLock backed by
an exclusive file lock. Parallel CLI processes therefore cannot allocate the same token or prune
while another process is writing. Retention still evicts oldest-first and never evicts the record
just written.

6. Empty UIAutomator hierarchies are transient

A rapid screen transition can produce a well-formed but empty UIAutomator dump. The manager treated
that as a successful blank screen. v0.9.3 classifies an empty hierarchy as a transient capture
failure, retries it with the existing recovery path, and only returns a hierarchy with nodes.

7. Desktop render gate

desktop/tests/smoke.ps1 is a local release gate for the egui cockpit. It launches all 13 pages
(setup, overview, context, devices, sessions, matrix, ownership, runs, triage, compare, logcat,
inspector, maintenance), captures a screenshot per page, rejects blank or too-small renders, records
the Windows UI Automation tree and invokes the overview Refresh button. The release run passed 13/13
pages with UI Automation trees of 74-244 elements. It is intentionally not a headless CI test and
does not claim full interactive coverage; see desktop/tests/README.md.

8. Exit-code drift protection

EXIT_CODES.md is now checked against ErrorCode::ALL in cargo test --workspace: every documented
code, numeric exit code and recoverability flag must match the enum, and every enum variant must be
documented. The user and agent guides now state explicitly that session stop is owner-guarded and
is not --yes-guarded.

Compatibility

  • Full JSON remains the default; existing fields are unchanged.
  • New configuration section: [storage] with observation_retention (default 20, range 2-1000).
  • Nested adapter sections and hook entries now reject unknown fields. Configurations that previously
    relied on silently ignored typos will fail with E_CONFIG_INVALID naming the field.
  • agent-test brief stages retain command_argv: []; run_id may be null.
  • No destructive behavior, Gradle execution, cloud service or hidden retry was added.
  • Workspace, CLI, desktop, installer and compatibility version are 0.9.3.
  • v0.6.0-v0.9.2 releases, tags and assets remain untouched.

Validation

cargo fmt --check, clippy with -D warnings, the full workspace test suite and the release build
passed. Exact test counts, emulator evidence, desktop evidence and package hashes are recorded in
VERIFICATION.md.