# Check service implementation
ls -la services/infrastructure/config/methodology_configuration.py
# Check test implementation
ls -la tests/infrastructure/config/test_methodology_configuration.py
# Verify classes importable
PYTHONPATH=. python -c "from services.infrastructure.config.methodology_configuration import get_methodology_config_service; print('✅ Import successful')"
# Run all methodology configuration tests
PYTHONPATH=. python -m pytest tests/infrastructure/config/test_methodology_configuration.py -v
# Expected: 15 PASSED, 2 warnings (thread stress test warnings are expected)
# Test basic service creation and configuration
PYTHONPATH=. python -c "
from services.infrastructure.config.methodology_configuration import get_methodology_config_service
service = get_methodology_config_service()
config = service.get_config()
print(f'Enforcement Level: {config.handoff_enforcement_level}')
print(f'Preferred Agents: {config.preferred_agents}')
print(f'Evidence Collection: {config.evidence_collection}')
print('✅ Basic functionality working')
"
# Create test config file
cat > test_config.md << 'EOF'
# Test Configuration
\`\`\`yaml
methodology:
handoff_protocol:
enforcement_level: "STRICT"
verification_required: true
agent_coordination:
preferred_agents: ["Code", "Cursor"]
multi_agent_threshold: 5
verification_pyramid:
evidence_collection: "MANDATORY"
\`\`\`
EOF
# Test loading configuration
PYTHONPATH=. python -c "
from services.infrastructure.config.methodology_configuration import MethodologyConfigurationService
from pathlib import Path
service = MethodologyConfigurationService()
service.load_from_file('test_config.md')
config = service.get_config()
print(f'Loaded Enforcement: {config.handoff_enforcement_level}')
print(f'Loaded Threshold: {config.multi_agent_threshold}')
print('✅ PIPER.user.md integration working')
"
# Cleanup
rm test_config.md
# Test PM-138 mandatory handoff protocol compatibility
PYTHONPATH=. python -c "
from services.infrastructure.config.methodology_configuration import get_methodology_config_service, MethodologyValidationLevel
service = get_methodology_config_service()
result = service.validate(MethodologyValidationLevel.FULL)
print(f'PM-138 Compatible: {result.pm138_compatibility_result}')
print(f'Overall Valid: {result.is_valid()}')
if result.pm138_compatibility_result:
print('✅ PM-138 compatibility validated')
else:
print('❌ PM-138 compatibility failed')
print(f'Errors: {result.errors}')
"
# Test configuration access performance
PYTHONPATH=. python -c "
import time
from services.infrastructure.config.methodology_configuration import get_methodology_config_service
service = get_methodology_config_service()
start_time = time.time()
for i in range(1000):
config = service.get_config()
end_time = time.time()
avg_time = (end_time - start_time) / 1000 * 1000 # Convert to ms
print(f'1000 reads in {(end_time - start_time)*1000:.1f}ms')
print(f'Average per read: {avg_time:.3f}ms')
print(f'Performance target (<1ms): {\"✅ PASS\" if avg_time < 1 else \"❌ FAIL\"}')
"
Test different team configurations work correctly:
methodology:
handoff_protocol:
enforcement_level: "STRICT"
verification_required: true
methodology:
handoff_protocol:
enforcement_level: "PROGRESSIVE"
verification_required: true
methodology:
agent_coordination:
multi_agent_threshold: 2
preferred_agents: ["Code", "Cursor", "Lead", "Chief"]
Test all three validation levels work:
PYTHONPATH=. python -c "
from services.infrastructure.config.methodology_configuration import get_methodology_config_service, MethodologyValidationLevel
service = get_methodology_config_service()
for level in [MethodologyValidationLevel.BASIC, MethodologyValidationLevel.ENHANCED, MethodologyValidationLevel.FULL]:
result = service.validate(level)
print(f'{level.value}: Valid={result.is_valid()}, Errors={len(result.errors)}')
"
Test event notification system:
PYTHONPATH=. python -c "
from services.infrastructure.config.methodology_configuration import get_methodology_config_service
service = get_methodology_config_service()
events = []
def event_handler(key, old_value, new_value):
events.append(f'{key}: {old_value} -> {new_value}')
service.subscribe_to_changes(event_handler)
service.update_config({'handoff_enforcement_level': 'ADVISORY'})
print(f'Events captured: {len(events)}')
for event in events:
print(f' {event}')
"
| Test | Expected Result | Success Criteria |
|---|---|---|
| Import Test | ✅ Import successful | No import errors |
| Test Suite | 15 PASSED, 2 warnings | All tests pass |
| Basic Functionality | Config values displayed | Service creates and returns config |
| PIPER.user.md Integration | Loaded values displayed | Configuration loaded from YAML |
| PM-138 Compatibility | ✅ PM-138 compatibility validated | Validation passes |
| Performance | <1ms per read | Performance under target |
If any test fails, provide:
This enables rapid debugging and fixes based on concrete evidence.
Once cross-validation is complete with all checks passing, the MethodologyConfigurationService is ready for: