testsAndMisc/phone_focus_mode/lib
Krzysztof kuhy Rudnicki 728301c9a4 monitor: split 449 -> 215 + 138 + 136, partitioned by probe kind
lib/monitor.sh was 199 lines over the cap. Its eleven _check_* probes
move into two siblings: monitor_checks_health.sh (format indicators,
battery, storage, the three enforcer daemons) and
monitor_checks_policy.sh (hosts blocklist, DNS chain, launcher,
companion app, boot persistence).

A single monitor_checks.sh was tried first and left at 265 lines — still
over, the net-zero outcome. Two libraries split the cluster at its own
seam and land both comfortably under.

The _MONITOR_* constants are partitioned by reader so no file assigns a
global it never reads. The five read only by the policy probes move into
that file; the ones monitor.sh reads itself or shares between both
children stay put. shellcheck is clean on each file standing alone.

Not a deployment concern: lib/monitor.sh is PC-side, consumed by
run_phone.sh, and deploy.sh never references lib/ — so neither copy list
changes.

Verified three ways: test_monitor.sh reports 9 passed / 0 failed, the
same count as before; verify_shell_split.sh confirms all 25 top-level
functions moved verbatim; and run_phone.sh --help exits 0, proving the
source chain resolves in the real consumer. Over-cap count 24 -> 23.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011w2Pj4Ek3ZNMQVYcFHgXDY
2026-08-17 14:59:41 +02:00
..
tests tether_enforcer: split 267 -> 182 + 103, and grow both deploy lists 2026-08-17 14:38:53 +02:00
adb_common.sh phone_focus_mode: split adb_common.sh 346 -> 155 + two libs 2026-08-17 10:31:34 +02:00
adb_locking.sh phone_focus_mode: split adb_common.sh 346 -> 155 + two libs 2026-08-17 10:31:34 +02:00
adb_trusted.sh phone_focus_mode: split adb_common.sh 346 -> 155 + two libs 2026-08-17 10:31:34 +02:00
backup.sh feat(phone-focus): add recovery workflow, automation scripts, and docs 2026-05-01 19:07:27 +02:00
monitor_checks_health.sh monitor: split 449 -> 215 + 138 + 136, partitioned by probe kind 2026-08-17 14:59:41 +02:00
monitor_checks_policy.sh monitor: split 449 -> 215 + 138 + 136, partitioned by probe kind 2026-08-17 14:59:41 +02:00
monitor_report.py refactor: extract all inline Python from shell scripts into proper .py files 2026-06-06 10:31:48 +02:00
monitor.sh monitor: split 449 -> 215 + 138 + 136, partitioned by probe kind 2026-08-17 14:59:41 +02:00
restore.sh feat(phone-focus): add recovery workflow, automation scripts, and docs 2026-05-01 19:07:27 +02:00