chore: harden Protocol contract checks#138
Open
QuantumGhost wants to merge 7 commits into
Open
Conversation
Assisted-By: Codex:GPT-5.5
Assisted-By: Codex:GPT-5.5
Exclude static type contract modules from published distributions and document their development-only role. Add tests that ensure Protocol methods remain abstract enough to reject indirect nominal implementations without overrides. Assisted-by: Codex:GPT-5.4
Replace the hand-maintained Protocol list with AST-based discovery over graphon modules so new Protocol definitions are automatically covered. Assisted-by: Codex:GPT-5.4
Contributor
Author
|
Updated the protocol regression tests to follow the AST-based discovery approach from the previous PR reference. Changes:
Validation:
|
Remove type contract files where the implementation already subclasses the Protocol directly, and document that type contracts are intended for structural implementations. Assisted-by: Codex:GPT-5.4
Contributor
Author
|
Adjusted the static type contract scope based on review feedback. Changes:
Validation:
|
Contributor
Author
|
Adjusted the static type contract scope based on review feedback. Changes:
Validation:
|
3 tasks
Keep the Protocol contract test focused on member abstractness, document the non-empty member guard, and remove direct/indirect instantiation checks. Assisted-by: Codex:GPT-5.4
Contributor
Author
|
Updated the protocol abstract contract test per review feedback. Changes:
Validation:
|
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.
AI disclosure: This PR was primarily drafted with Codex using GPT-5.5.
I have reviewed and edited the final diff, and I am responsible for the content.
Important
!Related Issue
Closes #136
Summary
This PR hardens protocol contracts by:
Changes included:
*_type_contract.pystatic assertions for in-repository protocol implementations.*_type_contract.pyfiles from published distributions.Validation performed:
make checkuv run pytestuv build --out-dir /tmp/graphon-dist.FoJno3*_type_contract.pyfiles are included.Checklist
!