Skip to content

feat: cross-platform WiFi collector factory (ADR-049)#173

Merged
ruvnet merged 1 commit intomainfrom
fix/adr-049-cross-platform-wifi
Mar 6, 2026
Merged

feat: cross-platform WiFi collector factory (ADR-049)#173
ruvnet merged 1 commit intomainfrom
fix/adr-049-cross-platform-wifi

Conversation

@ruvnet
Copy link
Copy Markdown
Owner

@ruvnet ruvnet commented Mar 6, 2026

Summary

  • Add create_collector() factory that auto-detects platform and never raises — Docker, WSL, and headless users get SimulatedCollector automatically with a clear WARNING log
  • Add LinuxWifiCollector.is_available() for probe-without-exception
  • Refactor ws_server.py to use factory, removing ~30 lines of duplicated platform detection
  • 10 new unit tests covering all platform paths

Test plan

  • 45/45 Python sensing tests pass (including 10 new tests)
  • create_collector("auto") returns SimulatedCollector when /proc/net/wireless is missing
  • create_collector("auto") returns LinuxWifiCollector when interface is available
  • Invalid preferred parameter falls back to "auto" safely
  • Windows interface name mapping (wlan0Wi-Fi) works

Closes #148, closes #155

🤖 Generated with claude-flow

… (ADR-049)

- Add create_collector() factory function that auto-detects platform and never raises
- Add LinuxWifiCollector.is_available() classmethod for probe-without-exception
- Refactor ws_server.py to use create_collector(), removing ~30 lines of duplicated platform detection
- Add 10 unit tests covering all platform paths and edge cases
- Add ADR-049 documenting the cross-platform detection and fallback chain

Docker, WSL, and headless users now get SimulatedCollector automatically
with a clear WARNING log instead of a RuntimeError crash.

Closes #148
Closes #155

Co-Authored-By: claude-flow <ruv@ruv.net>
@ruvnet ruvnet merged commit 7659b0b into main Mar 6, 2026
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.

fix: graceful fallback when /proc/net/wireless is missing (ADR-049) RuntimeError: Cannot read /proc/net/wireless

1 participant