- Add internal/cache package for deduplicating activity results
- Implement ResultCache with MD5 hash-based cache keys
- Support cache by activity type, task ID, input hash, model ID
- Configurable max size with FIFO eviction policy
- TTL support for automatic expiration
- Persistence to JSON for recovery across runs
- Query operations: by activity type, by task ID
- Hit rate tracking and statistics
- 13 cache tests, all passing
Features:
- ComputeHash() for input deduplication
- Set/Get operations with TTL support
- Invalidation by activity type or task ID
- Cache stats with usage ratio
- Full cache clear
- Disk persistence with JSON storage
- Hit rate calculation
Performance:
- Avoids redundant LLM calls
- Reduces API costs
- Faster workflow execution
- Configurable eviction policies
Test Coverage:
- 13 cache tests (set/get, TTL, eviction, persistence)
- Hit rate calculation verified
- Invalidation tested
- Multi-entry scenarios
Next: T2.2 (Parallel task dispatch)