Skip to content

Sanitize WHB04 spindle display values#681

Draft
righteousgambit wants to merge 2 commits into
Carvera-Community:developfrom
righteousgambit:agent/sanitize-pendant-spindle-display
Draft

Sanitize WHB04 spindle display values#681
righteousgambit wants to merge 2 commits into
Carvera-Community:developfrom
righteousgambit:agent/sanitize-pendant-spindle-display

Conversation

@righteousgambit

@righteousgambit righteousgambit commented Jul 13, 2026

Copy link
Copy Markdown

Closes #672

Summary

  • read curspindle with a zero default
  • normalize missing, malformed, and non-finite values to zero
  • clamp finite values, including integers outside float's range, to the WHB04 setter's 0..65535 range
  • add an eleven-case regression matrix that starts from a nonzero display value
  • add the unreleased changelog entry

The change only sanitizes what is shown on the pendant. It does not write CNC state or issue a spindle command.

Validation

Validated against develop@2ea66c10e96d88013a04441134d3d4f8e8c88510 with Python 3.11:

  • regression matrix on the pinned upstream base: 11 failed
  • adversarial test on the previous patch revision: 2 failed, 9 passed; both huge integers raised OverflowError
  • regression matrix with this change: 11 passed
  • ruff check passed for the source and test
  • git diff --check passed

Targeted command:

poetry run python -m pytest -q tests/unit/test_pendant_display.py

Changelog

- Fixed: Sanitize missing or malformed spindle values before updating the WHB04 display

Real branch verification

The repository's locked Poetry environment was installed from poetry.lock. The targeted suite passed on real fork commit 75dc25352e51, whose sole parent is pinned upstream develop@2ea66c10e96d88013a04441134d3d4f8e8c88510.

poetry run python -m pytest -q tests/unit/test_pendant_display.py

Result: 11 passed.

Quality gates on the real branch:

  • Ruff check: passed
  • Ruff format --check: passed
  • git diff --check 2ea66c10e96d88013a04441134d3d4f8e8c88510..75dc25352e51dbe834d00378715a6f516e2b19b0: passed

@SergeBakharev

Copy link
Copy Markdown
Contributor

Same as #677 (comment)

@righteousgambit

Copy link
Copy Markdown
Author

Addressed in 1cf1460bac5d.

The Quality Gate now runs poetry run ./scripts/install_linux_prereqs.sh after Poetry bootstrap, so the Ubuntu runner installs libhidapi-hidraw0, and then installs the remaining Xvfb/OpenGL test packages. The resulting workflow blob is byte-for-byte identical to the correction requested and applied on #677.

Local verification on the updated branch:

  • pendant regression suite: 11 passed
  • Ruff check and format check: passed
  • workflow validation (filtering the repository's pre-existing action.yml options diagnostic): passed
  • shell syntax and git diff --check: passed

The exact-head Quality Gate run is currently action_required with zero jobs, so it needs upstream approval before the runner can exercise the new prerequisite step.

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