Add host UCSI source and USB-C TUI tab - #162
Draft
dymk wants to merge 4 commits into
Draft
Conversation
Upgrade crossbeam-epoch from 0.9.18 to 0.9.20 to address RUSTSEC-2026-0204. The dependency is pulled through the existing sysinfo/rayon graph used by ec-test-tui. Assisted-by: GitHub Copilot:gpt-5.6-sol Copilot-Session: 6cb7060d-6d47-49ad-a710-428fe4c2f3dc
Move the existing safe-to-deploy exemption from crossbeam-epoch 0.9.18 to the patched 0.9.20 release so cargo-vet accepts the lockfile security update. Assisted-by: GitHub Copilot:gpt-5.6-sol Copilot-Session: 6cb7060d-6d47-49ad-a710-428fe4c2f3dc
Add a read-only host UCSI slice so ec-test-lib and the ec-test-tui Ratatui app can query the secure-world UCSI stub over ACPI. ec-test-lib: - New platform-neutral `ucsi` module: small value types (version, capability, connector capability/status, CCI) plus 48-byte mailbox decoding that validates VERSION, CCI and the response data length. Kept off the Windows-only path so decode is unit-tested on Linux. - `UcsiSource` trait (get_version, get_capability, get_connector_capability, get_connector_status) added to the `Source` supertrait with an `Arc` forwarding impl. - Mock returns deterministic single-connector PD-sink fixtures. - Serial gains an `Unsupported` error (mapped to `ErrorKind::Other`) as it has no EC-side UCSI peer; it never fakes success. - Windows Acpi backend evaluates `\_SB.ECT0.USND` with an 8-byte CONTROL buffer and decodes the returned 48-byte mailbox. ec-test-tui: - Extend `DynSource` and the manual battery/thermal test doubles. - Add `UcsiState`/`UcsiUpdater` and a compact, stateless USB-C tab plus dashboard card modeled on the RTC module (version, connector 1 capability, connected sink status). Errors render honestly. Assisted-by: GitHub Copilot:claude-opus-4.8 Copilot-Session: 6cb7060d-6d47-49ad-a710-428fe4c2f3dc
Apply the independent code-judo findings, cutting LOC and concepts while preserving behavior and the unique tests. ec-test-lib: - Replace the public `Mailbox` + `Cci` intermediate types with two private helpers (`validate` / `message_in`) plus free `decode_*` functions. They enforce 48-byte length, VERSION 0x0120, cmd_complete, no error/not_supported, and the expected data length, then decode each response directly. - Flatten `UcsiConnectorCapability` (drop the `OperationMode` wrapper) and drop the unused CCI `busy` accessor and capability Type-C version field. `UcsiVersion` is retained since Source/TUI consume it. - Delete the duplicate Mock tests that mirrored the fixture constants; the retained updater test already exercises the Mock values. ec-test-tui: - Collapse the UCSI UI to one shared metric-row builder used by both the tab and the dashboard card; remove the dedicated panel renderers and redundant formatting helpers. Pending/error text stays honest. - Stop warning every poll for the steadily-unsupported serial backend; the Fetched error cells still surface the failure to the UI. - Give `DynSource` default UCSI methods so the battery/thermal test doubles need no stubs, reverting those files to pristine. - Drop the UI formatting tests that only mirrored string output. Assisted-by: GitHub Copilot:claude-opus-4.8 Copilot-Session: 6cb7060d-6d47-49ad-a710-428fe4c2f3dc
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
UcsiSourceabstractionECT0.USNDStack
Depends on the crossbeam advisory draft from branch
dymk/update-crossbeam-epoch. Until that merges, GitHub will show those prerequisite commits in this draft.Scope
Supports only UCSI version, capability, connector-capability, and connector-status reads for the deterministic one-connector stub. No CLI, notifications, or native UCSI class-driver integration.
Validation
Related