feat: group-level default scope via class RequestGroup(Group, scope=...) (API-4)#288
Merged
Conversation
…..) (API-4) Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…e coverage (API-4) Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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 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.
The accepted API-4 item from the 2026-07-05 3.0 UX research: a
Groupsubclass may declareclass RequestGroup(Group, scope=Scope.REQUEST); everyFactory/ContextProviderdeclared in that class body without an explicitscope=takes the group's scope instead ofScope.APP. Non-breaking: groups without the kwarg and providers omitting scope behave exactly as before.scope=> groupscope=kwarg (nearest in MRO; a subclass's kwarg applies to its own body) >Scope.APP.Aliasnever participates — its scope derives from its source.GroupScopeConflictErrorat class creation (maintainer-ruled: import order must never decide a provider's scope); same default is a no-op. Ships with its troubleshooting page, catalog entry, and census bump (21→22 concrete exceptions).Group.__init_subclass__+ a defaulted-scope marker; the UNSET sentinel is normalized toScope.APPinsideAbstractProvider.__init__and never leaks. No metaclass.providers/scopes.md, cross-links,invalid-scope-type-errorpage covers its second raise site;architecture/providers.mdpromoted.just test-ci(100% line coverage, 320 passed),just lint-ci,just docs-build --strict,just check-planning— all green. Adversarial final review probed import-order flips, APP-stamp vs normalization ambiguity, subclass chains, multiple inheritance, and custom IntEnum scopes — all behave as specified.Design bundle (rationale home): planning/changes/2026-07-08.02-group-default-scope.md
🤖 Generated with Claude Code