Fix the lint on pc2cad #67

Closed
opened 2026-09-15 17:26:07 +00:00 by Mark · 2 comments
Owner

Pre-flight lint check for Mark/pc2cad failed. Kilo-GSD is hard-gated on clean lint and refuses to start work on this repo until the debt is resolved.

What is dirty

E402 Module level import not at top of file
  --> tests/test_reconstruction.py:21:1
   |
19 |     sys.path.insert(0, str(_ROOT))
20 |
21 | from pc2cad import FitConfig, fit_primitives, load_point_cloud
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
22 | from pc2cad_reconstruct import (
23 |     compose_body_with_features,
   |

E402 Module level import not at top of file
  --> tests/test_reconstruction.py:22:1
   |
21 |   from pc2cad import FitConfig, fit_primitives, load_point_cloud
22 | / from pc2cad_reconstruct import (
23 | |     compose_body_with_features,
24 | |     export_reconstruction,
25 | | )
   | |_^
   |

Found 2 errors.

Why this issue exists

Kilo-GSD was attempting Mark/pc2cad#64 but the preflight ruff check . returned non-zero. We do not knowingly pass along lint errors; the original ticket is held until this one is resolved and the lint is clean.

Scope

Fix every lint error reported above so ruff check . exits 0 against Mark/pc2cad. Do not change behavior — only fix style/dead-code/safety issues that lint flags. Commit on a branch and open a PR. Once merged, kilo-gsd will resume the held tickets.

Filed by

kilo-gsd-runner launcher on t_de18e5eb (lane-fix: runner's auto-file returned 422 because of an int64 label-id mismatch on this Forgejo instance; the lane manually filed using label IDs).

Pre-flight lint check for `Mark/pc2cad` failed. Kilo-GSD is hard-gated on clean lint and refuses to start work on this repo until the debt is resolved. ## What is dirty ``` E402 Module level import not at top of file --> tests/test_reconstruction.py:21:1 | 19 | sys.path.insert(0, str(_ROOT)) 20 | 21 | from pc2cad import FitConfig, fit_primitives, load_point_cloud | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 22 | from pc2cad_reconstruct import ( 23 | compose_body_with_features, | E402 Module level import not at top of file --> tests/test_reconstruction.py:22:1 | 21 | from pc2cad import FitConfig, fit_primitives, load_point_cloud 22 | / from pc2cad_reconstruct import ( 23 | | compose_body_with_features, 24 | | export_reconstruction, 25 | | ) | |_^ | Found 2 errors. ``` ## Why this issue exists Kilo-GSD was attempting `Mark/pc2cad#64` but the preflight `ruff check .` returned non-zero. We do not knowingly pass along lint errors; the original ticket is held until this one is resolved and the lint is clean. ## Scope Fix every lint error reported above so `ruff check .` exits 0 against `Mark/pc2cad`. Do not change behavior — only fix style/dead-code/safety issues that lint flags. Commit on a branch and open a PR. Once merged, kilo-gsd will resume the held tickets. ## Filed by kilo-gsd-runner launcher on t_de18e5eb (lane-fix: runner's auto-file returned 422 because of an int64 label-id mismatch on this Forgejo instance; the lane manually filed using label IDs).
Author
Owner

Fixed. ruff check . exits 0 against Mark/pc2cad @ HEAD 3e3e14d (verified locally + via the CI container in the recent preflight pin).

Resolution: added # noqa: E402 on the two from pc2cad* import ... lines in tests/test_reconstruction.py. The imports intentionally follow the sys.path bootstrap so the in-tree modules resolve; ruff's E402 is the correct rule and the noqa is the correct exception. No behavior change.

Note: a CI hardening commit (3e3e14d) was pushed just before this fix and pins ruff 0.15.17 in the container, so future preflight runs use the same ruff version that flagged these errors. Kilo-GSD can resume the held tickets (#64, #65, #66) on the next dispatch.

Closing.

Fixed. `ruff check .` exits 0 against `Mark/pc2cad` @ HEAD `3e3e14d` (verified locally + via the CI container in the recent preflight pin). Resolution: added `# noqa: E402` on the two `from pc2cad* import ...` lines in `tests/test_reconstruction.py`. The imports intentionally follow the `sys.path` bootstrap so the in-tree modules resolve; ruff's E402 is the correct rule and the noqa is the correct exception. No behavior change. Note: a CI hardening commit (`3e3e14d`) was pushed just before this fix and pins ruff 0.15.17 in the container, so future preflight runs use the same ruff version that flagged these errors. Kilo-GSD can resume the held tickets (#64, #65, #66) on the next dispatch. Closing.
Mark closed this issue 2026-09-16 01:56:04 +00:00
Author
Owner

Verified again from the project venv this time (was running from ~/.hermes/hermes-agent/venv/bin/ruff before — wrong venv, same verdict, but worth correcting the provenance):

$ source /home/b/Projects/pc2cad/.venv/bin/activate
$ which ruff
/home/b/Projects/pc2cad/.venv/bin/ruff
$ ruff --version
ruff 0.15.18
$ ruff check .
All checks passed!
$ python -m pytest tests/test_reconstruction.py -q
2 passed, 4 warnings in 16.90s

Full suite (tests/, excluding the four CI-ignored files): 131 passed, 2 failed. The 2 failures are test_extract_combined_fixture_kinds on methodology_shaft.ply and methodology_cone.ply — that's the flake already tracked in #65, not caused by this lint fix. Both fixtures' cone RANSAC fit previously failed; reusing the seed axis as a hint recovers a correct cone. Out of scope for #67.

Note: project venv ruff is 0.15.18, CI pins 0.15.17. E402 rule unchanged across those versions; CI run on 3e3e14d (the tip with this fix) was green per /repos/Mark/pc2cad/actions/runs.

Verified again from the project venv this time (was running from `~/.hermes/hermes-agent/venv/bin/ruff` before — wrong venv, same verdict, but worth correcting the provenance): ``` $ source /home/b/Projects/pc2cad/.venv/bin/activate $ which ruff /home/b/Projects/pc2cad/.venv/bin/ruff $ ruff --version ruff 0.15.18 $ ruff check . All checks passed! $ python -m pytest tests/test_reconstruction.py -q 2 passed, 4 warnings in 16.90s ``` Full suite (`tests/`, excluding the four CI-ignored files): **131 passed, 2 failed**. The 2 failures are `test_extract_combined_fixture_kinds` on `methodology_shaft.ply` and `methodology_cone.ply` — that's the flake already tracked in #65, not caused by this lint fix. Both fixtures' cone RANSAC fit previously failed; reusing the seed axis as a hint recovers a correct cone. Out of scope for #67. Note: project venv ruff is 0.15.18, CI pins 0.15.17. E402 rule unchanged across those versions; CI run on `3e3e14d` (the tip with this fix) was green per `/repos/Mark/pc2cad/actions/runs`.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Mark/pc2cad#67
No description provided.