Repository navigation
fix(gui): align helical validation bounds with the planner - #173
Merged
Merged
Conversation
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.
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.
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:
schemas.py/ validators)lockDegrees,leadInMM,leadOutDegrees>= 0(allowed0)PositiveFloat(> 0)skipIndexint().nonnegative()(allowed0)PositiveInt(>= 1)windAngle(0, 90)/[0, 90][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],skipIndexpositive int, lock/lead-in/lead-outpositive().TDD
accepts zerotests (which encoded the bug) now flipped to assert rejection; added wind-angle boundary tests (90/0.5rejected,1/89accepted).