←
AGEN-2
Created: 2026-02-03
•
Updated: 2026-02-03
Relationships
Loading...
Attachments
Loading...
Comments (7)
Claude QA Agent
·
2026-02-03
[QA] ✅ **VERIFICATION COMPLETE - PRODUCTION READY**
## Test Results
- **Unit Tests:** 711/711 passed (100% pass rate)
- **Integration Tests:** 7/7 passed (all QA scenarios verified)
- **Code Coverage:** 97% for skip_conditions.py module
- **Regression Tests:** 10 tests added for critical bug fixes
## Verified Functionality
✅ File-exists condition works correctly
✅ File-contains condition works correctly
✅ Template variable interpolation works
✅ Working directory handling is correct
✅ Per-task directory override works
✅ Absolute paths bypass working directory
✅ Error handling follows on-error strategy
✅ Skip status treated as success in workflow
## Critical Bugs Fixed & Verified
✅ Bug 1: Skipped status now treated as success (cli.py:455)
✅ Bug 2: Skip-if respects workflow directory (8 regression tests)
## QA Verdict
**STATUS: APPROVED FOR PRODUCTION**
All requirements met, all tests pass, no regressions detected. Implementation is clean, well-tested, and production-ready.
Full report: /tmp/qa-AGEN-2.md
agent
·
2026-02-03
## 🤖 says: Working Directory Bug Fixed
### Problem
Skip conditions were resolving relative paths from Python's cwd instead of the workflow's `directory` setting. When a workflow specified `directory: /tmp/my-workflow`, skip-if conditions with relative paths like `file-exists: "flag.txt"` would incorrectly check for `/path/to/python/cwd/flag.txt` instead of `/tmp/my-workflow/flag.txt`.
### Root Cause
- `src/skip_conditions.py:96` and `src/skip_conditions.py:137` used `os.path.abspath()` without considering the workflow directory
- The skip-if check in `executor.py` was called BEFORE the working directory was determined
### Fix
**Modified `src/skip_conditions.py`:**
- Added `working_dir` parameter to `BaseSkipCondition.__init__()` (line 66-79)
- Updated `FileExistsSkipCondition.check()` to resolve relative paths against `working_dir` (lines 99-106)
- Updated `FileContainsSkipCondition.check()` similarly (lines 139-145)
- Updated `create_skip_condition()` and `check_skip_conditions()` to pass working_dir
**Modified `src/executor.py`:**
- Moved working directory computation BEFORE skip-if check (lines 84-106)
- Pass computed `working_dir` to `check_skip_conditions()` (line 112)
- Refactored duplicate directory computation code to reuse `working_dir`
### Test Coverage
Added 8 new regression tests in `tests/test_skip_if.py`:
1. `test_file_exists_uses_workflow_directory`
2. `test_file_exists_relative_path_without_working_dir_uses_cwd`
3. `test_file_contains_uses_workflow_directory`
4. `test_check_skip_conditions_passes_working_dir`
5. `test_executor_passes_workflow_directory_to_skip_conditions`
6. `test_executor_uses_task_directory_override_for_skip_if`
7. `test_file_exists_with_absolute_path_ignores_working_dir`
8. `test_file_contains_with_absolute_path_ignores_working_dir`
### Verification
- All 711 tests pass (44 skip-if tests including 8 new ones)
- Merged to main and pushed
Commit: 759d9a5
Claude QA Agent
·
2026-02-03
[QA] **CRITICAL BUG FOUND** - Skip-if does not respect workflow directory
## Bug Summary
Skip conditions use `os.path.abspath()` which resolves relative paths from Python's cwd, NOT the workflow's `directory` setting. This makes the feature non-functional for relative paths.
## Root Cause
`src/skip_conditions.py:96` - Uses `os.path.abspath()` without considering workflow directory
## Impact
- ❌ Relative paths in skip-if: BROKEN
- ✅ Absolute paths in skip-if: Works
- ❌ Primary use case (idempotent workflows): BROKEN
## Evidence
Test workflow with `directory: /tmp/qa-skip-if-test` and `skip-if: {file-exists: "flag.txt"}`:
- File exists at: `/tmp/qa-skip-if-test/flag.txt` ✅
- Skip-if checks: `/tmp/agent-yaml-AGEN-2/flag.txt` ❌
- Result: Task executes when it should skip ❌
## Required Fix
Pass working directory to skip conditions and resolve relative paths correctly:
```python
# In executor.py
working_dir = get_working_directory(task_def, workflow_config)
skip_result = check_skip_conditions(skip_config, resolved_vars, working_dir)
# In skip_conditions.py - resolve paths relative to working_dir
if not os.path.isabs(file_path):
file_path = os.path.join(self.working_dir, file_path)
```
## QA Verdict
❌ **FAILED - DO NOT MERGE**
Severity: CRITICAL (Showstopper)
Full report: /tmp/qa-AGEN-2.md
agent
·
2026-02-03
## 🤖 says: Bug Fix Complete
### Problem
QA identified a critical bug in `src/cli.py:455` where `execute_task_tree` only checked for `status == 'success'`, treating `'skipped'` as a failure. This caused skip-if conditions to be treated as task failures even when they correctly skipped the task.
### Fix
Changed the status check from:
```python
return 0 if result['status'] == 'success' else 1
```
To:
```python
return 0 if result['status'] in ('success', 'skipped') else 1
```
### Files Changed
- `src/cli.py`: 1 line fix at line 455
- `tests/test_cli.py`: Added 2 regression tests (50 lines)
- `test_skipped_status_treated_as_success`
- `test_skipped_status_in_sequential_execution`
### Verification
- All 703 tests pass (18 skipped)
- New regression tests specifically verify the fix
- Merged to main and pushed
Commit: 00513bb
Claude QA Agent
·
2026-02-03
[QA] **CRITICAL BUG FOUND** - Feature does not work in production
## Bug Location
`src/cli.py` line 455
## Problem
When a task is skipped, `execute_single_task` returns `{"status": "skipped"}`, but `execute_task_tree` only checks for `"success"`, treating "skipped" as a failure. This causes skipped tasks to be incorrectly handled.
## Evidence
Created test workflow where task should skip if file exists. The file existed, but the task still executed and created error.txt with content "TASK WAS NOT SKIPPED".
## Fix Required
Change line 455 from:
```python
return 0 if result["status"] == "success" else 1
```
To:
```python
return 0 if result["status"] in ("success", "skipped") else 1
```
## Impact
- Unit tests pass (36/36 skip-if tests)
- Full test suite passes (701 tests)
- **Integration fails**: Feature non-functional in actual workflows
## Severity
HIGH - Showstopper bug. Feature is 90% implemented but completely broken in production use.
See full QA report: /tmp/qa-AGEN-2.md
agent
·
2026-02-03
## 🤖 says: Implementation Complete
**Summary:** Implemented file-based skip conditions to enable idempotent workflows.
### Changes Made
1. **New Module: `src/skip_conditions.py`** (~80 lines)
- `FileExistsSkipCondition`: Skip if file exists at path
- `FileContainsSkipCondition`: Skip if file contains text substring
- `check_skip_conditions()`: Main entry point for skip checks
- Template variable interpolation in all paths
- Clear error messages with skip reasons to stderr
2. **Modified: `src/executor.py`** (+33 lines)
- Added skip-if check BEFORE task execution (lines 82-115)
- Returns `{"status": "skipped", "exit_code": 0}` when condition met
- Error handling follows task's `on-error` strategy
3. **Modified: `src/validator.py`** (+80 lines)
- Added `skip-if` to known meta fields
- Added `_validate_skip_if_config()` method
- Validates condition types (file-exists, file-contains)
- Validates type-specific config (string for file-exists, dict for file-contains)
4. **New Tests: `tests/test_skip_if.py`** (36 tests)
- FileExistsSkipCondition tests (4 tests)
- FileContainsSkipCondition tests (8 tests)
- Factory function tests (3 tests)
- check_skip_conditions tests (5 tests)
- SkipConditionResult tests (2 tests)
- Schema validation tests (9 tests)
- Executor integration tests (5 tests)
5. **New Example: `examples/30-skip-if-conditions.yaml`**
- Demonstrates both condition types
- Shows template variable usage
6. **Updated: `CLAUDE.md`**
- Added Pre-Task Skip Conditions documentation
- Updated module architecture diagram
- Updated examples list
### Verification
- All 36 new skip-if tests pass
- All 685 existing tests pass (no regressions)
- Example workflow validates successfully
### Files Changed
```
src/skip_conditions.py # NEW - 263 lines
src/executor.py # +33 lines
src/validator.py # +82 lines
tests/test_skip_if.py # NEW - 664 lines
examples/30-skip-if-conditions.yaml # NEW - 66 lines
CLAUDE.md # +59 lines
```
Commit: ed3934e
triage-agent
·
2026-02-03
## 🤖 says: Feature Triage Complete
**Status:** NOT IMPLEMENTED (Feature does not exist)
**Summary:** This is a new feature request for file-based skip conditions. The codebase has no existing skip-if mechanism. However, the post-task validators in `src/task_validators.py` provide an excellent pattern to follow - specifically `FileExistsValidator` and `ContainsValidator` contain 90% of the needed file-checking logic.
**Implementation Location:**
- New file: `src/skip_conditions.py` (~80 lines)
- Modify: `src/executor.py` (~20 lines) - add skip check before task execution
- Modify: `src/validator.py` (~50 lines) - schema validation
- New file: `tests/test_skip_if.py` (~70 lines)
**Complexity:** Low-Medium (~200 lines total, well-defined scope)
**Key Finding:** The feature is already planned in `spec/planning.txt` (lines 110-123). Implementation follows established validator patterns.
See full triage report: `/tmp/triage-AGEN-2.md`