Skip to content

refactor(operator-trend): drop dead re-export shim layer (T3-2 phase 3)#78

Merged
saagpatel merged 3 commits into
mainfrom
refactor/operator-trend-shim-kill
Jun 20, 2026
Merged

refactor(operator-trend): drop dead re-export shim layer (T3-2 phase 3)#78
saagpatel merged 3 commits into
mainfrom
refactor/operator-trend-shim-kill

Conversation

@saagpatel

Copy link
Copy Markdown
Owner

What

Deletes the 16 pure re-export shim modules in the operator_trend_closure_forecast_* fractal and repoints their mirror tests to the real source modules.

Why

Each shim was import + __all__ with zero logic, imported only by its own mirror test — never by any production module. They roughly doubled the apparent size of the fractal while adding a pure layer of import indirection.

Changes

  • Repoint 16 mirror tests → real sources (reset_controls / reacquisition_controls / freshness_controls / core)
  • Delete 16 dead shim modules
  • Delete the facades test — its only job was asserting shim re-export identity (facade_X is X), tautological once the shims are gone

Safety

  • No status string or composer behavior touched
  • recovery-state golden contract byte-identical
  • ruff check src/ tests/ clean; full suite 2492 passed, 2 skipped
  • Net +20 / −405 (33 files)

Deferred (follow-on phase)

The per-tier composer collapse — the original Phase 3 target — is intentionally not here. The tiers have diverged behaviorally (e.g. rebuild clamps each magnitude adjustment at zero, rererestore does not), and the golden does not yet cover the multi-arg dict-composers. A naive recovery_state(target, *, depth) parametrization would risk a silent contract break with no test to catch it. That collapse needs a wider characterization net first.

The operator_trend_closure_forecast_* fractal carried 16 leaf modules that were
pure re-export shims (import + __all__, zero logic), each imported only by its
own mirror test and never by any production module. They roughly doubled the
apparent size of the fractal without adding behavior.

Repoint the 16 mirror tests to import directly from the real source modules
(reset_controls / reacquisition_controls / freshness_controls / core) and delete
the shims. Also delete the facades test, whose sole purpose was asserting the
shims' re-export identity — tautological once the shims are gone.

No status string or composer behavior is touched; the recovery-state golden
contract is byte-identical and the full suite stays green (2492 passed).

Note: the per-tier composer collapse is deferred — the tiers have diverged
behaviorally (clamp vs no-clamp) and the golden does not yet cover the
dict-composers, so that collapse needs a wider characterization net first.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 33e496f3a2

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@@ -1,11 +0,0 @@
from __future__ import annotations

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Update the CI mypy target list before deleting shims

In the GitHub Actions workflow I inspected (.github/workflows/ci.yml line 33), the Type-check operator trend seams step still passes this deleted path and the other removed shim files directly to python -m mypy; mypy's help says positional arguments are files/folders to type check, and running it against this removed file now exits with cannot read file 'src/operator_trend_closure_forecast_events.py': No such file or directory. Any push or PR that reaches this workflow will fail until the deleted shim paths are removed or replaced with the real source modules.

Useful? React with 👍 / 👎.

The 'Type-check operator trend seams' step listed the 16 re-export shim
modules removed in this PR, so mypy failed with 'No such file or directory'.
Drop them; the 15 real modules still type-check (verified locally).
@saagpatel saagpatel merged commit 9c3a9d4 into main Jun 20, 2026
3 checks passed
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