mirror of
https://github.com/kuhyx/testsAndMisc.git
synced 2026-11-11 14:07:49 +01:00
The split referenced $_NL_PAYLOAD_DIR from both install functions but
defined it nowhere, so `setup_night_lockdown.sh setup` would have died
with an unbound variable partway through installing the lockdown. My
earlier scratch verification set the variable by hand, which is exactly
what hid the bug: the emitted artifacts hashed correctly while the real
entry path could not have reached them.
It is now defined in each lib that uses it, eight lines above the use,
via `: "${_NL_PAYLOAD_DIR:=...}"` so an explicit override still wins. A
definition placed in the entry script was silently stripped by an
autoformat pass three times during this work, and a half-run lockdown
installer is not an acceptable failure mode.
Also drops two zero-byte payload files left behind by the .sh -> .sh.in
rename.
Re-verified without presetting anything: install_enter_script and
install_unlock_script emit mode-0755 files hashing 4baaf405... and
eafce28d..., byte-identical to the live /usr/local/bin copies. help and
an unknown command match their baselines; status differs only by the
05:00 countdown ticking 13h to 12h between runs.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
19 lines
1.7 KiB
JSON
19 lines
1.7 KiB
JSON
{
|
|
"title": "Split setup_night_lockdown.sh under the 250-line cap",
|
|
"objective": "Bring setup_night_lockdown.sh (918 lines) under the cap by moving its top-level functions into five libs and its two quoted heredocs into verbatim payload files, while guaranteeing the two scripts it deploys to /usr/local/bin are unchanged — night-lockdown-unlock.timer is enabled and fires at 05:00.",
|
|
"acceptance_criteria": [
|
|
"The entry script and every lib is at most 250 lines, verified with the payloads git-tracked so the gate actually sees them.",
|
|
"The emitted night-lockdown-enter.sh and night-lockdown-unlock.sh hash identically to the files currently deployed in /usr/local/bin, with mode 0755.",
|
|
"verify_shell_split.sh reports additions only — no moved function's body changed.",
|
|
"`--help` is byte-identical to the pre-split baseline and `status` differs only in live clock state.",
|
|
"Both payloads parse as standalone scripts; shellcheck passes without -x and shfmt is a no-op, with no suppression added.",
|
|
"install_enter_script and install_unlock_script run without an unbound variable."
|
|
],
|
|
"out_of_scope": [
|
|
"Running `setup_night_lockdown.sh setup`: it masks the TTY login surface and tears down the GUI, with SSH as the only recovery path.",
|
|
"Re-deploying to /usr/local/bin — unnecessary, since the split provably emits the same bytes already there.",
|
|
"Splitting the 279-line enter payload: it is one generated artifact, and the user chose the .sh.in convention over splitting it."
|
|
],
|
|
"verifier": "sha256 of emitted artifacts vs /usr/local/bin (the decisive check); check_file_length.sh --all with payloads tracked; verify_shell_split.sh; diff of --help/status against baselines; bash -n on payloads; shellcheck + shfmt idempotence."
|
|
}
|