{ "intent": "Put focus_owner on the one shared palette every other kuhy app uses, and stop the night curfew from removing the todo app minutes after it is installed.", "scope": [ "focus_owner/lib/theme.dart, focus_owner/lib/main.dart, focus_owner/pubspec.yaml", "focus_owner/assets/policy.json (night_allowed_packages)", "phone_focus_mode/config.sh (NIGHT_WHITELIST + two latent set -u aborts)", "Non-goal: no enforcement logic, geofence, or curfew-window change" ], "changes": [ "focus_owner had drifted entirely off the frozen palette -- a cool blue accent #5B9DD9 on a #1B1D21 field -- while its own doc comment claimed it matched the other com.kuhy.* apps. lib/theme.dart now aliases the shared design_system palette (accent #B8862E, field #211D1B), so the ~80 existing call sites keep reading but the values cannot drift again.", "Deleted the six palette constants duplicated verbatim in main.dart as _kField.._kDanger. The old comment said they had been 'lifted out' into theme.dart, but the originals were never removed, so there were two copies of a wrong palette.", "Added dev.kuhy.todo to night_allowed_packages in focus_owner's policy.json. It was in the day list but not the night one, so a release build installed at 23:07 was hidden by the enforcer ~80ms after install.", "Mirrored the same entry into phone_focus_mode/config.sh's NIGHT_WHITELIST, and fixed two pre-existing latent bugs found while deploying it: comment lines inside the double-quoted WHITELIST string referenced $NIGHT_WHITELIST (defined ~70 lines later) and $ALWAYS_BLOCKED (never defined anywhere), so under deploy.sh's set -u the whole deploy aborted with 'unbound variable'." ], "verification": [ { "command": "flutter analyze (focus_owner)", "result": "pass", "evidence": "No issues found! (ran in 2.0s)" }, { "command": "flutter test (focus_owner)", "result": "pass", "evidence": "94/94 tests passed on the new palette" }, { "command": "flutter test (ad-hoc palette assertion, then deleted)", "result": "pass", "evidence": "kAccent=ffb8862e, kField=ff211d1b, kText=ffeceae9, kGap=16.0 -- confirms the values actually changed, not just that it compiles" }, { "command": "grep -rnoE 'Colors\\.[a-zA-Z]+|Color\\(0x' focus_owner/lib", "result": "pass", "evidence": "15 literals -> 2, and both remaining are Colors.transparent sentinels" }, { "command": "bash -n phone_focus_mode/config.sh && bash -c 'set -u; source phone_focus_mode/config.sh'", "result": "pass", "evidence": "syntax OK; sources cleanly under set -u; dev.kuhy.todo present in NIGHT_WHITELIST" }, { "command": "phone_deploy.sh ~/testsAndMisc/focus_owner --release (on-device)", "result": "pass", "evidence": "Installed data-preserving on Pixel 6a 23181JEGR08034. Screenshot shows CURFEW / 'Why these 43 apps are hidden' / 'Debug log' in gold #B8862E, and 'Allowed apps 29 (16 at night)' -- was 15 -- with 'Changed this pass: hid 0, restored 1'." }, { "command": "adb shell monkey -p dev.kuhy.todo (at 23:19, inside curfew)", "result": "pass", "evidence": "mCurrentFocus=dev.kuhy.todo/.MainActivity; app renders with all 108 notes intact. Before this change the package was hidden within ~80ms of install during curfew." } ], "risks": [ "Adding a notes app to the night allowlist is a deliberate loosening of the curfew's 'answer the phone, reach a bank, handle an emergency' rule. Recorded in both config files so the comment and the behaviour do not disagree later.", "focus_owner is a live Device Owner enforcement surface; a bad build could strand the phone. Mitigated by keeping the change to colour aliases plus one policy list entry, with no touch to enforcement logic, and by verifying the escape hatch (release-device-owner) still renders on-device.", "phone_focus_mode/config.sh targets the old rooted Blackview and cannot deploy to the unrooted Pixel; its NIGHT_WHITELIST edit is for parity only. The Pixel's real source of truth is focus_owner/assets/policy.json, which ships inside the APK." ], "rollback": [ "git revert the commit, then rebuild and reinstall focus_owner with phone_deploy.sh --release; the palette and the policy both live in the APK, so reverting the source is not enough on its own.", "After rollback, confirm on-device that 'Allowed apps' reads 29 (15 at night) again and that the enforcer still reports Device owner: yes / Admin active: yes." ] }