You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
refactor(memory): use typing.Protocol for MemoryBackend interface (#19)
* refactor(memory): use typing.Protocol for MemoryBackend interface
- Replace duck-typing hasattr checks with structural Protocol
- MemoryBackend is runtime_checkable for isinstance validation
- Aligns with hawk-eco architecture: SDKs use structural interfaces
* fix(memory): move Sequence to TYPE_CHECKING block, use hasattr for backend detection
- Import Sequence under TYPE_CHECKING to satisfy ruff UP035/TC003
- Use hasattr instead of isinstance(Protocol) for backend detection
since runtime_checkable checks class attrs, not instance attrs,
breaking MagicMock-based tests on Python 3.12+
* style: ruff format memory_tools.py
0 commit comments