Skip to content

Harden Protocol contracts with abstract methods and regression checks #136

@QuantumGhost

Description

@QuantumGhost

AI Disclosure: This issue is generated with Codex and GPT-5.5.

Summary

Some Protocol definitions in this repository declare members without @abstractmethod, which can allow accidental concrete subclasses in multi-level inheritance chains.

Problem

Without consistently marking protocol members as abstract, a subclass can unintentionally become instantiable after only partially overriding inherited members. This weakens interface contracts and can hide missing method implementations until runtime behavior diverges.

Proposed changes

  1. Add @abstractmethod to protocol members that currently lack it.
  2. Add static implementation assertions (in sibling files with _type_contract suffix) for in-repo protocol implementations, following the _assert_readonly_variable_pool pattern.
  3. Add regression tests to ensure protocol contracts stay abstract and are not unintentionally implemented without explicit overrides.

Validation target

  • New tests should prove that:
    • protocol members remain abstract,
    • direct subclasses without overrides cannot be instantiated,
    • indirect partial overrides remain abstract.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions