00 epic final
Mission¶
Restructure src/rigplane/ from a flat-with-some-subdirs layout into a strictly-layered internal module structure with explicit dependency contracts, without breaking the public API or any existing tests. This is internal refactoring only — no new PyPI packages, no pyproject.toml extras changes, no frontend changes, no new features. The end state enables faster onboarding for AI agents and human contributors (clear layer map), safer refactoring (compile-time-equivalent checks via dependency linting), a cleaner mental model in ARCHITECTURE.md, and a foundation that makes a possible future move to namespace packages cheap.
Source documents¶
- Orchestrator brief (out of repo):
/Users/moroz/Projects/rigplane-research/2026-04-29-internal-modularization-orchestrator.md - Phase 1 discovery doc:
docs/plans/2026-04-29-modularization-discovery.md - Phase 2 plan doc:
docs/plans/2026-04-29-modularization-plan.md
Locked decisions (Phase 1, maintainer-approved)¶
- Silent re-export shims with grep-able header (template in plan §5.1; verbatim
# Re-export shim for backwards compatibility.comment block, noDeprecationWarning). import-linteris the boundary tool, integrated in Step 13 (after the bulk-move steps, before final import cleanup).- Shims for the 43 private-path leaks (15 test files reach into
_connection_state,_civ_rx,_poller_types, etc.) are produced by this effort; a tracked followup migrates the tests off those private paths post-modularization. rigplane-prothree-tier validation: end-of-Phase-2 paper check (plan §9, complete) → Phase 4 smoke-imports peraudio//dsp/PR → Phase 5 full downstream test suite as the definition-of-done marker.
Sub-issues checklist¶
- [ ] #1284 [Modularization 1/13] Skeleton + lazy-resolution contract test
- [ ] #1285 [Modularization 2/13] Move
corefoundationals - [ ] #1286 [Modularization 3/13] Move
corecontract trio + transport primitives - [ ] #1287 [Modularization 4/13] Move
commandstop-level - [ ] #1288 [Modularization 5/13] Move
profiles - [ ] #1289 [Modularization 6/13] Move
scope - [ ] #1290 [Modularization 7/13] Move
audiotop-level - [ ] #1291 [Modularization 8/13] Move
runtimepart 1 (radio + state) - [ ] #1292 [Modularization 9/13] Move
runtimepart 2 (mixins) - [ ] #1293 [Modularization 10/13] Move
runtimepart 3 (pollers + control + sync) - [ ] #1294 [Modularization 11/13] Move
discovery.pytobackends/ - [ ] #1295 [Modularization 12/13] Move
cli - [ ] #1296 [Modularization 13/13]
import-linterintegration +LAZY_MAPcleanup
Followup issues¶
These are post-modularization cleanup; they MUST NOT start until this epic is closed.
- [ ] #1297 [Followup] Migrate tests off private internal imports
- [ ] #1298 [Followup] Refactor
web_startupto usebackends.factory
Definition of done — the whole effort¶
The work is complete when all of the following are true:
src/rigplane/has the layer structure agreed in Phase 2.- Every layer has an
__init__.pywith explicit__all__. - Every layer has a
LAYER.mdcharter. import-linteris in pre-commit and CI, with a config matching the plan.- All ~5210+ existing tests pass on
main. - No public import path that worked before this effort returns
ImportErrornow. ARCHITECTURE.mdandCLAUDE.mdare updated.rigplane-pro(downstream) builds and tests cleanly against the newrigplane(verified by maintainer).- The epic issue is closed with a summary comment.
- The maintainer agrees that this brief's mission has been achieved.