ContextLab / ContextLab/orchestrator
Implement Result API - log, outputs, qc() methods
- Dominant language
- Python
- Stars
- 3
- Forks
- 2
- Avg merge
- 13m
- Merged PRs (30d)
- 1
Description
## Problem
Issue #307 specifies a comprehensive Result API that is missing from the current implementation:
```python
result = pipeline.run(topic="AI safety", style="academic")
result.log # JSON execution log
result.outputs # Dictionary of step outputs
result.qc() # Quality control analysis
orc.log.markdown(result.log) # Formatted log viewing
```
## Solution Required
Implement the complete Result API with:
### 1. result.log - JSON Execution Log
- Timestamped execution trace
- Step-by-step execution details
- Variable state changes
- Error/success information
### 2. result.outputs - Output Dictionary
- Dictionary mapping step IDs to output files
- File paths for generated products
- Variable access interface
### 3. result.qc() - Quality Control Analysis
- Orchestrator model evaluation of outputs
- Content quality assessment
- Completeness validation
- Cached reports (run once)
### 4. orc.log.markdown() - Formatted Log Display
- Human-readable execution summary
- Markdown formatted output
- Progress visualization
## Acceptance Criteria
- [ ] Result object returned by pipeline.run()
- [ ] All 4 API methods implemented and tested
- [ ] Real execution data captured and accessible
- [ ] Quality control integration working
- [ ] Documentation and examples provided
## Files to Modify
- `src/orchestrator/core/pipeline.py` - Result class
- `src/orchestrator/execution/engine.py` - Log capture
- `src/orchestrator/api/core.py` - API integration
**Priority**: High - Core API requirement from #307
Contributor guide
Assessment
This issue has not been assessed yet.