Spec for full AI agent mobile control capability:
- Voice call control (dial/answer/hangup/status/list)
- App lifecycle management (install --url, update, permissions, grant, info)
- Device backup & restore (create/list/restore/app/verify, AES-256 encrypt)
- SMS send/delete + wait-reply via KDE Connect
- Audio control (volume/mute/route)
- Contacts management (list/add/export VCF)
56 tasks across 7 phases. TDD: fixtures → RED tests → GREEN impl.
Target: ≥130 BATS tests on completion.
Closes: specs/003-autonomous-agent-control/{spec,plan,tasks}.md
5.9 KiB
Task Breakdown: Autonomous AI Agent Mobile Control
Feature: 003-autonomous-agent-control Created: 2026-03-02 Status: Pending
Phase 1: Setup & Fixtures
- T001 Create
tests/fixtures/dumpsys_telephony.txt— capturedadb shell dumpsys telephony.registryoutput (idle + active states) - T002 Create
tests/fixtures/dumpsys_package.txt— capturedadb shell dumpsys package <pkg>output - T003 Create
tests/fixtures/content_sms.txt— capturedadb shell content query --uri content://smsoutput - T004 Create
tests/fixtures/content_contacts.txt— capturedadb shell content query --uri content://contacts/phonesoutput
Phase 2: Foundational Libraries
- T005 Create
lib/call.sh—call_dial,call_answer,call_hangup,call_status,call_listfunctions - T006 Create
lib/backup.sh—backup_create,backup_list,backup_restore,backup_app,backup_verifyfunctions - T007 Create
lib/contacts.sh—contacts_list,contacts_add,contacts_exportfunctions - T008 Extend
lib/adb.sh— addadb_install_url,adb_app_update,adb_app_permissions,adb_app_grant,adb_app_info
Phase 3: Tests — RED Phase (write before implementation)
- T009 [US1] Write
tests/test_call.bats— call dial/answer/hangup/status/list (offline fixtures + online markers) - T010 [US2] Write
tests/test_app_extended.bats— app install --url, update, permissions, grant, info - T011 [US3] Write
tests/test_backup.bats— backup create/list/restore/app/verify - T012 [US4] Write
tests/test_sms_extended.bats— sms send, sms send --wait-reply, sms delete - T013 [US5] Write
tests/test_audio.bats— audio volume/mute/route - T014 [US6] Write
tests/test_contacts.bats— contacts list/add/export - T015 Verify ALL new tests FAIL (RED phase confirmed) before implementing libraries
Phase 4: Implementation — P1 (Call + App + Backup)
-
T016 [US1] Implement
lib/call.sh—call_dialviaadb shell am start -a android.intent.action.CALL -
T017 [US1] Implement
lib/call.sh—call_answer/call_hangupvia UIAutomator button tap -
T018 [US1] Implement
lib/call.sh—call_statusviadumpsys telephony.registryparsing -
T019 [US1] Implement
lib/call.sh—call_listviaadb shell content query --uri content://call_log/calls -
T020 [US1] Add
callsubcommand tofs5entrypoint with--help -
T021 Verify T009 tests PASS (GREEN for US1)
-
T022 [US2] Implement
adb_install_url—curldownload to/tmp+adb install -
T023 [US2] Implement
adb_app_update—adb install -rfor single package -
T024 [US2] Implement
adb_app_update --all— iterate user packages,adb install -reach -
T025 [US2] Implement
adb_app_permissions— parsedumpsys packagegranted/denied sections -
T026 [US2] Implement
adb_app_grant—adb shell pm grant <pkg> <perm> -
T027 [US2] Implement
adb_app_info— parsedumpsys packagefor version/date/size + JSON output -
T028 [US2] Extend
appsubcommand infs5withinstall --url,update,permissions,grant,info -
T029 Verify T010 tests PASS (GREEN for US2)
-
T030 [US3] Implement
backup_create—adb backup+ content provider pulls + tar.gz + manifest JSON -
T031 [US3] Implement
backup_list— scan backup directory, parse manifests, output JSON array -
T032 [US3] Implement
backup_restore— extract archive,adb restore, push SMS/contacts -
T033 [US3] Implement
backup_app— single package APK pull +adb backup -package <pkg> -
T034 [US3] Implement
backup_verify— sha256sum check against manifest checksum -
T035 [US3] Add
backupsubcommand tofs5entrypoint with--help -
T036 Verify T011 tests PASS (GREEN for US3)
Phase 5: Implementation — P2 (SMS Send + Audio)
-
T037 [US4] Implement
sms send—kdeconnect-cli --send-smswith pairing check -
T038 [US4] Implement
sms send --wait-reply— poll KDE Connect notifications with 60s timeout -
T039 [US4] Implement
sms delete—adb shell content delete --uri content://sms/<id> -
T040 [US4] Extend
smssubcommand infs5withsend,delete -
T041 Verify T012 tests PASS (GREEN for US4)
-
T042 [US5] Implement
audio volume set—adb shell media volume --stream <n> --set <level> -
T043 [US5] Implement
audio mute—adb shell media volume --stream <n> --set 0 -
T044 [US5] Implement
audio route—adb shell service call audiofor speaker routing -
T045 [US5] Add
audiosubcommand tofs5entrypoint with--help -
T046 Verify T013 tests PASS (GREEN for US5)
Phase 6: Implementation — P3 (Contacts)
- T047 [US6] Implement
contacts_list—adb shell content query --uri content://contacts/phones+ JSON - T048 [US6] Implement
contacts_add—adb shell content insert --uri content://contacts/raw_contacts - T049 [US6] Implement
contacts_export— query all contacts, format as VCF, write to file - T050 [US6] Add
contactssubcommand tofs5entrypoint with--help - T051 Verify T014 tests PASS (GREEN for US6)
Phase 7: Polish & Integration
- T052 [P] Run
shellcheck fs5 lib/*.sh— fix all warnings - T053 [P] Update
README.md— documentcall,backup,audio,contactssubcommands - T054 [P] Update
NEXT_STEPS.md— mark 003 tasks in progress - T055 Add integration test: full auth flow (dial → wait OTP → enter OTP) as
tests/test_integration_auth.bats - T056 Verify all tests pass:
bats tests/(target: ≥130 tests)
Dependency Graph
T001-T004 (fixtures) → T009-T014 (tests RED)
T005-T008 (libraries) → T016-T051 (implementation)
T009-T014 (tests RED) → T015 (verify RED) → T016+ (implement GREEN)
T016-T051 (all GREEN) → T052-T056 (polish)