Testing & Validation Framework
Relevant source files
The following files were used as context for generating this wiki page:
The RuView Testing & Validation Framework ensures the integrity, accuracy, and deterministic performance of the WiFi-based human sensing system. It spans multiple layers, including Rust workspace tests for production crates, deterministic Python proofs for signal processing pipelines, and comprehensive UI unit and integration tests.
The framework enforces a "prove everything" rule, requiring that all accuracy or performance claims be measured with a reproducer or synthetic baseline. It employs a "fail-closed" posture where missing prerequisites or failed validations return explicit errors rather than false successes.
Framework Architecture
The framework is structured to validate the system across different environments and languages. It integrates low-level Rust unit tests with high-level integration scripts and UI test runners.
The diagram shows the multi-layered validation flow from core logic to UI and physical hardware.
Sources: AGENTS.md:27-31, plugins/ruview/skills/ruview-verify/SKILL.md:5-15, harness/ruview/src/tools.js:10-15
Core Validation Components
Rust Workspace Tests
The production Rust crates in v2/ undergo extensive testing. This includes unit tests, single-crate checks, and workspace-wide invocations.
- Command:
cargo test --workspace --no-default-features - Requirement: Must pass 1,400+ tests with 0 failures.
- Coverage: Includes sensing-server, signal processing, and core libraries.
Sources: plugins/ruview/skills/ruview-verify/SKILL.md:10-15, harness/ruview/src/tools.js:192-198
Deterministic Python Proof (Trust Kill Switch)
The framework uses a reference CSI (Channel State Information) signal fed through the production pipeline to generate a SHA-256 hash. Any drift in the signal processing logic changes the hash, triggering a failure.
- Verification script:
archive/v1/data/proof/verify.py - Artifacts:
expected_features.sha256andsample_csi_data.json(1,000 synthetic frames).
Sources: plugins/ruview/skills/ruview-verify/SKILL.md:19-30, harness/ruview/src/tools.js:176-188
Witness Bundle Generation (ADR-028/ADR-115)
Recipients can verify implementations end-to-end using Witness Bundles. These bundles contain evidence such as test logs, benchmark results, and SHA-256 manifests of all relevant source files.
Sources: scripts/witness-adr-115.sh:10-25, plugins/ruview/skills/ruview-verify/SKILL.md:36-47
UI Testing Framework
The UI testing framework is dependency-free and runs directly in the browser. It categorizes tests into unit tests for utility modules and integration tests for service-level workflows.
| Test Category | Focus Area | Source File |
|---|---|---|
| Unit Tests | ToastManager, ThemeToggle, KeyboardShortcuts, PerfMonitor | ui/tests/unit-tests.html |
| Service Tests | API Configuration, WebSocket Heartbeat, Pose Service | ui/tests/test-runner.html |
| Integration | End-to-end API workflows with Mock Server fallback | ui/tests/test-runner.html |
UI Test Execution Flow
Sequence illustrating how UI tests utilize a Mock Server to validate component behavior without live backend dependencies.
Sources: ui/tests/unit-tests.html:25-50, ui/tests/test-runner.html:150-165
Integration & Hardware Validation
Hardware Evidence Requirements
Hardware validation prohibits the use of simulators as evidence for hardware claims. It requires captured boot or runtime logs from real silicon (e.g., ESP32-S3 or C6).
- Node Monitoring: Tools like
ruview_node_monitoropen serial ports to assert that CSI is flowing viaMGMT+DATAindicators. - Firmware Audit: SHA-256 hashes of firmware files are included in the witness manifest.
Sources: AGENTS.md:33-35, harness/ruview/src/tools.js:203-220, plugins/ruview/skills/ruview-verify/SKILL.md:43
Integration Validation Script
A bash-based validation script performs comprehensive system checks, including environment verification, database migrations, and API endpoint availability.
# Example integration validation sequence
check_prerequisites # Python 3.9+, venv, dependencies
validate_package_structure # Required files and directories
validate_imports # Core modules (csi_processor, pose_estimator)
run_integration_tests # pytest tests/integration/
Sources: archive/v1/scripts/validate-integration.sh:55-150
Pre-Merge Checklist
Every significant change must pass a strict checklist before merging into the main branch:
- Rust Workspace: 1,400+ passed, 0 failed.
- Deterministic Proof: Must print
VERDICT: PASS. - Witness Bundle: Regenerated if tests or proof hashes changed.
- Crate Documentation:
README.mdmust not drift from the actual public API. - Security Scan: Mandatory for modules touching hardware or network boundaries.
Sources: plugins/ruview/skills/ruview-verify/SKILL.md:55-75, v2/crates/wifi-densepose-bfld/tests/crate_readme.rs:45-55
Conclusion
The RuView Testing & Validation Framework provides a rigorous, multi-lingual pipeline for verifying RF perception capabilities. By combining deterministic proofs with hardware-in-the-loop monitoring and browser-based UI testing, the system ensures that every sensing claim is backed by reproducible evidence.