e00762bb0bf6f06dadcf407666600e5f8da52333
4
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
e00762bb0b |
feat(T3.3): implement task dependency graph
- Add internal/graph package for dependency management - Implement DependencyGraph for task ordering - Support task dependencies and prerequisite tracking - Validate graph for cycles (no circular dependencies) - Topological sort for execution order (Kahn's algorithm) - Track task status (pending, completed, failed) - Get ready-to-execute tasks based on dependencies - Get tasks that depend on a given task - Check if task can execute (all deps complete) - Calculate critical path through graph - Task metadata support - 23 graph tests, all passing Features: - AddTask() - add task to graph - AddDependency(dependent, prerequisite) - specify ordering - ValidateGraph() - check for cycles - GetTopologicalOrder() - execution order - GetReadyTasks() - tasks ready to run - MarkCompleted(taskID) - mark as done - MarkFailed(taskID) - mark as failed - GetDependencies(taskID) - what task depends on - GetDependents(taskID) - what depends on task - CanExecuteTask(taskID) - check if ready - GetCriticalPath() - longest path in graph Graph Properties: - Directed acyclic graph (DAG) - Cycle detection (prevents deadlocks) - Multi-dependency support (diamond dependencies) - Status tracking (pending/completed/failed) - Thread-safe (RWMutex) - Kahn's algorithm for topological sort - O(V+E) for validation and sorting Example Usage: - T0.1 Analyze (no deps) - T0.2 Implement (depends on T0.1) - T0.3 Test (depends on T0.2) - T0.4 Review (depends on T0.2, T0.3) Ready Detection: - T0.1 ready (no dependencies) - After T0.1 complete: T0.2 ready - After T0.2 complete: T0.3 ready - After T0.2, T0.3 complete: T0.4 ready Test Coverage: - 23 dependency graph tests - Cycle detection verified - Topological sort tested - Multiple dependency chains - Diamond dependency patterns - Ready task calculation - Status tracking - Critical path calculation - Complex graphs (10+ tasks) - Metadata handling - Performance benchmarks Performance: - Cycle detection: O(V+E) DFS - Topological sort: O(V+E) Kahn's algorithm - Ready tasks: O(V) scan - Add task: O(1) - Add dependency: O(1) amortized Use Cases: - Workflow orchestration (T0.1 -> T0.2 -> T0.3 -> ...) - CI/CD pipelines (build -> test -> deploy) - Milestone hierarchies (T0 milestone with sub-tasks) - Parallel tasks with merge points (diamond deps) Next: T3.4 (Human-in-the-loop gates) |
||
|
|
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) |
||
|
|
cb8a3fe12a |
feat(T3.1): implement custom skill plugin system
- Add internal/plugins package for custom skill plugins
- Implement SkillPlugin interface for extensibility
- Implement PluginRegistry for plugin management
- Support plugin:// URL scheme for plugin references
- Register/unregister plugins dynamically
- Enable/disable plugin control
- Execution logging with timing metrics
- Plugin metadata tracking (version, author, config)
- PluginLoader for lifecycle management
- Load plugins from files and directories
- Reload plugins without restart
- Statistics tracking (executions, success rate)
- 48 plugin tests, all passing
Features:
- SkillPlugin interface (Name, Version, Execute, Validate, Description)
- PluginRegistry for central registration and execution
- plugin:// URL scheme for plugin references
- Dynamic loading from JSON config files
- Plugin enable/disable control
- Execution history tracking
- Timing metrics for performance monitoring
- Configuration storage per plugin
- Metadata tracking (version, author, description)
- Plugin statistics (total runs, success rate, avg time)
Registry Operations:
- Register(plugin, author, config) - register new plugin
- Unregister(name) - remove plugin
- Execute(name, input) - execute by name
- Get(name) - retrieve plugin reference
- ListPlugins() - enumerate all plugins
- EnablePlugin(name) / DisablePlugin(name)
- GetExecutionLog(name) - timing and result history
- ResolvePluginURL(url) - resolve plugin:// URLs
Loader Operations:
- RegisterLoadedPlugin() - add to registry
- UnloadPlugin() - remove from registry
- ReloadPlugin() - reinitialize without restart
- LoadPluginDirectory() - batch load from directory
- ExecutePlugin() - execute through loader
- GetLoadedPlugins() - enumerate loaded
- IsPluginLoaded() - check status
- Close() - shutdown all plugins
URL Scheme:
- plugin://plugin-name - reference custom plugin
- Enables flexible skill resolution
- Supports custom activities beyond pi clone
Plugin Metadata:
- Name, Version, Author
- Description, URL, Config
- LoadedAt timestamp, Enabled flag
- Config is arbitrary map[string]interface{}
Execution Tracking:
- Timestamp of execution
- Input and output data
- Success/failure status
- Duration measurement
- Error messages preserved
Test Coverage:
- 48 plugin tests (registry + loader)
- Plugin registration/unregistration
- Execution success and failure cases
- Enable/disable control
- Logging and timing verification
- URL resolution testing
- Directory loading tests
- Configuration persistence
- Statistics accuracy
- Concurrent safety (RWMutex)
Performance:
- Fast plugin lookup (O(1) hash map)
- Minimal overhead for execution
- Efficient logging with reuse
- Scalable to 100s of plugins
Next: T3.2 (Workflow templates)
|
||
|
|
aa21f064f7 |
Add future milestones: T1 (hardening), T2 (scale), T3 (features)
T1: Error recovery, observability, metrics, audit logging (8 tasks) T2: Caching, parallelism, distributed locking (8 tasks) T3: Plugins, templates, dependencies, custom judges, nested workflows (8 tasks) Total project timeline: ~3 months T0→T3. |