Repository navigation
Fix Self dependencies when copying containers - #990
Open
Aschenbath wants to merge 1 commit into
Open
Aschenbath wants to merge 1 commit into
Aschenbath wants to merge 1 commit into
Conversation
This branch has not been deployed
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.
Copying a container with a
Selfdependency currently injects the original container class instead of the copied container instance. Seed the copy memo with the destination container's canonicalSelfprovider so inherited and locally declared dependencies share the provider that is rebound during instantiation.Add regression coverage for instance isolation, destination aliases, delegated/provided dependencies, repeated copying and deep copying, resource lifecycle, and nested containers. Document the copied
Selfbehavior.Fixes #619. Fixes #675.
Validation:
twine checkpass; installed wheel passes all six regressions.Independent Codex review exercises 192 scenarios across 12 provider families, inheritance, aliases and repeated copying: 2,688 assertions pass against both the compiled candidate and installed wheel, while the original fails 1,056 identity checks. Another 24 checks cover nested containers, external Self providers and destination overrides; the original fails six and both fixed packages pass all 24.
Copied dependencies now use the destination canonical Self and its overrides. Source Self overrides stay with the source. Inherited source Self alias registration remains outside this fix.
AI assistance: OpenAI Codex investigated, implemented and tested the change. A separate Codex agent reviewed the complete patch and ran the independent native-package checks above. No human review is claimed. Other OS/Python versions and the hosted CI matrix were not run locally.