refactor: provider display_name (R-1) + public fetch_context_value (R-2)#219
Merged
Conversation
…lue (R-2) - R-1: add AbstractProvider.display_name (Factory overrides for creator name); replace the bound_type-or-repr idiom at ~5 sites (Factory/Alias _resolution_step, validate() cycle path, InvalidScopeDependencyError). - R-2 (minimal): rename ContextProvider._find_context_value -> public fetch_context_value; Factory calls it without the SLF001 suppression. isinstance routing kept by design (see bundle). Behavior-preserving; existing suite + 100% coverage exercise all branches. Spec: planning/audits/2026-06-14-deep-audit-report.md Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
lesnik512
added a commit
that referenced
this pull request
Jun 14, 2026
Move bundle to archive (status: shipped, pr: 219); update README Index; mark R-1/R-2 resolved in the 2026-06-14 audit report Status line. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
Summary
Batch 3 of the 2026-06-14 deep audit — two behavior-preserving refactors that reduce duplication and remove a private-method reach-in.
AbstractProvider.display_name(bound_type.__name__elserepr(self);Factoryoverrides to fall back to the creator name). Replaces the duplicatedbound_type.__name__ if … else repr(…)idiom at ~5 sites:_resolution_stepinFactoryandAlias, the cycle-path list invalidate(), and both names inInvalidScopeDependencyError.ContextProvider._find_context_value→ publicfetch_context_value;Factorycalls it without the# noqa: SLF001suppression.Design decision (R-2 shape)
Chose the minimal option: keep
isinstance(provider, ContextProvider)for compile-time routing (acceptable against a concrete sibling provider) and only promote the value-probe to public — one new method, not a ClassVar+method decouple. R-4/R-5/R-6 deferred (marginal; the compile vs. validate predicates genuinely diverge, so R-5 can't be cleanly unified). Recorded in the bundle.Test Plan
display_namebranches and the renamed methodjust test-ci)just lint-ciclean (the SLF001 noqa is gone; ty clean)🤖 Generated with Claude Code