Skip to content

Add device inventory query support#22

Merged
slideep merged 3 commits into
mainfrom
codex/device-inventory-query
May 19, 2026
Merged

Add device inventory query support#22
slideep merged 3 commits into
mainfrom
codex/device-inventory-query

Conversation

@slideep
Copy link
Copy Markdown
Contributor

@slideep slideep commented May 19, 2026

Summary

Add device-status and --device-query support for selecting and reporting adb-visible devices.

What changed

  • add device inventory normalization for adb devices -l
  • add device-status with explicit inventory metadata plus readiness details
  • keep query parsing and selector resolution in CLI routing instead of host/infrastructure contracts
  • add focused tests, including an exact device-status command-envelope contract test
  • document the new command usage

Validation

  • dotnet build .\\Luotsi.sln
  • AdbReadinessTests (23 passing)

Notes

This keeps host interfaces focused on raw device operations while the CLI layer owns command-specific query and envelope behavior.

Copilot AI review requested due to automatic review settings May 19, 2026 12:05
Comment thread Luotsi.Cli.Tests/AdbReadinessTests.cs Fixed
Comment thread Luotsi.Cli.Tests/AdbReadinessTests.cs Fixed
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a normalized “device inventory” layer on top of adb devices -l, introduces a new device-status command (inventory metadata + preflight/readiness), and adds --device-query for selecting a single target device in CLI routing (kept out of host/infrastructure contracts).

Changes:

  • Introduces normalized device inventory models (DeviceState) and inventory derivation from DeviceListResult.
  • Adds device-status command and --device-query parsing/selection in CLI routing.
  • Adds focused tests for inventory derivation, device-status envelope contract, and --device-query selection behavior; updates help/docs.

Reviewed changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
Luotsi.Cli/Models/CommandResults.cs Adds new command result records for normalized inventory and device-status output.
Luotsi.Cli/Infrastructure/Devices/DeviceInventory.cs Implements normalization of adb devices -l rows into a richer DeviceState.
Luotsi.Cli/Cli/Routing/DeviceStatusResolver.cs Resolves the selected device’s inventory entry and combines it with preflight readiness.
Luotsi.Cli/Cli/Routing/DeviceSelectorResolver.cs Implements --device-query resolution before creating the “real” command host.
Luotsi.Cli/Cli/Routing/DeviceQuerySelector.cs Adds query parsing (key=value clauses) and single-device selection/erroring.
Luotsi.Cli/Cli/Routing/AppCommandFamilyRouter.cs Wires device-query resolution into default command routing before host creation.
Luotsi.Cli/Cli/Routing/AppCommandDispatcher.cs Routes devices to inventory output and adds device-status command execution.
Luotsi.Cli/Cli/Help.cs Documents device-status and the new --device-query option in CLI help text.
Luotsi.Cli/Cli/CliOptions.cs Registers device-status as a known command token.
Luotsi.Cli.Tests/TestSupport.cs Enhances the fake factory to capture created host configurations for assertions.
Luotsi.Cli.Tests/AdbReadinessTests.cs Adds tests for inventory derivation, device-status contract, and device-query selection.
docs/commands.md Documents the new device-status command in the command reference.

Comment thread Luotsi.Cli/Infrastructure/Devices/DeviceInventory.cs
Comment thread Luotsi.Cli/Cli/Routing/DeviceQuerySelector.cs Outdated
Comment thread Luotsi.Cli/Cli/Routing/DeviceStatusResolver.cs
Comment thread docs/commands.md
Comment thread Luotsi.Cli.Tests/AdbReadinessTests.cs Fixed
@slideep slideep merged commit b1798e1 into main May 19, 2026
12 checks passed
@slideep slideep deleted the codex/device-inventory-query branch May 19, 2026 13:09
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.

2 participants