Skip to content

fix(snif): make Wasmex an optional, absence-guarded dependency#46

Merged
hyperpolymath merged 1 commit into
mainfrom
fix/snif-wasmex-optional-guard
May 19, 2026
Merged

fix(snif): make Wasmex an optional, absence-guarded dependency#46
hyperpolymath merged 1 commit into
mainfrom
fix/snif-wasmex-optional-guard

Conversation

@hyperpolymath
Copy link
Copy Markdown
Owner

Why

Burble.Coprocessor.SNIFBackend referenced Wasmex.start_link/1 and
Wasmex.call_function/3 directly while :wasmex is not even a declared
dependency, and available?/0 only checked the .wasm file existed.
That produced a compile-time Wasmex … is undefined warning and the
wrong runtime failure mode (rescued exception per call instead of clean
degradation).

What

Applies the accepted :quicer / Burble.Bolt.Quic pattern from
ADR-0004 to :wasmex:

  • server/mix.exs:wasmex documented in the existing optional-NIF
    block (Rust/wasmtime toolchain), commented like quicer/elmdb.
  • snif_backend.ex@wasmex Wasmex alias; calls via apply/3 so
    the compiler does not warn when absent; available?/0 now also
    requires Code.ensure_loaded?(@wasmex) + function_exported?, so the
    existing if available?() guards transparently fall back to
    ZigBackend.
  • CHANGELOG — Fixed entry.

Verification

mix compile --force --no-deps-check → no Wasmex warning, no new
unused/undefined warnings in snif_backend.ex. Pure consistency/bugfix;
no behaviour change when Wasmex is present.

🤖 Generated with Claude Code

Burble.Coprocessor.SNIFBackend called Wasmex.start_link/1 and
Wasmex.call_function/3 directly, and available?/0 only checked the .wasm
file existed — not whether the (undeclared) :wasmex runtime was loadable.
Result: a compile-time "Wasmex is undefined" warning, and SNIF kernels
routing into Wasmex at runtime only to fail by rescued exception instead
of cleanly degrading.

Apply the established :quicer / Burble.Bolt.Quic pattern (ADR-0004):

* server/mix.exs — document :wasmex in the optional-NIF block (Rust/
  wasmtime toolchain; commented like quicer/elmdb).
* snif_backend.ex — `@wasmex Wasmex` alias; call via apply/3 (no direct
  reference => no compile warning); available?/0 now also requires
  Code.ensure_loaded?(@wasmex) and the function exported, so every
  kernel transparently uses ZigBackend when Wasmex is absent.
* CHANGELOG — Fixed entry.

Verified: `mix compile --force` emits no Wasmex warning and no new
unused/undefined warnings in snif_backend.ex.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@hyperpolymath hyperpolymath merged commit caa2216 into main May 19, 2026
12 of 14 checks passed
@hyperpolymath hyperpolymath deleted the fix/snif-wasmex-optional-guard branch May 19, 2026 12:17
@github-actions
Copy link
Copy Markdown

🔍 Hypatia Security Scan

Findings: 21 issues detected

Severity Count
🔴 Critical 4
🟠 High 6
🟡 Medium 11

⚠️ Action Required: Critical security issues found!

View findings
[
  {
    "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 ocaml/setup-ocaml@v3 needs attention",
    "type": "unpinned_action",
    "file": "affinescript-canary.yml",
    "action": "pin_sha",
    "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": "No permissions declaration -- add permissions: read-all",
    "type": "missing_permissions",
    "file": "elixir-ci.yml",
    "action": "add_permissions",
    "rule_module": "workflow_audit",
    "severity": "medium"
  },
  {
    "reason": "binary_to_term without :safe option -- deserialization attack (1 occurrences, CWE-502)",
    "type": "elixir_send_unsanitised",
    "file": "/home/runner/work/burble/burble/server/lib/burble/media/lmdb_playout.ex",
    "action": "flag",
    "rule_module": "code_safety",
    "severity": "high"
  },
  {
    "reason": "SSL verify_none disables certificate validation -- MITM risk (1 occurrences, CWE-295)",
    "type": "elixir_no_ssl_verify",
    "file": "/home/runner/work/burble/burble/server/lib/burble/bridges/mumble.ex",
    "action": "flag",
    "rule_module": "code_safety",
    "severity": "high"
  },
  {
    "reason": "believe_me undermines formal verification (2 occurrences, CWE-704)",
    "type": "believe_me",
    "file": "/home/runner/work/burble/burble/src/interface/abi/Foreign.idr",
    "action": "flag",
    "rule_module": "code_safety",
    "severity": "critical"
  },
  {
    "reason": "Nickel file missing SPDX-License-Identifier header (1 occurrences, CWE-1104)",
    "type": "ncl_missing_spdx",
    "file": "/home/runner/work/burble/burble/configs/config.ncl",
    "action": "flag",
    "rule_module": "code_safety",
    "severity": "medium"
  },
  {
    "reason": "Lock.unwrap() without poison handling (14 occurrences, CWE-754)",
    "type": "lock_unwrap",
    "file": "/home/runner/work/burble/burble/tools/selur-compose/crates/selur-compose-driver/src/mock.rs",
    "action": "flag",
    "rule_module": "code_safety",
    "severity": "high"
  }
]

Powered by Hypatia Neurosymbolic CI/CD Intelligence

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant