Repository navigation
equivalence_cics: lazy family re-exports end the 23 unsafe cyclic imports (Part of #7153) - #7231
Merged
Merged
Conversation
…ed at import (Part of #7153) Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Contributor
|
No description provided. |
Contributor
|
No description provided. |
This was referenced Oct 31, 2026
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.
Part of #7153.
Checklist: done [c:3e30b5cd]
What
tests/tools/equivalence_cics.pycopied 23 names out of theequivalence_cics_*family modules at import time (fault_lines = cics_faults.fault_lines, ...). Each family importsequivalence_cicsback, so importing a family first ran those copies against a half-initialised module: CodeQL's 23py/unsafe-cyclic-importalerts (lines 61-83 on main). The names are now resolved on first use through a module-level__getattr__(PEP 562) over one_FAMILY_NAMEStable (24 names,check_child_faultsincluded), andequivalence_cics.py's own calls usecics_<family>.<name>directly. Externalec.<name>access is unchanged. No engine code, no golden change.Class sweep
The class: an import-time copy of an attribute of a module that imports this one back.
equivalence_cics.py: converted (23 alerted +check_child_faults).py/unsafe-cyclic-importalerts on main by API query: 23, all in this file. None elsewhere.import equivalence_cicsinequivalence_call/ims/inputs.py: lazy, not the class.Tests
test_cics_family_split.py: an AST check that noX = cics_*.Xcopy remains, and a freshpython -Iimport of each of the 8 modules first, asserting every re-exported name is the family's own object. The affected suites pass (750 passed, 30 skipped). ruff, mypy and dead-key audits show no new findings.Sibling gaps
None found for this rule. The 4
py/uninitialized-local-variablealerts are the next checklist item.Lessons for agents
A function's bare global lookup never goes through a module
__getattr__: when replacing a module-level alias by a lazy re-export, rewrite the module's own bare uses to the qualified form.Cross-repo
None.