Repository navigation
Share the nominal key declaration overlap contract - #215
Merged
Merged
Conversation
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.
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
1 source file, one nominal declaration metaclass, one default overlap implementation. Paired with OpenHCSDev/toad#1338 (P917).
Declaration ownership
Before:
KeyInvocation.overlaps_declaration(type[KeyDeclaration])admits only native command classes. Toad'sMenuDeclarationis itself a class-valued invocation and declares keys through its metaclass; passing it violates that annotation. Native and Menu families also separately supplied the defaultpermits_key_overlap=Falseanswer.After:
KeyDeclarationType(ABCMeta)is the nominal contract for key-declaring classes and supplies the default overlap method.KeyDeclarationuses that metaclass. Both overlap argument annotations consumeKeyDeclarationType. Toad composes it withFamilyMetafor both Action and Menu, removes MenuCommand's duplicate default, and keeps only the real mutually-exclusive family overrides.No cast, Any, bare-type widening, registration roster, Toad forwarding shim, or behavior-kind test. Existing double dispatch and explicit overlap decisions remain.
Source evidence
Retained source inventory: 882 Toad source/test + Textual source modules, zero parse omissions. Read the native invocation/declaration methods and every Toad overlap override. Whole-source search:
rg -n 'permits_key_overlap|overlaps_declaration|KeyDeclarationType' srcin both repositories. Source evidence does not establish runtime metaclass composition.Verification and remaining owner controls
No author pytest, collection, type-checker, imports, UI/provider or installation runs: integration owns combined qualification. Required controls: import Action/Menu with the paired source; verify C3/metaclass compatibility, native↔Menu and native↔native overlap directions, exclusive collapse/expand alternatives, remap/unbind/Reset, and captured Menu effects. The Toad PR's genuine annotation-cycle growth remains explicitly open for integration's owner shape.
Assumed: paired runtime import/type qualification, hosted gate status and physical keyboard acceptance are not established by this source diff.