mirror of
https://github.com/kuhyx/testsAndMisc.git
synced 2026-11-20 11:52:23 +01:00
The decision layer and setApplicationHidden were both built and tested but never connected -- the service logged a tick. Joining them meant porting the decision to Kotlin, because a background Service has no Flutter engine and starting one per alarm to answer a pure question would be slow and would add a failure mode at precisely the moment enforcement has to be reliable. That duplication is only safe if the two cannot drift, so the Kotlin suite restates the Dart cases one for one rather than testing something adjacent. It was checked for vacuity by asserting the hidden set contained a package that is not installed: 13 tests completed, 1 failed, and it was the right one. Show is applied before hide. If a pass is interrupted -- process killed, device sleeps -- the half that ran is the half that restores access rather than the half that removes it. The launcher, the protected prefixes and the app's own package are re-checked at the point of use as well as in the policy, because hiding the dialer would be unrecoverable from the device itself. An unreadable policy yields no decision rather than an empty allowlist, which would hide every app. The next run is scheduled in a finally, so an enforcement bug costs one tick instead of ending the chain. Note for the next session: JDK 26 is the system default and breaks the Android jlink transform; the Gradle tests need JAVA_HOME=/usr/lib/jvm/java-21-openjdk, which is what Flutter itself uses. NOT verified on device. Unit tests cover the decision, but no real hide/show pass has been observed -- a managed profile was created and the app made profile owner, and the UI confirmed the policy loaded, but the session ended before a pass was triggered. The profile was removed and user 0 verified clean. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AwepyL5Lxs5QKbKkMpxxxL
20 lines
1.6 KiB
JSON
20 lines
1.6 KiB
JSON
{
|
|
"title": "Join the enforcement decision to the DPM hide call",
|
|
"objective": "The decision layer and setApplicationHidden were both built and tested but never connected: the service logged a tick. Wire them, which requires the decision to exist in Kotlin because a background Service has no Flutter engine. Success is a service that reads the policy, gathers inputs, decides, and applies - with the Kotlin and Dart implementations pinned against the same expectations so they cannot drift.",
|
|
"acceptance_criteria": [
|
|
"The Kotlin decision mirrors the Dart one case for case, enforced by a test suite that restates the Dart cases",
|
|
"That suite is non-vacuous, demonstrated by a deliberate mutation failing the expected test",
|
|
"Show is applied before hide, so an interrupted pass leaves access restored rather than removed",
|
|
"The launcher, protected prefixes and the app itself are re-checked at the point of use, not only in the policy",
|
|
"An unreadable policy yields no decision rather than an empty allowlist, which would hide every app",
|
|
"A failure inside a pass still schedules the next run"
|
|
],
|
|
"out_of_scope": [
|
|
"Device Owner provisioning and the factory reset",
|
|
"Runtime location permission request - the code reads a fix when granted and fails closed when not",
|
|
"Health Connect query implementation",
|
|
"On-device verification of a real hide/show pass: NOT COMPLETED this session"
|
|
],
|
|
"verifier": "JAVA_HOME=/usr/lib/jvm/java-21-openjdk ./gradlew :app:testDebugUnitTest (13 tests); flutter analyze && flutter test (67); a mutation run to prove the Kotlin suite is live"
|
|
}
|