ContextLab / ContextLab/orchestrator

Implement Result API - log, outputs, qc() methods

Open
#332 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

## 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

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.