{ "title": "Split focus_daemon.sh into three tested libraries", "objective": "Take focus_daemon.sh from 543 lines to under the repo's 250-line cap by extracting its location/curfew logic, its state-file builders and its app layer into three flat siblings, and test all three. is_allowed is the single decision that determines whether an app keeps working; it had no test at all.", "acceptance_criteria": [ "bash meta/scripts/check_file_length.sh --all no longer lists phone_focus_mode/focus_daemon.sh, and no new file is over the cap.", "Every stdin-draining `while read ... done < file` loop is identified BEFORE extraction and moved verbatim. None may be converted to a pipe: each body calls pm, which would drain the loop's stdin.", "Every assertion is mutation-proofed with zero survivors, including mutations targeting code kcov cannot attribute — the embedded awk Haversine and the trailing `done < file` redirect lines.", "Where kcov cannot reach 100%, the shortfall must be shown to be a measurement artifact by mutation, and reported as an explicit exception with the real number — never by restructuring code in a way that risks behaviour.", "meta/scripts/verify_shell_split.sh reports every function moved verbatim.", "All three siblings are added to BOTH of deploy.sh's hardcoded lists, and the two lists remain in exact correspondence.", "shellcheck passes on each touched file individually, with no -x and no disable directive; sh -n passes on all four phone-side scripts.", "A reproducible mutation spec lands in meta/scripts/fixtures/mutations/." ], "out_of_scope": [ "Deploying to the phone or verifying on-device; there is no device in this session.", "Splitting init, main, acquire_lock or the logging helpers out of the entry script, which is under the cap without the three extracted clusters.", "Moving CURRENT_MODE or _CURFEW_TICK_CACHED out of the entry script: both are written there and in a library, so they are genuine shared globals.", "Collapsing the multi-line awk Haversine onto one line to satisfy kcov; readability of the distance formula outweighs a measurement artifact." ], "verifier": "bash phone_focus_mode/lib/tests/test_daemon_libs.sh (expects 110 passed, 0 failed), plus shell_coverage.sh reporting 100.00% for daemon_state.sh and the documented artifact figures for the other two, plus python3 meta/scripts/mutate_shell.py meta/scripts/fixtures/mutations/daemon_libs.json at 33 killed / 0 not killed, plus check_file_length.sh --all showing 18 files, plus deploy-list parity, plus pre-commit run --files on the touched files." }