{ "title": "focus_owner: correct the geofence input and make every decision explainable", "objective": "The Device Owner enforcer failed in both directions on the Pixel 6a: nothing blocked at home (a coarse, fuzzed fix read as AWAY and restored the browser) and everything blocked at the office (an empty last-known cache produced LOCATION_UNKNOWN, which applies the identical sweep to AT_HOME). Neither was diagnosable, because logcat rotates and run-as is refused on the release build device owner requires. Success means the geofence classifies correctly from a precise, actively-acquired fix; the phone states on screen why it is enforcing, how far it believes it is from home, whether curfew is active, and which apps are hidden with the reason for each; and a durable in-app record answers the same questions hours later. Play Store and Tachiyomi's per-source extensions become available without weakening the YouTube block.", "acceptance_criteria": [ "ACCESS_FINE_LOCATION is declared and self-granted by the device owner; on-device dumpsys shows granted=true.", "Each pass actively acquires a fix inside a location-typed foreground service, bounded by a timeout, and treats a fix older than the freshness window as no fix (fail-closed).", "The freshness window is strictly longer than the enforcement cadence, so an idle phone does not fall to LOCATION_UNKNOWN every pass.", "Fix selection gates on freshness first and prefers accuracy only within the fresh set; a recent coarse fix beats an old precise one.", "LOCATION_UNKNOWN and no-home-configured are each rendered distinctly on screen, never as AT_HOME.", "Hysteresis widens the threshold only when the previous pass placed the phone inside the fence.", "A durable, size-bounded record of each pass is written and readable in-app; it never contains latitude or longitude.", "A malformed or wrong-typed log record is skipped and can never disable the release-device-owner escape hatch.", "Installing over the app re-arms the alarm chain without the app being opened.", "YouTube, YouTube Music and Chrome remain hidden in every state including AWAY; Play Store, inFakt, RunnerUp and all installed Tachiyomi packages are available at home.", "Play Store is allowed by day and hidden during curfew.", "The generated policy asset reproduces exactly from config.sh with home coordinates redacted." ], "out_of_scope": [ "Making the DNS/VPN layer actually filter youtube.com. private_dns_host is empty, port 853 is not forwarded, and VPN lockdown bypasses system Private DNS, so a browser still reaches YouTube when AWAY. At home and during curfew every browser is hidden, which is what closes it there.", "Removing the rooted-era phone_focus_mode shell daemon, which still parses the same config.sh but does not consume the new prefix lists.", "The unrelated poker-stakes work present in the same working tree." ], "verifier": "bash ~/.claude/scripts/finish.sh gate (pre-commit + suites); python3 -m pytest python_pkg/focus_policy/tests/ (137); cd focus_owner && flutter analyze && flutter test (94); cd focus_owner/android && JAVA_HOME=/usr/lib/jvm/java-21-openjdk ./gradlew :app:testDebugUnitTest (40); on-device: adb install -r, tap Run enforcement now, read the status card, then adb shell pm list packages -e to confirm the hidden/available sets." }