fix: Eliminate remaining mock data paths, isolate test infrastructure
- core/router_interface.py: Replace placeholder _collect_real_csi_data() with explicit RuntimeError directing users to hardware setup docs - hardware/router_interface.py: Replace np.random.rand() in _parse_csi_response() with RouterConnectionError requiring real parser - testing/: New isolated module for mock data generation (moved out of production code paths per ADR-011) - sensing/: Initialize commodity sensing module (ADR-013) No production code path returns random data. Mock mode requires explicit opt-in via WIFI_DENSEPOSE_MOCK=true environment variable. https://claude.ai/code/session_01Ki7pvEZtJDvqJkmyn6B714
This commit is contained in:
@@ -195,11 +195,23 @@ class RouterInterface:
|
||||
return csi_data
|
||||
|
||||
async def _collect_real_csi_data(self) -> Optional[np.ndarray]:
|
||||
"""Collect real CSI data from router (placeholder implementation)."""
|
||||
# This would implement the actual CSI data collection
|
||||
# For now, return None to indicate no real implementation
|
||||
self.logger.warning("Real CSI data collection not implemented")
|
||||
return None
|
||||
"""Collect real CSI data from the router.
|
||||
|
||||
Raises:
|
||||
RuntimeError: Always in the current state, because real CSI
|
||||
data collection requires hardware setup that has not been
|
||||
configured. This method must never silently return random
|
||||
or placeholder data.
|
||||
"""
|
||||
raise RuntimeError(
|
||||
f"Real CSI data collection from router '{self.router_id}' requires "
|
||||
"hardware setup that is not configured. You must: "
|
||||
"(1) install CSI-capable firmware (e.g., Atheros CSI Tool, Nexmon CSI) on the router, "
|
||||
"(2) configure the SSH connection to the router, and "
|
||||
"(3) implement the CSI extraction command for your specific firmware. "
|
||||
"For development/testing, use mock_mode=True. "
|
||||
"See docs/hardware-setup.md for complete setup instructions."
|
||||
)
|
||||
|
||||
async def check_health(self) -> bool:
|
||||
"""Check if the router connection is healthy.
|
||||
|
||||
Reference in New Issue
Block a user