Skip to content

feat(control): port APK Control v2 slice 2 with AppFunctions, VirtualDisplay, and reversible profiles (#1865) - #2413

Draft
NubsCarson wants to merge 1 commit into
developfrom
feat/alpha-next-control-v2-slice2
Draft

NubsCarson wants to merge 1 commit into
developfrom
feat/alpha-next-control-v2-slice2

Conversation

@NubsCarson

Copy link
Copy Markdown
Collaborator

Summary

Ports APK Control v2 (Slice 2, tracking #1865 and stacking cleanly on merged Slice 1 #2397) onto develop, reconciled with first-boot accessibility pre-grants (#2383) and generated Schemas vocabulary (#2365), with ZERO changes to the default monolith apps/app/android/app (ai.alphacompute.alphaphone) or aosp.ts:

  • Android alpha-control library (apps/app/android/alpha-control/):
    • Extends IAlphaControlBridge.aidl, AlphaControlBridgeClient.java, AlphaControlPolicy.java, and AlphaUiControlExecutor.java for dual-mode foreground + trusted VirtualDisplay execution, post-action readback refresh, and takeover reconciliation.
    • Adds AppFunctionsBridge.java (Android 16+/17 structured AppFunctions discovery and execution fallback), VirtualDisplaySessionManager.java (dual-mode headless display lifecycle and per-display input/capture), ReversibleProfileController.java (with AndroidSettingStore wiring and attribution receipts), plus their 3 JUnit test suites (AppFunctionsBridgeTest.java, ReversibleProfileControllerTest.java, VirtualDisplaySessionManagerTest.java).
  • AOSP privileged bridge (apps/app/aosp/control-bridge/):
    • Extends AlphaControlBridgeService.java, IAlphaControlBridge.aidl, AndroidManifest.xml, privapp-permissions-alpha-control.xml, sepolicy/alpha_control_bridge.te, and test_bridge_plan.py for protocol v2 virtual displays, per-display input injection, and signer/lockscreen invariants.
  • Formal specs, proofs, and conformance (spec/app/control/, apps/app/test/drivers/, apps/agent/src/plugins/control*):

Draft / spec/lock.json Note

  • spec/lock.json is intentionally left untouched in this Draft PR while develop carries unrelated unaccepted review entries, avoiding merge contention. Before marking ready for merge, accept the 44 new control spec review entries (spec/app/control/index.md: 32, spec/app/control/profile.md: 12).

Verification

  • Android API 36 JVM JUnit (alpha-control, AIDL + all 4 suites): 15/15 PASS (AlphaControlPolicyTest 5, AppFunctionsBridgeTest 4, ReversibleProfileControllerTest 3, VirtualDisplaySessionManagerTest 3)
  • AOSP bridge plan (python3 apps/app/aosp/control-bridge/test_bridge_plan.py -v): 2/2 PASS (AIDL + AlphaControlBridgeService.java compile against Android API 36 + BridgePolicyTest on JVM)
  • @repo/agent Vitest (test/control-v2.test.ts + test/alpha-apps.test.ts): 43/43 PASS (5 + 38); @repo/agent typecheck: PASS
  • Quint simulation (app__control + app__control__profile): 12,000 traces each always PASS, all sometimes goals reachable (6/6 + 1/1), all guards allow and refuse (9/9 + 4/4), TS replay agrees (406 + 401 traces)
  • Conformance drivers: app__control.ts PASS (12 model paths, 6 journeys, 150 walks, 9/9 accepted/refused) and app__control__profile.ts PASS (19 model paths, 1 journey, 150 walks, 4/4 accepted/refused)
  • Dafny 4.11.0 / Z3 4.12.1 proofs: 62/62 obligations PROVED (app__control.ts 50/50, app__control__profile.ts 12/12; 0 unproved, 0 exhausted, 0 errors)
  • danglingCitations=0, eslint --max-warnings 0 (all 6 TS files) PASS, jscpd --threshold 0 (0 clones, 0.00%) PASS, pnpm no-bun PASS, git diff --check PASS

This branch was successfully deployed

1 active deployment
turbo-cache-read — 57cd8fdd Deployed Dec 4, 2026 by NubsCarson via build #5872
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