cbcl-wasm: add verify_message_shape and verify_protocol exports #4

Merged
hugooconnor merged 0 commits from refs/pull/4/head into main 2026-04-29 03:41:55 +00:00
hugooconnor commented 2026-04-28 23:54:44 +00:00 (Migrated from codeberg.org)

Summary

  • Adds two new C-ABI exports to cbcl-wasm: cbcl_verify_message_shape (REQ-220 / REQ-223, composition-by-conjunction per REQ-224) and cbcl_verify_protocol (REQ-203 / REQ-304), each a thin wrapper over the existing cbcl-core / cbcl-parser primitives.
  • Failures emit the canonical REQ-233 blame S-expression via ViolationError::from_shape_violation; Unknown causal results return (pending :reason "unknown-predecessor") so callers can plumb predecessor lookup out-of-band.
  • Reuses the existing alloc / RESULT_BUF ABI from cbcl_verify_dialect; mirrored under the bindgen feature.
  • Unblocks the W1.2 hard gate in cbcl-mcp's Python SDK so it can perform per-message shape and causal verification, not just install-time R1–R5 well-formedness.

Test plan

  • 12 new unit tests covering: shape pass / shape type-mismatch / no-shape vacuous-pass / malformed-frame / bytes round-trip; protocol caused-by-begin valid / missing-caused-by violation / unknown-predecessor pending / no-protocol vacuous-pass / malformed-frame / bytes round-trip.
  • Confirmed cbcl_verify_message_shape and cbcl_verify_protocol symbols present in the wasm32-unknown-unknown release artefact via strings.
  • Downstream: integrate into cbcl-mcp Python SDK and rerun the NeurIPS-paper-demo plan W3 step.
## Summary - Adds two new C-ABI exports to `cbcl-wasm`: `cbcl_verify_message_shape` (REQ-220 / REQ-223, composition-by-conjunction per REQ-224) and `cbcl_verify_protocol` (REQ-203 / REQ-304), each a thin wrapper over the existing `cbcl-core` / `cbcl-parser` primitives. - Failures emit the canonical REQ-233 blame S-expression via `ViolationError::from_shape_violation`; `Unknown` causal results return `(pending :reason "unknown-predecessor")` so callers can plumb predecessor lookup out-of-band. - Reuses the existing `alloc` / `RESULT_BUF` ABI from `cbcl_verify_dialect`; mirrored under the `bindgen` feature. - Unblocks the W1.2 hard gate in `cbcl-mcp`'s Python SDK so it can perform per-message shape and causal verification, not just install-time R1–R5 well-formedness. ## Test plan - [x] 12 new unit tests covering: shape pass / shape type-mismatch / no-shape vacuous-pass / malformed-frame / bytes round-trip; protocol caused-by-begin valid / missing-caused-by violation / unknown-predecessor pending / no-protocol vacuous-pass / malformed-frame / bytes round-trip. - [x] Confirmed `cbcl_verify_message_shape` and `cbcl_verify_protocol` symbols present in the `wasm32-unknown-unknown` release artefact via `strings`. - [ ] Downstream: integrate into `cbcl-mcp` Python SDK and rerun the NeurIPS-paper-demo plan W3 step.
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
anuna-research/cbcl-rs!4
No description provided.