Skip to content

fix(rate-of-closure): repair three variation modules that are unimportable on main - #4523

Merged
dieterolson merged 2 commits into
mainfrom
fix/regional-ground-study-adapter-import
Aug 17, 2026
Merged

fix(rate-of-closure): repair three variation modules that are unimportable on main#4523
dieterolson merged 2 commits into
mainfrom
fix/regional-ground-study-adapter-import

Conversation

@dieterolson

Copy link
Copy Markdown
Collaborator

main is currently broken. Three modules cannot be imported:

ImportError: cannot import name 'to_ground_model_result'
from 'shared.python.swing_sim.ground'

Affected: regional_ground_study_adapter, regional_ground_variation, regional_ground_target_projection.

Two of my own PRs combined to cause it

Neither PR's tests imported the adapter module, so both were green while three modules could not load at all.

The fix

The import now names the owning module, shared.python.swing_sim.ground.result_adapter, which does export it. That keeps the package contract intact — the unqualified adapter is still not package-public — while making the unqualified dependency explicit at the call site, which is the honest thing for a compatibility path. The ground contract test still passes, so nothing #4517 established is weakened.

The check that was missing

tests/rate_of_closure/test_variation_module_importability.py imports every module in the package.

A suite can be entirely green while a module in it is unreachable, and no existing gate covered that. This also catches the neighbouring cases: a symbol dropped from a package's __all__, a rename, a new circular import.

Verified by reverting the one-line fix: 3 failed, 35 passed.

Please prioritise — every PR branched from current main inherits the breakage.

🤖 Generated with Claude Code

…main

`rate_of_closure.variation.regional_ground_study_adapter` cannot be imported on
current `main`:

    ImportError: cannot import name 'to_ground_model_result'
    from 'shared.python.swing_sim.ground'

Two of my own PRs combined to cause it. #4517 removed that name from the ground
package's eager exports, correctly — the package's own
`test_unqualified_compatibility_adapter_is_not_public` requires the explicitly
*unqualified* compatibility adapter to stay private, and it is absent from both
`__all__` and the lazy-import map. #4520 then landed a consumer importing it
from the package path. Neither PR's tests imported the adapter module, so both
were green while three modules could not be loaded at all:
`regional_ground_study_adapter`, `regional_ground_variation`, and
`regional_ground_target_projection`.

The import now names the owning module,
`shared.python.swing_sim.ground.result_adapter`, which does export it. That
keeps the package contract intact — the unqualified adapter is still not
package-public — while making the unqualified dependency explicit where it is
used, which is the honest thing for a compatibility path.

Adds `tests/rate_of_closure/test_variation_module_importability.py`, which
imports every module in the package. This is the check that was missing: a
suite can be entirely green while a module in it is unreachable, and no
existing gate covers that. It also catches the neighbouring cases — a symbol
dropped from a package's `__all__`, a rename, a new circular import. Verified
by reverting the one-line fix: 3 failed, 35 passed.

The ground contract test still passes, so this does not weaken what #4517
established. Scoped ruff and ruff format clean.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

@dieterolson
dieterolson enabled auto-merge (squash) August 17, 2026 13:13
ruff-format flagged the added test; formatted. SPEC row renumbered to 1.17.24
above the merged ground-playback 1.17.23.
@dieterolson
dieterolson merged commit 2f511d0 into main Aug 17, 2026
15 of 17 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