Your friendly neighborhood hallucination-busting task force.
We chase down stray fictions, unravel tangled logic, and return clean, fact-checked truth.
Not affiliated with any cartoon dogs, paranormal investigators, or 80s movie franchises — just here to keep the LLM output on the level.
clewcrew-common is the foundational package that eliminates duplication across all clewcrew components. It provides standardized utilities for confidence scoring, logging, configuration management, and more.
clewcrew-common
├── Confidence Scoring # Standardized confidence calculation
├── Logging Framework # Unified logging and monitoring
├── Configuration # Environment and config management
├── Data Models # Common Pydantic models
├── Async Utilities # Common async patterns
├── File Operations # Path handling, file operations
└── Validation # Common validation patterns
# Install from PyPI
pip install clewcrew-common
# Or install with UV
uv add clewcrew-commonfrom clewcrew_common import ConfidenceCalculator, ConfidenceScore
# Calculate agent confidence
delusions = [
{"confidence": 0.8, "severity": "high"},
{"confidence": 0.6, "severity": "medium"}
]
confidence = ConfidenceCalculator.calculate_agent_confidence(delusions)
print(f"Confidence: {confidence.value:.2f}")
print(f"Factors: {confidence.factors}")from clewcrew_common import ClewcrewLogger
logger = ClewcrewLogger("my-component")
logger.info("Component initialized successfully")
logger.warning("Potential issue detected")
logger.error("Error occurred during execution")from clewcrew_common import ConfigManager
config = ConfigManager()
api_key = config.get("API_KEY", required=True)
debug_mode = config.get("DEBUG", default=False)Purpose: Eliminate duplication of confidence calculation logic
Features:
- Agent Confidence: Calculate confidence for expert agents
- Recovery Confidence: Calculate confidence for recovery engines
- Validation Confidence: Calculate confidence for validators
- Workflow Confidence: Calculate confidence for workflow execution
- Score Combination: Combine multiple confidence scores
Purpose: Unified logging across all clewcrew components
Features:
- Structured Logging: Consistent log format
- Log Levels: Standardized log levels
- Context Tracking: Track execution context
- Performance Monitoring: Built-in performance tracking
Purpose: Centralized configuration management
Features:
- Environment Variables: Load from environment
- Configuration Files: Support for YAML/JSON configs
- Validation: Validate configuration values
- Defaults: Sensible defaults for all settings
Purpose: Common Pydantic models for all components
Features:
- BaseResult: Common result model
- BaseConfig: Common configuration model
- Validation: Built-in validation rules
- Serialization: Easy JSON serialization
Purpose: Common async patterns and utilities
Features:
- AsyncExecutor: Execute async operations
- Retry Logic: Built-in retry mechanisms
- Timeout Handling: Configurable timeouts
- Error Handling: Standardized error handling
Purpose: Common file and path operations
Features:
- Path Handling: Cross-platform path operations
- File Reading: Safe file reading utilities
- File Writing: Safe file writing utilities
- Directory Operations: Directory management utilities
Purpose: Common validation patterns
Features:
- Input Validation: Validate user inputs
- Data Validation: Validate data structures
- Schema Validation: Validate against schemas
- Error Reporting: Standardized error messages
- Pydantic: Data validation and serialization
- Typing Extensions: Enhanced type hints
- Pytest: Testing framework
- Black: Code formatting
- Ruff: Linting
- MyPy: Type checking
# Install development dependencies
pip install -e ".[dev]"
# Run all tests
pytest
# Run with coverage
pytest --cov=src --cov-report=html
# Run specific test categories
pytest -m "unit"
pytest -m "slow"- Confidence Scoring API
- Logging Framework API
- Configuration Management API
- Data Models API
- Async Utilities API
- File Operations API
- Validation Utilities API
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests for new functionality
- Ensure all tests pass
- Submit a pull request
- Follow PEP 8 style guidelines
- Use type hints for all functions
- Add docstrings for all classes and methods
- Maintain test coverage above 90%
- Confidence Calculation: < 1ms for typical workloads
- Logging Operations: < 0.1ms per log entry
- Configuration Loading: < 10ms for complex configs
- File Operations: < 5ms for typical file operations
- Input Validation: Validate all inputs
- Safe File Operations: Prevent path traversal
- Configuration Security: Secure configuration handling
- Logging Security: Sanitize sensitive data
- Enhanced Logging: Structured logging with correlation IDs
- Configuration Validation: Schema-based configuration validation
- Performance Monitoring: Built-in performance metrics
- Error Handling: Advanced error handling and recovery
- Plugin System: Extensible plugin architecture
- Metrics Collection: Comprehensive metrics and analytics
- Distributed Tracing: Support for distributed systems
- Caching Layer: Intelligent caching mechanisms
- Issues: GitHub Issues
- Discussions: GitHub Discussions
- Documentation: Project Wiki
- Author: Lou Springer
- Email: lou@example.com
- Project: clewcrew-common
This project is licensed under the MIT License - see the LICENSE file for details.
Status: 🚀 ACTIVE DEVELOPMENT
Version: 0.1.0
Python: 3.9+
License: MIT
Chase down hallucinations, unravel tangled logic, keep the output on the level! 🕵️✨