Skip to content

--inspect refuses every scanner except the fi-8170, blocking the contribution we ask for #5

Description

@eliseorobles

Context

CONTRIBUTING.md and README.md both say the single most valuable contribution available is a hardware datapoint: run swift run scandeck-m0 --list and --inspect on your own duplex ADF scanner and report the vendorFeatures dump.

That is currently impossible on any device other than the fi-8170.

ImageCaptureScannerProbe.resolveAndOpenScanner() filters discovered devices through the USB allowlist before opening a session:

// Sources/ScanDeckScanner/ImageCaptureScannerProbe.swift:1302-1303
let candidates = discoveredScanners.filter {
    isSupportedScanner($0) && deviceMatchesSelection($0)
}

isSupportedScanner consults SupportedScanner.usbIdentities, which has exactly two entries (ScannerInventory.swift:23-25). So on any other scanner the probe reports "No supported fi-8170 USB scanner was found."

--list is not gated — it finishes with the full discoveredScanners count and prints name, transport, location and usb=vendor:product. Useful, but not the capability dump the matrix needs.

Why the allowlist exists — do not remove it

Its docstring gives the real reason, and it is a good one: the pipeline depends on duplex, 600 dpi, the configured scan area and the PFU cropping features, and a device missing any of them would produce output that looks plausible and is wrong.

That argument is about scanning, not about looking. --inspect opens a session, dumps capabilities, applies and verifies settings, and closes without scanning. It publishes nothing.

What to change

  1. Let --inspect proceed on an unsupported device — make the allowlist filter conditional on the probe's mode. .scan keeps today's behaviour; .inspect accepts any ICScannerDevice. ProbeMode is in Sources/ScanDeckScanner/ScannerProbeConfiguration.swift.
  2. Emit a clear unsupported banner before opening: something like "<name> (usb=0x…:0x…) is not a scanner ScanDeck can drive. Inspecting read-only; no scan will run."
  3. Leave --scan and the app's pass path exactly as they are. The inventory browser and status monitor must keep reading the same set.
  4. Update the failure copy — "No supported fi-8170 USB scanner was found" should not be what an inspection prints once inspection no longer requires support.
  5. Update the --inspect usage line in Sources/ScanDeckM0/main.swift.

Expect the capability gates to throw ProbeError.unsupported("duplex scanning") and friends on many devices. That is the datapoint — make sure the failure names which gate failed rather than aborting silently.

How to verify

swift build
swift run scandeck-m0 --list
swift run scandeck-m0 --inspect     # now opens a session on yours
swift test -c release

If you have any ICA-visible scanner, paste the --inspect output into the PR — that is a second contribution for free. If you have none, say so; the change still compiles and the suite still covers the seam. The maintainer will re-verify the fi-8170 path before merge, since that is the one behaviour that must not change.

See CONTRIBUTING.md.

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

    good first issueGood for newcomershelp wantedExtra attention is neededno-hardware-neededCan be done with just a Mac. No scanner required.scanner-supportWidening the set of scanners ScanDeck can drive.

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions