Repository navigation
refactor: delete dead dump_header + add Motion IR single-source CI guard (S5) - #289
Merged
Merged
Conversation
S5 (final cleanup) of the Motion IR epic. Removes `WindDefinition.dump_header` (superseded by `gcode/serializer.py::_render_header` and never called) and its now-orphaned `json` import; the serializer docstring no longer points at it. Adds `tests/test_motion_ir_invariants.py`, a CI guard locking in the epic's single-source-of-truth: the O1 surface-arc distance (`math.sqrt(`) lives only in `planning/metrics.py`, dialect sniffing (`_detect_dialect`) and the `; Parameters` header parse live only in `gcode/reader.py`, and `ast.literal_eval` stays gone. The grep fails loudly if a duplicate motion-math or G-code re-parser reappears. No behavior change: 157 passed, example G-code byte-equal, no OpenAPI drift. Closes #136 slice S5.
Two fixes surfaced by the pre-close adversarial review of the epic: - Update the stale plotter module docstring — it still claimed segment tracking was "deliberately G92-blind", contradicting the shipped S4 code, which honors G92 (resets the reference frame on SET_POSITION). - Widen the invariant guard to scan fiberpath_cli/ and fiberpath_api/ as well, so a duplicate motion-math or G-code re-parser reintroduced at the CLI/API boundary is caught too (previously only fiberpath/ was scanned). No behavior change: 157 passed; ruff/mypy clean.
15 tasks done
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.
S5 of #136 (final cleanup) — closes #288.
Removes
WindDefinition.dump_header(superseded byserializer._render_header, never called) + its orphanedjsonimport. Addstests/test_motion_ir_invariants.py— a grep-based CI guard locking the epic's single-source-of-truth:math.sqrt() → onlyplanning/metrics.py_detect_dialect) +; Parametersheader parse → onlygcode/reader.pyast.literal_evalstays goneFails loudly if a duplicate motion-math or G-code re-parser reappears. No behavior change: 157 passed, example G-code byte-equal, no OpenAPI drift. After this merges, epic #136 closes.