Skip to content

0.2.0 Matter Bridge: scaffold + cluster mapping + hub --matter wiring#27

Merged
avrabe merged 2 commits into
mainfrom
0.2.0/matter-bridge-scaffold
May 25, 2026
Merged

0.2.0 Matter Bridge: scaffold + cluster mapping + hub --matter wiring#27
avrabe merged 2 commits into
mainfrom
0.2.0/matter-bridge-scaffold

Conversation

@avrabe
Copy link
Copy Markdown
Contributor

@avrabe avrabe commented May 25, 2026

Summary

  • New crate wohl-matter-bridge lays the scaffold for the Matter integration decided in SWARCH-WOHL-006: CCSDS sensors + the hub as a Matter Bridge.
  • Defines the MatterBridge trait + cluster mapping table; ships LoggingBridge as the only impl in 0.2.0.
  • wohl-hub --matter (or WOHL_MATTER=1) routes alerts + readings through the bridge alongside the existing stdout JSON. Default off — wohl-hub behaves identically to 0.1.0 when not set.
  • Zero edits to verified crates (wohl-{leak,temp,air,door,power,alert,ota}, wohl-fw-door-bench). The Kani-verified line and Verus proofs are untouched.

What this PR is NOT

  • No rs-matter dependency. No mDNS / UDP / Matter wire bytes. No commissioning. Those are 0.3.0 scope, behind a future rs-matter-backend feature gate.
  • This is the interface contract that 0.3.0 will implement. crates/wohl-matter-bridge/DESIGN.md captures the open questions for the 0.3.0 implementor.

Cluster mapping (enum-encoded)

Wohl AlertKind Cluster Cluster id
Freeze / Overheat / RapidDrop / RapidRise TemperatureMeasurement 0x0402
WaterLeak BooleanState (1.0 fallback) 0x0045
Co2Warning / Co2Critical CarbonDioxideConcentrationMeasurement 0x040D
Pm25Warning / Pm25Critical Pm25ConcentrationMeasurement 0x042A
VocWarning / VocCritical TotalVolatileOrganicCompoundsConcentrationMeasurement 0x042C
DoorOpenTooLong / DoorOpenedAtNight BooleanState 0x0045
Overconsumption / PowerSpike / DeviceLeftOn ElectricalPowerMeasurement 0x0090
HealthMiss not bridged (internal-only)

Verified locally

  • cargo +1.85.0 fmt --check
  • cargo +1.85.0 clippy --workspace --all-targets -- -D warnings
  • cargo +1.85.0 test -p wohl-matter-bridge (all green)
  • cargo +1.85.0 test -p wohl-hub (bridge off: identical 0.1.0 behavior; with --matter: bridge receives readings + alerts)
  • cargo +1.85.0 check --workspace
  • Kani: untouched (no edits to verified crates)

Open questions for 0.3.0 (from DESIGN.md §7)

  1. Endpoint id allocation policy — flat-namespace scheme proposed; needs final call before commissioning ships.
  2. WaterLeakDetector dual-publish (Matter 1.0 BooleanState + 1.2+ WaterLeakDetector) vs BooleanState only.
  3. High-frequency reading throttle vs pass-through.

Test plan

  • All CI jobs green (fmt+clippy, test, fuzz-smoke, rivet, Verus, Kani matrix, cargo-deny, bazel-build).
  • Independent reviewer reads scaffold + DESIGN.md cold.
  • After merge: tag v0.2.0 and exercise release.yml.

🤖 Generated with Claude Code

avrabe and others added 2 commits May 25, 2026 13:12
…ring

Lands the *interface* for SWARCH-WOHL-006 (CCSDS sensors + hub as Matter
Bridge) without pulling in rs-matter. The verified sensor line stays
untouched; the unverified Matter stack remains explicitly hub-side.

- New crate `crates/wohl-matter-bridge` (no rs-matter dep):
  * `MatterBridge` trait — the contract wohl-hub calls.
  * Typed `MatterCluster` / `MatterAttribute` enums + exhaustive
    `mapping_for_alert` / `mapping_for_reading` tables (19 unit tests
    pinning every cluster id to Matter App-Cluster-Spec 1.3 values).
  * `LoggingBridge` stderr stub for end-to-end wiring validation.
- wohl-hub: optional Matter bridge field + `--matter` flag (or
  `WOHL_MATTER=1`). Default off — wohl-hub behaves identically to 0.1.0
  when the flag is unset. 2 new tests cover both states.
- `DESIGN.md`: rationale for scaffold-first, cluster decisions,
  rs-matter target version, commissioning approach (`/var/lib/wohl/matter/`),
  multi-admin behavior, attestation cert path, 3 open questions for 0.3.0.
- `WORKSPACE_INTEGRATION.md`: exact root Cargo.toml edits the
  orchestrator needs to apply (workspace member + workspace.dependency).

Verification (Rust 1.85.0): fmt --check clean, clippy --all-targets
-D warnings clean, 19/19 wohl-matter-bridge tests pass, 30/30 wohl-hub
tests pass (including the 2 new bridge-wiring tests). wohl-alert tests
re-run to confirm verified core untouched.

Refs SWARCH-WOHL-006.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Adds the new crate as a workspace member and registers it under
[workspace.dependencies] so wohl-hub can use the `.workspace = true`
form (matching every other intra-workspace dep). The scaffold commit
intentionally left this orchestration-layer edit out so the scaffold
itself stayed reviewable on its own.

Verified:
  cargo +1.85.0 fmt --check
  cargo +1.85.0 clippy --workspace --all-targets -- -D warnings
  cargo +1.85.0 test -p wohl-matter-bridge -p wohl-hub
  cargo +1.85.0 check --workspace

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@avrabe avrabe merged commit 19b8168 into main May 25, 2026
14 checks passed
@avrabe avrabe deleted the 0.2.0/matter-bridge-scaffold branch May 25, 2026 11:34
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