{ "intent": "Split three more linux_configuration scripts under the cap, fixing a latent unchecked cd the split exposed.", "scope": [ "linux_configuration/scripts/single_use/features/setup_syncyomi.sh (408 -> 138) + lib/syncyomi_stack.sh, lib/syncyomi_expose.sh", "linux_configuration/scripts/single_use/features/setup_personal_website.sh (396 -> 192) + lib/website_build.sh", "linux_configuration/scripts/single_use/fixes/fix_thorium.sh (377 -> 208) + lib/thorium_repairs.sh", "Non-goal: no script executed" ], "changes": [ "setup_syncyomi.sh needed two cuts: the compose/startup half went to syncyomi_stack.sh, which was still 279 lines, so the Caddy vhost, DuckDNS record and firewall rules went on to syncyomi_expose.sh.", "All three entry scripts already declared SCRIPT_DIR, and the splitter had added a second declaration to each. That aborts the script with 'readonly variable' at runtime while passing bash -n and shellcheck; the stubbed run caught it on setup_personal_website.sh. Removed from all three, and the splitter now reuses an existing declaration.", "Fixed SC2164 in build_website: a bare cd \"$WEBSITE_SRC\" inside a subshell, followed by pnpm install and pnpm run build. A failed cd would have run the build in whatever directory the caller happened to be in. Now guarded with || die." ], "verification": [ { "command": "scratchpad/verify_split.sh per script", "result": "fail then pass", "evidence": "setup_personal_website.sh first aborted with 'SCRIPT_DIR: readonly variable'. After the fix, all three report 'libs sourced, functions defined'." }, { "command": "shellcheck on each new lib", "result": "fail then pass", "evidence": "SC2164 on the unguarded cd in website_build.sh, fixed at the source. Clean afterwards, with no disable directive anywhere." }, { "command": "bash ~/utils/scripts/check_file_length.sh --all | grep ", "result": "pass", "evidence": "No output - all three entry scripts and all four libs are under the cap." }, { "command": "pre-commit run --files , then the real git commit", "result": "pass", "evidence": "Clean, jscpd included, now with nine new libs across the linux_configuration commits." } ], "risks": [ "None of the three was run: they write Docker compose stacks, Caddy vhosts and browser profile data. The stubbed run proves the libs are reachable and the functions defined, not that the scripts still work end to end.", "The cd guard is a behaviour change in the failure path only: previously the build would have run in the wrong directory, now it dies. That is the intended correction, but it is a change." ], "rollback": [ "git revert the commit; the three scripts return to 408, 396 and 377 lines and the four libs disappear.", "After rollback, re-run bash -n and shellcheck on the restored scripts." ] }