Test
|
b0313ae818
|
feat(T3.2): implement workflow templates system
- Add WorkflowTemplate for YAML-based workflow definition
- Implement WorkflowTemplateManager for template lifecycle
- Save/load templates from disk (YAML format)
- Validate templates (name, planner, dependencies)
- Export templates to JSON
- Task configuration with dependency tracking
- Orchestrator configuration per template
- Template metadata (author, version, description)
- Default variables and tags support
- Template usage tracking and statistics
- Batch load templates from directory
- 26 workflow template tests, all passing
Features:
- WorkflowTemplate structure with metadata
- OrchestratorConfig per template (URLs, timeouts, retries)
- TaskConfig with dependencies and priority
- Save to YAML (human-readable)
- Load from YAML (auto-cached)
- Validate dependencies (no cycles, all tasks exist)
- Export to JSON for external systems
- Usage tracking (exec count, last used time)
- Directory loading for multi-template setups
Template Structure:
- Metadata: name, version, author, description
- Timestamps: created_at, updated_at
- Orchestrator config: planner/judge/implementer URLs
- Task list with dependencies
- Default variables
- Tags for organization
Validation:
- Template name required
- Planner URL required
- At least one task required
- All dependencies must reference existing tasks
- No circular dependencies
Operations:
- SaveTemplate() - persist to YAML
- LoadTemplate() - load from file
- GetTemplate() - retrieve cached
- ListTemplates() - enumerate all
- DeleteTemplate() - remove from disk
- ValidateTemplate() - check validity
- ExportTemplateJSON() - external format
- RecordUsage() - track usage stats
- LoadTemplateDirectory() - batch load
Test Coverage:
- 26 workflow template tests
- Save/load cycle verified
- Validation logic tested
- Dependency checking tested
- JSON export tested
- Usage tracking tested
- Directory loading tested
- Timestamp management tested
- Defaults and tags support tested
- Error handling comprehensive
Performance:
- Fast YAML parsing (single file)
- Cached templates in memory
- O(1) lookup by name
- Minimal disk I/O
Format Example:
---
name: golang-project
version: 1.0.0
author: platform-team
orchestrator:
planner_url: http://planner:8000
judge_url: http://judge:8000
timeout_seconds: 300
tasks:
- id: T0.1
title: Analyze Requirements
type: feature
priority: high
- id: T0.2
title: Implement
type: feature
depends_on: [T0.1]
Next: T3.3 (Task dependency graph)
|
2026-08-23 17:31:37 -07:00 |
|
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 |
|