Repository navigation
A type-only retype names a contract base, never a mixin - #476
Merged
Merged
Conversation
An annotation says which type a value is. Widening it to any base that passes the type check erases that when the reader reads no member, and the check cannot see the loss: Todo -> StoreRows passed mypy while saying a goal row is a store marker. The retype target is now the nearest base below the reader that declares a contract: an abstract member of its own, or membership in a registry family (its root or a member). A Protocol names no nominal identity. Bases below that only supply code are passed over; when they are all there is, BaseIsImplementationMixin names them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016gZLduhisRHdamZ5LNK72Z
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.
An annotation is identity evidence: it says which type a value is. Step 1 (#472) widened annotations to the nearest base below the reader that passed mypy. When the reader reads no member, that erases identity, and mypy can't see the loss. On agent-comms it retyped
TodotoStoreRows, a__slots__ = ()marker, and the type check passed.The rule now
abstract_method_namesandis_registration_authority.BaseIsImplementationMixinnames them as a typed refusal with OPERATION input: a contract base declared below is what's needed.Fixtures
StoreRows.__init_subclass__.NativeAttestation→SnapshotAttestationshape.SnapshotAttestationisABCwith abstractconflicts.Tests: the targeted set passes, 171 of 171: type_only, hidden_import_cuts, hidden_imports, downstream_consumers, composition_layering, repository_architecture and restated_fact_detectors.
Generated by Claude Code