Skip to content

Cleanup pass: remove dead code, fix pre_clamp_temp diagnostic bug#6

Merged
alchemystack merged 1 commit intomainfrom
claude/elated-ishizaka
Mar 27, 2026
Merged

Cleanup pass: remove dead code, fix pre_clamp_temp diagnostic bug#6
alchemystack merged 1 commit intomainfrom
claude/elated-ishizaka

Conversation

@alchemystack
Copy link
Copy Markdown
Owner

Summary

  • Fix: EDTTemperatureStrategy.diagnostics["pre_clamp_temp"] was silently reporting the wrong value whenever clamping was active — it re-computed the power-law expression after the result variable had already been overwritten by the clamp. Captured raw_temp before clamping so the diagnostic correctly shows what the formula produced before bounds were applied.
  • Remove: Dead _encode_svarint() from entropy_service_pb2.py — ZigZag encoding is only needed for sint32/sint64 proto field types, none of which appear in this proto.
  • Cleanup: import inspect in processor.py promoted from inside _accepts_config() to the module-level imports block.
  • Test: Removed a redundant _entry_points_loaded = False re-assignment in test_broken_entry_point_does_not_crash (the flag was already set False on the line immediately above).
  • Docs: CHANGELOG updated with Fixed, Removed, and Changed entries.

Test plan

  • pytest tests/ -q — 308 passed, 0 failed
  • ruff check src/ tests/ — all checks passed
  • mypy --strict src/ — no issues found in 30 source files

- Remove _encode_svarint() from entropy_service_pb2.py — ZigZag encoding
  is only needed for sint32/sint64 proto fields; none exist in this proto.

- Fix EDTTemperatureStrategy: diagnostics["pre_clamp_temp"] was silently
  wrong whenever the temperature hit edt_min_temp or edt_max_temp — it
  re-computed the power-law expression after the clamp variable had already
  been overwritten. Capture raw_temp before clamping and use it directly.

- Promote `import inspect` in processor.py to module level (was deferred
  inside _accepts_config() with no technical justification).

- Remove redundant _entry_points_loaded = False re-assignment in
  test_broken_entry_point_does_not_crash (set on the line immediately above
  with nothing between).

308 tests pass, ruff clean, mypy strict clean.
@alchemystack alchemystack merged commit 6c46c3b into main Mar 27, 2026
7 checks passed
@alchemystack alchemystack deleted the claude/elated-ishizaka branch March 27, 2026 15:01
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