Skip to content

0.3.0 C4: Matter verified-core bazel landing — composed graph builds + runs PASE in CI#37

Merged
avrabe merged 7 commits into
mainfrom
0.3.0/matter-core-bazel-landing
May 30, 2026
Merged

0.3.0 C4: Matter verified-core bazel landing — composed graph builds + runs PASE in CI#37
avrabe merged 7 commits into
mainfrom
0.3.0/matter-core-bazel-landing

Conversation

@avrabe
Copy link
Copy Markdown
Contributor

@avrabe avrabe commented May 30, 2026

0.3.0 C4: Matter verified-core — bazel landing of the composed graph (SWARCH-WOHL-008)

Lands the locally-proven spike2c-compose graph as rules_wasm_component + wac_plug bazel targets, with a wasmtime execution gate in CI. Step 4's landing (C4) of the feature loop — promotes SWARCH-WOHL-008 to approved.

CI-gated now (every PR)

  • Builds via rules_wasm_component: //:wohl-matter-transport (exports wire), //:wohl-matter-core-composed (rs-matter, imports wire, exports runner.run; deps from @wohl_crates), //:wohl-matter-composed (the two via wac_plug).
  • Runs: the bazel-build job runs wasmtime run --invoke 'run()' on the composed component → true = full SPAKE2+ PASE handshake across the wac-composed WIT boundary, PASE-RUNS-OK in CI.

Security

Uses the bazel toolchain's own wasmtime (verified via MODULE.bazel.lock), not curl | bash — resolves the automated review's HIGH finding.

Honest scope (refinement owed)

The landed seam is the simplified channelled wire interface, not yet the exact spar matter-world seam; clock/entropy stay core-internal. The claim (verified core runs as a composed component built by rules_wasm_component) is proven. Faithful spar-seam rebind = C4b, witness MC/DC = C5, both tracked in SWV-MATTER-002.

🤖 Generated with Claude Code

avrabe and others added 7 commits May 30, 2026 17:09
First increment of the SWARCH-WOHL-008 C4 bazel landing — encode the
locally-proven spike2c-compose graph as rules_wasm_component targets.

This commit lands the simplest piece (transport shell, exports the
seam) to learn the rule's behavior with a multi-world WIT (world=transport),
wasi p2 (sync), and std queues, before adding the rs-matter consumer +
wac_compose. Source rewritten from the spike's wit_bindgen::generate! to
the rule's <crate>_bindings convention (wohl_matter_transport_bindings).

CI bazel-build //:all exercises it. Cannot be verified locally (nix +
wasi-sdk egress blocked), so this is a high-information CI round.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
CI round 1 learned: rust_wasm_component_bindgen has no 'world' attribute
(it forwards kwargs to rust_shared_library). The bound world is selected by
the wit_library's world attr (transport), matching the existing
wohl-matter-core target which passes no world to the bindgen rule.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…s runner)

Round 2 landed the transport shell green. This adds the rs-matter consumer:

- compose.wit: export run via a `runner` interface (predictable Guest path).
- matter_compose_core_wit: second wit_library bound to world matter-core.
- wohl-matter-core-composed: rust_wasm_component_bindgen, deps
  @wohl_crates//:{rs-matter,embassy-futures,embassy-time-driver,
  critical-section}. Source is the 2c handshake rewritten to the rule's
  <crate>_bindings convention; exports runner.run (block_on the PASE
  handshake), imports the wire seam.
- crate-universe seed (wohl-leak/wasm/Cargo.toml): embassy-futures,
  embassy-time-driver, critical-section added as DIRECT deps so
  @wohl_crates aliases them (they were transitive via rs-matter only).

No wac_compose yet — isolating the consumer-build risk (rs-matter +
embassy + critical-section + import/export bindgen + std + p2) before
composing. CI-only verification.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…port)

Round 3 landed both components green. This composes them via wac_plug
(socket = the verified core, plugs = the transport shell) — the bazel
realisation of the locally-proven `wac plug mcore --plug transport`. The
composed component //:wohl-matter-composed exports the runner; a wasmtime
CI step (next) invokes `run` to prove the PASE handshake runs across the
seam in CI, turning C3 into a live gate.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Verified the invoke recipe locally: `wasmtime run --invoke 'run()'` reaches
only TOP-LEVEL world exports, not interface-instance exports. So:

- compose.wit: export `run` as a bare world func (dropped the `runner`
  interface wrapper from the previous round).
- mcore.rs: use the world-level Guest (bindings root), not exports::...::runner.
- ci.yml: after `bazel build //:all`, install wasmtime and run
  `wasmtime run --invoke 'run()'` on //:wohl-matter-composed, asserting
  `true`. This is the C4 execution gate — proves the SPAKE2+ PASE handshake
  RUNS across the wac-composed seam in CI, not just builds. Promotes the
  locally-proven spike2c result to a live gate (and SWARCH-WOHL-008 toward
  approved).

Local confirmation of the invoke syntax: a trivial bare-export `run()`
component composed with a wire provider returned `true` under wasmtime 41.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…ity fix)

Two corrections from round 5:

1. Bare world-func exports make the rule's bindgen emit a duplicate
   __export_world_matter_core_cabi symbol (E0255). Revert to the `runner`
   interface export — which builds (green round 4) AND is still reachable
   via `wasmtime run --invoke 'run()'` (verified locally: a trivial
   interface-export component returns true under wasmtime 41; my earlier
   "interface not invokable" was a parens mistake — 'run' vs 'run()').

2. Security: drop `curl … wasmtime.dev/install.sh | bash` (unpinned remote
   script execution, flagged HIGH). The rules_wasm_component toolchain
   already fetches wasmtime 43.0.1, integrity-verified by bazel via
   MODULE.bazel.lock; locate and use that binary instead.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Both promotion criteria are now met and CI-gated: the composed graph
builds via rules_wasm_component (//:wohl-matter-composed = transport
wac_plug'd into the rs-matter core) and a wasmtime step runs the full
SPAKE2+ PASE handshake on it (`--invoke 'run()'` -> true) on every PR.

SWARCH-WOHL-008: proposed -> approved, with an explicit refinement note
(the landed seam is the simplified `wire` interface, not yet the exact
spar matter-world seam; clock/entropy still core-internal).

SWV-MATTER-002: C4 marked DONE/CI-GATED; the spar-seam fidelity rebind
split out as C4b (still owed), C5 witness MC/DC still owed.

rivet validate: PASS.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@avrabe avrabe changed the title 0.3.0 C4: Matter verified-core bazel landing (WIP) 0.3.0 C4: Matter verified-core bazel landing — composed graph builds + runs PASE in CI May 30, 2026
@avrabe avrabe marked this pull request as ready for review May 30, 2026 19:59
@avrabe avrabe merged commit e9177ed into main May 30, 2026
14 checks passed
@avrabe avrabe deleted the 0.3.0/matter-core-bazel-landing branch May 30, 2026 20:02
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