Skip to content

refactor(operation): carve _recipe_expansion/ + _pseudoaxis/ subpackages from the BC root#311

Merged
xmap merged 1 commit into
mainfrom
worktree-operation-root-carve
Jun 22, 2026
Merged

refactor(operation): carve _recipe_expansion/ + _pseudoaxis/ subpackages from the BC root#311
xmap merged 1 commit into
mainfrom
worktree-operation-root-carve

Conversation

@xmap

@xmap xmap commented Jun 22, 2026

Copy link
Copy Markdown
Owner

Summary

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 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

  • The moved modules' content is byte-identical except one intra-cluster import line each (rewritten to the sibling submodule) — confirmed by git rename detection (R100/R098/R099).
  • All consumer import sites updated to the package path; the lazy/canonical_json_bytes/steps_to_wire imports still resolve through the package __init__ re-exports.
  • 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.

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_watcher scaffold — shipped in #308).

🤖 Generated with Claude Code

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>
@xmap xmap enabled auto-merge (squash) June 22, 2026 11:56
@github-actions

Copy link
Copy Markdown

Coverage report

Click to see where and how coverage changed

FileStatementsMissingCoverageCoverage
(new stmts)
Lines missing
  apps/api/src/cora/api
  _calibration_watcher.py
  _clearance_watcher.py
  _procedure_watcher.py
  apps/api/src/cora/operation
  _conduct_preparation.py
  apps/api/src/cora/operation/_pseudoaxis
  __init__.py
  _expander.py
  apps/api/src/cora/operation/_recipe_expansion
  __init__.py
  _replay.py
  apps/api/src/cora/operation/adapters
  in_memory_recipe_expander.py
  apps/api/src/cora/operation/features/reconduct_procedure
  handler.py
Project Total  

This report was generated by python-coverage-comment-action

@xmap xmap merged commit e5bd70e into main Jun 22, 2026
16 checks passed
@xmap xmap deleted the worktree-operation-root-carve branch June 22, 2026 12:02
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