testsAndMisc/docs/superpowers/contracts/linux-config-batch6-2026-08-16.json
Krzysztof kuhy Rudnicki 2527fb37e6 Split three large linux_configuration scripts, defer a fourth
organize_downloads.sh 513 -> 72, setup_kcd2_dice_solver.sh 497 -> 112,
fix_ubuntu_performance.sh 494 -> 150. First 490+ line scripts done; all
three needed two or three seams.

Repeated splitting chained the libs - each sourced the next, because the
tool inserts its source line relative to the file it just wrote.
Flattened so the entry sources all three and no lib sources a sibling.

diagnose_pacman_hook_stall.sh is reverted and stays at 493. Its
transaction runner assigns LAST_ELAPSED that the caller reads and reads
PACMAN_BIN that the caller defines, so linted alone it is SC2034 plus
SC2153. The pre-commit hook lints each lib in isolation and fails, while
shellcheck -x on the entry passes - suppressing that would be papering
over a seam that does not exist.

organize_downloads.sh is the ExecStart of media-organizer.service; the
unit still resolves and the script still parses.

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

20 lines
1.7 KiB
JSON

{
"title": "Split three large linux_configuration scripts, deferring a fourth",
"objective": "Bring organize_downloads.sh (513), setup_kcd2_dice_solver.sh (497) and fix_ubuntu_performance.sh (494) under the 250-line cap, and establish that a seam sharing mutable state with its caller must be abandoned rather than suppressed.",
"acceptance_criteria": [
"All three entry scripts and all seven new libs are at most 250 lines.",
"The pre-commit shellcheck hook passes on every touched file, with no new suppression and no disable directive. That hook lints each lib in isolation, which is stricter than shellcheck -x on the entry script.",
"No lib sources a sibling: the entry script sources every lib directly.",
"The stubbed run reports every moved function as defined, for all three scripts.",
"organize_downloads.sh is the ExecStart of the live media-organizer.service unit, so after the split that path must still resolve and the script must still parse.",
"No script is executed. These move files in ~/Downloads, write compose stacks and change sysctl and systemd settings.",
"diagnose_pacman_hook_stall.sh is fully restored to 493 lines, leaving no partial split behind."
],
"out_of_scope": [
"Executing any organize, setup or fix step.",
"diagnose_pacman_hook_stall.sh, whose load generator assigns LAST_ELAPSED read by the caller and reads PACMAN_BIN defined by it; splitting it would need a suppression.",
"Changing what any script does when run."
],
"verifier": "meta/scripts/verify_shell_split.sh per script, plus pre-commit run shellcheck over all touched files, plus systemctl cat media-organizer and test -f on its ExecStart, plus check_file_length.sh and the real git commit for jscpd."
}