testsAndMisc/docs/superpowers/contracts/linux-config-near-miss-batch1-2026-08-16.json
Krzysztof kuhy Rudnicki 658988ef9b Split three near-miss linux_configuration scripts
turn_off_auto_idle_screen_shutdown.sh 289 -> 180, mtk_root/install.sh
262 -> 141, setup_gitea.sh 255 -> 198. A deliberately small batch to
check jscpd before scaling; it stayed well under 2%.

The stubbed run earned its place again: mtk_root/install.sh aborted with
"SCRIPT_DIR: readonly variable" because it already declared one, and
both bash -n and shellcheck were clean on that broken file.

Two shellcheck findings the split exposed are fixed at the source, not
suppressed: persist_with_systemd_logind now takes the flag as an
argument instead of reading the caller's global, and a dead python_bin
assignment is gone. Neither was introduced here - the pre-split file
already had three SC2034 warnings.

No script was executed; all three are installers or enforcement.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011w2Pj4Ek3ZNMQVYcFHgXDY
2026-08-16 18:38:43 +02:00

20 lines
1.8 KiB
JSON

{
"title": "Split three near-miss linux_configuration scripts under the 250-line cap",
"objective": "Bring turn_off_auto_idle_screen_shutdown.sh (289), mtk_root/install.sh (262) and setup_gitea.sh (255) under the cap using the pattern established by the install_joplin.sh split, and prove the pattern holds on a small batch before scaling to the remaining 80 files.",
"acceptance_criteria": [
"All three entry scripts and all three new libs are at most 250 lines.",
"bash -n and shellcheck pass on every entry script and every new lib, with no new suppression and no shellcheck disable directive.",
"A stubbed run of each entry script -- copied into a mirrored temp tree, with the final main invocation replaced by a declare -F probe -- reports every moved function as defined. This is the check that replaces the pass count; static checks alone are known insufficient.",
"No enforcement script is executed. turn_off_auto_idle_screen_shutdown.sh in particular manipulates idle inhibition and logind and must not run.",
"The two live systemd units that point at repo paths still resolve to existing files.",
"jscpd stays under its 2% duplication threshold on the real git commit, which is the only place it runs.",
"No behaviour change: functions move verbatim, apart from the two shellcheck findings fixed below."
],
"out_of_scope": [
"Executing any installer or enforcement step.",
"The digital_wellbeing scripts, which are live enforcement and are deferred to the end with phone_focus_mode.",
"Changing what any script does when run."
],
"verifier": "The scratchpad verify_split.sh per script (bash -n + shellcheck -x + stubbed run), plus systemctl cat on the two repo-path units, plus pre-commit run --files, plus the real git commit for jscpd."
}