Skip to content

Audit follow-up: leaner tests, app defaults from Config, two small fixes - #7

Merged
Rigare merged 4 commits into
mainfrom
claude/audit-cleanup
Oct 3, 2026
Merged

Rigare merged 4 commits into
mainfrom
claude/audit-cleanup

Conversation

@Rigare

@Rigare Rigare commented Oct 3, 2026 •

Copy link
Copy Markdown
Owner

Follow-up to an over-engineering audit of the repo. Four self-contained commits:

1. Tests: drop redundant tests, sharpen the weak ones

  • Removed what another test or the shipped code already pins: TestConfigDefaults (literal checks), three file_hash tests implied by test_known_content, the selection_key / is_rotation_axis mapping tests (both branches run through AppTest), unused cylinder fixtures, no-throw dilate / decimation tests, the individual_recess_positions signature check, five unused imports.
  • Sharpened tests that could not fail for the reason they exist:
    • TestEffectiveWorkers pins os.cpu_count: on the 4-core CI runner min(100, 4) is 4 with or without the RAM cap.
    • Removed build_inlay keywords are checked by calling, since a signature check misses a **kwargs swallowing them; no fixture needed.
    • The rotation order test rebuilt the implementation's own matrices; it now pins where the unit vectors land (order and direction).
    • normalize("de.UTF-8") / "de.utf8": the only inputs that need the split at ., previously uncovered.
    • Four stale DYNAMIC_KEYS entries.

2. Simplify app and pipeline plumbing; the app starts from Config's defaults

  • Widgets start at inlayer.Config.<field> like the CLI instead of literals of their own (new AppTest, one sentence in AGENTS.md).
  • The per-axis plain session key is gone: only _requantize_axes read it, the stored per-figure values stay the source. Rewriting the display keys on every run is what keeps them while a section is hidden (Streamlit only drops hidden widget state that nothing set) - documented in the docstring.
  • One gap callback instead of two mirrored ones; single-use aliases inlined; euler_matrix ("sxyz" == Rz·Ry·Rx); messages folded into _RANGE_RULES; _is_manifold inlined.

3. German thousands separator in pipeline logs; show the gap's help text

  • The German CLI printed "1,448 Dreiecke"; counts now go through i18n.format_int.
  • The gap help sat on a slider with a collapsed label, where Streamlit never shows a tooltip; it now sits on the caption.

4. Packaging: stale docker-compose.yml entry in .dockerignore, outdated manifold3d comment in requirements.txt.

Deliberately unchanged: folding the gap row into _axis_row (would change the UI) and the web app's figure.stl fallback (product decision).

Test plan

  • Full suite locally on Python 3.13: 409 passed (was 419: 28 removed or replaced, 18 new); commits 1-3 green on their own
  • New and rewritten tests fail when their bug is reintroduced (RAM cap, **kwargs, rotation order, normalize, step requantization, app defaults, gap tooltip, log separator)
  • pyrefly check: the same 21 pre-existing errors as main, none new
  • Docker test stage and runtime smoke test (CI)
  • Gap tooltip visible in the browser

🤖 Generated with Claude Code

Marco Wittwer and others added 4 commits October 3, 2026 00:58
Follow-up to an over-engineering audit of the suite.

Removed, because another test or the shipped code already pins the same:
- TestConfigDefaults: ten literal checks. A changed default is a deliberate
  edit; what can drift is a second copy of the defaults, so test_app_render
  now checks that the web app starts with Config's values.
- three file_hash tests implied by test_known_content, the selection_key and
  is_rotation_axis mapping tests (both branches run through AppTest and
  quantize_axis_value), the unused cylinder fixtures, two no-throw dilate
  tests, a decimation test that only checked "no error", the signature check
  for individual_recess_positions and five unused imports.

Sharpened, because they could not fail for the reason they exist:
- TestEffectiveWorkers pins os.cpu_count: on the 4-core CI runner
  min(100, 4) is 4 with or without the RAM cap.
- Removed build_inlay keywords are checked by calling - a signature check
  misses a **kwargs swallowing them. Binding fails before the body runs, so
  the test needs no fixture any more.
- The rotation order test rebuilt the implementation's own matrices; it now
  pins where the unit vectors land (order and direction).
- normalize: "de.UTF-8" and "de.utf8" are the only inputs that need the
  split at "." and no case covered them.
- DYNAMIC_KEYS lost four keys app.py now passes as literals.

New: format_int per language; a coarser rotation step snaps slider, number
field and stored value together; the gap's number field sets the gap.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ults

- app.py read its start values from literals of its own (value=0.4, 2.0,
  ...) while the CLI reads Config's defaults - nothing kept the two in sync.
  Every widget with a Config counterpart now starts at inlayer.Config.<field>,
  like the CLI; test_app_render checks it and AGENTS.md records it.
- The per-axis plain session key (offset_x, rot_z, ...) is gone. Only
  _requantize_axes read it, to rewrite the slider and number field from it;
  it now rewrites them from the slider itself. The stored per-figure values
  stay the source, and rewriting the keys on every run is what keeps them
  while their section is hidden - documented in the docstring.
- One gap callback with args instead of two mirrored ones; GAP_KEYS names
  the three keys that move together.
- Single-use aliases _file_hash and _selection_key inlined.
- apply_euler_rotation uses trimesh's euler_matrix ("sxyz" is Rz·Ry·Rx,
  identical to the hand-built product); the zero-rotation branch went too,
  apply_transform skips an identity matrix anyway.
- Each range rule carries its message; the parallel _RANGE_MESSAGES dict
  is gone. _is_manifold (one caller) is inlined.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- The pipeline formatted triangle counts with f"{n:,}" in every language,
  so the German CLI printed "1,448 Dreiecke" - a decimal number to a German
  reader. The ten counts now go through i18n.format_int, like the app's
  triangle metric already did.
- The gap slider carried the help text, but Streamlit only shows a tooltip
  next to a visible label and that slider's label is collapsed - the text
  was never displayed. It now sits on the caption above slider and number
  field.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- .dockerignore listed docker-compose.yml, a file the repo never had (it
  ships compose.yaml). The note on why the Dockerfile stays in the build
  context now closes the file instead of sitting above an unrelated entry.
- requirements.txt still said build_inlay calls trimesh.boolean with
  engine='manifold'; it calls manifold3d directly.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Rigare
Rigare merged commit 7a4a533 into main Oct 3, 2026
2 checks passed
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.

1 participant