ContextLab / ContextLab/orchestrator

Complete YAML Pipeline Specification Implementation

Open
#320 2 comments 0 reactions 0 assignees View on GitHub
architecture enhancement
Dominant language
Python
Stars
3
Forks
2
Avg merge
13m
Merged PRs (30d)
1

Description

# Complete YAML Pipeline Specification Implementation

## Overview
The current YAML pipeline implementation is missing several critical features from the original specification in issue #307. This issue addresses the gaps to fully implement the intended YAML pipeline specification.

## Missing Features

### 1. Expert Model Assignment System
**Current State**: Not implemented
**Required**: Support for expert model assignments in pipeline headers:
```yaml
experts:
- tool_name: model_or_list_of_models
- another_tool_name: specific_model
- [list, of, tools]: models_supporting_these_tools
```

### 2. Selection Schema Strategy
**Current State**: Not implemented
**Required**: Model selection strategies:
```yaml
selection_schema: "cost" | "performance" | "balanced"
```

### 3. Personality System Prompts
**Current State**: Not implemented
**Required**: Personality-based system prompts:
```yaml
personality: "standard" | path_to_md_file | "custom system prompt string"
```

### 4. Advanced Step Control Flow
**Current State**: Basic step execution only
**Required**: Full control flow support:
```yaml
- condition: valid_python_expression
- on_false: step_id_to_go_to
- on_failure: step_id_for_error_handling
- on_success: step_id_for_success_path
```

### 5. Structured Variable Output
**Current State**: Basic variable handling
**Required**: LangChain structured outputs integration:
```yaml
vars:
- var_1: format_description_or_example
- var_2: None # string default
```

### 6. Product File Generation
**Current State**: Not implemented
**Required**: Automatic file generation:
```yaml
products:
- var_name: destination_file.extension
- another_var: another_file.pdf
```

## Implementation Requirements

### YAML Parser Enhancements
- [ ] Extend YAMLCompiler to parse expert definitions
- [ ] Add selection_schema validation and enforcement
- [ ] Implement personality system prompt resolution
- [ ] Add advanced step attribute parsing

### Step Execution Engine Updates
- [ ] Implement conditional step execution logic
- [ ] Add control flow routing (on_false, on_failure, on_success)
- [ ] Integrate LangChain structured outputs for variables
- [ ] Build product file generation system

### Compilation Validation
- [ ] Validate expert model assignments against tool requirements
- [ ] Check selection_schema against available models
- [ ] Resolve personality files from ~/.orchestrator/personalities/
- [ ] Validate control flow paths and dependencies

### Error Handling
- [ ] Comprehensive error messages for invalid configurations
- [ ] Graceful fallbacks for missing expert assignments
- [ ] Clear validation errors for malformed control flow

## Acceptance Criteria

1. **Full YAML Compatibility**: All features from issue #307 specification supported
2. **Backward Compatibility**: Existing pipelines continue to work without modification
3. **Comprehensive Testing**: Real-world pipeline examples demonstrating all features
4. **Error Reporting**: Clear, actionable error messages for configuration issues
5. **Documentation**: Complete specification documentation with examples

## Priority: High
This addresses core missing functionality from the original specification that is essential for the orchestrator to fulfill its intended design.

## Related Issues
- Original specification: #307
- Epic implementation: #308
- Current YAML Pipeline Specification: #310

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.