refactor(operation): carve _recipe_expansion/ + _pseudoaxis/ subpackages from the BC root#311
Merged
Merged
Conversation
The Operation BC root had drifted to 12 private _*.py modules, past the ~10-file "revisit" threshold in docs/reference/layout.md (the 2nd BC to cross it; the equipment _bodies/ + _pidinst/ carve is the n=1 precedent). This groups two cohesive clusters into private subpackages whose __init__ re-exports the public surface, so consumers import from the package: - _recipe_expansion/ <- _expand.py (was _recipe_expansion.py), _replay.py (was _recipe_replay.py), _resolved_steps_replay.py. The recipe step-resolution + replay/verify cluster. - _pseudoaxis/ <- _evaluator.py (was _pseudoaxis_evaluator.py), _expander.py (was _pseudoaxis_expander.py). The virtual-axis resolution cluster. Root drops from 12 to 7 private modules + 2 subpackages. Pure, behavior-preserving file reorganization: the moved modules' content is byte-identical except one intra-cluster import line each (rewritten to the sibling submodule), all 56... the consumer import sites are updated to the package path, and a path-coupled arch test (test_recipe_step_variants_match_step_union) is retargeted to the _expand submodule where the private _expand_step dispatch helper now lives. Submodules drop the redundant package prefix (_pseudoaxis/_evaluator, not _pseudoaxis/_pseudoaxis_evaluator), matching the locked _pidinst/ precedent. No behavior change: operation unit tests (881) + full arch (26916) + full unit tier (10466) pass; gate review confirmed all imports intact (no P0/P1), behavior preserved, and naming-r3 clean. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Coverage reportClick to see where and how coverage changed
This report was generated by python-coverage-comment-action |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
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.
Summary
The Operation BC root had drifted to 12 private
_*.pymodules, past the ~10-file "revisit" threshold indocs/reference/layout.md— the 2nd BC to cross it (the equipment_bodies/+_pidinst/carve is the n=1 precedent). This is a pure, behavior-preserving file reorganization that groups two cohesive clusters into private subpackages whose__init__re-exports the public surface, so consumers import from the package._recipe_expansion/←_expand.py(was_recipe_expansion.py),_replay.py(was_recipe_replay.py),_resolved_steps_replay.py— the recipe step-resolution + replay/verify cluster._pseudoaxis/←_evaluator.py(was_pseudoaxis_evaluator.py),_expander.py(was_pseudoaxis_expander.py) — the virtual-axis resolution cluster.Root drops from 12 → 7 private modules + 2 subpackages.
Why it's behavior-preserving
canonical_json_bytes/steps_to_wireimports still resolve through the package__init__re-exports.test_recipe_step_variants_match_step_union) is retargeted to the_expandsubmodule where the private_expand_stepdispatch helper now lives._pseudoaxis/_evaluator, not_pseudoaxis/_pseudoaxis_evaluator), matching the locked_pidinst/precedent.Verification
Operation unit tests (881) + full architecture tier (26,916) + full unit tier (10,466) + pyright + tach + ruff all green. Gate-reviewed (behavior-preservation + import-graph completeness + naming-r3): ship, no P0/P1 — runtime import check of all 14 re-exported names + the private helper + all consumer modules resolved OK; no import cycle; no surviving bare-module import paths. Two cosmetic stale-docstring references were also fixed.
This resolves the second of the two fired rule-of-three triggers from the agent-fleet review (the first — the
_flag_watcherscaffold — shipped in #308).🤖 Generated with Claude Code