Commit 794733a
fix(aspect+e2e): make tests truthful + add mutex to ums-mcp + install elixir
Two failing checks on PR #149 (and on every PR/main run since at least
2026-05-20) had four distinct root causes. Each fixed at source:
## Aspect — Thread Safety + ABI Contract + SPDX (27 → 0 failures)
1. **Comment-stripping filters were broken.** Aspect 2 (Idris2 banned
patterns) used `grep -v '^\s*--'` and `grep -v '^\s*|||'` to skip
line-comments and `|||` doc-comments — but `grep -rn` output is
`path:lineno:content`, so the line never starts with `--` or `|||`;
it starts with the path. The filters silently let every commented
match through, producing two false-positive failures (Admitted in
`cartridges/fleet-mcp/.../SafeFleet.idr` doc-comment + trailing
`Echidnabot — ... (Admitted, sorry)` comment). Fixed by anchoring
the filters at `:[[:space:]]*--` etc., factored into one
`strip_comments_and_docstrings` helper that also handles trailing
`-- … <pat>` comment matches.
2. **`believe_me` check didn't exempt class-J axioms.** `src/abi/Boj/
SafetyLemmas.idr` declares 5 documented class-J `believe_me`
primitives (`charEqSound`, `charEqSym`, `unpackLength`,
`appendLengthSum`, `substrLengthBound`) — see PROOF-NEEDS.md / ADR-
008. Added a `PROOF_EXEMPT` regex so the test passes on documented
axioms while still failing on any new `believe_me` elsewhere.
3. **Aspect 1 Mutex check was over-aggressive.** It failed any .zig
file with `pub export fn` + zero `Mutex` references — including
purely-functional FFI like `cartridges/burble-admin-mcp/ffi/
burble_admin_ffi.zig` (3 exports, ZERO file-scope globals — table
lookups + arithmetic over i32). 9 false-positive failures. The
right invariant: only fail when there's ALSO file-scope mutable
global state (`^(pub )?var <ident>`). Refined accordingly. Now
reports purely-functional FFI with a clear pass message.
4. **Aspect 4 lacked a stub/ffi_only status.** 15 cartridges failed
"incomplete layers (ABI=false ...)" — but ~10 of them are
manifest-only stubs (cartridge.json declares the API surface, no
abi/ or ffi/ yet) and ~5 are intentionally proof-free
observability/glue (boj-health, claude-ai-mcp, lang-mcp,
orchestrator-lsp-mcp, toolchain-mcp). Added a `"status"` field to
`cartridge.json` (`complete` (default) / `stub` / `ffi_only`);
Aspect 4 honours it and reports `(N complete, M stub, K ffi_only)`
so the categories stay visible.
5. **ums-mcp had a real bug.** 15 C-ABI exports operating on a global
`var sessions: [MAX_SESSIONS]SessionSlot` array, no Mutex. The
filter fixes above narrow Aspect 1 to true positives, and this was
the one left over. Added `var sessions_mu: std.Thread.Mutex` and
`sessions_mu.lock(); defer sessions_mu.unlock();` to all 14
sessions-touching exports. `ums_can_transition` is a pure function
(enum→enum) and stays lock-free. Mirrors the 007-mcp pattern
(`g_state_mu` in `cartridges/007-mcp/ffi/oo7_mcp_ffi.zig:79`).
`cd cartridges/ums-mcp/ffi && zig build` passes.
After all five fixes: 115 passed / 0 failed / 1 warning (was 87/27/1).
The one warning (`federation.zig` `catch unreachable` patterns) was
already pre-existing — out of scope here.
## E2E — Full REST + MCP Bridge (failing since 2026-05-20)
`tests/e2e_full.sh` requires `mix` to start the Elixir backend, but
`.github/workflows/e2e.yml` never installed Elixir/OTP. Added an
`erlef/setup-beam@v1.18.2` step (Elixir 1.18 + OTP 27 — matches the
estate convention used in every other repo's hypatia-scan.yml) plus a
`mix deps.get` step before the test runs.
## Foundational follow-up (NOT in this PR)
Same gap as r-g-t-v#89 and absolute-zero#42: `main` branch protection
has no `required_status_checks` block, which is how three workflows
(E2E, OpenSSF Scorecard Enforcer, Instant Sync) have been failing on
main for days without blocking merges. Hypatia PR #316 ships the
BH001/BH002/BH003 rules that detect this class estate-wide.
## Test plan
- [x] `bash tests/aspect_tests.sh` — 115/0/1 (was 87/27/1)
- [x] `cd cartridges/ums-mcp/ffi && zig build` — clean
- [x] All cartridge.json files still valid JSON
- [x] e2e.yml YAML parses; step ordering correct (setup-beam before
build-FFI / run-e2e)
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 6626b52 commit 794733a
18 files changed
Lines changed: 182 additions & 25 deletions
File tree
- .github/workflows
- cartridges
- boj-health
- chromadb-mcp
- claude-ai-mcp
- echidna-llm-mcp
- elevenlabs-mcp
- ffmpeg-mcp
- lang-mcp
- orchestrator-lsp-mcp
- pinecone-mcp
- qdrant-mcp
- replicate-mcp
- search-mcp
- toolchain-mcp
- ums-mcp/ffi
- weaviate-mcp
- whisper-mcp
- tests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
59 | 68 | | |
60 | 69 | | |
61 | 70 | | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
62 | 75 | | |
63 | 76 | | |
64 | 77 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
7 | 8 | | |
8 | 9 | | |
9 | 10 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
7 | 8 | | |
8 | 9 | | |
9 | 10 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
7 | 8 | | |
8 | 9 | | |
9 | 10 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
7 | 8 | | |
8 | 9 | | |
9 | 10 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
7 | 8 | | |
8 | 9 | | |
9 | 10 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
7 | 8 | | |
8 | 9 | | |
9 | 10 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
7 | 8 | | |
8 | 9 | | |
9 | 10 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
7 | 8 | | |
8 | 9 | | |
9 | 10 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
7 | 8 | | |
8 | 9 | | |
9 | 10 | | |
| |||
0 commit comments