Repository navigation
feat: warn on known trigger-source coercion via capability flags - #176
Merged
Merged
Conversation
…acy, advisory-check safety) Claude-Session: https://claude.ai/code/session_01JADNk6BTZoHFRgtSQSfpXe
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
little-did-I-know
deleted the
worktree-trigger-quirk-capability-flags
branch
September 3, 2026 14:10
4 tasks done
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.
Description
Pilot for moving known SCPI hardware quirks from comment-only documentation into typed, driver-consumed
ModelCapabilityflags. This PR migrates exactly one quirk: the SDS824X HD's silent trigger-source coercion (EX/EX5never take, and a disabled channel is coerced toLINE), already measured and documented intrigger.py/scpi_commands.pycomments but never acted on by the driver.Related Issues
Fixes #
Type of Change
Changes Made
unreliable_trigger_sources: FrozenSet[str]andwarns_on_disabled_trigger_channel: booltoModelCapability(scpi_control/models.py), populated only for"SDS824X HD"— every other registry entry keeps safe defaults until measured.Trigger.source's setter (scpi_control/trigger.py): it now logs alogger.warning(...)before writing a trigger source the connected model is known to silently coerce, without changing what gets written to the instrument.isinstance(cap, ModelCapability)(not a bareis None/truthy check) so it's a safe no-op against the plainunittest.mock.Mock()scopes used throughout the existing trigger test suite.try/exceptso a query failure degrades to "can't check" rather than blocking the write — this mechanism is advisory only, per the design spec.Trigger.sourcedocstring anddocs/user-guide/trigger-control.mdto describe the new warning while preserving "read it back" guidance for unmeasured models.docs/about/changelog.md).Design spec:
docs/superpowers/specs/2026-09-02-trigger-quirk-capability-flags-design.md(local, not committed — this repo'sdocs/superpowers/convention is untracked working notes).Testing
pytest tests/)Test Details
Test environment:
Test results:
New tests:
tests/test_models.py(capability flag defaults/values),tests/test_trigger_coercion_warnings.py(warning fires forEX/EX5/disabled-channel, does not fire forLINE/enabled channel/unflagged models/plain-Mock test doubles), plus a mutation check (verified during development, not committed) proving the new tests fail when the flags are cleared.Code Quality
make lintpasses)make format)Documentation
Checklist
Additional Notes
This is a pilot. If it holds up in review, the same pattern (measured facts on
ModelCapability,isinstance-guarded consumer) is intended to extend to three other known quirks that are explicitly out of scope here:code_per_divsharing, the:WAVeform:POINttrap, and the SPD1000X OVP fall-through. A final whole-branch review flagged that those three are behavior-affecting rather than advisory, so the field-naming convention (warns_on_disabled_trigger_channelnames the driver's reaction, not the hardware fact) should be revisited before that follow-up work, andModelCapability's flat field list is worth nesting into aquirkssub-dataclass once a second quirk lands.https://claude.ai/code/session_01JADNk6BTZoHFRgtSQSfpXe