Skip to content

Commit 0a01375

Browse files
ty13rMatt (via Claude Code)claude
authored
refactor: wave 6 — ratchet mypy coverage, link clean-code standard (#53)
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: Matt (via Claude Code) <matt@skillforge.local> Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 22d03a8 commit 0a01375

2 files changed

Lines changed: 8 additions & 2 deletions

File tree

CLAUDE.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ Core loop: `skillforge/engine/evolution.py` (molecular) + `skillforge/engine/var
5454

5555
## Key Reference Documents
5656
- `docs/how-skld-works.md`**start here**: full system overview for first-time readers.
57+
- `docs/clean-code.md` — the review rubric every PR is held to (naming, functions, errors, data, async, functional idioms, React/TS, testing, comments, checklist).
5758
- `plans/SPEC-V2.0.md` — v2.0 architecture spec (taxonomy, agents, variants, evaluation, data model).
5859
- `plans/PLAN-V2.0.md` — v2.0 implementation plan (5 phases, 15 waves, file-by-file).
5960
- `plans/SPEC-V2.1.md` — v2.1 architecture spec (controlled evaluation environments, tiered challenge pools, train/test separation).
@@ -181,11 +182,17 @@ When running autonomously (overnight work, no active user):
181182
- **On hard block**: document in Progress Tracker with `[BLOCKED: reason]` marker, write a journal entry explaining what was tried, skip to any independent work, stop cleanly if no independent work remains.
182183

183184
## Code Style
185+
Full rubric: **`docs/clean-code.md`**. TL;DR:
184186
- Type hints everywhere. Dataclasses for internal models, Pydantic only at API boundary.
185187
- Async throughout — evolution engine is fully async.
186188
- No classes where functions suffice.
187-
- Short functions, clear names, minimal comments.
189+
- Short functions (≤50 lines), clear names, minimal comments.
188190
- Prefer composition over inheritance.
191+
- No bare `except Exception` — typed exceptions from `skillforge/errors.py`.
192+
- No `print` in library code — `logging` module with `logger.exception` inside excepts.
193+
- No mutable module globals — use `skillforge/engine/run_registry.py` or similar injected state.
194+
- No raw `fetch()` in React components — typed hooks from `frontend/src/api/hooks/`.
195+
- File ceilings: 500 LOC (Python), 400 LOC (TSX). Split into packages when they grow.
189196

190197
## Testing
191198
- Unit tests mock the Agent SDK.

pyproject.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,6 @@ exclude = [
8989
"^skillforge/engine/evolution\\.py$",
9090
"^skillforge/engine/export\\.py$",
9191
"^skillforge/engine/sandbox\\.py$",
92-
"^skillforge/engine/scorer\\.py$",
9392
"^skillforge/main\\.py$",
9493
"^skillforge/models/run\\.py$",
9594
]

0 commit comments

Comments
 (0)