refactor: wave 6 — ratchet mypy coverage + link clean-code standard#53
Merged
refactor: wave 6 — ratchet mypy coverage + link clean-code standard#53
Conversation
Polish pass closing out the refactor series. pyproject.toml -------------- - Drop skillforge/engine/scorer.py from the mypy exclusion list. After Wave 2's logging cleanup it now type-checks clean at the default level. Mypy now covers 65 source files (up from 64). CLAUDE.md --------- - Add docs/clean-code.md to the Key Reference Documents list. - Expand the Code Style TL;DR with the five load-bearing rules the refactor waves actually enforced (no bare except, no print in library code, no mutable module globals, no raw fetch in React components, file-size ceilings) so the standard is discoverable from the project root. QA -- ruff check skillforge - clean mypy skillforge - 65 files pass pytest tests/ - 403 passed, 2 skipped frontend build/lint/test - all green Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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
Wave 6 — closing polish on the clean-code refactor series.
Changes
pyproject.toml— dropsskillforge/engine/scorer.pyfrom the mypy exclusion list. After Wave 2's logging cleanup it now type-checks clean at the default level. Mypy now covers 65 source files (up from 64). This establishes the ratchet pattern from the Wave 1 mypy config: as modules get cleaned up, they graduate out of the exclusion list instead of staying forever permissive.CLAUDE.md— two additions:docs/clean-code.mdadded to the Key Reference Documents list.printin library code, no mutable module globals, no rawfetch()in React components, file-size ceilings (500 LOC Python / 400 LOC TSX).So the standard is discoverable from the project root by anyone (human or AI) working on the repo.
Test plan
uv run ruff check skillforge— cleanuv run mypy skillforge— 65 files pass (was 64)uv run pytest tests/— 403 passed, 2 skippedcd frontend && npm run build/lint/format:check/test— all greenThe refactor series
After this PR merges, the refactor is complete end-to-end:
docs/clean-code.md— the standarderrors.py+ typed exceptions + kill prints + de-duped JSON +run_registry.pyeliminates mutable globalsdb/queries.py1363 LOC → 7-submodule packageapi/routes.py704 LOC → 4-submodule packageAtomicRunDetail.tsx(738 → 625 LOC, 7 useEffect → 0, 9 useState → 1, 6 fetch → 0)Deferred (explicitly)
PackageExplorer,SpecializationInput,PipelineSteps,EvolutionArena(4 components still >400 LOC). The infrastructure is ready — each can be converted to the Wave 4 pattern when opened for other reasons.spawner.py,breeder.py,variant_evolution.py. These want "pure planner + thin I/O shell" refactors that benefit from a specific feature change to motivate them.🤖 Generated with Claude Code