Skip to content

refactor: wave 6 — ratchet mypy coverage + link clean-code standard#53

Merged
ty13r merged 1 commit intomainfrom
refactor/wave-6-polish
Apr 19, 2026
Merged

refactor: wave 6 — ratchet mypy coverage + link clean-code standard#53
ty13r merged 1 commit intomainfrom
refactor/wave-6-polish

Conversation

@ty13r
Copy link
Copy Markdown
Owner

@ty13r ty13r commented Apr 19, 2026

Summary

Wave 6 — closing polish on the clean-code refactor series.

Changes

pyproject.toml — drops 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). 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:

  1. docs/clean-code.md added to the Key Reference Documents list.
  2. Code Style TL;DR expanded with the five load-bearing rules the refactor waves enforced: no bare except, no print in library code, no mutable module globals, no raw fetch() 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 — clean
  • uv run mypy skillforge — 65 files pass (was 64)
  • uv run pytest tests/ — 403 passed, 2 skipped
  • cd frontend && npm run build/lint/format:check/test — all green

The refactor series

After this PR merges, the refactor is complete end-to-end:

Wave PR What it did
0 direct to main docs/clean-code.md — the standard
1 #48 mypy + eslint + prettier + pre-commit + CI + 45 pre-existing lint fixes + 2 flaky test fixes
2 #49 errors.py + typed exceptions + kill prints + de-duped JSON + run_registry.py eliminates mutable globals
3a #50 db/queries.py 1363 LOC → 7-submodule package
3b #51 api/routes.py 704 LOC → 4-submodule package
4 #52 TanStack Query API layer + converted AtomicRunDetail.tsx (738 → 625 LOC, 7 useEffect → 0, 9 useState → 1, 6 fetch → 0)
6 this PR mypy ratchet + link the standard from CLAUDE.md

Deferred (explicitly)

  • Frontend hotspot decomposition for 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.
  • Agent/engine decomposition for 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

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>
@ty13r ty13r merged commit 0a01375 into main Apr 19, 2026
2 checks passed
@ty13r ty13r deleted the refactor/wave-6-polish branch April 19, 2026 18:35
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