Skip to content

feat(bin): read Android emulator availability in the fleet snapshot - #321

Merged
sKeLe100 merged 5 commits into
mainfrom
fm/fleet-snapshot-android-reader
Nov 23, 2026
Merged

sKeLe100 merged 5 commits into
mainfrom
fm/fleet-snapshot-android-reader

Conversation

@sKeLe100

@sKeLe100 sKeLe100 commented Nov 23, 2026 •

Copy link
Copy Markdown
Owner

Intent

We should be filing any tasks in relation to the gaps mentioned this session as priority 0 on pc01 and within resources

Context: the fleet inventory (bin/fm-resource-snapshot.sh, behind /fleet) lists android,no reader for Android emulator availability under unavailable. Phone checks are run by workers on the Android emulator (PC01 emulator recorded in data/hosts.md), so the fleet view cannot currently say whether an emulator is available for that work.

What Changed

  • bin/fm-resource-snapshot.sh gains a read-only Android reader that probes emulator -list-avds, adb devices, and getprop sys.boot_completed on the local host and on PC02 over a bounded ssh batch. It emits a new android[] section (machine, avd, serial, state, boot_completed, detail, read_utc). Listed AVDs with no running emulator show as stopped. The state is unknown when adb is missing or failing, or when another emulator's AVD name can't be resolved. none means both probes read cleanly and found nothing. A missing adb or emulator is reported as an unavailable[] row with its reason, and timeouts are reported as bound hits instead of zero devices. New FM_RESOURCE_ANDROID_FIXTURE, FM_RESOURCE_ADB, FM_RESOURCE_EMULATOR, and timeout overrides are the test seams.
  • .agents/skills/fleet/SKILL.md now lists Android emulator availability among the snapshot's sources and tells /fleet how to render it. It names each host's AVDs, serials, adb state, and boot completion, and states a missing tool with its reason.
  • tests/fm-resource-snapshot.test.sh adds about 300 lines of coverage for the Android reader. bin/fm-test-run.sh and docs/fm-test-portable-shards.md refresh the tests/fm-self-repo-role.test.sh serial timing hint (7363 ms to 11958 ms).

Risk Assessment

✅ Low: The change adds a bounded, read-only Android emulator reader with fixture and PC02 paths. I traced the unresolved-serial, missing-adb, offline-serial and non-emulator-serial cases and found no wrong-output path. The other edits are a docs line and a timing hint.

Testing

The configured baseline command had already passed. I then ran tests/fm-resource-snapshot.test.sh in full, which drives the real bin/fm-resource-snapshot.sh against fake adb/emulator binaries, a fixture, and a fake ssh boundary for PC02. All Android scenarios passed. The one skipped test is the opt-in live fleet check. Real adb and emulator are not installed here, so the fakes stand in for them and no real emulator was exercised. The changed surface is CLI/JSON/TOON output with no UI, so no screenshots apply.

  • Live validation: ✅ go - 6 of 6 scenarios driven live against the product
Scenario Result Live Evidence
PC01 and PC02 Android rows render from fixture; the unavailable android row clears; the TOON table renders ✅ pass live resource-snapshot-test.log: test_android_fixture_renders_both_hosts
Fake adb and emulator (PATH-injected) yield a running AVD row with serial and boot_completed=1, plus an offline serial row ✅ pass live resource-snapshot-test.log: test_android_probe_reads_fake_tools
A running emulator with an unresolvable name shows as unknown, never as a stopped AVD; a non-emulator serial leaves a stopped AVD rendered stopped ✅ pass live resource-snapshot-test.log: test_android_unresolved_name_is_not_stopped, test_android_physical_device_does_not_hide_stopped_avd
A failed adb read with a listed AVD renders the AVD unknown with its reason, never stopped ✅ pass live resource-snapshot-test.log: test_android_adb_failure_keeps_avd_unknown_not_stopped
Probe failures, timeouts, missing tools and a failed PC02 remote read are stated as reasons, never zero devices; clean empty reads render a none row ✅ pass live resource-snapshot-test.log: probe_failures, timeouts, missing_tools, empty_clean, pc02_android_live_failure tests
PC02 live Android read over the shipped remote helper returns rows across the ssh boundary ✅ pass live resource-snapshot-test.log: test_pc02_android_live_read
Evidence: resource snapshot test transcript

Source: resource snapshot test transcript

ok - every section renders and JSON/TOON share the same model
ok - the Android fixture renders one row per host and clears the unavailable row
ok - adb serials, AVD list, and boot_completed come from the bounded probes
ok - an unnamed running emulator renders once as avd unknown, never also as a stopped AVD
ok - a failed adb read renders the AVD unknown with its reason, never stopped
ok - failed adb and emulator probes render as stated reasons, never as zero devices
ok - clean empty Android reads render a none row
ok - boot_completed renders 0, unknown for empty, and failed for an unanswered probe
ok - a non-emulator adb serial leaves a stopped AVD rendered stopped
ok - timed-out adb and emulator probes render as stated reasons
ok - the shipped PC02 Android probe returns rows over the ssh boundary
ok - a failed PC02 Android read is an unavailable row, never zero devices
ok - missing adb and emulator render as stated reasons, never as zero devices
ok - an opencode worker's context band comes from its session store
ok - a failed quota read is labelled and never rendered as zero
ok - a rate-limited quota read shows state and retry, never 0 percent
ok - a down PC02 yields unavailable rows and keeps PC01 complete
ok - the remote fixture alone supplies PC02 hosts, drives, and the running session
ok - worker-lane accounts follow the lane classification, not the orchestrator role
ok - row caps hold and the omitted counts report the cut rows
ok - the command creates no file and leaves fixture mtimes unchanged
ok - home-only renders just one home's workers for the remote call
skip: live: opt-in; set FM_FLEET_LIVE=1 to run

Pipeline

Updates from git push no-mistakes

✅ **Intent** - passed

✅ No issues found.

✅ **Rebase** - passed

✅ No issues found.

✅ **Review** - passed

✅ No issues found.

✅ **Test** - passed

✅ No issues found.

  • Live validation: ✅ go - 6 of 6 scenarios driven live against the product
Scenario Result Live Evidence
PC01 and PC02 Android rows render from fixture; the unavailable android row clears; the TOON table renders ✅ pass live resource-snapshot-test.log: test_android_fixture_renders_both_hosts
Fake adb and emulator (PATH-injected) yield a running AVD row with serial and boot_completed=1, plus an offline serial row ✅ pass live resource-snapshot-test.log: test_android_probe_reads_fake_tools
A running emulator with an unresolvable name shows as unknown, never as a stopped AVD; a non-emulator serial leaves a stopped AVD rendered stopped ✅ pass live resource-snapshot-test.log: test_android_unresolved_name_is_not_stopped, test_android_physical_device_does_not_hide_stopped_avd
A failed adb read with a listed AVD renders the AVD unknown with its reason, never stopped ✅ pass live resource-snapshot-test.log: test_android_adb_failure_keeps_avd_unknown_not_stopped
Probe failures, timeouts, missing tools and a failed PC02 remote read are stated as reasons, never zero devices; clean empty reads render a none row ✅ pass live resource-snapshot-test.log: probe_failures, timeouts, missing_tools, empty_clean, pc02_android_live_failure tests
PC02 live Android read over the shipped remote helper returns rows across the ssh boundary ✅ pass live resource-snapshot-test.log: test_pc02_android_live_read
  • bin/fm-test-run.sh --changed --exclude-family real-herdr-gated --exclude-quarantined --pc02-if-idle
  • bash tests/fm-resource-snapshot.test.sh (all tests passed; the live opt-in check was skipped)
✅ **Document** - passed

✅ No issues found.

✅ **Lint** - passed

✅ No issues found.

✅ **Push** - passed

✅ No issues found.

sKeLe100 and others added 5 commits November 23, 2026 00:39
…nown

Keep only emulator-* serials in the AVD name check, render a physical
adb device as its own row, and render an unresolved running emulator
once as avd=unknown. When adb is missing or failing, a listed AVD is
unknown with the adb reason instead of stopped. Add tests for all three.
@sKeLe100
sKeLe100 force-pushed the fm/fleet-snapshot-android-reader branch from 017dac1 to b4ea242 Compare November 23, 2026 06:57
@sKeLe100
sKeLe100 merged commit 07905bb into main Nov 23, 2026
26 checks passed
sKeLe100 added a commit that referenced this pull request Nov 23, 2026
…he upstream catch-up

Keep-both resolution in bin/fm-test-run.sh family_for_basename: retain the
upstream fm-procevent-extension-errors arm and add main's fm-timed-dispatch arm.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant