testsAndMisc/docs/superpowers/contracts/linux-config-common-lib-split-2026-08-16.json
Krzysztof kuhy Rudnicki 51e3945507
Some checks are pending
billsplit CI / quality (push) Waiting to run
Pre-commit checks / pre-commit (push) Waiting to run
Shell tests / shell-tests (push) Waiting to run
Shell tests / arch-tests (push) Waiting to run
Split scripts/lib/common.sh, the library 49 scripts source
620 -> 163, with common.sh staying the single entry point that sources
its own three parts - the shape the handoff prescribes for config.sh, so
all 49 consumers are untouched.

Verified by diffing `declare -F` after sourcing it against the same from
a detached worktree at HEAD: an identical 48-function set. For a library
this widely sourced that is the check that matters, not a passing lint.

The FOCUS_APPS_* arrays moved with is_focus_app_running, the only
function that reads them.

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

19 lines
1.4 KiB
JSON

{
"title": "Split scripts/lib/common.sh under the 250-line cap",
"objective": "Bring the shared library that 49 scripts source under the cap, without changing any name it exports or requiring a single consumer to be edited.",
"acceptance_criteria": [
"common.sh and all three new parts are at most 250 lines.",
"common.sh remains the single path every consumer sources; it sources its own parts, so no caller changes.",
"Sourcing common.sh yields exactly the same set of function names as before the split, proven by diffing `declare -F` against a detached worktree at HEAD. A passing lint is not sufficient evidence for a library with this many consumers.",
"Any array or constant a moved function reads moves with it, rather than being left behind and suppressed.",
"The pre-commit shellcheck hook passes on every file, with no new suppression.",
"The parts are sourced in the original definition order, so a consumer relying on ordering is unaffected."
],
"out_of_scope": [
"Executing any of the 49 consumer scripts.",
"Changing what any helper does.",
"The other over-cap linux_configuration scripts."
],
"verifier": "A subshell that sources common.sh and prints `declare -F`, diffed against the same run from a detached worktree at HEAD; plus array-length checks, shellcheck -x, meta/scripts/verify_shell_split.sh on a real consumer, and check_file_length.sh."
}