Commit a557d7b
fix(ci): repair aspect_tests.sh grep-count bash bug (baseline rot) (#118)
## Summary
Restores the `Aspect — Thread Safety + ABI Contract + SPDX` check to
green. The check has been red on `main` for some time, gating every PR.
## Root cause
```
tests/aspect_tests.sh: line 77: [[: 0
0: syntax error in expression (error token is "0")
```
The pattern `has_export=$(grep -c 'pattern' file 2>/dev/null || echo
"0")` is broken: `grep -c` always prints the count (including `0` for no
matches) **and** exits non-zero when there are no matches. So `|| echo
"0"` also fires, and `has_export` ends up `"0\n0"`. The next line — `[[
"$has_export" -gt 0 ]]` — chokes on the embedded newline in arithmetic
context.
## Fix
Swap `|| echo "0"` → `|| true` at all 4 call-sites (lines 74, 75, 98,
99). `grep -c` already prints `0` cleanly; the `|| true` just suppresses
the exit code so `set -euo pipefail` doesn't abort the script.
## What's held out of this PR
The companion `.github/workflows/e2e.yml` fix — bump Zig `0.15.0` →
`0.15.1` (matches `.tool-versions`, retired upstream) and refresh the
`denoland/setup-deno` SHA pin (`5fae568d…` no longer resolves;
repointing to v2.0.4's `667a34cd…` SHA which `publish.yml` already uses)
— is **held out** because the current OAuth token lacks the `workflow`
scope GitHub requires for workflow-file edits. Will land in a follow-up
PR once the token is rotated, or you can apply those 4 line-edits
directly.
The `governance / Language / package anti-pattern policy` failure is
also red on main, but a parallel session is already diagnosing it under
the Estate-drift-remediation 2026-05 campaign. Not touched here per
`[[parallel-session-branch-drift]]`.
## Test plan
- [x] `bash -n tests/aspect_tests.sh` — syntax clean.
- [ ] CI runs `Aspect — Thread Safety + ABI Contract + SPDX` green on
this PR.
- [ ] No regression in the test's pass/fail logic for repos that
*should* fail it (cartridges with C-ABI exports + no Mutex).
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent a60b942 commit a557d7b
1 file changed
Lines changed: 4 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
71 | 71 | | |
72 | 72 | | |
73 | 73 | | |
74 | | - | |
75 | | - | |
| 74 | + | |
| 75 | + | |
76 | 76 | | |
77 | 77 | | |
78 | 78 | | |
| |||
95 | 95 | | |
96 | 96 | | |
97 | 97 | | |
98 | | - | |
99 | | - | |
| 98 | + | |
| 99 | + | |
100 | 100 | | |
101 | 101 | | |
102 | 102 | | |
| |||
0 commit comments