fix(tests): resolve SC2015 in mktemp guards - #3
Merged
Conversation
Four identical guards validated mktemp output with A && B || C before installing a 'rm -rf' trap. ShellCheck flagged SC2015 on each. Rewritten as explicit if-statements: same semantics, unambiguous intent. No test assertion is touched; the suite is 202 passing before and after and oracle.lock.json's tests[] array is byte-identical. Three of the four files are hashed by the freeze gate, so R7 will fail until a human reviews this diff and re-locks with --accept. That is deliberate.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes the ShellCheck job, red on
mainsince 2026-07-25. It was the only failing job — all four test jobs pass.The finding
Four files carried the same guard, validating
mktempoutput before installing arm -rftrap:ShellCheck raises SC2015 (
A && B || Cis not if-then-else). Here it is arguably a false positive — both operands are tests, so C running when B fails is the intent. I did not suppress it: the guard protects arm -rf, and it should say what it means.Identical semantics, no
shellcheck disableanywhere. Files:tests/simple-test.sh,tests/mutate.sh,tests/spec-map.sh,tests/oracle-gate.sh.Evidence nothing was weakened
bash tests/simple-test.sh→ 202 passed, 0 failed — identical to beforeoracle.lock.json'stests[]array is byte-identical, 202 entriesbash -nclean on all fourThree of these files are content-hashed by the oracle. The gate now reports:
oracle-gate.shstates that--acceptis "a deliberate human act", so this PR does not re-lock itself. An agent that edits the tests and then re-arms the gate over its own change is the exact tamper path this repo is built to stop.To land: review the diff above, then:
bash tests/oracle-gate.sh --accept git commit -am "chore(tests): re-lock oracle after SC2015 guard fix"CI goes green after that.