Skip to content

Wire HotplugMonitor into Server, or delete it — v1.0 reliability primitive is fiction #29

Description

@stanvx

Parent

Architecture review (2026-06-21). Slice 3 of 6 from the deepening series. Documented at server/usbip-server/src/hotplug.rs:40-106 and CONTEXT.md:35-37.

What to build

HotplugSource, HotplugEvent, and HotplugMonitor are declared, exported, and tested — but no Server ever instantiates one. CONTEXT.md lists hot-plug detection as a v1.0 reliability primitive. The agent must pick one of two paths and execute end-to-end:

Path A — wire it. Server::new constructs a HotplugMonitor::new(rusb::Context::new()?) and spawns a task that subscribes to attach/detach events. Detach events close active client sessions with a structured error. Attach events refresh the advertised device list and re-broadcast over mDNS. Tests must include a fake libusb context producing a scripted attach/detach sequence.

Path B — delete it. Remove hotplug.rs, remove the tests/hotplug_integration.rs file, remove the symbols from lib.rs re-exports, and amend CONTEXT.md to demote hot-plug detection to "deferred to v1.1". Update any callers (ARCHITECTURE.md, CLAUDE.md) that reference it.

The choice belongs to the agent; the discipline is that one of the two lands, not both, not neither.

Acceptance criteria

  • Exactly one of: (a) Server constructs a HotplugMonitor and the integration test runs end-to-end, or (b) hotplug.rs and its tests are deleted and CONTEXT.md is amended
  • If Path A: detach events close active client sessions with a structured error carrying the device's VID:PID and correlation_id
  • If Path A: grep -r 'HotplugMonitor::new' server/usbip-server/src/ returns at least one construction site
  • If Path B: grep -r 'hotplug\|Hotplug' server/usbip-server/src/ returns zero matches and tests/hotplug_integration.rs no longer exists
  • CONTEXT.md v1.0 contract section matches the chosen path (no fiction either way)
  • cargo test -p usbip-server --release passes; cargo clippy --workspace -- -D warnings clean

Blocked by

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestready-for-agentTriage complete; ready for an agent to implement

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions