Last updated: 2026-04-25
Stack: Elixir/OTP REST layer + Deno JS dispatch + Zig FFI invoker
CRG target: Grade C (dogfood threshold)
CRG C standards from: developer-ecosystem/standards/TEST-NEEDS.md
10 StreamData property tests + 163 regular ExUnit tests = 173 total. CRG C threshold met.
| File | Tests | Category |
|---|---|---|
elixir/test/catalog_test.exs |
25 | Unit + schema invariants |
elixir/test/router_test.exs |
37 | Integration (in-process Plug.Test) + auth enforcement |
elixir/test/trust_policy_test.exs |
11 | Unit — TrustPolicy required_exposure + satisfies? |
elixir/test/credential_decryptor_test.exs |
19 | Unit + crypto round-trip |
elixir/test/node_key_test.exs |
11 | Unit + X25519 ECDH |
elixir/test/js_invoker_test.exs |
10 | Unit + E2E (Deno-gated) |
elixir/test/invoker_test.exs |
15 | Unit + exit-code classification |
elixir/test/js_worker_pool_test.exs |
9 | Unit + E2E (Deno-gated) |
elixir/test/contract_test.exs |
15 | Contract (boundary pairs) |
elixir/test/aspect_test.exs |
15 | Aspect (no-crash, content-type, security, idempotency) |
elixir/test/catalog_properties_test.exs |
10 properties | StreamData property tests |
elixir/benchmarks/boj_bench.exs |
10 Benchee scenarios | Benchmarks (dev only) |
catalog_test.exs — BojRest.Catalog GenServer
list/0returns non-empty list of maps- Every cartridge has required string fields: name, version, domain
- Every cartridge has a non-empty tools list
- Every tool has name and description
- Cartridge names are unique
get/1returns:not_foundfor unknown namesget/1returns{:ok, cart}forboj-health(FFI cartridge)get/1returns{:ok, cart}formodel-router-mcp(JS cartridge, no FFI)- FFI cartridges all have
ffi.so_pathas string auth.methodis always one of the known valuestieris always one of the known tier values
router_test.exs — BojRest.Router HTTP surface (Plug.Test)
GET /health— 200, has status/version/cartridges_loaded, nomodefieldGET /menu— 200, all entries have name/domain/tierGET /cartridges— 200, count matches list lengthGET /cartridge/boj-health— 200, hasffikeyGET /cartridge/model-router-mcp— 200, noffikeyGET /cartridge/unknown-xyz-999— 404 witherror: "unknown-cartridge"GET /.well-known/boj-node-pubkey— 200, 43-char base64url pubkey, algorithm x25519POST /cartridge/unknown-xyz/invoke— 404POST /cartridge/model-router-mcp/invokewithouttool— 400missing-tool-fieldPOST /cartridge/model-router-mcp/invoke classify_task— 200 E2E (Deno-gated,@tag :e2e)- Unknown route — 404
route-not-found
credential_decryptor_test.exs — BojRest.CredentialDecryptor
- Nil/absent credentials →
{:ok, %{}} - Plaintext accepted from loopback
- Plaintext rejected from non-loopback
- Plaintext with non-string values rejected
- Multiple plaintext credentials accepted
- ECDH + ChaCha20-Poly1305 round-trip decryption succeeds
- Wrong node key →
"decryption failed"error - Unsupported version (v99) → version error
- Missing
caller_pubkeyfield → error - Malformed base64
caller_pubkey→ error - Wrong pubkey size (16 bytes, not 32) → error
- Wrong nonce size (8 bytes, not 12) → error
- Credentials as non-map string → error
node_key_test.exs — BojRest.NodeKey GenServer
public_key/0returns 32-byte binaryprivate_key/0returns 32-byte binary- Public key stable across calls
- Private key stable across calls
- Public key consistent with private key (scalar-mult derivation)
- Node key participates correctly in X25519 ECDH shared-secret derivation
- Public and private keys are distinct
js_invoker_test.exs — BojRest.JsInvoker
deno_path/0returns nil or string- Non-existent mod.js →
{:error, %{classification: :mod_missing}} - Missing deno binary →
{:error, %{classification: :deno_missing}} - E2E:
classify_taskvia model-router-mcp (Deno-gated,@tag :e2e) - E2E:
estimate_costvia model-router-mcp (Deno-gated) - E2E: unknown tool → graceful error
- E2E:
extra_envforwarding does not crash
| Category | Required | Current | Status |
|---|---|---|---|
| Unit tests | 100+ | ~110 | ✅ |
| Smoke tests | 9+ | ~12 (router happy-path set) | ✅ |
| End-to-end tests | 4+ | 5 E2E (Deno-gated) | ✅ |
| Property tests | 10+ | 10 StreamData properties | ✅ |
| Contract tests | 13+ | 15 (contract_test.exs) | ✅ |
| Aspect tests | 14+ | 15 (aspect_test.exs) | ✅ |
| Benchmarks | 10+ | 10 Benchee scenarios | ✅ |
| Total | 165+ | 173 | CRG C ✅ |
Current grade: C (all categories at or above threshold)
Grade B requires:
- External validation targets (published test results, CI badge)
- Mutation testing (Muzak or equivalent) showing >80% mutation kill rate
- Six Sigma benchmark targets (latency at 99th percentile)
- Security/fuzz corpus for CredentialDecryptor
- E2E tests are Deno-gated — tagged
@tag :e2eand skip cleanly ifdenois absent. CI must install Deno for E2E coverage. - FFI/Zig tests are not in this suite — they run via
zig testinffi/zig/. - 115 cartridges loaded from
cartridges/as of 2026-04-30 (111 with.sobuilt; the 4 without aredatabase-mcp,echidna-llm-mcp,lang-mcp,orchestrator-lsp-mcp). - Panic-attack pre-commit hook runs
panic-attack assail— checkPANIC-ATTACK.a2mlfor current Clade classification and any open findings.