Files
Test 8baf16a9d3 feat(T2.3): implement prompt template caching engine
- Add internal/templates package for Go template pre-compilation
- Implement TemplateEngine with compile-once-render-many pattern
- Template caching with LRU eviction policy
- Configurable max cache size (default 100)
- Compile-time tracking for performance analysis
- Per-template render count and latency metrics
- Cache statistics: hit ratio, avg render time, total renders
- CompileAndRender() for single-call compile+render
- Thread-safe concurrent access with RWMutex
- 17 template tests, all passing

Features:
- Compile() caches compiled templates
- Render() uses cached templates for fast rendering
- GetStats() tracks per-template metrics
- GetCacheStats() shows overall cache health
- Clear() resets all cached templates
- Remove() removes specific template
- IsCached() checks if template is pre-compiled

Performance:
- Template render latency: <100ms ✓
- Caching eliminates parse overhead
- LRU eviction when cache full
- Concurrent render support
- Compile once, render many times

Verification:
- Render latency < 100ms (verified in tests)
- Cache eviction working correctly
- Stats tracking accurate
- Complex templates supported
- Error handling robust

Test Coverage:
- 17 template tests (compile, render, caching, stats)
- Latency verification (< 100ms)
- Complex template support
- LRU eviction testing
- Concurrent access patterns

Next: T2.4 (Lessons file indexing)
2026-08-23 17:18:30 -07:00

1.8 KiB
Raw Permalink Blame History

Task Board — Milestone T2: Scale & Performance

Submilestone: T2 (Distributed execution, caching, performance optimization)

ID Scope Status Branch Verification
T2.1 Activity result caching: deduplicate repeated LLM calls for same task state [x] task/T2.1 Implementer called 2x on same code → second call returns cached Implementer output
T2.2 Parallel task dispatch: multiple T0.x tasks execute truly concurrently (not sequential) [x] task/T2.2 9 tasks complete in ~1/9 total time (wall-clock speedup measured)
T2.3 Prompt template caching: pre-compile Go templates on worker startup [x] task/T2.3 Template render latency < 100ms (vs parse+render each time)
T2.4 Lessons file indexing: fast lookup of past failures without full file scan [ ] task/T2.4 Query lessons by task type → return in < 10ms for 1000s of entries
T2.5 Git operation batching: combine multiple worktree commits into single push/merge [ ] task/T2.5 N tasks → 1 push (vs N pushes), measured via git ref-log
T2.6 LLM request batching: group similar Implementer calls into one API request [ ] task/T2.6 3 implementer tasks → 1 Anthropic API call with batch input (vs 3 separate calls)
T2.7 Workflow history pruning: trim old task unit outputs from orchestrator history [ ] task/T2.7 Continue-as-new cycle history size constant despite 1000s of task units completed
T2.8 Distributed lock optimization: replace flock with Redis/etcd for multi-pod scenarios [ ] task/T2.8 5 concurrent orchestrators on different pods share FS safely via distributed lock

Submission Criteria

All T2.1T2.8 marked [x] → submilestone complete → squash-merge task/T2.* to main.