{ "intent": "Build and validate the shell equivalent of the Python ast identity check, and record the deployment triage of all 29 over-cap shell scripts, so the splits that follow can be verified rather than assumed.", "scope": [ "New: meta/scripts/verify_shell_split.sh", "docs/shell-split-verification.md - the harness usage, its self-test contract, and the triage table", "Non-goal: any split; this commit only builds the tooling" ], "changes": [ "verify_shell_split.sh extracts each top-level function from a git rev and from the post-split files, normalises through shfmt -mn, and compares a hash per function. shfmt is already a REQUIRED_TOOLS binary here, so this adds no dependency.", "It names the function that changed rather than reporting a whole-file diff, so a failure points at the seam.", "Documented the triage: deploy.sh copies a hardcoded per-file list into /data/local/tmp/focus_mode and never deploys lib/, which decides the seam shape for 8 of the 29 scripts." ], "verification": [ { "command": "verify_shell_split.sh HEAD ", "result": "pass", "evidence": "IDENTICAL: all 5 top-level functions moved verbatim." }, { "command": "verify_shell_split.sh against a copy with blank lines inserted every 7th line", "result": "pass", "evidence": "IDENTICAL - formatting changes do not register, which is what makes the check usable after shfmt and pre-commit autofixes." }, { "command": "verify_shell_split.sh against a copy with one character of logic changed (file_path=\"$1\" -> \"$2\")", "result": "pass", "evidence": "DIFFERENCE FOUND, naming process_packages and printing both hashes, exit 1. The first attempt at this test used sed 's/exit 1/exit 2/' on a file containing no 'exit 1' and reported IDENTICAL; diffing the mutation showed it had never applied. The harness was fine, the test was vacuous - which is exactly the failure mode a normalizer self-test exists to catch, and it is now written down." }, { "command": "shellcheck meta/scripts/verify_shell_split.sh", "result": "pass", "evidence": "Clean. An SC2329 on the cleanup function was fixed by inlining it into the trap rather than suppressing the warning." }, { "command": "grep triage over all 29 over-cap shell scripts for cp/install/ln into deployed locations", "result": "pass", "evidence": "13 scripts have a deployed copy: the 8 phone_focus_mode scripts (individually listed in deploy.sh), install_leechblock.sh and block_compulsive_opening.sh (preferred from /usr/local by pacman_wrapper.sh on every pacman call), and three that install helpers to /usr/local. The other 16 are safe to give an entry+lib shape. Confirmed the phone scripts source only config.sh, which is on deploy.sh's copy list - so a sibling-file seam works there but an entry+lib seam would not." }, { "command": "npx prettier --write docs/shell-split-verification.md and wc -l", "result": "pass", "evidence": "136 lines, under the 250-line cap. prettier runs on pre-push, so markdown is formatted before it can fail there." } ], "risks": [ "The function extractor is a brace-counting awk pass, so a function whose body contains an unbalanced brace inside a string or heredoc could be mis-delimited. Mitigated by the control test on a real repo script and by the harness reporting the function count, which would drop visibly if extraction went wrong.", "The check covers top-level functions only. Code outside any function - the argument parsing and main flow most of these scripts end with - is not compared, so a split must still be verified by running the script." ], "rollback": [ "git revert the commit; the harness and the documentation section disappear together.", "Nothing depends on them yet, so no follow-up validation is needed after rollback." ] }