Skip to content

sudo-KNO3/Continuous-quality-guard

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Continuous Quality Guard (CQG) System

Overview

The Continuous Quality Guard (CQG) is a real-time monitoring and intervention system designed for flow regime monitoring in industrial fluid systems. It provides continuous quality assessment, risk detection, and automated supervisory control to maintain optimal system performance.

Key Features

  • Real-time Data Ingestion: High-throughput streaming data processing from sensors and IoT devices
  • Feature Factory: Advanced feature engineering with temporal and statistical transformations
  • Regime Detection: ML-powered flow regime classification with confidence scoring
  • Quality & Risk Assessment: Multi-dimensional quality scoring and risk prediction
  • Supervisory Policy Engine: Rule-based and adaptive control strategies
  • Action Gateway: Safe, coordinated execution of control actions
  • TimescaleDB Integration: Time-series optimized data storage and retrieval
  • Kubernetes-Ready: Production-grade deployment with horizontal scaling

Quick Start

# Clone the repository
git clone <repository-url>
cd "Flow Regime Monitoring"

# Set up environment
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate
pip install -r requirements.txt

# Configure environment
cp .env.example .env
# Edit .env with your settings

# Start services with Docker Compose
docker-compose up -d

# Run initialization
python scripts/init_database.py
python scripts/load_baseline_models.py

# Start the CQG system
python src/main.py

Architecture

The CQG system consists of six core components:

  1. Ingestion Service: Receives and validates sensor data in real-time
  2. Feature Factory: Transforms raw data into engineered features
  3. Regime Detection: Classifies flow regimes using ML models
  4. Quality & Risk Engine: Evaluates system health and predicts risks
  5. Supervisory Policy: Determines optimal control actions
  6. Action Gateway: Executes approved control commands

See CQG_SYSTEM_ARCHITECTURE.md for detailed architecture.

Documentation

System Requirements

Minimum

  • Python 3.10+
  • PostgreSQL 14+ with TimescaleDB 2.8+
  • 4 GB RAM
  • 2 CPU cores

Recommended

  • Python 3.11+
  • PostgreSQL 15+ with TimescaleDB 2.11+
  • 16 GB RAM
  • 8 CPU cores
  • SSD storage

Installation

Development Setup

# Install dependencies
pip install -r requirements.txt
pip install -r requirements-dev.txt

# Set up pre-commit hooks
pre-commit install

# Run tests
pytest tests/

Production Deployment

See Deployment Guide for:

  • Docker deployment
  • Kubernetes deployment
  • Cloud provider setup (AWS, Azure, GCP)
  • High availability configuration
  • Monitoring and alerting

Configuration

Primary configuration file: config/cqg_config.yaml

Key configuration sections:

  • Database connection settings
  • Feature engineering parameters
  • Model hyperparameters
  • Risk thresholds
  • Control policies
  • Logging and monitoring

See Configuration Guide for details.

Testing

# Run all tests
pytest tests/

# Run specific test suites
pytest tests/unit/
pytest tests/integration/
pytest tests/acceptance/
pytest tests/performance/

# Run with coverage
pytest --cov=src --cov-report=html tests/

Monitoring

The CQG system includes built-in monitoring:

  • Prometheus metrics export
  • Grafana dashboards
  • Health check endpoints
  • Performance profiling
  • Audit logging

Performance

Expected performance characteristics:

  • Data ingestion: 10,000+ samples/second
  • Feature computation: <10ms per sample
  • Regime detection: <50ms per classification
  • End-to-end latency: <100ms (p95)
  • Throughput: 5,000+ decisions/second

Security

  • API authentication via JWT tokens
  • Role-based access control (RBAC)
  • Encrypted data at rest and in transit
  • Audit logging for all control actions
  • Configurable action approval workflows

License

MIT License - See LICENSE for details

Contributing

We welcome contributions! Please see CONTRIBUTING.md for:

  • Code style guidelines
  • Testing requirements
  • Pull request process
  • Development workflow

Support

  • Documentation: docs/
  • Issues: GitHub Issues
  • Discussions: GitHub Discussions

Changelog

See CHANGELOG.md for version history and release notes.

Acknowledgments

Built with:

  • Python 3.11
  • FastAPI
  • TimescaleDB
  • scikit-learn
  • pandas
  • NumPy
  • Kubernetes

Version: 1.0.0
Status: Production Ready
Last Updated: February 2026

About

Real-time flow-regime monitoring & supervisory control for industrial fluid systems — ML regime detection, quality/risk scoring, TimescaleDB, K8s-ready.

Topics

Resources

License

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors