Skip to content

fix(firmware): sanitize Windows reserved device names in state paths and enforce LF on homecore - #2261

Open
VG31OP wants to merge 1 commit into
ruvnet:mainfrom
VG31OP:fix/windows-provisioning-state-and-manifest-crlf
Open

VG31OP wants to merge 1 commit into
ruvnet:mainfrom
VG31OP:fix/windows-provisioning-state-and-manifest-crlf

Conversation

@VG31OP

@VG31OP VG31OP commented Oct 13, 2026

Copy link
Copy Markdown

Summary

Resolves cross-platform failures on Windows for ESP32 node provisioning and Homecore manifest verification:

  1. DOS reserved device name clash: On Windows, files whose base name matches CON, PRN, AUX, NUL, COM1-9, or LPT1-9 (e.g. COM7.json) cannot be opened or created, causing provision.py to fail with FileNotFoundError whenever a Windows serial port is used and causing 16 test errors in firmware/esp32-csi-node/tests.
    • Prefix reserved device names with _ in _state_path_for.
    • Added backward-compatible fallback in load_state and load_board_state for legacy files.
    • Added regression tests in test_provision_state.py.
  2. Homecore manifest line endings: Added harness/homecore/** text=auto eol=lf to .gitattributes (matching harness/ruview/**) so manifest.sha256 byte-for-byte verification does not fail on Windows checkouts.

Validation

  • python -m unittest discover -s firmware/esp32-csi-node/tests: 73/73 passed (0 errors, 11 skipped).
    • harness/ruview: npm test, npm run test:security, npm run brain:verify, npm run manifest:verify all PASS.
    • harness/homecore: npm test, npm run test:security, npm run manifest:verify, npm pack --dry-run all PASS.

On Windows, files whose basenames match DOS reserved device names (CON, PRN, AUX, NUL, COM1-9, LPT1-9) cannot be created, causing provision.py to fail with FileNotFoundError whenever Windows COM ports (e.g. COM7) were used. This also caused 16 test failures in the esp32-csi-node test suite on Windows.

- Prefix reserved device names with '_' in _state_path_for.
- Add legacy unprefixed path fallback in load_state and load_board_state for backward compatibility.
- Add regression tests in test_provision_state.py for reserved device prefixing.
- Add harness/homecore/** text=auto eol=lf in .gitattributes to maintain byte-for-byte provenance and prevent manifest.sha256 mismatch on Windows checkouts.

Validation: All 73 esp32-csi-node tests pass on Windows, and all 120 harness/ruview security tests, package manifest, and brain verification pass.

This branch has not been deployed

No deployments
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