testsAndMisc/linux_configuration/scripts/periodic_background/digital_wellbeing
Krzysztof kuhy Rudnicki 76e73830f6 shell: split clean_audio, enforce_vbox_hosts and migrate_hosts_guard
clean_audio.sh          419 -> 230 + 204
  enforce_vbox_hosts.sh   443 -> 220 + 236
  migrate_hosts_guard.sh  444 -> 167 + 162 + 141

migrate_hosts_guard needed two libraries: with all ten work functions moved
the single lib was 295 lines, so migrate and rollback were separated.

The extractor's brace matcher required index > start and so silently skipped
one-line `warn() { ...; }` definitions. Fixed, and regression-checked against
the committed fresh-install/main.sh split byte-for-byte.

The harness earned its keep on a fourth file: adding `export` to libre_translate
to satisfy SC2034 changed two function bodies, and verify_shell_split.sh caught
what lint had accepted. Those exports were reverted, and libre_translate.sh is
parked - what remains after its clean seams both assigns and reads the same
globals, so getting it under the cap needs parse_args restructured rather than
relocated, which is a refactor rather than a verbatim move.

That cost is now written down: a lib must contain the readers of every global
it assigns. The precedent at install_pacman_wrapper.sh:29 is about
definitions-only libs, not about assignments as such, and the pre-commit hook
runs shellcheck with no -x, so a source= directive will not make it follow the
link. This is the shell analogue of the monkeypatch-target trap.

Verified: all 8, 13 and 19 functions verbatim; all four libraries source with
no side effects; shellcheck passes standalone on every file with no
suppression; bash -n passes on all seven. None of the three was executed -
they drive ffmpeg over real media, mutate VirtualBox guest disks, and rewrite
systemd units.

Over-cap files 29 -> 26.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011w2Pj4Ek3ZNMQVYcFHgXDY
2026-08-17 14:27:57 +02:00
..
lib Split music_parallelism.sh into an entry script and three libs 2026-08-16 21:50:34 +02:00
llm-notes Bring every markdown file under the cap 2026-08-16 19:25:59 +02:00
pacman Split install_pacman_wrapper.sh into an entry plus four libs 2026-08-17 07:42:31 +02:00
systemd Add install_core_system.sh; remove pc_startup and thesis_tracker 2026-05-15 01:13:28 +02:00
virtualbox shell: split clean_audio, enforce_vbox_hosts and migrate_hosts_guard 2026-08-17 14:27:57 +02:00
.gitignore refactor(linux_configuration/scripts): split all scripts into single_use/ and periodic_background/ 2026-05-15 00:32:35 +02:00
block_compulsive_opening.sh fix(wellbeing): clear every remaining error/warning; drop thesis_tracker 2026-07-17 08:58:43 +02:00
install_leechblock.sh refactor(linux_configuration/scripts): split all scripts into single_use/ and periodic_background/ 2026-05-15 00:32:35 +02:00
install_ublock.sh Wire uBlock Origin into every real Chromium launch, alongside LeechBlock 2026-08-12 22:44:28 +02:00
leechblock_defaults.json refactor(linux_configuration/scripts): split all scripts into single_use/ and periodic_background/ 2026-05-15 00:32:35 +02:00
music_parallelism.sh Split music_parallelism.sh into an entry script and three libs 2026-08-16 21:50:34 +02:00
package-lock.json refactor(linux_configuration/scripts): split all scripts into single_use/ and periodic_background/ 2026-05-15 00:32:35 +02:00
package.json refactor(linux_configuration/scripts): split all scripts into single_use/ and periodic_background/ 2026-05-15 00:32:35 +02:00
README_COMPULSIVE_BLOCK_LLM.md refactor(linux_configuration/scripts): split all scripts into single_use/ and periodic_background/ 2026-05-15 00:32:35 +02:00
README_MIDNIGHT_SHUTDOWN_LLM.md Bring every markdown file under the cap 2026-08-16 19:25:59 +02:00
remove_guest_mode.sh refactor(linux_configuration/scripts): split all scripts into single_use/ and periodic_background/ 2026-05-15 00:32:35 +02:00
seed_leechblock_storage.js refactor(linux_configuration/scripts): split all scripts into single_use/ and periodic_background/ 2026-05-15 00:32:35 +02:00
seed_ublock_storage.js Wire uBlock Origin into every real Chromium launch, alongside LeechBlock 2026-08-12 22:44:28 +02:00
setup_midnight_shutdown.sh feat(shutdown): night lockdown instead of power-off, so servers stay up 2026-07-17 09:09:54 +02:00
setup_night_lockdown.sh Add overnight power-save to night-lockdown; harden dnsmasq with a watchdog 2026-07-23 11:58:37 +02:00
youtube-music-wrapper.sh refactor(linux_configuration/scripts): split all scripts into single_use/ and periodic_background/ 2026-05-15 00:32:35 +02:00