Bring workspace to clippy-clean + fmt-clean baseline#2
Merged
Conversation
Binary input mode reading 14-byte Wohl sensor packets from stdin, matching the format Wohl sensor nodes emit. Translates SENSOR_TEMP/WATER/CONTACT/ CO2/POWER to SensorEvent; JSON mode unchanged. 6 new tests, 28 total. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Four new files under spar/: - wohl_properties.aadl — custom property set (current, battery, radio, Zephyr binding) - wohl_hardware.aadl — part library: nRF52840, ESP32-S3, RPi4, SHT30, BMP280, SCD41, SPS30, BH1750, reed, PIR, water probe - wohl_nodes.aadl — DoorWindowNode/ClimateNode/AirQualityNode/HubNode impls - wohl_home.aadl — StarterHome.Deployed wiring 3 door + 1 climate + 1 air + hub Passes `spar parse`, `spar instance` (48 components), `spar analyze` (fault tree correctly flags the hub as SPoF). Every sensor carries a Zephyr_Binding for devicetree generation. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Adds wohl_firmware.aadl with DoorFirmware/ClimateFirmware/AirFirmware threads and NodeBootloader + OTAManager threads (the gale-boot and OTA placeholders). Node systems now expose packet_out/image_in/attest_out ports and wire sensor devices through the firmware process to the radio bus. StarterHome.Deployed wires all 5 nodes to the hub for sensor packets, OTA images, and attestation reports. Spar instance: 62 components. Analyze: sensor data flow, OTA distri- bution, and attestation paths are modeled. Thread→processor binding warnings are a pre-existing Spar limitation with nested-path bindings that also affects wohl_system.aadl. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- Adds HubMonitorProcess with PacketRouter + 5 monitor threads + AlertDispatcher, wired inside HubNode.RPi. - New IntelN100 processor type and HubNode.MiniPC alternate implementation (GMKtec/Beelink/Minisforum-style mini PC) for ML/ local-LLM headroom when RPi is outgrown. - Zone_Id / Zone_Name / Location / Role properties on DoorWindowNode/ClimateNode/AirQualityNode subcomponents in StarterHome.Deployed, so the model carries the sensor-to-room mapping today consumed from wohl.toml. - StarterHome.DeployedMiniPC deployment mirrors Deployed with the MiniPC hub substituted. (Spar instance JSON currently drops the property values — filed as pulseengine/spar#129.) Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
New Spar build's connection_rules checker caught temp_out/air_out/ power_out being event data ports while the monitor inputs are data ports. Matched: periodic sensors route through data ports, sporadic (water, contact) through event data ports. Spar analyze is now clean on both StarterHome.Deployed and StarterHome.DeployedMiniPC. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Prepares the codebase to satisfy a future cargo fmt + clippy -D warnings
CI merge gate. All changes are mechanical / semantics-preserving; Kani
spot-checked on wohl-leak (4/4) and wohl-power (3/3) post-cleanup.
Workspace lints
- Cargo.toml: [workspace.lints.rust] check-cfg = ['cfg(kani)']
- Each crate: [lints] workspace = true (8 crates)
- Eliminates 6 unexpected_cfgs warnings without #[allow] noise
Clippy fixes across all 6 monitor crates
- 6× added impl Default { fn default() -> Self { Self::new() } }
- 9× manual x = x + 1 → x += 1
- 1× manual abs-diff → watts.abs_diff(last) (wohl-power)
- 1× index-loop → for (i, &t) in thresholds.iter().enumerate() (wohl-air)
- 2× collapsible nested if → joined with && (wohl-door)
wohl-hub dead-code handling
- #[allow(dead_code)] on 5 TOML config structs (public schema, fields
not yet wired) and on ALERT_HEALTH_MISS (reserved alert ID)
- #[cfg(test)] on config_from_str (only called from tests)
- Deleted contact_zone method (truly unused, no callers)
- 1× collapsible_if in process_event
cargo fmt --all sweep
- Reformatted 8 wohl files (was pre-existing drift in engine.rs and
wohl-hub/main.rs)
Verification
- cargo fmt --all --check: clean
- cargo clippy --workspace --all-targets -- -D warnings: clean
- cargo test --workspace --all-features: 92/92 pass
- cargo kani -p wohl-leak: 4/4 verified
- cargo kani -p wohl-power: 3/3 verified
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
3 tasks
…easons Adds `reason = "..."` to every #[allow(dead_code)] introduced in 3f2f524. Per the architect reviewer's recommendation, naked `#[allow]` is invisible to future grep; reasons make each suppression load-bearing and connect it to the specific follow-up work (Track D Verus, firmware-AADL scheduler, TOML schema surface). No behavior or verification change — `cargo fmt`, `clippy -D warnings`, test (92/92), and Kani all still pass. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Reviewer caught a wrong file pointer in the reason string introduced in d06c553. The Scheduler thread is defined at spar/wohl_system.aadl:207, not wohl_firmware.aadl (which holds node-firmware threads). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Mechanical, semantics-preserving cleanup of the wohl workspace so a future
cargo fmt --check+cargo clippy -D warningsCI merge gate can land cleanly. No behavior changes; all 92 tests pass, Kani verified on all 6 components (20 harnesses total).This is PR 1a of 2 for the foundation work — PR 1b (#TBD) will introduce the CI workflow itself, README, and CLAUDE.md drift fix. Issue #1 is closed by PR 1b, not this one.
What changed
Workspace lints (modern Rust check-cfg idiom):
Cargo.toml:[workspace.lints.rust] unexpected_cfgs = { level = "warn", check-cfg = ['cfg(kani)'] }[lints] workspace = truecfg(kani)" warnings without scattering#[allow]attributesClippy fixes (all 6 monitor crates):
Defaultimplx = x + 1→+=.abs_diff().iter().enumerate()ifwohl-hub dead-code (judgment-based, with load-bearing
reason = "..."per architect review):#[allow(dead_code, reason = "...")]on 5 TOML config structs andALERT_HEALTH_MISS— reasons connect each suppression to specific follow-up work (Track D Verus, scheduler thread atspar/wohl_system.aadl:207, TOML schema surface)#[cfg(test)]onconfig_from_str(only called from tests)contact_zonemethod — truly unused, no callers anywhereFormat sweep:
cargo fmt --allreformatted 8 files with pre-existing drift (engine.rs files +wohl-hub/main.rs)wohl-integration/src/lib.rswas incidentally swept as wellVerification
cargo fmt --all --checkcargo clippy --workspace --all-targets -- -D warningscargo test --workspace --all-featurescargo kani -p wohl-leakcargo kani -p wohl-tempcargo kani -p wohl-aircargo kani -p wohl-doorcargo kani -p wohl-powercargo kani -p wohl-alertAll 20 Kani harnesses across 6 monitors PASS post-cleanup. Verification status preserved.
Reviewer feedback addressed
reason = "..."to every#[allow(dead_code)]directive (commitd06c553)wohl_firmware.aadl→wohl_system.aadl:207) in the SchedulerConfig reason (commit5a44e87)3f2f524+d06c553+5a44e87once PR Sync: wohl-hub CCSDS support and AADL system models #4 mergesOut of scope
wohl-alertdedup invariant — separate Track D workrelay/*clippy drift — visible as warnings from dependencies but not gated by this workspace's lintsCargo.lockchange reflects relay sibling now depending onrelay-primitivesand addingrelay-ccsds— upstream, not authored hereTest plan
cargo fmt --all --check(local, macOS-aarch64)cargo clippy --workspace --all-targets -- -D warnings(local)cargo test --workspace --all-features(local, 92 pass)cargo kani -p wohl-{leak,power}(local, 4/4 + 3/3 PASS)cargo kani -p wohl-{temp,air,door,alert}(independent reviewer verified — 3/3 + 3/3 + 3/3 + 4/4 PASS)contact_zonedeletion confirmed safe;config_from_struse confirmed test-only;ALERT_HEALTH_MISSretention confirmed ID-numbering-preserving)🤖 Generated with Claude Code