Files
Jane Alesi ad8c738160 feat(spec): add 003-autonomous-agent-control specification
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
2026-03-02 18:38:35 +01:00

111 lines
5.9 KiB
Markdown

# 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` — captured `adb shell dumpsys telephony.registry` output (idle + active states)
- [ ] T002 Create `tests/fixtures/dumpsys_package.txt` — captured `adb shell dumpsys package <pkg>` output
- [ ] T003 Create `tests/fixtures/content_sms.txt` — captured `adb shell content query --uri content://sms` output
- [ ] T004 Create `tests/fixtures/content_contacts.txt` — captured `adb shell content query --uri content://contacts/phones` output
---
## Phase 2: Foundational Libraries
- [ ] T005 Create `lib/call.sh``call_dial`, `call_answer`, `call_hangup`, `call_status`, `call_list` functions
- [ ] T006 Create `lib/backup.sh``backup_create`, `backup_list`, `backup_restore`, `backup_app`, `backup_verify` functions
- [ ] T007 Create `lib/contacts.sh``contacts_list`, `contacts_add`, `contacts_export` functions
- [ ] T008 Extend `lib/adb.sh` — add `adb_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_dial` via `adb shell am start -a android.intent.action.CALL`
- [ ] T017 [US1] Implement `lib/call.sh``call_answer`/`call_hangup` via UIAutomator button tap
- [ ] T018 [US1] Implement `lib/call.sh``call_status` via `dumpsys telephony.registry` parsing
- [ ] T019 [US1] Implement `lib/call.sh``call_list` via `adb shell content query --uri content://call_log/calls`
- [ ] T020 [US1] Add `call` subcommand to `fs5` entrypoint with `--help`
- [ ] T021 Verify T009 tests PASS (GREEN for US1)
- [ ] T022 [US2] Implement `adb_install_url``curl` download to `/tmp` + `adb install`
- [ ] T023 [US2] Implement `adb_app_update``adb install -r` for single package
- [ ] T024 [US2] Implement `adb_app_update --all` — iterate user packages, `adb install -r` each
- [ ] T025 [US2] Implement `adb_app_permissions` — parse `dumpsys package` granted/denied sections
- [ ] T026 [US2] Implement `adb_app_grant``adb shell pm grant <pkg> <perm>`
- [ ] T027 [US2] Implement `adb_app_info` — parse `dumpsys package` for version/date/size + JSON output
- [ ] T028 [US2] Extend `app` subcommand in `fs5` with `install --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 `backup` subcommand to `fs5` entrypoint 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-sms` with 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 `sms` subcommand in `fs5` with `send`, `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 audio` for speaker routing
- [ ] T045 [US5] Add `audio` subcommand to `fs5` entrypoint 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 `contacts` subcommand to `fs5` entrypoint 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` — document `call`, `backup`, `audio`, `contacts` subcommands
- [ ] 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
```text
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)
```