Skip to content

refactor: exemplary __init__.py — bare re-exports, no __all__, process doc removed - #24

Merged
SuperElectron merged 5 commits into
stagingfrom
feat/v2-init-cleanup
Aug 27, 2026
Merged

refactor: exemplary __init__.py — bare re-exports, no __all__, process doc removed#24
SuperElectron merged 5 commits into
stagingfrom
feat/v2-init-cleanup

Conversation

@SuperElectron

Copy link
Copy Markdown
Owner

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

  • Every __init__.py is 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.md deleted — 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-pattern scaffold and the test-fixture unit writer emit the same minimal shape, so future units and fixtures model the style automatically.
  • __main__.py untouched (standard thin package entry points, settled).

Net: 171 files, +297/−1352.

Verification

make check green (546 tests; mypy --strict on 360 files is the referee for the re-export form), uv build clean, documented import contract verified (from patterns.structural.decorator import retry, logged), three demos run. Orchestrator review pass: repo-wide asserts that every __init__.py is empty or pure as-alias lines.

Held for Mat's review — do not merge.

🤖 Generated with Claude Code

SuperElectron and others added 5 commits August 27, 2026 14:06
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>
@SuperElectron
SuperElectron merged commit 70fb0de into staging Aug 27, 2026
3 checks passed
@SuperElectron
SuperElectron deleted the feat/v2-init-cleanup branch August 27, 2026 21:16
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