Repository navigation
chore: align USB crate boundaries - #1695
Benoît Cortier (CBenoit) wants to merge 7 commits into
Conversation
There was a problem hiding this comment.
Pull request overview
Aligns the internal USB model crate with shared testing policy and documents its core-tier role.
Changes:
- Disables publishing and generated library/doctest targets.
- Adds
ironrdp-usbto the architecture map.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
crates/ironrdp-usb/Cargo.toml |
Applies internal publishing and testing settings. |
ARCHITECTURE.md |
Documents the USB crate under Core Tier. |
|
|
||
| _TODO_: clean up the dependencies | ||
|
|
||
| #### [`crates/ironrdp-usb`](./crates/ironrdp-usb) |
There was a problem hiding this comment.
Correct. However, I’ll not add fuzzing as part of this PR.
uchouT (@uchouT) is this a follow up you intended to do in the future?
There was a problem hiding this comment.
Yes, in my future plan, and #1690 seems to help.
There was a problem hiding this comment.
Oh, right! I’ll go check it
There was a problem hiding this comment.
Docs-only "chore" PR: sets publish = false and disables doctest/test for ironrdp-usb (mirroring the sibling ironrdp-rdpeusb crate's existing settings), and adds ARCHITECTURE.md entries for ironrdp-usb and ironrdp-rdpeusb. The ironrdp-usb entry (no-alloc, USB-only parsing) is verified accurate against the crate's #![no_std] source. The ironrdp-rdpeusb entry, however, describes a "`usb` module" that translates ironrdp-usb operations into RDPEUSB packets; no such module exists (the crate exposes client/io/pdu/server, with pdu::usb_dev handling TS_URB), and ironrdp-rdpeusb does not depend on or import ironrdp-usb at all. Packaging changes are otherwise low-risk and consistent with existing crate conventions.
Protocol analysis: partially_accepted — The handoff correctly scoped itself to a docs/packaging-only diff and correctly flagged the DVC-naming invariant (line 119) as incomplete_evidence since the implementing crate wasn't changed here. However, its 'conforms' assessment for the TS_URB-translation invariant (line 123-125) cites pdu/usb_dev/ts_urb/mod.rs as matching the documentation, without noting that the documentation names a nonexistent '`usb` module' and asserts an ironrdp-usb integration that does not exist in the current source (no dependency, no imports, no module named `usb`). That is a concrete discrepancy between the new architecture text and the actual crate structure that the handoff should have surfaced but did not.
| Selecting `TS_URB` forms and applying Windows USBD conventions remain in this crate. | ||
|
|
||
| **Architectural Invariant**: the `usb` module does not allocate request IDs, track device state, or manage pending-request lifetimes. | ||
| Those responsibilities belong to the layer above the channel implementation. |
There was a problem hiding this comment.
blocking / medium: This new architectural-invariant text asserts that ironrdp-rdpeusb has a `usb` module that translates protocol-independent `ironrdp-usb` operations into RDPEUSB packets and does not allocate request IDs or track device state. Neither claim matches the current crate: lib.rs only exposes `client`, `io`, `pdu`, and `server` modules (no module named `usb`), and ironrdp-rdpeusb's Cargo.toml has no dependency on ironrdp-usb and no source file imports it anywhere in the crate. The closest existing code is `pdu::usb_dev::ts_urb`, which builds TS_URB PDUs directly rather than adapting an `ironrdp-usb` abstraction. Since ARCHITECTURE.md is designated in this repository's own CLAUDE.md as an authoritative source of truth for both human and AI contributors, checking in a factually incorrect description of the crate's module structure and its (nonexistent) dependency on ironrdp-usb will mislead future readers into believing an integration exists that has not been built yet.
There was a problem hiding this comment.
The usb module is added as part of another PR.
And yes, I need to update CLAUDE.md/AGENTS.md file.
There was a problem hiding this comment.
Architectural Invariant: the
usbmodule does not allocate request IDs, track device state, or manage pending-request lifetimes.
Those responsibilities belong to the layer above the channel implementation.
client and server modules in this crate provide channel implementation, including request IDs allocation, device state track, etc. Not sure if this is suitable. Because I think we are talking about crate layer here, not just module layer.
Other parts LGTM
Rubber Duck Review — PR #1695
Findings
Review Limitations & Skipped Passes
Note LLM-assisted content (no human feedback). |
Keep the USB model crate internal and use the shared integration suite\nrather than Cargo's generated library and doctest targets.\n\nDocument the crate's core-tier responsibility. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Document the RDPEUSB adapter boundary so lifecycle ownership stays above the channel layer. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Separate the core-tier sans-I/O rule from USB-specific allocation and transport parsing boundaries. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Record that generated RDPEUSB packets preserve agreement among the URB payload, function, envelope, flags, and buffer shape. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Keep USB publishable for versioned consumers and describe request state as owned by channel state machines and backends.
26bcd94 to
6059e36
Compare
There was a problem hiding this comment.
🟢 Documentation-only plus a harmless manifest tweak: ARCHITECTURE.md documents the ironrdp-usb crate boundaries (no allocation, USB-format-only parsing) and two ironrdp-rdpeusb usb-module invariants; crates/ironrdp-usb/Cargo.toml adds [lib] doctest=false and test=false. Verified against the head: ironrdp-usb has zero dependencies and no inline unit tests (its tests live in ironrdp-testsuite-core tests/usb.rs and tests/rdpeusb/usb.rs), so disabling the lib test/doctest targets has no build or dependency-graph effect and matches the workspace convention (e.g., ironrdp-pdu). The rdpeusb invariants match the code: usb.rs contains no RequestId handling, while server.rs owns RequestIdAllocator and client.rs owns pending_io, exactly as documented and consistent with the review-thread wording resolution. No correctness, protocol, dependency, or maintainability issues found; the validated specialist aggregate reported no candidates.
|
Diff and validation for head
Note LLM-assisted content (no human feedback). |
Document
ironrdp-usb's allocation-free caller-owned storage and USB-format-only parsing boundary, and the RDPEUSB adapter's complete request translation.Keep request IDs, device state, and pending requests in the channel state machines and their backends, outside the translation module.
Disable the USB crate's inline unit-test and doctest targets so its tests use the centralized testsuite.
Co-authored-by: Copilot App 223556219+Copilot@users.noreply.github.com