Repository navigation
refactor(planning): validators over the pattern primitive + roadmap (S5) - #305
Merged
Merged
Conversation
…mitive Stage 2 / S5 (#299). The coverage validation (skipIndex<patternNumber, gcd coprimality, circuit divisibility, lockDegrees slot math) now reads its parameters from the declarative PatternSpec rather than the raw schema, and a single validate_layer entry validates every layer type -- numeric bounds for all, coverage checks for the laying patterned (helical) case, returning the kinematics for the planner to reuse (None for hoop/skip, which carry no coverage pattern). The planner calls the one entry instead of branching on layer type. Behavior-preserving and byte-safe (helical_spec is a verbatim projection of the coverage fields, so every check is unchanged; goldens untouched). Also mark Stages 1-2 done in the roadmap and note where the unified primitive lives. Closes #137.
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.
Closes #299. Final slice of the Stage 2 epic #137 — merging this completes the epic.
What's here
validate_helical_layerreads its coverage parameters (skip_index,pattern_number,lock_degrees,lead_in_mm) frompattern_spec(layer)(the declarativePatternSpec) rather than the raw schema.validate_layer(index, layer, mandrel, tow) → HelicalKinematics | Noneruns numeric bounds for every layer and the coverage checks for the laying patterned case (helical), returning the kinematics for the planner to reuse —Nonefor hoop/skip, which carry no coverage pattern. The planner calls this single entry instead of branching on layer type.pattern.py+developed.py).Honesty note
Hoop and skip have no coverage pattern by nature, so "uniform" here means a single spec-based entry that validates every layer — not inventing constraints for hoop/skip. The coverage math stays where it's meaningful (helical,
pattern_number > 1).Behavior-preserving + byte-safe
helical_specis a verbatim projection of the coverage fields, so every check (and error message) is unchanged; no G-code output changes and all goldens are untouched. An adversarial review confirmed field-by-field equivalence, no skipped/spurious validation, no circular import, and accurate docs — no blockers.Verification
ruff format/ruff check/mypyclean.validate_layertests: helical returns kinematics, coverage errors propagate, hoop/skip returnNone.