Skip to content

Open Keithley USB resources with the device spelling - #130

Draft
test1card wants to merge 4 commits into
masterfrom
codex/keithley-usb-resource-nul
Draft

test1card wants to merge 4 commits into
masterfrom
codex/keithley-usb-resource-nul

Conversation

@test1card

Copy link
Copy Markdown
Owner

Laboratory failure corrected

The laboratory Keithley is configured with the canonical resource
USB0::0x05E6::0x2604::4083236::0::INSTR, while the installed VISA stack
enumerates the same physical device with one trailing NUL byte in the USB
serial token. Opening only the canonical spelling therefore failed before the
instrument could be used.

This change keeps the configured and durable instrument identity canonical
and control-free. At the transport-open boundary only, it accepts one unique
otherwise-identical enumerated USB-INSTR resource whose serial has exactly one
trailing NUL, and passes that raw device spelling to VISA. Other controls,
malformed or oversized enumeration, duplicate matches, and canonical-plus-NUL
ambiguity fail closed. Non-USB and direct-open fallback behavior is unchanged.

Evidence

The coordinator restored the exact old production open boundary and ran the
new production-path guard. It failed with pytest exit 1 because the canonical
resource was not openable. After byte-exact restoration of the correction:

  • Windows USBTMC scope: 73 passed;
  • Ubuntu 22.04 USBTMC scope: 72 passed, 1 existing Windows-only skip;
  • read-only Ruff lint and format checks passed on both operating systems;
  • the prevention-removal baseline gate passed: 7 tests;
  • the newly registered production-path guard passed in the USBTMC scope;
  • the fixed-point docs gate passed: 71 tests.

PR #98 also touches usbtmc.py, but only moves parent-death binding into a
shared module; it does not alter resource discovery or the transport-open
boundary. This is file contention, not a duplicate fix.

This pull request remains a draft until an exact-head Codex review has no
findings. Full hosted CI is deferred until then.

@test1card

Copy link
Copy Markdown
Owner Author

@codex review

Please review the exact head 438ad6c. Focus on whether canonical configured identity remains control-free, whether only one unique device-enumerated USB-INSTR spelling with exactly one trailing NUL in its serial token can reach open_resource, whether ambiguity and other controls fail closed, and whether non-USB/direct-open behavior is unchanged.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Nice work!

Reviewed commit: 438ad6c562

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-08-31T18:05:42.205229Z 438ad6c Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

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.

1 participant