{ "intent": "Exempt YouTube, YouTube Music and Chrome from the geofence so they stay hidden everywhere, and make pl.infakt.infakt unhideable under every condition rather than merely allowlisted.", "scope": [ "python_pkg/focus_policy/export.py", "python_pkg/focus_policy/tests/test_export.py", "focus_owner/android/app/src/main/kotlin/com/kuhy/focus_owner/FocusPolicy.kt", "focus_owner/android/app/src/main/kotlin/com/kuhy/focus_owner/EnforcementDecision.kt", "focus_owner/android/app/src/test/kotlin/com/kuhy/focus_owner/EnforcementDecisionTest.kt", "phone_focus_mode/config.sh", "focus_owner/assets/policy.json", "Non-goal: network-level YouTube blocking, which the app cannot currently do at all" ], "changes": [ "New always_blocked_packages field. The AWAY branch previously returned early with packagesToShow = everything, so leaving home restored YouTube -- the geofence was an off switch, which is what device owner exists to remove.", "The exemption is applied in all four branches: AWAY hides them, the allowlist loop cannot show them, and the workout release skips them (otherwise 'go for a run' becomes the off switch).", "com.android.vending deliberately NOT always-blocked: Play stays geofenced so apps can be installed away from home, and a hidden package cannot be reinstalled from Play anyway.", "pl.infakt.infakt moved into SYSTEM_NEVER_DISABLE. Allowlisting depended on it staying in BOTH the day and night lists; isAllowed() checks the never-disable list first, before the curfew split, so it now holds unconditionally.", "Exporter raises if an always-blocked package is not also blockable: the runner filters unopted system packages out of installedPackages, so such an entry would silently never be hidden." ], "verification": [ { "command": "pytest python_pkg/focus_policy/ --cov", "result": "pass", "evidence": "128 tests, 100% branch coverage on every focus_policy module (export/loader/model/blocklist/__main__)." }, { "command": "gradlew :app:testDebugUnitTest with a deliberately wrong assertion (canary)", "result": "pass", "evidence": "'16 tests completed, 1 failed' with AssertionError at the always-blocked case, proving the new tests actually execute rather than being skipped. Restored, then 16/16 pass. The pre-existing 'away from home hides nothing' test was updated rather than left passing, since it documented the hole being closed." }, { "command": "adb install -r over the device owner; run enforcement pass", "result": "pass", "evidence": "Success, Device Owner Type: 0 preserved. 'applied LOCATION_UNKNOWN: hid 0, restored 0' -- correctly a no-op, the packages were already hidden by the earlier pass." }, { "command": "dumpsys on the always-blocked set and on infakt", "result": "pass", "evidence": "youtube, youtube.music, chrome, vending all hidden=true. pl.infakt.infakt hidden=false. adb uninstall still returns DELETE_FAILED_DEVICE_POLICY_MANAGER." } ], "risks": [ "The AWAY exemption could NOT be verified on device: with no home_location.json every pass decides LOCATION_UNKNOWN, so the AWAY branch is unreachable on this phone today. It is covered by unit tests (canary-verified) but not by a real geofence transition. That verification has to wait for the in-app coordinate writer.", "Because of the same missing coordinates, the user's 'other apps are fine' half is NOT yet delivered: everything is still hidden everywhere, not only the always-blocked set. The in-app 'set home to current location' action is now on the critical path for that.", "isEnforcing is derived from packagesToHide.isNotEmpty(), so the always-blocked set keeps it true under AWAY and the uninstall block stays on. This is relied upon rather than stated as a separate flag; a future change making AWAY report not-enforcing would silently make `adb uninstall` reachable away from home. A test pins it.", "The user's most important request -- blocking all YouTube hosts/URLs at the network level -- is NOT implemented. focus_owner does no network blocking of any kind. RethinkDNS is installed but at first-run state after the wipe (its 8 wildcard rules are gone) and is itself currently hidden by enforcement." ], "rollback": [ "git revert; regenerate the asset; rebuild; install in place. The extra asset fields are ignored by an older build (optionalStringSet reads a missing key as empty).", "To unblock one of the always-blocked apps without a revert: remove it from ALWAYS_BLOCKED_PACKAGES, regenerate, rebuild, install, run a pass." ] }