mirror of
https://github.com/wshobson/agents.git
synced 2026-03-18 09:37:15 +00:00
feat: add Conductor plugin for Context-Driven Development
Add comprehensive Conductor plugin implementing Context-Driven Development methodology with tracks, specs, and phased implementation plans. Components: - 5 commands: setup, new-track, implement, status, revert - 1 agent: conductor-validator - 3 skills: context-driven-development, track-management, workflow-patterns - 18 templates for project artifacts Documentation updates: - README.md: Updated counts (68 plugins, 100 agents, 110 skills, 76 tools) - docs/plugins.md: Added Conductor to Workflows section - docs/agents.md: Added conductor-validator agent - docs/agent-skills.md: Added Conductor skills section Also includes Prettier formatting across all project files.
This commit is contained in:
@@ -19,6 +19,7 @@ Comprehensive testing approaches for Temporal workflows using pytest, progressiv
|
||||
## Testing Philosophy
|
||||
|
||||
**Recommended Approach** (Source: docs.temporal.io/develop/python/testing-suite):
|
||||
|
||||
- Write majority as integration tests
|
||||
- Use pytest with async fixtures
|
||||
- Time-skipping enables fast feedback (month-long workflows → seconds)
|
||||
@@ -26,6 +27,7 @@ Comprehensive testing approaches for Temporal workflows using pytest, progressiv
|
||||
- Validate determinism with replay testing
|
||||
|
||||
**Three Test Types**:
|
||||
|
||||
1. **Unit**: Workflows with time-skipping, activities with ActivityEnvironment
|
||||
2. **Integration**: Workers with mocked activities
|
||||
3. **End-to-end**: Full Temporal server with real activities (use sparingly)
|
||||
@@ -35,9 +37,11 @@ Comprehensive testing approaches for Temporal workflows using pytest, progressiv
|
||||
This skill provides detailed guidance through progressive disclosure. Load specific resources based on your testing needs:
|
||||
|
||||
### Unit Testing Resources
|
||||
|
||||
**File**: `resources/unit-testing.md`
|
||||
**When to load**: Testing individual workflows or activities in isolation
|
||||
**Contains**:
|
||||
|
||||
- WorkflowEnvironment with time-skipping
|
||||
- ActivityEnvironment for activity testing
|
||||
- Fast execution of long-running workflows
|
||||
@@ -45,9 +49,11 @@ This skill provides detailed guidance through progressive disclosure. Load speci
|
||||
- pytest fixtures and patterns
|
||||
|
||||
### Integration Testing Resources
|
||||
|
||||
**File**: `resources/integration-testing.md`
|
||||
**When to load**: Testing workflows with mocked external dependencies
|
||||
**Contains**:
|
||||
|
||||
- Activity mocking strategies
|
||||
- Error injection patterns
|
||||
- Multi-activity workflow testing
|
||||
@@ -55,18 +61,22 @@ This skill provides detailed guidance through progressive disclosure. Load speci
|
||||
- Coverage strategies
|
||||
|
||||
### Replay Testing Resources
|
||||
|
||||
**File**: `resources/replay-testing.md`
|
||||
**When to load**: Validating determinism or deploying workflow changes
|
||||
**Contains**:
|
||||
|
||||
- Determinism validation
|
||||
- Production history replay
|
||||
- CI/CD integration patterns
|
||||
- Version compatibility testing
|
||||
|
||||
### Local Development Resources
|
||||
|
||||
**File**: `resources/local-setup.md`
|
||||
**When to load**: Setting up development environment
|
||||
**Contains**:
|
||||
|
||||
- Docker Compose configuration
|
||||
- pytest setup and configuration
|
||||
- Coverage tool integration
|
||||
@@ -118,6 +128,7 @@ async def test_activity():
|
||||
## Coverage Targets
|
||||
|
||||
**Recommended Coverage** (Source: docs.temporal.io best practices):
|
||||
|
||||
- **Workflows**: ≥80% logic coverage
|
||||
- **Activities**: ≥80% logic coverage
|
||||
- **Integration**: Critical paths with mocked activities
|
||||
@@ -134,6 +145,7 @@ async def test_activity():
|
||||
## How to Use Resources
|
||||
|
||||
**Load specific resource when needed**:
|
||||
|
||||
- "Show me unit testing patterns" → Load `resources/unit-testing.md`
|
||||
- "How do I mock activities?" → Load `resources/integration-testing.md`
|
||||
- "Setup local Temporal server" → Load `resources/local-setup.md`
|
||||
|
||||
@@ -51,6 +51,7 @@ async def test_workflow_with_mocked_activity(workflow_env):
|
||||
### Dynamic Mock Responses
|
||||
|
||||
**Scenario-Based Mocking**:
|
||||
|
||||
```python
|
||||
@pytest.mark.asyncio
|
||||
async def test_workflow_multiple_mock_scenarios(workflow_env):
|
||||
@@ -106,6 +107,7 @@ async def test_workflow_multiple_mock_scenarios(workflow_env):
|
||||
### Testing Transient Failures
|
||||
|
||||
**Retry Behavior**:
|
||||
|
||||
```python
|
||||
@pytest.mark.asyncio
|
||||
async def test_workflow_transient_errors(workflow_env):
|
||||
@@ -154,6 +156,7 @@ async def test_workflow_transient_errors(workflow_env):
|
||||
### Testing Non-Retryable Errors
|
||||
|
||||
**Business Validation Failures**:
|
||||
|
||||
```python
|
||||
@pytest.mark.asyncio
|
||||
async def test_workflow_non_retryable_error(workflow_env):
|
||||
|
||||
@@ -519,6 +519,7 @@ async def test_workflow_with_breakpoint(workflow_env):
|
||||
## Troubleshooting
|
||||
|
||||
**Issue: Temporal server not starting**
|
||||
|
||||
```bash
|
||||
# Check logs
|
||||
docker-compose logs temporal
|
||||
@@ -529,12 +530,14 @@ docker-compose up -d
|
||||
```
|
||||
|
||||
**Issue: Tests timing out**
|
||||
|
||||
```python
|
||||
# Increase timeout in pytest.ini
|
||||
asyncio_default_timeout = 30
|
||||
```
|
||||
|
||||
**Issue: Port already in use**
|
||||
|
||||
```bash
|
||||
# Find process using port 7233
|
||||
lsof -i :7233
|
||||
|
||||
@@ -7,12 +7,14 @@ Comprehensive guide for validating workflow determinism and ensuring safe code c
|
||||
**Purpose**: Verify that workflow code changes are backward-compatible with existing workflow executions
|
||||
|
||||
**How it works**:
|
||||
|
||||
1. Temporal records every workflow decision as Event History
|
||||
2. Replay testing re-executes workflow code against recorded history
|
||||
3. If new code makes same decisions → deterministic (safe to deploy)
|
||||
4. If decisions differ → non-deterministic (breaking change)
|
||||
|
||||
**Critical Use Cases**:
|
||||
|
||||
- Deploying workflow code changes to production
|
||||
- Validating refactoring doesn't break running workflows
|
||||
- CI/CD automated compatibility checks
|
||||
@@ -78,6 +80,7 @@ async def test_replay_multiple_workflows():
|
||||
### Common Non-Deterministic Patterns
|
||||
|
||||
**Problem: Random Number Generation**
|
||||
|
||||
```python
|
||||
# ❌ Non-deterministic (breaks replay)
|
||||
@workflow.defn
|
||||
@@ -95,6 +98,7 @@ class GoodWorkflow:
|
||||
```
|
||||
|
||||
**Problem: Current Time**
|
||||
|
||||
```python
|
||||
# ❌ Non-deterministic
|
||||
@workflow.defn
|
||||
@@ -114,6 +118,7 @@ class GoodWorkflow:
|
||||
```
|
||||
|
||||
**Problem: Direct External Calls**
|
||||
|
||||
```python
|
||||
# ❌ Non-deterministic
|
||||
@workflow.defn
|
||||
@@ -432,6 +437,7 @@ class MigratedWorkflow:
|
||||
## Common Replay Errors
|
||||
|
||||
**Non-Deterministic Error**:
|
||||
|
||||
```
|
||||
WorkflowNonDeterministicError: Workflow command mismatch at position 5
|
||||
Expected: ScheduleActivityTask(activity_id='activity-1')
|
||||
@@ -441,6 +447,7 @@ Got: ScheduleActivityTask(activity_id='activity-2')
|
||||
**Solution**: Code change altered workflow decision sequence
|
||||
|
||||
**Version Mismatch Error**:
|
||||
|
||||
```
|
||||
WorkflowVersionError: Workflow version changed from 1 to 2 without using get_version()
|
||||
```
|
||||
|
||||
@@ -39,6 +39,7 @@ async def test_workflow_execution(workflow_env):
|
||||
```
|
||||
|
||||
**Key Benefits**:
|
||||
|
||||
- `workflow.sleep(timedelta(days=30))` completes instantly
|
||||
- Fast feedback loop (milliseconds vs hours)
|
||||
- Deterministic test execution
|
||||
@@ -46,6 +47,7 @@ async def test_workflow_execution(workflow_env):
|
||||
### Time-Skipping Examples
|
||||
|
||||
**Sleep Advancement**:
|
||||
|
||||
```python
|
||||
@pytest.mark.asyncio
|
||||
async def test_workflow_with_delays(workflow_env):
|
||||
@@ -72,6 +74,7 @@ async def test_workflow_with_delays(workflow_env):
|
||||
```
|
||||
|
||||
**Manual Time Control**:
|
||||
|
||||
```python
|
||||
@pytest.mark.asyncio
|
||||
async def test_workflow_manual_time(workflow_env):
|
||||
@@ -99,6 +102,7 @@ async def test_workflow_manual_time(workflow_env):
|
||||
### Testing Workflow Logic
|
||||
|
||||
**Decision Testing**:
|
||||
|
||||
```python
|
||||
@pytest.mark.asyncio
|
||||
async def test_workflow_branching(workflow_env):
|
||||
@@ -160,6 +164,7 @@ async def test_activity_basic():
|
||||
### Testing Activity Context
|
||||
|
||||
**Heartbeat Testing**:
|
||||
|
||||
```python
|
||||
async def test_activity_heartbeat():
|
||||
"""Verify heartbeat calls"""
|
||||
@@ -177,6 +182,7 @@ async def test_activity_heartbeat():
|
||||
```
|
||||
|
||||
**Cancellation Testing**:
|
||||
|
||||
```python
|
||||
async def test_activity_cancellation():
|
||||
"""Test activity cancellation handling"""
|
||||
@@ -199,6 +205,7 @@ async def test_activity_cancellation():
|
||||
### Testing Error Handling
|
||||
|
||||
**Exception Propagation**:
|
||||
|
||||
```python
|
||||
async def test_activity_error():
|
||||
"""Test activity error handling"""
|
||||
@@ -270,6 +277,7 @@ async def test_activity_parameterized(activity_env, input, expected):
|
||||
## Common Patterns
|
||||
|
||||
**Testing Retry Logic**:
|
||||
|
||||
```python
|
||||
@pytest.mark.asyncio
|
||||
async def test_workflow_with_retries(workflow_env):
|
||||
|
||||
Reference in New Issue
Block a user