devforgeai 1.0.4 → 1.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CLAUDE.md +120 -0
- package/package.json +9 -1
- package/src/CLAUDE.md +699 -0
- package/src/claude/scripts/README.md +396 -0
- package/src/claude/scripts/audit-command-skill-overlap.sh +67 -0
- package/src/claude/scripts/check-hooks-fast.sh +70 -0
- package/src/claude/scripts/devforgeai-validate +6 -0
- package/src/claude/scripts/devforgeai_cli/README.md +531 -0
- package/src/claude/scripts/devforgeai_cli/__init__.py +12 -0
- package/src/claude/scripts/devforgeai_cli/cli.py +716 -0
- package/src/claude/scripts/devforgeai_cli/commands/__init__.py +1 -0
- package/src/claude/scripts/devforgeai_cli/commands/check_hooks.py +384 -0
- package/src/claude/scripts/devforgeai_cli/commands/invoke_hooks.py +149 -0
- package/src/claude/scripts/devforgeai_cli/commands/phase_commands.py +731 -0
- package/src/claude/scripts/devforgeai_cli/commands/validate_installation.py +412 -0
- package/src/claude/scripts/devforgeai_cli/context_extraction.py +426 -0
- package/src/claude/scripts/devforgeai_cli/feedback/AC_TO_TEST_MAPPING.md +636 -0
- package/src/claude/scripts/devforgeai_cli/feedback/DELIVERY_SUMMARY.txt +329 -0
- package/src/claude/scripts/devforgeai_cli/feedback/README_TEST_SPECS.md +486 -0
- package/src/claude/scripts/devforgeai_cli/feedback/TEST_IMPLEMENTATION_GUIDE.md +529 -0
- package/src/claude/scripts/devforgeai_cli/feedback/TEST_SPECIFICATIONS.md +2652 -0
- package/src/claude/scripts/devforgeai_cli/feedback/TEST_SPECS_INDEX.md +398 -0
- package/src/claude/scripts/devforgeai_cli/feedback/__init__.py +34 -0
- package/src/claude/scripts/devforgeai_cli/feedback/adaptive_questioning_engine.py +581 -0
- package/src/claude/scripts/devforgeai_cli/feedback/aggregation.py +179 -0
- package/src/claude/scripts/devforgeai_cli/feedback/commands.py +535 -0
- package/src/claude/scripts/devforgeai_cli/feedback/config_defaults.py +58 -0
- package/src/claude/scripts/devforgeai_cli/feedback/config_manager.py +423 -0
- package/src/claude/scripts/devforgeai_cli/feedback/config_models.py +192 -0
- package/src/claude/scripts/devforgeai_cli/feedback/config_schema.py +140 -0
- package/src/claude/scripts/devforgeai_cli/feedback/coverage.json +1 -0
- package/src/claude/scripts/devforgeai_cli/feedback/feature_flag.py +152 -0
- package/src/claude/scripts/devforgeai_cli/feedback/feedback_indexer.py +394 -0
- package/src/claude/scripts/devforgeai_cli/feedback/hot_reload.py +226 -0
- package/src/claude/scripts/devforgeai_cli/feedback/longitudinal.py +115 -0
- package/src/claude/scripts/devforgeai_cli/feedback/models.py +67 -0
- package/src/claude/scripts/devforgeai_cli/feedback/question_router.py +236 -0
- package/src/claude/scripts/devforgeai_cli/feedback/retrospective.py +233 -0
- package/src/claude/scripts/devforgeai_cli/feedback/skip_tracker.py +177 -0
- package/src/claude/scripts/devforgeai_cli/feedback/skip_tracking.py +221 -0
- package/src/claude/scripts/devforgeai_cli/feedback/template_engine.py +549 -0
- package/src/claude/scripts/devforgeai_cli/feedback/validation.py +163 -0
- package/src/claude/scripts/devforgeai_cli/headless/__init__.py +30 -0
- package/src/claude/scripts/devforgeai_cli/headless/answer_models.py +206 -0
- package/src/claude/scripts/devforgeai_cli/headless/answer_resolver.py +204 -0
- package/src/claude/scripts/devforgeai_cli/headless/exceptions.py +36 -0
- package/src/claude/scripts/devforgeai_cli/headless/pattern_matcher.py +156 -0
- package/src/claude/scripts/devforgeai_cli/hooks.py +313 -0
- package/src/claude/scripts/devforgeai_cli/metrics/__init__.py +46 -0
- package/src/claude/scripts/devforgeai_cli/metrics/command_metrics.py +142 -0
- package/src/claude/scripts/devforgeai_cli/metrics/failure_modes.py +152 -0
- package/src/claude/scripts/devforgeai_cli/metrics/story_segmentation.py +181 -0
- package/src/claude/scripts/devforgeai_cli/orchestrate_hooks.py +780 -0
- package/src/claude/scripts/devforgeai_cli/phase_state.py +1229 -0
- package/src/claude/scripts/devforgeai_cli/session/__init__.py +30 -0
- package/src/claude/scripts/devforgeai_cli/session/checkpoint.py +268 -0
- package/src/claude/scripts/devforgeai_cli/tests/__init__.py +1 -0
- package/src/claude/scripts/devforgeai_cli/tests/conftest.py +29 -0
- package/src/claude/scripts/devforgeai_cli/tests/feedback/TEST_EXECUTION_GUIDE.md +298 -0
- package/src/claude/scripts/devforgeai_cli/tests/feedback/__init__.py +3 -0
- package/src/claude/scripts/devforgeai_cli/tests/feedback/test_adaptive_questioning_engine.py +2171 -0
- package/src/claude/scripts/devforgeai_cli/tests/feedback/test_aggregation.py +476 -0
- package/src/claude/scripts/devforgeai_cli/tests/feedback/test_config_defaults.py +133 -0
- package/src/claude/scripts/devforgeai_cli/tests/feedback/test_config_manager.py +592 -0
- package/src/claude/scripts/devforgeai_cli/tests/feedback/test_config_models.py +373 -0
- package/src/claude/scripts/devforgeai_cli/tests/feedback/test_config_schema.py +130 -0
- package/src/claude/scripts/devforgeai_cli/tests/feedback/test_configuration_management.py +1355 -0
- package/src/claude/scripts/devforgeai_cli/tests/feedback/test_edge_cases.py +308 -0
- package/src/claude/scripts/devforgeai_cli/tests/feedback/test_feature_flag.py +307 -0
- package/src/claude/scripts/devforgeai_cli/tests/feedback/test_feedback_indexer.py +384 -0
- package/src/claude/scripts/devforgeai_cli/tests/feedback/test_hot_reload.py +580 -0
- package/src/claude/scripts/devforgeai_cli/tests/feedback/test_integration.py +402 -0
- package/src/claude/scripts/devforgeai_cli/tests/feedback/test_models.py +105 -0
- package/src/claude/scripts/devforgeai_cli/tests/feedback/test_question_routing.py +262 -0
- package/src/claude/scripts/devforgeai_cli/tests/feedback/test_retrospective.py +333 -0
- package/src/claude/scripts/devforgeai_cli/tests/feedback/test_skip_tracker.py +410 -0
- package/src/claude/scripts/devforgeai_cli/tests/feedback/test_skip_tracking.py +159 -0
- package/src/claude/scripts/devforgeai_cli/tests/feedback/test_skip_tracking_integration.py +1155 -0
- package/src/claude/scripts/devforgeai_cli/tests/feedback/test_template_engine.py +1389 -0
- package/src/claude/scripts/devforgeai_cli/tests/feedback/test_validation_comprehensive.py +210 -0
- package/src/claude/scripts/devforgeai_cli/tests/fixtures/autonomous-deferral-story.md +46 -0
- package/src/claude/scripts/devforgeai_cli/tests/fixtures/missing-impl-notes.md +31 -0
- package/src/claude/scripts/devforgeai_cli/tests/fixtures/valid-deferral-story.md +46 -0
- package/src/claude/scripts/devforgeai_cli/tests/fixtures/valid-story-complete.md +48 -0
- package/src/claude/scripts/devforgeai_cli/tests/manual_test_invoke_hooks.sh +200 -0
- package/src/claude/scripts/devforgeai_cli/tests/session/DELIVERABLES.md +518 -0
- package/src/claude/scripts/devforgeai_cli/tests/session/TEST_SUMMARY.md +468 -0
- package/src/claude/scripts/devforgeai_cli/tests/session/__init__.py +6 -0
- package/src/claude/scripts/devforgeai_cli/tests/session/fixtures/corrupted-checkpoint.json +1 -0
- package/src/claude/scripts/devforgeai_cli/tests/session/fixtures/missing-fields-checkpoint.json +4 -0
- package/src/claude/scripts/devforgeai_cli/tests/session/fixtures/valid-checkpoint.json +15 -0
- package/src/claude/scripts/devforgeai_cli/tests/session/test_checkpoint.py +851 -0
- package/src/claude/scripts/devforgeai_cli/tests/test_check_hooks.py +1886 -0
- package/src/claude/scripts/devforgeai_cli/tests/test_depends_on_normalizer.py +171 -0
- package/src/claude/scripts/devforgeai_cli/tests/test_dod_validator.py +97 -0
- package/src/claude/scripts/devforgeai_cli/tests/test_invoke_hooks.py +1902 -0
- package/src/claude/scripts/devforgeai_cli/tests/test_phase_commands.py +320 -0
- package/src/claude/scripts/devforgeai_cli/tests/test_phase_commands_error_handling.py +1021 -0
- package/src/claude/scripts/devforgeai_cli/tests/test_phase_commands_import.py +697 -0
- package/src/claude/scripts/devforgeai_cli/tests/test_phase_state.py +2187 -0
- package/src/claude/scripts/devforgeai_cli/tests/test_skip_tracking.py +2141 -0
- package/src/claude/scripts/devforgeai_cli/tests/test_skip_tracking_coverage_gap.py +195 -0
- package/src/claude/scripts/devforgeai_cli/tests/test_subagent_enforcement.py +539 -0
- package/src/claude/scripts/devforgeai_cli/tests/test_validate_installation.py +361 -0
- package/src/claude/scripts/devforgeai_cli/utils/__init__.py +11 -0
- package/src/claude/scripts/devforgeai_cli/utils/depends_on_normalizer.py +149 -0
- package/src/claude/scripts/devforgeai_cli/utils/markdown_parser.py +219 -0
- package/src/claude/scripts/devforgeai_cli/utils/story_analyzer.py +249 -0
- package/src/claude/scripts/devforgeai_cli/utils/yaml_parser.py +152 -0
- package/src/claude/scripts/devforgeai_cli/validators/__init__.py +27 -0
- package/src/claude/scripts/devforgeai_cli/validators/ast_grep_validator.py +373 -0
- package/src/claude/scripts/devforgeai_cli/validators/context_validator.py +180 -0
- package/src/claude/scripts/devforgeai_cli/validators/dod_validator.py +309 -0
- package/src/claude/scripts/devforgeai_cli/validators/git_validator.py +107 -0
- package/src/claude/scripts/devforgeai_cli/validators/grep_fallback.py +300 -0
- package/src/claude/scripts/install_hooks.sh +186 -0
- package/src/claude/scripts/invoke_feedback_hooks.sh +59 -0
- package/src/claude/scripts/migrate-ac-headers.sh +122 -0
- package/src/claude/scripts/plan_file_kb.sh +704 -0
- package/src/claude/scripts/requirements.txt +8 -0
- package/src/claude/scripts/session_catalog.sh +543 -0
- package/src/claude/scripts/setup.py +55 -0
- package/src/claude/scripts/start-devforgeai.sh +16 -0
- package/src/claude/scripts/statusline.sh +27 -0
- package/src/claude/scripts/validate_deferrals.py +344 -0
- package/src/claude/skills/devforgeai-qa/SKILL.md +1 -1
- package/src/claude/skills/researching-market/SKILL.md +2 -1
- package/src/cli/lib/copier.js +13 -1
- package/src/claude/skills/designing-systems/scripts/__pycache__/detect_anti_patterns.cpython-312.pyc +0 -0
- package/src/claude/skills/designing-systems/scripts/__pycache__/validate_all_context.cpython-312.pyc +0 -0
- package/src/claude/skills/designing-systems/scripts/__pycache__/validate_architecture.cpython-312.pyc +0 -0
- package/src/claude/skills/designing-systems/scripts/__pycache__/validate_dependencies.cpython-312.pyc +0 -0
- package/src/claude/skills/devforgeai-story-creation/scripts/__pycache__/migrate_story_v1_to_v2.cpython-312.pyc +0 -0
- package/src/claude/skills/devforgeai-story-creation/scripts/tests/__pycache__/measure_accuracy.cpython-312.pyc +0 -0
|
@@ -0,0 +1,486 @@
|
|
|
1
|
+
# Test Specifications for STORY-011 - Complete Test Suite
|
|
2
|
+
|
|
3
|
+
**Generated:** 2025-11-10
|
|
4
|
+
**Story:** STORY-011 Configuration Management System
|
|
5
|
+
**Status:** Test Specifications Complete - Ready for Implementation
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Overview
|
|
10
|
+
|
|
11
|
+
This directory contains comprehensive test specifications for 6 untested Python modules in the DevForgeAI feedback configuration system:
|
|
12
|
+
|
|
13
|
+
1. **config_manager.py** (161 statements) → 68 tests
|
|
14
|
+
2. **hot_reload.py** (99 statements) → 55 tests
|
|
15
|
+
3. **config_models.py** (85 statements) → 59 tests
|
|
16
|
+
4. **skip_tracker.py** (78 statements) → 51 tests
|
|
17
|
+
5. **config_schema.py** (4 statements) → 15 tests
|
|
18
|
+
6. **config_defaults.py** (8 statements) → 15 tests
|
|
19
|
+
|
|
20
|
+
**Total:** 263+ tests targeting 435 untested statements (95%+ coverage)
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
## Documents in This Directory
|
|
25
|
+
|
|
26
|
+
### 1. TEST_SPECIFICATIONS.md (Complete)
|
|
27
|
+
**Size:** 11,000+ lines
|
|
28
|
+
**Purpose:** Detailed test method specifications for all 263 tests
|
|
29
|
+
**Organization:** By module with test class, fixture, assertion details
|
|
30
|
+
|
|
31
|
+
**Sections:**
|
|
32
|
+
- Module-by-module breakdown
|
|
33
|
+
- Test class definitions
|
|
34
|
+
- Test method names and descriptions
|
|
35
|
+
- Fixture requirements
|
|
36
|
+
- Key assertions
|
|
37
|
+
- Coverage targets
|
|
38
|
+
- Edge cases covered
|
|
39
|
+
|
|
40
|
+
**Use This When:**
|
|
41
|
+
- Implementing individual test methods
|
|
42
|
+
- Need detailed assertion patterns
|
|
43
|
+
- Looking up specific test requirements
|
|
44
|
+
- Verifying coverage targets
|
|
45
|
+
|
|
46
|
+
---
|
|
47
|
+
|
|
48
|
+
### 2. TEST_IMPLEMENTATION_GUIDE.md (Quick Reference)
|
|
49
|
+
**Size:** 800+ lines
|
|
50
|
+
**Purpose:** Implementation roadmap, timeline, and quick reference
|
|
51
|
+
**Organization:** By implementation phase with time estimates
|
|
52
|
+
|
|
53
|
+
**Sections:**
|
|
54
|
+
- Summary statistics (263 tests, 435 statements, 95%+ target)
|
|
55
|
+
- Module-by-module breakdown with priorities
|
|
56
|
+
- Implementation roadmap (4 phases, 35-41 hours)
|
|
57
|
+
- Pytest configuration
|
|
58
|
+
- Testing patterns (thread safety, file I/O, parametrization)
|
|
59
|
+
- Running tests
|
|
60
|
+
- AC-to-test mapping table
|
|
61
|
+
- Success criteria checklist
|
|
62
|
+
|
|
63
|
+
**Use This When:**
|
|
64
|
+
- Planning implementation sprints
|
|
65
|
+
- Estimating time and effort
|
|
66
|
+
- Need quick reference for phase breakdown
|
|
67
|
+
- Want to see testing patterns
|
|
68
|
+
- Creating pytest configuration
|
|
69
|
+
|
|
70
|
+
---
|
|
71
|
+
|
|
72
|
+
### 3. AC_TO_TEST_MAPPING.md (Requirements Traceability)
|
|
73
|
+
**Size:** 800+ lines
|
|
74
|
+
**Purpose:** Map acceptance criteria (AC-1 through AC-9) to test methods
|
|
75
|
+
**Organization:** By acceptance criterion with requirement, tests, assertions
|
|
76
|
+
|
|
77
|
+
**Sections:**
|
|
78
|
+
- AC-1: YAML loading (7 tests)
|
|
79
|
+
- AC-2: Master enable/disable (5 tests)
|
|
80
|
+
- AC-3: Trigger modes (8 tests)
|
|
81
|
+
- AC-4: Conversation settings (9 tests)
|
|
82
|
+
- AC-5: Skip tracking (14 tests)
|
|
83
|
+
- AC-6: Template preferences (11 tests)
|
|
84
|
+
- AC-7: Invalid config errors (16 tests)
|
|
85
|
+
- AC-8: Default config (15 tests)
|
|
86
|
+
- AC-9: Hot-reload (14 tests)
|
|
87
|
+
- Summary matrix
|
|
88
|
+
- Test execution strategy
|
|
89
|
+
- Validation checklist
|
|
90
|
+
|
|
91
|
+
**Use This When:**
|
|
92
|
+
- Verifying AC compliance
|
|
93
|
+
- Running tests for specific feature
|
|
94
|
+
- Creating validation checklists
|
|
95
|
+
- Ensuring traceability
|
|
96
|
+
- Documentation/audit purposes
|
|
97
|
+
|
|
98
|
+
---
|
|
99
|
+
|
|
100
|
+
## Quick Start
|
|
101
|
+
|
|
102
|
+
### 1. Read Overview (15 min)
|
|
103
|
+
```bash
|
|
104
|
+
# Review key documents
|
|
105
|
+
- This README_TEST_SPECS.md (5 min)
|
|
106
|
+
- TEST_IMPLEMENTATION_GUIDE.md (10 min)
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
### 2. Review Detailed Specs (1 hour)
|
|
110
|
+
```bash
|
|
111
|
+
# Read the detailed test specifications
|
|
112
|
+
- TEST_SPECIFICATIONS.md sections for your module
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
### 3. Setup Environment (30 min)
|
|
116
|
+
```bash
|
|
117
|
+
# Create conftest.py with shared fixtures
|
|
118
|
+
# Setup pytest.ini configuration
|
|
119
|
+
# Install dependencies: pytest, pytest-cov
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
### 4. Implement Tests (16-20 hours)
|
|
123
|
+
```bash
|
|
124
|
+
# Phase 1: Data models (4-5 hours)
|
|
125
|
+
pytest test_config_models.py -v
|
|
126
|
+
pytest test_config_defaults.py -v
|
|
127
|
+
pytest test_config_schema.py -v
|
|
128
|
+
|
|
129
|
+
# Phase 2: Configuration management (10-12 hours)
|
|
130
|
+
pytest test_config_manager.py -v
|
|
131
|
+
|
|
132
|
+
# Phase 3: Hot-reload (11-13 hours)
|
|
133
|
+
pytest test_hot_reload.py -v
|
|
134
|
+
|
|
135
|
+
# Phase 4: Skip tracking (10-11 hours)
|
|
136
|
+
pytest test_skip_tracker.py -v
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
### 5. Validate Coverage (1 hour)
|
|
140
|
+
```bash
|
|
141
|
+
# Run all tests with coverage
|
|
142
|
+
pytest --cov --cov-report=html
|
|
143
|
+
|
|
144
|
+
# Check coverage is >95% per module
|
|
145
|
+
# Generate coverage report: htmlcov/index.html
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
---
|
|
149
|
+
|
|
150
|
+
## Test Specification Format
|
|
151
|
+
|
|
152
|
+
### Typical Test Method Entry
|
|
153
|
+
|
|
154
|
+
```markdown
|
|
155
|
+
#### test_method_name
|
|
156
|
+
- **Purpose:** What behavior is being tested
|
|
157
|
+
- **Setup:** How test is initialized
|
|
158
|
+
- **Assertions:** What is verified (bullet list)
|
|
159
|
+
- **Coverage:** Which lines of code tested (e.g., Lines 34-52)
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
### Example Test Method (from TEST_SPECIFICATIONS.md)
|
|
163
|
+
|
|
164
|
+
```markdown
|
|
165
|
+
#### test_load_valid_yaml_file
|
|
166
|
+
- **Purpose:** Load valid YAML configuration file
|
|
167
|
+
- **Setup:** Create valid YAML with all sections
|
|
168
|
+
- **Assertions:**
|
|
169
|
+
- load_configuration() returns FeedbackConfiguration
|
|
170
|
+
- All sections populated correctly
|
|
171
|
+
- No errors logged
|
|
172
|
+
- **Coverage:** Lines 109-136, 226-248
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
---
|
|
176
|
+
|
|
177
|
+
## Module Coverage Targets
|
|
178
|
+
|
|
179
|
+
| Module | Statements | Target Tests | Coverage % |
|
|
180
|
+
|--------|-----------|-------------|-----------|
|
|
181
|
+
| config_manager.py | 161 | 68 | 95%+ |
|
|
182
|
+
| hot_reload.py | 99 | 55 | 95%+ |
|
|
183
|
+
| config_models.py | 85 | 59 | 95%+ |
|
|
184
|
+
| skip_tracker.py | 78 | 51 | 95%+ |
|
|
185
|
+
| config_schema.py | 4 | 15 | 100% |
|
|
186
|
+
| config_defaults.py | 8 | 15 | 100% |
|
|
187
|
+
| **TOTAL** | **435** | **263+** | **95%+** |
|
|
188
|
+
|
|
189
|
+
---
|
|
190
|
+
|
|
191
|
+
## Acceptance Criteria Coverage
|
|
192
|
+
|
|
193
|
+
All 9 acceptance criteria fully specified with tests:
|
|
194
|
+
|
|
195
|
+
| AC | Feature | Tests | Status |
|
|
196
|
+
|----|---------|-------|--------|
|
|
197
|
+
| 1 | YAML loads | 7 | ✓ Specified |
|
|
198
|
+
| 2 | Enable/disable | 5 | ✓ Specified |
|
|
199
|
+
| 3 | Trigger modes | 8 | ✓ Specified |
|
|
200
|
+
| 4 | Conversation settings | 9 | ✓ Specified |
|
|
201
|
+
| 5 | Skip tracking | 14 | ✓ Specified |
|
|
202
|
+
| 6 | Template preferences | 11 | ✓ Specified |
|
|
203
|
+
| 7 | Invalid config errors | 16 | ✓ Specified |
|
|
204
|
+
| 8 | Default config | 15 | ✓ Specified |
|
|
205
|
+
| 9 | Hot-reload | 14 | ✓ Specified |
|
|
206
|
+
|
|
207
|
+
---
|
|
208
|
+
|
|
209
|
+
## Key Features of Specifications
|
|
210
|
+
|
|
211
|
+
### 1. Complete Coverage
|
|
212
|
+
- Every acceptance criterion has corresponding tests
|
|
213
|
+
- Every statement of untested code targeted
|
|
214
|
+
- Edge cases and error paths included
|
|
215
|
+
- Thread safety validated for concurrent operations
|
|
216
|
+
- File I/O and persistence covered
|
|
217
|
+
|
|
218
|
+
### 2. Implementation-Ready
|
|
219
|
+
- Each test method has clear purpose statement
|
|
220
|
+
- Setup instructions provided
|
|
221
|
+
- Assertion examples shown
|
|
222
|
+
- Fixture requirements listed
|
|
223
|
+
- Coverage targets identified
|
|
224
|
+
|
|
225
|
+
### 3. Quality Standards
|
|
226
|
+
- AAA pattern (Arrange, Act, Assert)
|
|
227
|
+
- Descriptive test names
|
|
228
|
+
- Independent tests (no ordering dependencies)
|
|
229
|
+
- Proper fixture cleanup
|
|
230
|
+
- Parametrized tests where applicable
|
|
231
|
+
|
|
232
|
+
### 4. Traceability
|
|
233
|
+
- AC-to-test mapping document
|
|
234
|
+
- Line-of-code coverage targets
|
|
235
|
+
- Module-specific test classes
|
|
236
|
+
- Integration tests for workflows
|
|
237
|
+
|
|
238
|
+
---
|
|
239
|
+
|
|
240
|
+
## Pytest Configuration
|
|
241
|
+
|
|
242
|
+
### Basic pytest.ini
|
|
243
|
+
```ini
|
|
244
|
+
[pytest]
|
|
245
|
+
testpaths = .claude/scripts/devforgeai_cli/feedback
|
|
246
|
+
python_files = test_*.py
|
|
247
|
+
python_classes = Test*
|
|
248
|
+
python_functions = test_*
|
|
249
|
+
addopts = -v --tb=short --cov --cov-report=html
|
|
250
|
+
```
|
|
251
|
+
|
|
252
|
+
### Recommended conftest.py Fixtures
|
|
253
|
+
```python
|
|
254
|
+
@pytest.fixture
|
|
255
|
+
def temp_config_dir(tmp_path):
|
|
256
|
+
"""Temporary config directory"""
|
|
257
|
+
config_dir = tmp_path / "devforgeai" / "config"
|
|
258
|
+
config_dir.mkdir(parents=True)
|
|
259
|
+
return config_dir
|
|
260
|
+
|
|
261
|
+
@pytest.fixture
|
|
262
|
+
def temp_logs_dir(tmp_path):
|
|
263
|
+
"""Temporary logs directory"""
|
|
264
|
+
logs_dir = tmp_path / "devforgeai" / "logs"
|
|
265
|
+
logs_dir.mkdir(parents=True)
|
|
266
|
+
return logs_dir
|
|
267
|
+
|
|
268
|
+
@pytest.fixture
|
|
269
|
+
def config_manager_instance(temp_config_dir, temp_logs_dir):
|
|
270
|
+
"""ConfigurationManager test instance"""
|
|
271
|
+
reset_config_manager()
|
|
272
|
+
manager = ConfigurationManager(
|
|
273
|
+
config_file_path=temp_config_dir / "feedback.yaml",
|
|
274
|
+
logs_dir=temp_logs_dir,
|
|
275
|
+
enable_hot_reload=False
|
|
276
|
+
)
|
|
277
|
+
yield manager
|
|
278
|
+
manager.shutdown()
|
|
279
|
+
reset_config_manager()
|
|
280
|
+
```
|
|
281
|
+
|
|
282
|
+
---
|
|
283
|
+
|
|
284
|
+
## Implementation Phases
|
|
285
|
+
|
|
286
|
+
### Phase 1: Data Models (4-5 hours)
|
|
287
|
+
**Priority:** HIGH (foundational)
|
|
288
|
+
```
|
|
289
|
+
test_config_models.py 59 tests
|
|
290
|
+
test_config_defaults.py 15 tests
|
|
291
|
+
test_config_schema.py 15 tests
|
|
292
|
+
```
|
|
293
|
+
|
|
294
|
+
### Phase 2: Configuration Management (10-12 hours)
|
|
295
|
+
**Priority:** CRITICAL (core functionality)
|
|
296
|
+
```
|
|
297
|
+
test_config_manager.py 68 tests
|
|
298
|
+
```
|
|
299
|
+
|
|
300
|
+
### Phase 3: Hot-Reload System (11-13 hours)
|
|
301
|
+
**Priority:** HIGH (AC-9)
|
|
302
|
+
```
|
|
303
|
+
test_hot_reload.py 55 tests
|
|
304
|
+
```
|
|
305
|
+
|
|
306
|
+
### Phase 4: Skip Tracking (10-11 hours)
|
|
307
|
+
**Priority:** MEDIUM (AC-5)
|
|
308
|
+
```
|
|
309
|
+
test_skip_tracker.py 51 tests
|
|
310
|
+
```
|
|
311
|
+
|
|
312
|
+
---
|
|
313
|
+
|
|
314
|
+
## Running Tests
|
|
315
|
+
|
|
316
|
+
### All Tests
|
|
317
|
+
```bash
|
|
318
|
+
pytest -v --cov
|
|
319
|
+
```
|
|
320
|
+
|
|
321
|
+
### Single Module
|
|
322
|
+
```bash
|
|
323
|
+
pytest test_config_models.py -v
|
|
324
|
+
```
|
|
325
|
+
|
|
326
|
+
### Specific Test Class
|
|
327
|
+
```bash
|
|
328
|
+
pytest test_config_manager.py::TestConfigurationValidation -v
|
|
329
|
+
```
|
|
330
|
+
|
|
331
|
+
### With Coverage Report
|
|
332
|
+
```bash
|
|
333
|
+
pytest --cov --cov-report=html
|
|
334
|
+
open htmlcov/index.html
|
|
335
|
+
```
|
|
336
|
+
|
|
337
|
+
### By Acceptance Criterion
|
|
338
|
+
```bash
|
|
339
|
+
# AC-5: Skip tracking
|
|
340
|
+
pytest test_skip_tracker.py -v
|
|
341
|
+
|
|
342
|
+
# AC-9: Hot-reload
|
|
343
|
+
pytest test_hot_reload.py -v
|
|
344
|
+
```
|
|
345
|
+
|
|
346
|
+
---
|
|
347
|
+
|
|
348
|
+
## Success Criteria
|
|
349
|
+
|
|
350
|
+
After implementation, verify:
|
|
351
|
+
|
|
352
|
+
1. **All Tests Pass**
|
|
353
|
+
- [ ] 263+ tests implemented
|
|
354
|
+
- [ ] 100% test pass rate
|
|
355
|
+
- [ ] No failures or errors
|
|
356
|
+
|
|
357
|
+
2. **Coverage Targets**
|
|
358
|
+
- [ ] config_manager.py: 95%+ (153/161)
|
|
359
|
+
- [ ] hot_reload.py: 95%+ (94/99)
|
|
360
|
+
- [ ] config_models.py: 95%+ (81/85)
|
|
361
|
+
- [ ] skip_tracker.py: 95%+ (74/78)
|
|
362
|
+
- [ ] config_schema.py: 100% (4/4)
|
|
363
|
+
- [ ] config_defaults.py: 100% (8/8)
|
|
364
|
+
- [ ] **Overall: 95%+ (414/435)**
|
|
365
|
+
|
|
366
|
+
3. **Acceptance Criteria**
|
|
367
|
+
- [ ] AC-1: YAML loading ✓
|
|
368
|
+
- [ ] AC-2: Enable/disable ✓
|
|
369
|
+
- [ ] AC-3: Trigger modes ✓
|
|
370
|
+
- [ ] AC-4: Conversation settings ✓
|
|
371
|
+
- [ ] AC-5: Skip tracking ✓
|
|
372
|
+
- [ ] AC-6: Template preferences ✓
|
|
373
|
+
- [ ] AC-7: Invalid config errors ✓
|
|
374
|
+
- [ ] AC-8: Default config ✓
|
|
375
|
+
- [ ] AC-9: Hot-reload ✓
|
|
376
|
+
|
|
377
|
+
4. **Quality Standards**
|
|
378
|
+
- [ ] AAA pattern applied
|
|
379
|
+
- [ ] Tests independent (no ordering)
|
|
380
|
+
- [ ] Thread safety validated
|
|
381
|
+
- [ ] Error paths tested
|
|
382
|
+
- [ ] Edge cases covered
|
|
383
|
+
- [ ] Fixtures cleaned up
|
|
384
|
+
|
|
385
|
+
---
|
|
386
|
+
|
|
387
|
+
## References
|
|
388
|
+
|
|
389
|
+
### In This Directory
|
|
390
|
+
- **TEST_SPECIFICATIONS.md** - Complete test method specifications (11,000+ lines)
|
|
391
|
+
- **TEST_IMPLEMENTATION_GUIDE.md** - Implementation roadmap and quick reference
|
|
392
|
+
- **AC_TO_TEST_MAPPING.md** - Acceptance criteria to test traceability
|
|
393
|
+
|
|
394
|
+
### In DevForgeAI Repository
|
|
395
|
+
- **devforgeai/specs/context/** - Architecture constraints
|
|
396
|
+
- **.claude/skills/devforgeai-qa/** - QA automation patterns
|
|
397
|
+
- **devforgeai/specs/Stories/STORY-011.story.md** - Original story file
|
|
398
|
+
|
|
399
|
+
### External Resources
|
|
400
|
+
- **Pytest Documentation:** https://docs.pytest.org/
|
|
401
|
+
- **Python Threading:** https://docs.python.org/3/library/threading.html
|
|
402
|
+
- **Pytest Fixtures:** https://docs.pytest.org/en/stable/fixture.html
|
|
403
|
+
|
|
404
|
+
---
|
|
405
|
+
|
|
406
|
+
## FAQ
|
|
407
|
+
|
|
408
|
+
### Q: How many tests should I write per day?
|
|
409
|
+
**A:** Aim for 30-40 tests/day for experienced developers (4-5 hours). Start with Phase 1 data model tests for quick wins.
|
|
410
|
+
|
|
411
|
+
### Q: Can I run tests incrementally?
|
|
412
|
+
**A:** Yes! Start with `test_config_models.py` (lowest complexity, fastest feedback). Run after each test class to verify progress.
|
|
413
|
+
|
|
414
|
+
### Q: What if a test is too complex?
|
|
415
|
+
**A:** Break it into smaller test methods. Each test should focus on one behavior. Look for parametrization opportunities.
|
|
416
|
+
|
|
417
|
+
### Q: How do I handle timing issues in hot-reload tests?
|
|
418
|
+
**A:** Use polling loops with small waits (0.1s intervals) and reasonable timeouts (5s max). See examples in TEST_SPECIFICATIONS.md.
|
|
419
|
+
|
|
420
|
+
### Q: Should I implement conftest.py first?
|
|
421
|
+
**A:** Yes. Create shared fixtures early (temp directories, mock callbacks). This makes test implementation much faster.
|
|
422
|
+
|
|
423
|
+
---
|
|
424
|
+
|
|
425
|
+
## Support & Troubleshooting
|
|
426
|
+
|
|
427
|
+
### Test Isolation Issues
|
|
428
|
+
**Problem:** Tests affect each other
|
|
429
|
+
**Solution:** Ensure proper fixture cleanup (use `yield`, cleanup after)
|
|
430
|
+
|
|
431
|
+
### Timing Issues
|
|
432
|
+
**Problem:** Tests flaky due to timing
|
|
433
|
+
**Solution:** Use `pytest-timeout` plugin, polling loops instead of fixed sleep
|
|
434
|
+
|
|
435
|
+
### Import Errors
|
|
436
|
+
**Problem:** Cannot import modules under test
|
|
437
|
+
**Solution:** Ensure devforgeai_cli is in Python path, use PYTHONPATH environment variable
|
|
438
|
+
|
|
439
|
+
### Coverage Not Increasing
|
|
440
|
+
**Problem:** Tests not hitting expected lines
|
|
441
|
+
**Solution:** Review test assertions, add print statements during development, use pytest -s flag
|
|
442
|
+
|
|
443
|
+
---
|
|
444
|
+
|
|
445
|
+
## Next Steps
|
|
446
|
+
|
|
447
|
+
1. **Review this README** (15 min) ✓
|
|
448
|
+
2. **Read TEST_IMPLEMENTATION_GUIDE.md** (15 min) ✓
|
|
449
|
+
3. **Setup pytest environment** (30 min)
|
|
450
|
+
4. **Create conftest.py** (30 min)
|
|
451
|
+
5. **Implement Phase 1 tests** (4-5 hours)
|
|
452
|
+
6. **Validate coverage** (1 hour)
|
|
453
|
+
7. **Continue to Phase 2** (repeat)
|
|
454
|
+
|
|
455
|
+
---
|
|
456
|
+
|
|
457
|
+
## Document History
|
|
458
|
+
|
|
459
|
+
| Version | Date | Author | Changes |
|
|
460
|
+
|---------|------|--------|---------|
|
|
461
|
+
| 1.0 | 2025-11-10 | Test Automator | Initial complete specifications |
|
|
462
|
+
|
|
463
|
+
---
|
|
464
|
+
|
|
465
|
+
## Summary
|
|
466
|
+
|
|
467
|
+
This test specification package provides everything needed to implement 263+ tests for STORY-011 Configuration Management system:
|
|
468
|
+
|
|
469
|
+
- ✅ **Complete specifications** for every test method
|
|
470
|
+
- ✅ **Implementation roadmap** with time estimates
|
|
471
|
+
- ✅ **Acceptance criteria traceability** to every test
|
|
472
|
+
- ✅ **Code coverage targets** (95%+ per module)
|
|
473
|
+
- ✅ **Testing patterns** (thread safety, file I/O, etc.)
|
|
474
|
+
- ✅ **Pytest configuration** examples
|
|
475
|
+
- ✅ **Success criteria** checklist
|
|
476
|
+
|
|
477
|
+
**Status:** Ready for implementation
|
|
478
|
+
**Estimated Effort:** 35-41 hours
|
|
479
|
+
**Expected Coverage Gain:** 435 → 0 untested statements (435 statements → 95%+ coverage)
|
|
480
|
+
**Target Completion:** Complete within 1 sprint (2 weeks)
|
|
481
|
+
|
|
482
|
+
---
|
|
483
|
+
|
|
484
|
+
**Generated by:** Test Automator (TDD-driven test generation)
|
|
485
|
+
**For:** STORY-011 Configuration Management System
|
|
486
|
+
**Date:** 2025-11-10
|