Skip to content

feat(koinon): hardware asset registry with USB device identification#12

Merged
forkwright merged 1 commit intomainfrom
p0-04/hardware-registry
Mar 14, 2026
Merged

feat(koinon): hardware asset registry with USB device identification#12
forkwright merged 1 commit intomainfrom
p0-04/hardware-registry

Conversation

@forkwright
Copy link
Owner

Summary

  • HardwareAsset, HardwareKind, RadioKind, SdrKind, MeshNodeKind types
  • ConnectionType enum (UsbSerial, Tcp, Ble, I2c, Spi, UsbDirect)
  • AssetRegistry: in-memory add/remove/query with snafu error handling
  • Known USB VID:PID table (PL2303, CH340, CP2102, FTDI, RTL-SDR, ESP32-S3)
  • PL2303 clone risk flagging
  • USB detection stub for future udev/nusb integration
  • 21 unit tests

Test plan

  • cargo test --workspace — all 72 tests pass (21 new hardware registry + USB lookup tests)
  • cargo clippy --workspace --all-targets -- -D warnings — zero warnings
  • Verify all 6 known USB devices resolve via lookup_usb_device

Observations

Out-of-scope findings noted for future tracking:

  • Debtcrates/koinon/src/tamper_log.rs: Test module uses #[allow] instead of #[expect] per RUST.md convention. Applies to all existing test modules. Consistent with current codebase practice but diverges from the standard.
  • Missing testAssetRegistry::all() iterator and get_mut() have no dedicated tests. Both are exercised indirectly but could use explicit coverage.
  • Observation — The // TODO: comment convention in the prompt conflicts with STANDARDS.md (which requires TODO(#NNN) with a tracking issue). Resolved here by using // NOTE: for the USB stub comment.

- HardwareAsset, HardwareKind, RadioKind, SdrKind, MeshNodeKind types
- ConnectionType enum (UsbSerial, Tcp, Ble, I2c, Spi, UsbDirect)
- AssetRegistry: in-memory add/remove/query with snafu error handling
- Known USB VID:PID table (PL2303, CH340, CP2102, FTDI, RTL-SDR, ESP32-S3)
- PL2303 clone risk flagging
- USB detection stub for future udev/nusb integration
- 21 unit tests covering all acceptance criteria
@github-actions
Copy link
Contributor

⚠️ Large PR detected — 2 files, 858 lines changed.

Consider splitting into smaller PRs for easier review. Not a blocker, just a signal.

@forkwright forkwright merged commit b2224d9 into main Mar 14, 2026
13 checks passed
@forkwright forkwright deleted the p0-04/hardware-registry branch March 14, 2026 08:31
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