Repository navigation
refactor: dynamic typing hardening - #54
Merged
Merged
Conversation
Plan to harden codebase against dynamic-typing pitfalls including magic numbers, stringly-typed patterns, unnamed tuples, and plain dicts with known schemas. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…verrides Phase 1 of dynamic typing hardening: - Add 11 named constants to const.py replacing magic numbers across client.py, cli.py, and TUI modules - Add kebab_name() utility and centralized display_name() overrides in models.py for consistent enum display across CLI and TUI - Replace unnamed tuples with NamedTuples in cli.py, tui/app.py, tui/widgets.py, tui/media_theme_screen.py, tui/flame_color_screen.py, and tui/color_screen.py - Replace dict return of _parse_login_page() with _B2CLoginFields NamedTuple in b2c_login.py - Add _WireParam TypedDict and Literal["GET","POST"] in client.py Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Phase 2 of dynamic typing hardening: - Replace 5 hand-maintained string-to-enum lookup dicts in cli.py with kebab_name()-based auto-generation from enum definitions - HeatMode lookup uses explicit member subset (NORMAL, BOOST, ECO) - Replace fragile '"status":"400"' string matching in b2c_login.py with proper json.loads() parsing and try/except fallback Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Phase 3 of dynamic typing hardening: - Remove duplicate _FIRE_MODE_DISPLAY and _FLAME_COLOR_DISPLAY dicts from cli.py, replacing with centralized display_name() from models.py - Remove duplicate _MODE_DISPLAY dict from tui/widgets.py - Add module-level assert validating _FEATURE_LABELS field names against FireFeatures dataclass fields - Add module-level assert validating _FLAME_EFFECT_SETTERS field names against FlameEffectParam dataclass fields Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
All 6 tasks across 3 phases completed successfully. All 1075 tests pass with zero linting or type errors. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
deviantintegral
marked this pull request as ready for review
March 2, 2026 12:17
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.
No description provided.