fix(ci): repair aspect_tests.sh grep-count bash bug (baseline rot) - #118
Merged
Conversation
`Aspect — Thread Safety + ABI Contract + SPDX` has been red on `main`,
gating every PR on these lines:
tests/aspect_tests.sh: line 77: [[: 0
0: syntax error in expression (error token is "0")
Root cause: `grep -c 'pattern' file 2>/dev/null || echo "0"`. When
`grep -c` finds zero matches it outputs `0` to stdout **and** exits
non-zero, which then triggers `|| echo "0"` — `has_export` ends up
`"0\n0"`, and `[[ "0\n0" -gt 0 ]]` chokes on the embedded newline in
arithmetic context. Swapped the `|| echo "0"` for `|| true` on all
four call-sites; `grep -c` already prints `0` cleanly, the `|| true`
just suppresses the exit code for `set -euo pipefail`.
Verification: `bash -n tests/aspect_tests.sh` clean.
(The companion `.github/workflows/e2e.yml` fix — Zig 0.15.0 → 0.15.1
and the `denoland/setup-deno` SHA refresh — is held out because the
current OAuth token lacks the `workflow` scope GitHub requires for
workflow-file edits. Will land separately once the token is rotated
or via a token with the right scope.)
Out of scope and deliberately not touched:
- `governance / Language / package anti-pattern policy` — also red
on main, but a parallel session is already diagnosing it under the
Estate-drift-remediation 2026-05 campaign (parent standards#66).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
🔍 Hypatia Security ScanFindings: 30 issues detected
View findings[
{
"reason": "Stale AI session file -- delete",
"type": "stale",
"file": "GEMINI.md",
"action": "delete",
"rule_module": "root_hygiene",
"severity": "medium"
},
{
"reason": "Issue in quality.yml",
"type": "missing_workflow",
"file": "quality.yml",
"action": "create",
"rule_module": "workflow_audit",
"severity": "high"
},
{
"reason": "Issue in security-policy.yml",
"type": "missing_workflow",
"file": "security-policy.yml",
"action": "create",
"rule_module": "workflow_audit",
"severity": "medium"
},
{
"reason": "Action hyperpolymath/standards/.github/workflows/governance-reusable.yml@main needs attention",
"type": "unpinned_action",
"file": "governance.yml",
"action": "pin_sha",
"rule_module": "workflow_audit",
"severity": "high"
},
{
"reason": "TypeScript file detected -- banned language",
"type": "banned_language_file",
"file": "/home/runner/work/boj-server/boj-server/cartridges/sanctify-mcp/adapter/mod.ts",
"action": "flag",
"rule_module": "cicd_rules",
"severity": "critical"
},
{
"reason": "TypeScript file detected -- banned language",
"type": "banned_language_file",
"file": "/home/runner/work/boj-server/boj-server/cartridges/academic-workflow-mcp/adapter/mod.ts",
"action": "flag",
"rule_module": "cicd_rules",
"severity": "critical"
},
{
"reason": "TypeScript file detected -- banned language",
"type": "banned_language_file",
"file": "/home/runner/work/boj-server/boj-server/cartridges/fireflag-mcp/adapter/mod.ts",
"action": "flag",
"rule_module": "cicd_rules",
"severity": "critical"
},
{
"reason": "TypeScript file detected -- banned language",
"type": "banned_language_file",
"file": "/home/runner/work/boj-server/boj-server/cartridges/ephapax-mcp/adapter/mod.ts",
"action": "flag",
"rule_module": "cicd_rules",
"severity": "critical"
},
{
"reason": "TypeScript file detected -- banned language",
"type": "banned_language_file",
"file": "/home/runner/work/boj-server/boj-server/cartridges/bofig-mcp/adapter/mod.ts",
"action": "flag",
"rule_module": "cicd_rules",
"severity": "critical"
},
{
"reason": "TypeScript file detected -- banned language",
"type": "banned_language_file",
"file": "/home/runner/work/boj-server/boj-server/cartridges/hesiod-mcp/adapter/mod.ts",
"action": "flag",
"rule_module": "cicd_rules",
"severity": "critical"
}
]Powered by Hypatia Neurosymbolic CI/CD Intelligence |
🔍 Hypatia Security ScanFindings: 30 issues detected
View findings[
{
"reason": "Stale AI session file -- delete",
"type": "stale",
"file": "GEMINI.md",
"action": "delete",
"rule_module": "root_hygiene",
"severity": "medium"
},
{
"reason": "Issue in quality.yml",
"type": "missing_workflow",
"file": "quality.yml",
"action": "create",
"rule_module": "workflow_audit",
"severity": "high"
},
{
"reason": "Issue in security-policy.yml",
"type": "missing_workflow",
"file": "security-policy.yml",
"action": "create",
"rule_module": "workflow_audit",
"severity": "medium"
},
{
"reason": "Action hyperpolymath/standards/.github/workflows/governance-reusable.yml@main needs attention",
"type": "unpinned_action",
"file": "governance.yml",
"action": "pin_sha",
"rule_module": "workflow_audit",
"severity": "high"
},
{
"reason": "TypeScript file detected -- banned language",
"type": "banned_language_file",
"file": "/home/runner/work/boj-server/boj-server/cartridges/sanctify-mcp/adapter/mod.ts",
"action": "flag",
"rule_module": "cicd_rules",
"severity": "critical"
},
{
"reason": "TypeScript file detected -- banned language",
"type": "banned_language_file",
"file": "/home/runner/work/boj-server/boj-server/cartridges/academic-workflow-mcp/adapter/mod.ts",
"action": "flag",
"rule_module": "cicd_rules",
"severity": "critical"
},
{
"reason": "TypeScript file detected -- banned language",
"type": "banned_language_file",
"file": "/home/runner/work/boj-server/boj-server/cartridges/fireflag-mcp/adapter/mod.ts",
"action": "flag",
"rule_module": "cicd_rules",
"severity": "critical"
},
{
"reason": "TypeScript file detected -- banned language",
"type": "banned_language_file",
"file": "/home/runner/work/boj-server/boj-server/cartridges/ephapax-mcp/adapter/mod.ts",
"action": "flag",
"rule_module": "cicd_rules",
"severity": "critical"
},
{
"reason": "TypeScript file detected -- banned language",
"type": "banned_language_file",
"file": "/home/runner/work/boj-server/boj-server/cartridges/bofig-mcp/adapter/mod.ts",
"action": "flag",
"rule_module": "cicd_rules",
"severity": "critical"
},
{
"reason": "TypeScript file detected -- banned language",
"type": "banned_language_file",
"file": "/home/runner/work/boj-server/boj-server/cartridges/hesiod-mcp/adapter/mod.ts",
"action": "flag",
"rule_module": "cicd_rules",
"severity": "critical"
}
]Powered by Hypatia Neurosymbolic CI/CD Intelligence |
This was referenced May 20, 2026
hyperpolymath
added a commit
that referenced
this pull request
May 20, 2026
Both merged after PR #126 was opened. CHANGELOG.md `[Unreleased]` Fixed: - Added bullet for SafeAPIKey `logSafeBounded` rebuild (#116, MERGED 2026-05-20T08:46Z). - Added bullet for `tests/aspect_tests.sh` grep-count bash bug (#118, MERGED 2026-05-20T09:02Z). .machine_readable/6a2/STATE.a2ml session-history: - Updated the 2026-05-20 entry to mark #116 and #118 MERGED inline, rather than the stale OPEN/OPEN-DRAFT status they carried when the entry was written. #123 (e2e.yml Zig + Deno pin refresh) remains OPEN — listed in session-history with its current status. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
hyperpolymath
added a commit
that referenced
this pull request
May 20, 2026
## Summary Restores three CI checks to green by repairing two unrelated upstream pin issues in `.github/workflows/e2e.yml`. All three had been red on `main`, gating every PR: - `E2E — Full REST + MCP Bridge` - `E2E — Order Ticket (FFI layer)` - `Bench — FFI Catalogue + Mount/Unmount + Hash` ## Fixes 1. **Zig `0.15.0` retired upstream.** All three `setup-zig` steps failed on `Error: Could not find version 0.15.0 for platform x86_64-linux`. Bumped to `0.15.1` to match `.tool-versions` (the canonical estate declaration). `release.yml` runs `0.15.2` via `mlugg/setup-zig`; either point on the 0.15.x line is fine. 2. **`denoland/setup-deno` SHA `5fae568d…` no longer resolves.** GitHub Actions: `Unable to resolve action denoland/setup-deno@5fae568`. Repointed to the same v2.0.4 SHA already in use by `publish.yml` (`667a34cdef165d8d2b2e98dde39547c9daac7282`), verified via the GitHub API. ## Relationship to #118 Companion to **#118** (`tests/aspect_tests.sh` grep-count fix). The two were originally one commit but workflow-file edits need the `workflow` OAuth scope to push, so they're split. ## Out of scope (deliberately) `governance / Language / package anti-pattern policy` is also red on main, but a parallel session is already diagnosing it under the Estate-drift-remediation 2026-05 campaign (parent standards#66). Not touched here per the parallel-session-branch-drift guardrail. ## Test plan - [ ] CI on this PR: the three previously-red checks (E2E Full, E2E Order Ticket, Bench) come back green. - [ ] No new reds introduced by the Zig version bump. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
hyperpolymath
added a commit
that referenced
this pull request
May 20, 2026
…eep (#126) ## Summary Human + machine documentation close-out for the 2026-05-20 epic #87 Tier C session and follow-on baseline-rot sweep. No code, no behavioural change. ## Files - **`CHANGELOG.md`** `[Unreleased]`: - *Added* — ADR-0014 RFC (#109); README "Formal verification" section (#108). - *Fixed* — SafeAPIKey `logSafeBounded` proof rebuild for Idris2 0.8.0 (#116); `tests/aspect_tests.sh` grep-count bash bug (#118); honest framing of the ABI axiom count + `(s t : T)` → `(s, t : T)` parser-comma fix to `SafetyLemmas.idr` (#108). - **`.machine_readable/6a2/STATE.a2ml`**: - `last-updated` bumped `2026-04-25` → `2026-05-20`. - `believe-me-count` corrected `4` → `5`, with citation back to `PROOF-NEEDS.md` 2026-05-18 audit + #108. - `[session-history]` entry appended summarising items 11 + 12 + the SafeAPIKey baseline-rot follow-up + the CI baseline-rot sweep + operational notes (parallel-session branch drift, workflow OAuth scope dance). ## Companion PRs from this thread | PR | Status | What | |---|---|---| | #108 | MERGED 2026-05-20T08:13Z | item 11 honest framing (docstring + README + parser-comma) | | #109 | MERGED 2026-05-20T08:12Z | item 12 ADR-0014 RFC (cross-cartridge composition safety) | | #116 | MERGED 2026-05-20T08:46Z | SafeAPIKey `logSafeBounded` rebuild for Idris2 0.8.0 | | #118 | MERGED 2026-05-20T09:02Z | `tests/aspect_tests.sh` grep-count bash bug | | #123 | OPEN | `.github/workflows/e2e.yml` Zig + Deno pin refresh | | **#126 (this)** | OPEN | session-close docs | ## Out of scope (intentionally) - `governance / Language / package anti-pattern policy` baseline rot stays untouched per the parallel-session-branch-drift guardrail (parent campaign standards#66 owns it). 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.
Summary
Restores the
Aspect — Thread Safety + ABI Contract + SPDXcheck to green. The check has been red onmainfor some time, gating every PR.Root cause
The pattern
has_export=$(grep -c 'pattern' file 2>/dev/null || echo "0")is broken:grep -calways prints the count (including0for no matches) and exits non-zero when there are no matches. So|| echo "0"also fires, andhas_exportends up"0\n0". The next line —[[ "$has_export" -gt 0 ]]— chokes on the embedded newline in arithmetic context.Fix
Swap
|| echo "0"→|| trueat all 4 call-sites (lines 74, 75, 98, 99).grep -calready prints0cleanly; the|| truejust suppresses the exit code soset -euo pipefaildoesn't abort the script.What's held out of this PR
The companion
.github/workflows/e2e.ymlfix — bump Zig0.15.0→0.15.1(matches.tool-versions, retired upstream) and refresh thedenoland/setup-denoSHA pin (5fae568d…no longer resolves; repointing to v2.0.4's667a34cd…SHA whichpublish.ymlalready uses) — is held out because the current OAuth token lacks theworkflowscope 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 policyfailure 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
bash -n tests/aspect_tests.sh— syntax clean.Aspect — Thread Safety + ABI Contract + SPDXgreen on this PR.🤖 Generated with Claude Code