mirror of
https://github.com/kuhyx/testsAndMisc.git
synced 2026-11-24 23:06:31 +01:00
focus_owner had drifted entirely off the frozen palette -- a cool blue #5B9DD9 accent on a #1B1D21 field -- while its own doc comment claimed it matched the other com.kuhy.* apps. It did not: every other app is on the gold #B8862E. lib/theme.dart now aliases design_system-v0.1.0, so the ~80 call sites keep reading the same names but the values come from one place and cannot drift again. The six constants duplicated verbatim in main.dart are deleted -- 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. Separately: dev.kuhy.todo was in the day allowlist but not the night one, so a release build installed at 23:07 was hidden by the enforcer ~80ms later. It is now in night_allowed_packages. That is a deliberate loosening of the curfew's "answer the phone, reach a bank, handle an emergency" rule -- writing an idea down at night is the one thing that app does -- and it is recorded as such in both config files. Deploying the shell mirror of that list surfaced two pre-existing latent bugs in phone_focus_mode/config.sh: comment lines inside the double-quoted WHITELIST string referenced the night list (defined ~70 lines below) and an ALWAYS_BLOCKED that is never defined anywhere, so under set -u the entire deploy aborted with "unbound variable". Both are now written plainly, with a note saying why a dollar sign or a double quote must never appear inside that string. Verified on the Pixel 6a: analyze clean, 94/94 tests, colour literals 15 -> 2 (both Colors.transparent sentinels), and an ad-hoc assertion confirming kAccent is really ffb8862e rather than merely compiling. The installed APK shows CURFEW and the action links in gold, "Allowed apps 29 (16 at night)" (was 15) and "restored 1"; todo then launched and rendered at 23:19, inside the curfew window, with all 108 notes intact. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XS1m7b1piBtAL22USLW6jL
62 lines
4.5 KiB
JSON
62 lines
4.5 KiB
JSON
{
|
|
"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."
|
|
]
|
|
}
|