fix: isolate model imports from dependency runtime - #412
Open
marlon-costa-dc wants to merge 6 commits into
Open
Conversation
Contributor
Author
|
Root-cause evidence: the new public regression first failed by listing dependency_injector plus 38 FastAPI/OpenAPI modules after resolving flext_core.m.StrictModel, then passed after the owner fix. The original flext-infra consumer also completed 21/21 in tests/unit/codegen/test_codegen_ci_matrix.py without MemoryError. Operator approval was provided in the active rollout session; full remote gates remain required. |
marlon-costa-dc
marked this pull request as ready for review
August 28, 2026 17:09
|
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.



Root cause\n\nImporting the public model facade traversed collection metadata normalization through the composite runtime facade. That initialized dependency-injector wiring and FastAPI/OpenAPI during test collection. Under host commit pressure, Pydantic schema construction then failed with MemoryError before tests could run.\n\n## Change\n\n- make the internal runtime package exports lazy\n- route collection metadata normalization to its leaf owner\n- prove that resolving flext_core.m.StrictModel loads neither dependency_injector nor fastapi\n\n## Evidence so far\n\n- RED: make test WHAT=all FILE=tests/unit/test_lazy_exports.py — new regression failed and listed the unintended modules\n- GREEN: same command — 1 passed, 23 deselected\n- make fmt — 524 files already formatted\n\nWIP: consumer and full native gates still running.
Summary by cubic
Isolates model imports from the dependency runtime and types the facade's field/private-attr helpers so test collection no longer initializes
dependency_injectoror FastAPI/OpenAPI (which failed with MemoryError under memory pressure) andPrivateAttrsupportsdefault,default_factory, and per-instance state._runtime._metadataowner instead of the composite runtime facade.PrivateAttrand reuses it in the utilities facade so bothm.PrivateAttrandu.PrivateAttrsupportdefault,default_factory, and per-instance state.functools.partialand typed callback helpers in handlers, config, and mapper to keep type contracts explicit.Written for commit 187453f. Summary will update on new commits.