diff --git a/docs/shell-split-recipes.md b/docs/shell-split-recipes.md index a43772b6..692a9bfc 100644 --- a/docs/shell-split-recipes.md +++ b/docs/shell-split-recipes.md @@ -18,6 +18,12 @@ enforcement script that mutates the live system or the phone.** else, which makes it safe for installers. Across 18 splits it caught five bugs no static check did. It needs the script to end in `main "$@"`; for the rest, use the by-hand checks below. +- **But a stubbed run only proves the `source` lines resolve.** It sources the + libs and never calls them, so it cannot reach a bug in a seam that passes + state — `analyze_repo.sh` passed every static check plus the stub and still + aborted at runtime. See **`docs/shell-split-verification.md`**, which now + holds every "the split was green and still wrong" lesson, including the + `set -e` function-tail trap and the flag that looked safe and was not. ### Use `${BASH_SOURCE[0]}`, not `$0` diff --git a/docs/shell-split-verification.md b/docs/shell-split-verification.md new file mode 100644 index 00000000..7edd6ac2 --- /dev/null +++ b/docs/shell-split-verification.md @@ -0,0 +1,69 @@ +# Shell split verification: how a green split is still broken + +Split out of `docs/shell-split-recipes.md` when that file hit the same 250-line +cap it exists to serve. That file covers **how to make** a split; this one +covers **how to find out it is wrong**. Read both before the next +`linux_configuration` or `phone_focus_mode` split. + +Every section below cost a failed run, a revert, or — once — a live system +mutation. + +### A `--skip-install` flag is not evidence the script is safe to run + +`shell_check.sh` gates only `install_if_missing`'s pacman branch on +`SKIP_INSTALL`. The AUR branch inside `install_linters` runs regardless, so a +backgrounded "baseline" run installed four packages (`python-pbr`, +`python-fixtures`, `python-discover`, `python-reno`) before it was killed +mid-`makepkg`. Decision 6 was violated by a flag that looked like it granted +permission. + +Before running any script to capture a baseline, grep the flag's variable and +confirm it gates **every** mutation path, not just the first one: + +```bash +grep -n 'SKIP_INSTALL\|DRY_RUN'