From dbc4d099a337cf3a65bca103891a5ca85be30d1b Mon Sep 17 00:00:00 2001 From: Krzysztof kuhy Rudnicki Date: Sun, 16 Aug 2026 18:59:20 +0200 Subject: [PATCH] Commit the shell-split verifier and the traps it found meta/scripts/verify_shell_split.sh was a scratchpad file; it has caught five bugs across 18 splits that bash -n and shellcheck both passed on, so it belongs in the repo. Tested in both directions - it fails on a deliberately broken source line and passes once restored. docs/shell-split-recipes.md gains what the last two batches taught: splitting a file twice can displace the first cut's source line, globals read across a seam have three different fixes depending on how many, and unguarded cd shows up constantly because a moved function finally gets linted on its own. Co-Authored-By: Claude Opus 5 (1M context) Claude-Session: https://claude.ai/code/session_011w2Pj4Ek3ZNMQVYcFHgXDY --- docs/shell-split-recipes.md | 42 ++++++++++-- .../verify-shell-split-script-2026-08-16.json | 44 +++++++++++++ meta/scripts/verify_shell_split.sh | 66 +++++++++++++++++++ 3 files changed, 148 insertions(+), 4 deletions(-) create mode 100644 docs/superpowers/evidence/verify-shell-split-script-2026-08-16.json create mode 100755 meta/scripts/verify_shell_split.sh diff --git a/docs/shell-split-recipes.md b/docs/shell-split-recipes.md index a2f3e16d..9a0fd51e 100644 --- a/docs/shell-split-recipes.md +++ b/docs/shell-split-recipes.md @@ -11,10 +11,13 @@ enforcement script that mutates the live system or the phone.** - After each split, `bash -n` and `shellcheck` the entry script _and_ every new lib. **Neither catches a `source` line that resolves to the wrong path** — both passed clean on a split whose lib was unreachable at runtime. -- So the real check is a **stubbed run**: copy the entry script and its libs to - a `mktemp -d`, `sed` the final `main` invocation into a `declare -F` probe, - and run it. That executes the `source` lines and nothing else. This caught - the bug below; no static check did. +- So the real check is a **stubbed run**, scripted as + `meta/scripts/verify_shell_split.sh