refactor: exemplary __init__.py — bare re-exports, no __all__, process doc removed - #24
Merged
Merged
Conversation
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…rinciple __init__ files Unit root imports through .pattern; pattern/__init__ imports from defining modules; export_plugins keeps its load-bearing plugin import with a one-line why. No __all__, no docstrings anywhere in scope. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…-exports Unit root and pattern/__init__ hold only 'from .pattern.<mod> import X as X' lines; example package inits empty; no __all__, docstrings, or comments. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
src/design_patterns/__init__.py emptied (version via importlib.metadata); conftest's synthetic unit models the as-alias house style; code-review.md removed and its references folded inline; scaffold emits the minimal shape; house rule recorded in CLAUDE.md/AGENTS.md. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…' into feat/v2-init-cleanup
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.
Per
.cache/plan-v2.md(approved): the catalog is served to agents over MCP, so every file — dunder files included — must model Python best practice.What
__init__.pyis now empty unless it needs content. The only non-empty ones are each unit's two API files (unit root +pattern/), reduced to bare PEP 484 re-exports (from .pattern.chain import Chain as Chain— the form mypy --strict requires for explicit re-export, replacing__all__), plus one load-bearing example init (registry's import-time caveat demo, with a one-line comment saying why it exists).__all__is gone from the entire repo (the only remaining mentions are the CLAUDE.md house rule banning it)..github/code-review.mddeleted — process content the product never uses; its load-bearing parts (house rules, mutation discipline one-liner) live inline in CLAUDE.md / docs/contributing.md./new-patternscaffold and the test-fixture unit writer emit the same minimal shape, so future units and fixtures model the style automatically.__main__.pyuntouched (standard thin package entry points, settled).Net: 171 files, +297/−1352.
Verification
make checkgreen (546 tests; mypy --strict on 360 files is the referee for the re-export form),uv buildclean, documented import contract verified (from patterns.structural.decorator import retry, logged), three demos run. Orchestrator review pass: repo-wide asserts that every__init__.pyis empty or pure as-alias lines.Held for Mat's review — do not merge.
🤖 Generated with Claude Code