chore: privatize Container scope_map/lock internals - #265
Merged
Merged
Conversation
Deprecation-shim rename of Container.scope_map/lock to _scope_map/_lock with warning aliases; find_container promoted to a documented extension point, parent_container left public. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This was referenced Sep 13, 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.
Privatizes the two genuinely-internal
Containerattributes behind deprecated aliases, following the project'scache_settings=deprecation precedent. Backward compatible; no integration touches these.Spec + plan:
planning/changes/2026-07-05.02-privatize-container-internals/.What changed
Container.scope_map→_scope_mapandContainer.lock→_lock. All internal callers (container.py,factory.py) switch to the private names.@propertyaliases that emitDeprecationWarning(stacklevel=2, "will be removed in a future release"). Because internal code uses the underscore names, the deprecated property never fires on the resolve hot path — a regression test (test_resolve_emits_no_deprecation_warning) guards this.find_container(scope)reclassified as a supported extension point (it's the primitive a customAbstractProvider.resolvecalls to locate its scope's container) — moved out of "internals" inadvanced-api.md.Deliberately unchanged
find_container,parent_container(attribute and constructor kwarg), theuse_lock=knob, and theContainer(...)constructor. These stay public.Docs / release notes
advanced-api.md:find_containerpromoted to extension points; internals bullets renamed to_scope_map/_lockwith the deprecation note.architecture/containers.md: prose updated to_scope_map.planning/releases/2.23.0.mdpre-staged (2.22.0 was already cut; maintainer confirms the version at tag time).Verification
just test-ci— 256 passed, 100% line coverage (the two property warning branches covered).just lint-ciclean (ruff + ty + planning).just docs-build --strictclean. TheSLF001noqa on cross-object private access matches existing convention (context_provider.py,alias.py).🤖 Generated with Claude Code