Skip to content

fix(planning): reject helical lead-in >= mandrel wind length - #167

Merged
CameronBrooks11 merged 1 commit into
mainfrom
fix/reject-lead-in-exceeding-wind-length
Jun 25, 2026
Merged

CameronBrooks11 merged 1 commit into
mainfrom
fix/reject-lead-in-exceeding-wind-length

Conversation

@CameronBrooks11

Copy link
Copy Markdown
Member

Bug B2 from the latent-bug audit (verified by execution — produced X-1 … X-50 G-code).

Problem

No validator checked leadInMM against windLength. A helical layer with leadInMM >= windLength passed validation, then generated G-code that drove the carriage off the end of the mandrel into negative coordinates and inverted the main-pass mandrel rotation — a real end-stop-collision risk on hardware.

Fix

Add an explicit leadInMM >= windLength check to validate_helical_layer, raising the standard LayerValidationError (→ HTTP 400 / clean CLI error).

TDD

  • RED: test_validate_helical_layer_rejects_lead_in_exceeding_wind_length (leadInMM=150, windLength=100) failed ("DID NOT RAISE") before the fix.
  • GREEN: passes after. Full suite 122 passed, ruff/format/mypy clean.

A helical layer with leadInMM >= the mandrel windLength passed all
validation but produced G-code that ran the carriage off the end of the
mandrel into negative coordinates and inverted the main-pass mandrel
rotation, risking an end-stop collision. Add an explicit check in
validate_helical_layer with a regression test.
@CameronBrooks11
CameronBrooks11 merged commit b25ce20 into main Jun 25, 2026
18 checks passed
@CameronBrooks11
CameronBrooks11 deleted the fix/reject-lead-in-exceeding-wind-length branch June 25, 2026 21:11
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