Skip to content

refactor: delete dead dump_header + add Motion IR single-source CI guard (S5) - #289

Merged
CameronBrooks11 merged 2 commits into
mainfrom
refactor/motion-ir-cleanup
Jun 28, 2026
Merged

CameronBrooks11 merged 2 commits into
mainfrom
refactor/motion-ir-cleanup

Conversation

@CameronBrooks11

Copy link
Copy Markdown
Member

S5 of #136 (final cleanup) — closes #288.

Removes WindDefinition.dump_header (superseded by serializer._render_header, never called) + its orphaned json import. Adds tests/test_motion_ir_invariants.py — a grep-based CI guard locking the epic's single-source-of-truth:

  • O1 surface-arc distance (math.sqrt() → only planning/metrics.py
  • dialect sniffing (_detect_dialect) + ; Parameters header parse → only gcode/reader.py
  • ast.literal_eval stays gone

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. After this merges, epic #136 closes.

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.
@CameronBrooks11
CameronBrooks11 merged commit 3f044b7 into main Jun 28, 2026
21 checks passed
@CameronBrooks11
CameronBrooks11 deleted the refactor/motion-ir-cleanup branch June 28, 2026 16:27
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.

S5 — delete dead scaffolding + CI guard for the Motion IR single source of truth

1 participant