---
name: acceptance-criteria
description: Enforce acceptance criteria capture and validation for tasks
status: done
parts:
- src/types/task.rs
- src/storage.rs
- src/servers/task.rs
- src/servers/unified.rs
- CLAUDE.md
estimate:
  optimistic: 4 hours
  normal: 6 hours
  pessimistic: 9 hours
---

# Implementation Plan

## Task Summary

| ID | Task | Files |
|----|------|-------|
| T1 | Extend feature model + config defaults | `src/types/task.rs` |
| T2 | Parse/store acceptance_criteria in features | `src/servers/task.rs`, `src/servers/unified.rs` |
| T3 | Enforce acceptance criteria before done | `src/servers/task.rs`, `src/servers/unified.rs` |
| T4 | Update project config persistence tests | `src/storage.rs` |
| T5 | Document acceptance criteria workflow | `CLAUDE.md` |

## Tasks

- [ ] **T1**: Add `acceptance_criteria` to feature JSON, and add `acceptance_criteria_max_iterations` to project config with defaults/comments/tests.
- [ ] **T2**: Ensure `save_features`, `mark_feature_complete`, and `mark_feature_verified` handle acceptance criteria arrays.
- [ ] **T3**: Block `TaskStatus::Done` if acceptance criteria are missing and provide config-guided hints.
- [ ] **T4**: Update storage/config tests for the new project config field.
- [ ] **T5**: Update workflow docs and feature-list schema examples.

## Testing Considerations

- Run `cargo test` to cover updated config parsing/merge tests.
- Exercise `set_task_status` failure paths for missing acceptance criteria.
- Validate `save_features` accepts acceptance_criteria in JSON.

---

## Estimate

**Senior Developer Profile:** 5+ years experience, familiar with the project's tech stack.

| Scenario | Time |
|----------|------|
| Optimistic | 4 hours |
| Normal | 6 hours |
| Pessimistic | 9 hours |

### Assumptions
- Acceptance criteria stored alongside steps in feature-list.json.
- Existing task workflow remains unchanged aside from new validation.
- No additional UI changes are required for criteria management.
