docs(audit): the bats rule carries the trap its own advice creates - #1140
Merged
Conversation
.claude/rules/bats-assertions.md prescribes writing an absence check as `<positive-condition-for-the-bad-case> && return 1`, and stops there. As a test's final statement that form inverts its own result: an absent needle leaves grep's non-zero status as the AND-list's status, which becomes the test's return value, so the test fails in exactly the case it exists to pass. The section that prescribes the form now states the trap and the fix, an explicit trailing `true`, lifting the phrasing already proven in .gaia/tests/lib/doc-machinery-waive-prose.bats's header. Reproduced on bash 3.2.57 and 5.3.15, both fail, so it sits in the version-independent `!`-negation section rather than the bash-3.2 one. Also adds one clause to _gaia_drop_full_base_matches's awk docstring in .gaia/scripts/check-audit-base-derivation.sh: FULL_BASE's exemption covers the default member's waive-eligibility derivation as well as the self-skip base, which the assertion-1 charter comment above it already states. The two comments now agree. Comment only, no behavior change. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015KqBHpzzuqf3aLMecia7mt
Contributor
|
code-review-audit skipped: no files in the frontend auditor's scope. GAIA-Audit is already green for this commit's tree, every dispatched member has cleared. No action needed |
.claude/rules/ is shipped surface, and the CHANGELOG gate treats a changed rule as product-surface movement. The comment-only half of this branch is not adopter-relevant and is not mentioned. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015KqBHpzzuqf3aLMecia7mt
GAIA-Audit: 1.6.1 0c18e379f597f4d3c7d457fc9835673bb9a08cc497729c6ffa04b6b14577ddbd 5ed6e41
Contributor
Author
|
@/var/folders/pn/m58c653j1js2r48m5n358ync0000gn/T/tmp.xt2FdCSRsS |
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.
Closes two of the three follow-ups left open when the machinery-waive widening merged. The third is declined; see below.
What changed
.claude/rules/bats-assertions.md— the!-negation section prescribes writing an absence check as<positive-condition-for-the-bad-case> && return 1and stops there. As a test's final statement that form inverts its own result: an absent needle leaves grep's non-zero status as the AND-list's status, which becomes the test's return value, so the test fails in exactly the case it exists to pass. Three lines now state the trap and the fix (an explicit trailingtrue), lifting phrasing already audit-proven in.gaia/tests/lib/doc-machinery-waive-prose.bats's header rather than inventing new.Placed in the version-independent
!-negation section, not the bash-3.2 one: reproduced on bash 3.2.57 and 5.3.15, both fail.cmd && return 1is an AND-list whose status iscmd's own, andset -eis ignored for a non-final member of an AND-OR list. The section that prescribes the form is where the trap belongs..gaia/scripts/check-audit-base-derivation.sh— one clause on_gaia_drop_full_base_matches's awk docstring. It describedFULL_BASEas the self-skip base only; the exemption also covers the default member's waive-eligibility derivation, which the assertion-1 charter comment directly above it already states. The two comments now agree. Comment only, no behavior change.Declined, recorded so it is not re-raised
The macOS BWK awk backslash-stripping gotcha (
-v-assigned regex loses\(\)) is not added to any rule. It is awk portability in a per-suite copy-pasted helper rather than assertion hygiene; it produced no false pass, becauseextract_section_or_fail's vacuous-match guard caught it loudly; and it is already documented at the point it bites, in the header of the suite that hit it. A rule is the wrong altitude for something that fired once.Verification
bash .gaia/tests/shell-lint.sh— passes (193 scripts, 181 suites, hook-array guard clean).gaia/scripts/tests/check-audit-base-derivation.batsunder the bash 5 guard — 42/42, exit 0wiki/decisions/Quality Gate.md: no staged file matches the source-extension or gate-affecting-config lists, and line 46 names.claude/**and pure-markdown commits explicitly.No mutation testing: both edits are prose and a comment with no executable behavior.