Skip to content

Commit a118872

Browse files
jwaldripclaude
andcommitted
fix: make testing non-negotiable, remove per-intent testing config
Testing is always required — not a per-intent preference. Asking users whether they want tests is like asking if they want a seatbelt. - Remove Phase 5.5 (testing requirements questions) from elaborate - Remove testing: frontmatter from intent.md template - Reviewer unconditionally requires tests for all new code - Remove conditional testing requirements table from subagent context - Remove coverage gate config from settings template - Delete PLAN.md and enforce-testing-gates.sh (wrong layer — mechanical coverage enforcement belongs in han backpressure hooks, not AI-DLC) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 5b767b2 commit a118872

File tree

4 files changed

+13
-153
lines changed

4 files changed

+13
-153
lines changed

plugin/hats/reviewer.md

Lines changed: 12 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,13 @@ The Reviewer verifies that the Builder's implementation satisfies the Unit's Com
3131

3232
## Steps
3333

34-
1. Check testing requirements
35-
- Read testing requirements from `.ai-dlc/{intent-slug}/intent.md` frontmatter
36-
- If testing requirements are configured, verify each:
37-
- **Unit tests**: If `unit_tests: true`, verify unit tests exist for new/modified code
38-
- **Integration tests**: If `integration_tests: true`, verify integration tests exist
39-
- **Coverage**: If `coverage_threshold` is set, run coverage and verify it meets the threshold
40-
- **E2E tests**: If `e2e_tests: true`, verify E2E tests pass
41-
- **Validation**: All required testing criteria are met
34+
1. Verify test coverage
35+
- You MUST verify that unit tests exist for all new and modified code
36+
- You MUST run the full test suite and confirm all tests pass
37+
- You MUST check that tests are meaningful (not just asserting `true`)
38+
- You MUST identify untested code paths and flag them
39+
- You SHOULD verify integration tests exist for component boundaries
40+
- **Validation**: All new code has corresponding tests, all tests pass
4241

4342
2. Verify criteria satisfaction
4443
- You MUST check each Completion Criterion individually
@@ -69,11 +68,11 @@ The Reviewer verifies that the Builder's implementation satisfies the Unit's Com
6968
- **Validation**: Feedback is actionable
7069

7170
6. Make decision
72-
- If all criteria pass, testing requirements met, and quality acceptable: APPROVE
73-
- If criteria fail, testing requirements unmet, or blocking issues: REQUEST CHANGES
71+
- If all criteria pass, tests pass, and quality acceptable: APPROVE
72+
- If criteria fail, tests missing, or blocking issues: REQUEST CHANGES
7473
- You MUST document decision clearly
7574
- You MUST NOT approve if criteria are not met
76-
- You MUST NOT approve if configured testing requirements are not satisfied
75+
- You MUST NOT approve if new code lacks tests
7776
- **Validation**: Clear approve/reject with rationale
7877

7978
#### Provider Sync — Review Outcome
@@ -86,51 +85,15 @@ The Reviewer verifies that the Builder's implementation satisfies the Unit's Com
8685

8786
## Success Criteria
8887

89-
- [ ] Testing requirements checked (if configured in intent.md)
88+
- [ ] All new code has corresponding tests
89+
- [ ] All tests pass
9090
- [ ] All Completion Criteria verified (pass/fail for each)
9191
- [ ] Code quality issues documented
9292
- [ ] Edge cases and error handling reviewed
9393
- [ ] Security considerations checked
9494
- [ ] Clear decision: APPROVE or REQUEST CHANGES
9595
- [ ] Actionable feedback provided if changes requested
9696

97-
## Testing Verification Details
98-
99-
When verifying testing requirements from `intent.md`:
100-
101-
### Reading the Configuration
102-
103-
```bash
104-
INTENT_SLUG=$(han keep load --branch main intent-slug --quiet 2>/dev/null || echo "")
105-
INTENT_DIR=".ai-dlc/${INTENT_SLUG}"
106-
TESTING_CONFIG=$(han parse yaml testing --json < "$INTENT_DIR/intent.md" 2>/dev/null || echo "{}")
107-
```
108-
109-
### Unit Tests (when `unit_tests: true`)
110-
111-
1. Identify new/modified source files from the unit's changes
112-
2. Check for corresponding test files (e.g., `*.test.ts`, `*.spec.ts`, `*_test.go`)
113-
3. Run the test suite and verify tests pass
114-
4. **FAIL if**: New code has no corresponding unit tests
115-
116-
### Integration Tests (when `integration_tests: true`)
117-
118-
1. Check for integration test files in the project
119-
2. Run integration test suite
120-
3. **FAIL if**: No integration tests exist for affected components
121-
122-
### Coverage (when `coverage_threshold` is set)
123-
124-
1. Run test coverage tool (e.g., `npm run test:coverage`, `go test -cover`)
125-
2. Compare coverage percentage against threshold
126-
3. **FAIL if**: Coverage is below the configured threshold
127-
128-
### E2E Tests (when `e2e_tests: true`)
129-
130-
1. Run E2E test suite (e.g., Playwright, Cypress)
131-
2. Verify all E2E tests pass
132-
3. **FAIL if**: E2E tests fail or are missing for affected user flows
133-
13497
## Error Handling
13598

13699
### Error: Cannot Verify Criterion Programmatically

plugin/hooks/subagent-context.sh

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -116,35 +116,6 @@ if [ -f "${INTENT_DIR}/completion-criteria.md" ]; then
116116
echo ""
117117
fi
118118

119-
# Display testing requirements if configured (stored in intent.md frontmatter)
120-
if [ -f "$INTENT_FILE" ]; then
121-
TESTING_JSON=$(han parse yaml testing --json < "$INTENT_FILE" 2>/dev/null || echo "")
122-
if [ -n "$TESTING_JSON" ] && [ "$TESTING_JSON" != "null" ] && [ "$TESTING_JSON" != "{}" ]; then
123-
echo "### Testing Requirements"
124-
echo ""
125-
126-
# Parse individual fields
127-
UNIT_TESTS=$(echo "$TESTING_JSON" | han parse json unit_tests -r --default "" 2>/dev/null || echo "")
128-
INTEGRATION_TESTS=$(echo "$TESTING_JSON" | han parse json integration_tests -r --default "" 2>/dev/null || echo "")
129-
COVERAGE=$(echo "$TESTING_JSON" | han parse json coverage_threshold -r --default "" 2>/dev/null || echo "")
130-
E2E_TESTS=$(echo "$TESTING_JSON" | han parse json e2e_tests -r --default "" 2>/dev/null || echo "")
131-
132-
echo "| Requirement | Status |"
133-
echo "|-------------|--------|"
134-
[ "$UNIT_TESTS" = "true" ] && echo "| Unit Tests | Required |"
135-
[ "$UNIT_TESTS" = "false" ] && echo "| Unit Tests | Optional |"
136-
[ "$INTEGRATION_TESTS" = "true" ] && echo "| Integration Tests | Required |"
137-
[ "$INTEGRATION_TESTS" = "false" ] && echo "| Integration Tests | Optional |"
138-
if [ -n "$COVERAGE" ] && [ "$COVERAGE" != "null" ]; then
139-
echo "| Coverage Threshold | ${COVERAGE}% |"
140-
else
141-
echo "| Coverage Threshold | None |"
142-
fi
143-
[ "$E2E_TESTS" = "true" ] && echo "| E2E Tests | Required |"
144-
[ "$E2E_TESTS" = "false" ] && echo "| E2E Tests | Optional |"
145-
echo ""
146-
fi
147-
fi
148119

149120
# Source DAG library if available
150121
DAG_LIB="${CLAUDE_PLUGIN_ROOT}/lib/dag.sh"

plugin/skills/elaborate/SKILL.md

Lines changed: 1 addition & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -502,59 +502,6 @@ Present the full unit breakdown to the user and confirm before proceeding.
502502

503503
---
504504

505-
## Phase 5.5: Define Testing Requirements
506-
507-
Ask the user about testing expectations for this intent:
508-
509-
```json
510-
{
511-
"questions": [
512-
{
513-
"question": "What testing requirements should we enforce for this intent?",
514-
"header": "Unit Tests",
515-
"options": [
516-
{"label": "Required", "description": "New code must have unit tests"},
517-
{"label": "Not required", "description": "Unit tests are optional"}
518-
],
519-
"multiSelect": false
520-
},
521-
{
522-
"question": "Integration tests?",
523-
"header": "Integration Tests",
524-
"options": [
525-
{"label": "Required", "description": "Integration tests must verify component interactions"},
526-
{"label": "Not required", "description": "Integration tests are optional"}
527-
],
528-
"multiSelect": false
529-
},
530-
{
531-
"question": "Coverage threshold?",
532-
"header": "Coverage",
533-
"options": [
534-
{"label": "80%", "description": "Minimum 80% code coverage"},
535-
{"label": "70%", "description": "Minimum 70% code coverage"},
536-
{"label": "60%", "description": "Minimum 60% code coverage"},
537-
{"label": "None", "description": "No coverage requirement"}
538-
],
539-
"multiSelect": false
540-
},
541-
{
542-
"question": "End-to-end tests?",
543-
"header": "E2E Tests",
544-
"options": [
545-
{"label": "Required", "description": "E2E tests must pass"},
546-
{"label": "Not required", "description": "E2E tests are optional"}
547-
],
548-
"multiSelect": false
549-
}
550-
]
551-
}
552-
```
553-
554-
Store the testing configuration for the reviewer hat to enforce.
555-
556-
---
557-
558505
## Phase 5.75: Spec Validation Gate
559506

560507
**This is the quality gate that prevents shallow specs from reaching construction.**
@@ -581,9 +528,6 @@ For each unit:
581528
- Builds: {specific components/modules/endpoints}
582529
- Criteria: {count} success criteria
583530

584-
### Testing Requirements
585-
{Summary of testing config}
586-
587531
### Workflow & Mode
588532
{workflow name} — {mode}
589533
```
@@ -697,11 +641,6 @@ git:
697641
change_strategy: {unit|intent|trunk|bolt}
698642
auto_merge: {true|false}
699643
auto_squash: false
700-
testing:
701-
unit_tests: true # true = required, false = optional
702-
integration_tests: false # true = required, false = optional
703-
coverage_threshold: 80 # percentage (0-100), or null for no requirement
704-
e2e_tests: false # true = required, false = optional
705644
created: {ISO date}
706645
status: active
707646
epic: "" # Ticketing provider epic key (auto-populated if ticketing provider configured)
@@ -743,15 +682,6 @@ problem space.}
743682
{Relevant background, constraints, decisions made during elaboration}
744683
```
745684

746-
**Testing frontmatter schema:**
747-
748-
| Field | Type | Description |
749-
|-------|------|-------------|
750-
| `testing.unit_tests` | boolean | Whether unit tests are required for new code |
751-
| `testing.integration_tests` | boolean | Whether integration tests are required |
752-
| `testing.coverage_threshold` | number or null | Minimum coverage percentage, or null if no requirement |
753-
| `testing.e2e_tests` | boolean | Whether E2E tests must pass |
754-
755685
### 3. Write `unit-NN-{slug}.md` for each unit:
756686
```markdown
757687
---
@@ -876,7 +806,7 @@ Intent Worktree: /tmp/ai-dlc-{intent-slug}/
876806
Branch: ai-dlc/{intent-slug}/main
877807
878808
Created: .ai-dlc/{intent-slug}/
879-
- intent.md (intent, config, and testing requirements)
809+
- intent.md (intent and config)
880810
- unit-01-{name}.md
881811
- unit-02-{name}.md
882812
...

website/public/templates/settings-template.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,6 @@ quality_gates:
3939
test: "npm test" # or "bun test", "pytest", etc.
4040
typecheck: "tsc --noEmit" # TypeScript check
4141
lint: "biome check" # or "eslint .", "ruff check", etc.
42-
# coverage: "npm run coverage" # Optional: coverage check
43-
44-
# Minimum test coverage percentage (if coverage gate enabled)
45-
# min_coverage: 80
4642

4743
# =============================================================================
4844
# Unit Configuration

0 commit comments

Comments
 (0)