diff --git a/CHANGELOG.md b/CHANGELOG.md index 2afbd67..68a864e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,9 +10,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [2.1.0] - 2026-07-11 ### Summary + Add runtime-checkable Protocol typing to public interfaces ### Changed + - 1cbcc1c Merge pull request '[minor] Add runtime-checkable Protocol typing to public interfaces' (#57) from cursor/protocol-abc-interfaces into main - a0e5c9d Document test organization and add Cursor workflow rules. - 44b15cb Move structural typing tests into interface unit test files. diff --git a/README.md b/README.md index bfc889a..0755aa6 100644 --- a/README.md +++ b/README.md @@ -6,11 +6,11 @@ Subclass an adapter in your own repository to add domain-specific methods while ## Architecture -| Layer | Responsibility | -| ---------------- | ----------------------------------------------------------------- | -| **Interfaces** | Abstract contracts for connection, context, and CRUD | +| Layer | Responsibility | +| ---------------- | ------------------------------------------------------------------------------------ | +| **Interfaces** | Abstract contracts for connection, context, and CRUD | | **Adapters** | Technology-specific base classes (`RedisAdapter`, `MinioAdapter`, `PostgresAdapter`) | -| **Your project** | Subclass an adapter and add domain methods | +| **Your project** | Subclass an adapter and add domain methods | Each public interface is a `@runtime_checkable` `Protocol` with `@abstractmethod` members. **Subclass an adapter** when you need connection management and shared behavior — explicit subclasses get runtime instantiation guards and inherited default methods (e.g. `scan_keys`). **Type-annotate against an interface** when you want loose coupling — any object with the right methods satisfies the contract for mypy and `isinstance()` checks, without inheriting from this package.