{ "intent": "Add a test suite for aw_autostart.sh (score 51), the second target in the hardest-first order. It stays on the allowlist at a measured 82.93%, below the 100% bar.", "scope": [ "linux_configuration/scripts/single_use/features/lib/tests/test_aw_autostart.sh: new, 25 assertions across all 4 functions", "Non-goal: no change to aw_autostart.sh -- unlike dwm_config.sh, no latent bug surfaced", "Non-goal: removing the lib from the allowlist" ], "changes": [ "The suite asserts the GENERATED i3blocks status script by EXECUTING it against stubbed pacman/pgrep, not by grepping its text. All four of its branches are covered: uninstalled, installed-but-stopped, running, and installed-via-package. A heredoc emitting syntactically broken bash would pass a text check and fail in front of the user; executing it is what catches that.", "setup_autostart's idempotence is asserted directly -- a second run must leave exactly one `exec --no-startup-id aw-qt` line in the i3 config.", "test_setup's two helpers (check_activitywatch_installed / check_activitywatch_running) live in the entry script above the source line. They are redefined per-assertion inside a SUBSHELL, per the documented trap: a top-level redefinition shadows the subject's own view for every later assertion and silently drops coverage while the tests still report passing." ], "verification": [ { "command": "run the suite outside the jail with SCRIPT_DIR rewritten", "result": "pass", "evidence": "'test_aw_autostart.sh: 25 passed, 0 failed'. An earlier run was 24/1: the 'AW uninstalled' case failed because aw-qt is genuinely installed at /usr/bin/aw-qt on this host, so a PREPENDED stub dir cannot hide it from `command -v`. Fixed by REPLACING PATH for that one case -- the assertion was silently testing nothing before." }, { "command": "shell_coverage_jail.sh --subject .../run_all.sh --measure aw_autostart.sh --min 1 --fail-on-case-error", "result": "pass", "evidence": "aw_autostart.sh: 68/82 lines = 82.93%, and no 'warn: case exited' line -- every assertion in all five suite files passes under the gate." }, { "command": "temporarily insert `exit 44` after the create_i3blocks_status assertions", "result": "pass", "evidence": "'warn: case exited 44' fired, proving create_i3blocks_status runs to completion even though kcov reports lines 145-162 at zero hits. Third lib exhibiting the documented under-report." }, { "command": "shellcheck on the new suite", "result": "pass", "evidence": "clean, no suppressions added." } ], "risks": [ "Lines 22, 148-149 and 205 are the `[[ $EUID -eq 0 ]]` false branches. Inside the jail the process IS uid 0, so the non-root halves are genuinely unreachable there -- a real limitation of measuring under the jail, not a gap in the tests. Reaching them needs a non-root run, which cannot write the paths the rest of the suite asserts on.", "82.93% is an under-report of unknown magnitude for the same reason recorded in docs/shell-split-verification.md, so the lib stays allowlisted -- the conservative direction." ], "rollback": [ "git revert the commit; the suite disappears and aw_autostart.sh returns to being untested but still allowlisted.", "After rollback, confirm the allowlist still contains aw_autostart.sh so the gate's view of the lib is unchanged." ] }