Test 9315fa6d32 feat(T2.1): implement activity result caching
- 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)
2026-08-23 17:15:10 -07:00
S
Description
No description provided
54 MiB
Languages
Go 99.3%
Shell 0.6%
Go Template 0.1%