Skip to content

fix(gui): align helical validation bounds with the planner - #173

Merged
CameronBrooks11 merged 1 commit into
mainfrom
fix/align-helical-validation-bounds
Jun 25, 2026
Merged

CameronBrooks11 merged 1 commit into
mainfrom
fix/align-helical-validation-bounds

Conversation

@CameronBrooks11

Copy link
Copy Markdown
Member

Bug F2 from the latent-bug audit — validation-bound drift across three layers.

Problem

The same helical fields were bounded three different ways, with the GUI/Zod looser than the engine, so the editor accepted values the backend then rejected with a 422:

Field GUI / Zod (before) Engine (schemas.py / validators)
lockDegrees, leadInMM, leadOutDegrees >= 0 (allowed 0) PositiveFloat (> 0)
skipIndex Zod int().nonnegative() (allowed 0) PositiveInt (>= 1)
windAngle (0, 90) / [0, 90] enforced [1, 89] (90° → cos = 0)

Fix

Aligned all three sources to the engine (no runtime behavior change — the planner already enforced these; the GUI just stops promising otherwise):

  • helicalValidation.ts: lock/lead-out/lead-in require > 0.
  • components.ts: NUMERIC_RANGES.WIND_ANGLE → [1, 89] inclusive.
  • schemas.ts (Zod save gate): windAngle [1, 89], skipIndex positive int, lock/lead-in/lead-out positive().

TDD

  • The 3 stale accepts zero tests (which encoded the bug) now flipped to assert rejection; added wind-angle boundary tests (90/0.5 rejected, 1/89 accepted).
  • Full GUI suite 623 passed, tsc clean.

The editor's live validation, the NUMERIC_RANGES table, and the Zod save
gate all accepted values the engine rejects (PositiveFloat/PositiveInt; wind
angle enforced to [1, 89]). lockDegrees/leadInMM/leadOutDegrees allowed 0,
the save gate allowed skipIndex 0, and the wind angle range was (0, 90), so
the GUI accepted inputs that failed downstream planning with a 422.

Tighten lock/lead-out/lead-in to > 0, skipIndex to a positive integer, and
the wind angle to [1, 89] across all three layers. Flip the stale
'accepts zero' tests to assert rejection and add wind-angle boundary tests.
@CameronBrooks11
CameronBrooks11 merged commit a5d654f into main Jun 25, 2026
15 checks passed
@CameronBrooks11
CameronBrooks11 deleted the fix/align-helical-validation-bounds branch June 25, 2026 22:01
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