Skip to content

refactor(planning): validators over the pattern primitive + roadmap (S5) - #305

Merged
CameronBrooks11 merged 1 commit into
mainfrom
feat/299-s5-validators-over-primitive
Jun 29, 2026
Merged

CameronBrooks11 merged 1 commit into
mainfrom
feat/299-s5-validators-over-primitive

Conversation

@CameronBrooks11

Copy link
Copy Markdown
Member

Closes #299. Final slice of the Stage 2 epic #137 — merging this completes the epic.

What's here

  • Validators are now type-checkers over the primitive. validate_helical_layer reads its coverage parameters (skip_index, pattern_number, lock_degrees, lead_in_mm) from pattern_spec(layer) (the declarative PatternSpec) rather than the raw schema.
  • One uniform validation surface. New validate_layer(index, layer, mandrel, tow) → HelicalKinematics | None runs numeric bounds for every layer and the coverage checks for the laying patterned case (helical), returning the kinematics for the planner to reuse — None for hoop/skip, which carry no coverage pattern. The planner calls this single entry instead of branching on layer type.
  • Docs: roadmap marks Stages 1–2 done and notes where the unified primitive lives (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_spec is 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

  • Full suite 192 passed; goldens byte-equal; ruff format/ruff check/mypy clean.
  • New validate_layer tests: helical returns kinematics, coverage errors propagate, hoop/skip return None.

…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.
@CameronBrooks11
CameronBrooks11 merged commit 862a339 into main Jun 29, 2026
21 checks passed
@CameronBrooks11
CameronBrooks11 deleted the feat/299-s5-validators-over-primitive branch June 29, 2026 05:59
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.

Stage 2 / S5 — validators become spec type-checkers over the primitive + docs/roadmap

1 participant