Cleanup pass: remove dead code, fix pre_clamp_temp diagnostic bug#6
Merged
alchemystack merged 1 commit intomainfrom Mar 27, 2026
Merged
Cleanup pass: remove dead code, fix pre_clamp_temp diagnostic bug#6alchemystack merged 1 commit intomainfrom
alchemystack merged 1 commit intomainfrom
Conversation
- 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.
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.
Summary
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. Capturedraw_tempbefore clamping so the diagnostic correctly shows what the formula produced before bounds were applied._encode_svarint()fromentropy_service_pb2.py— ZigZag encoding is only needed forsint32/sint64proto field types, none of which appear in this proto.import inspectinprocessor.pypromoted from inside_accepts_config()to the module-level imports block._entry_points_loaded = Falsere-assignment intest_broken_entry_point_does_not_crash(the flag was already setFalseon the line immediately above).Fixed,Removed, andChangedentries.Test plan
pytest tests/ -q— 308 passed, 0 failedruff check src/ tests/— all checks passedmypy --strict src/— no issues found in 30 source files