cbcl-erl: implement SPEC-009 Erlang/NIF binding (v0.1.0) #5
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "refs/pull/5/head"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
crates/cbcl-erl/exposesparse_message/1,parse_message_lax/1,verify_dialect/1, andversions/0as a Rustler 0.36 NIF returning native BEAM terms (REQ-001..REQ-006 + OBS-001 + OBS-002).#![forbid(unsafe_code)], every NIF wrapped inpanic_guard::catch(REQ-005 / ADR-001 mitigation), free-form error reasons returned as binaries (atom-table DoS).plans/SPEC-009-erl-binding.spldecomposes the work into 9 tasks across 3 subagent roles; all completed in dependency order.§11 open questions resolved with v0.1.0 defaults
cbcl-csexpco-binding out of scopeNotable findings
OwnedEnv::new()SIGABRTs outside anerl-hosted process (enif_alloc_envis dynamically loaded). Convention enforced across all modules: assertable logic lives in pure Rust helpers (*_purefunctions), tests target those;#[rustler::nif]wrappers are thin glue. 12 BEAM-host-only tests stay#[ignore]'d.parse_message_lax/1is a documented stopgap because cbcl-parser does not yet expose a separate lax mode. Returns{ok, {raw, <<bytes>>}}for non-Simple inputs (e.g. Meta) where strict rejects with{error, <<"message error: ...">>}. Top-of-file comment names §11.1 / §11.2 as the unblockers.KNOWN_DIVERGENCES(cap=20). All 16 trace to upstream — 3 are cbcl-parser permissiveness, 13 are scope mismatch (strings.jsondescribes parser-level atom recognition, not message forms). Each entry has a one-line reason; none are bugs in cbcl-erl. Should clear via a SPEC-008 vector update or a SPEC-009 ADR pinning cbcl-erl strictness above cbcl-parser.Other touches
crates/cbcl-core/src/lib.rsgains a singlepub const VERSIONline soversions/0can surface the linkedcbcl-coreversion without parsing the manifest.Cargo.tomlregisterscbcl-erlas a workspace member.plans/SPEC-009-erl-binding.splis the hence coordination plan.Out of scope (intentionally)
:hashconsistency check on dialects (cbcl-wasmcarries one) — CON-002 mandates R1/R2/R3 only for v0.1.0.Status note
SPEC-009 status remains
draft. §12 normally gates implementation on cross-model + human review; this PR is the v0.1.0 implementation against the draft and does not promote the spec.Test plan
cargo test -p cbcl-erl— 48 passing (33 unit + 14 integration + 1 conformance), 12 ignoredcargo check -p cbcl-erl --features tracingcleancargo checkcleancargo build -p cbcl-erl --releasesucceeds (cdylib + rlib)test-vectors/messages/*.json(48 cases / 7 files)cbcl-lfe-routerper SPEC-008