Skip to content

refactor(platform): phase 7/9 migrate serial, USB, and device mechanics #1313

Description

@zackees

Parent: #1306
Depends on: phase 6 daemon IPC/lifecycle migration

Scope

Move host device mechanics behind fbuild_core::platform::device:

  • serial-port enumeration/classification host seams;
  • Windows PnP/SetupAPI and recovery primitives;
  • Linux sysfs and macOS device facts;
  • USB/removable-volume/topology primitives shared by serial and deployment;
  • host-specific retry constants only when they are mechanics rather than product policy.

Preserve the FastLED/boards VID/PID source-of-truth rule and the existing Windows USB-CDC, DTR/RTS, recovery, and serial client contracts. Delete exact migrated ledger rows.

Acceptance criteria

  • RED characterization covers representative Windows, Linux, and macOS device behavior.
  • Shared serial/deploy callers leak no Win32, sysfs/IOKit, raw device, or concrete platform type.
  • No production VID/PID data is added outside the published boards registry.
  • Existing port probing, USB recovery, deploy preemption, and Python SerialMonitor behavior remains compatible.
  • Before/after ledger totals and RED -> GREEN evidence are recorded.
  • Focused serial/device tests, hardware-gated tests where required, three-host CI, workspace check/clippy, and repo tests are GREEN.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status
    Triage

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions