{ "intent": "Let a stub emit a value so traces exercise guarded branches, closing a hole where two traces compare identical while skipping every branch the split touched.", "scope": [ "meta/scripts/trace_shell_split.sh", "docs/shell-split-verification.md", "Non-goal: does not make file-placement installers traceable; that needs a prefix redirect" ], "changes": [ "--stub now accepts `name=output`; the generated stub prints that value after recording the call.", "Generate stubs from a quoted heredoc with the name and value passed via printf %q, so $* and $TRACE_FILE stay literal. Fixes SC2016 by restructuring rather than suppressing.", "Document the silent-stub trap, the file-placement scripts that remain out of scope, and the need to run baselines from the script's own directory when it reads relative paths." ], "verification": [ { "command": "trace_shell_split.sh on a fixture whose `sudo rm -rf` is guarded by `((size > 0))`, with --stub du (silent)", "result": "pass (hole demonstrated)", "evidence": "stdout 'size=[]' then 'branch skipped'; the guarded `sudo rm -rf` never appears in the trace. Two such traces would match perfectly while exercising nothing." }, { "command": "same fixture with --stub 'du=4096\\t/some/dir'", "result": "pass", "evidence": "stdout 'size=[4096]' then 'BRANCH TAKEN'; the trace now records 'sudo rm -rf /some/dir'. The guarded path is reached." }, { "command": "Regressions: the set -e function-tail fixture, the nameref fixture, and the multi-stub git/curl fixture", "result": "pass", "evidence": "exit 1 with empty trace; four 'circular name reference' warnings; both network calls captured. Unchanged by the rewrite." }, { "command": "shellcheck + shfmt -d on meta/scripts/trace_shell_split.sh", "result": "pass", "evidence": "Both exit 0. SC2016 resolved by the heredoc restructure, not a suppression." } ], "risks": [ "A stub value is a fixed string, so a script calling the same command with different arguments and expecting different answers gets one answer for all of them. Sufficient for reaching branches; not a simulator.", "This does not retroactively strengthen the disk_cleanup_check.sh trace, which used a silent du stub. That split's real-run-from-/tmp is what covered the populated path -- the trace alone only proved the empty-size path identical." ], "rollback": [ "Revert the commit; --stub returns to name-only and stubs print nothing.", "Re-run the four fixtures and confirm the same exit statuses." ] }