ruvnet/RuView · error · ValueError

Missing required configuration: {missing_fields}

Error message

Missing required configuration: {missing_fields}

What it means

Raised by CSIProcessor._validate_config (archive/v1/src/core/csi_processor.py) from __init__, so it fires at construction time. The config dict must contain all four keys: sampling_rate, window_size, overlap, noise_threshold — other parameters like human_detection_threshold have defaults. The missing key names are interpolated into the message, so the text tells you exactly what to add.

Source

Thrown at archive/v1/src/core/csi_processor.py:108

        # Statistics tracking
        self._total_processed = 0
        self._processing_errors = 0
        self._human_detections = 0
    
    def _validate_config(self, config: Dict[str, Any]) -> None:
        """Validate configuration parameters.
        
        Args:
            config: Configuration to validate
            
        Raises:
            ValueError: If configuration is invalid
        """
        required_fields = ['sampling_rate', 'window_size', 'overlap', 'noise_threshold']
        missing_fields = [field for field in required_fields if field not in config]
        
        if missing_fields:
            raise ValueError(f"Missing required configuration: {missing_fields}")
        
        if config['sampling_rate'] <= 0:
            raise ValueError("sampling_rate must be positive")
        
        if config['window_size'] <= 0:
            raise ValueError("window_size must be positive")
        
        if not 0 <= config['overlap'] < 1:
            raise ValueError("overlap must be between 0 and 1")
    
    def preprocess_csi_data(self, csi_data: CSIData) -> CSIData:
        """Preprocess CSI data for feature extraction.
        
        Args:
            csi_data: Raw CSI data
            
        Returns:
            Preprocessed CSI data

View on GitHub (pinned to 4685618388)

Solutions

  1. Add the listed missing keys to the config dict — the message names them, e.g. add 'noise_threshold': 0.1.
  2. Start from the canonical shape: {'sampling_rate': 100, 'window_size': 64, 'overlap': 0.5, 'noise_threshold': 0.1} and then tune.
  3. Check for exact key spelling and case; keys are snake_case and case-sensitive membership checks (`field not in config`).
  4. If loading from file, validate the loaded dict against the required set before constructing (see validationCode).

Example fix

# before
processor = CSIProcessor({'sampling_rate': 100, 'window_size': 64, 'overlap': 0.5})
# ValueError: Missing required configuration: ['noise_threshold']

# after
processor = CSIProcessor({
    'sampling_rate': 100,
    'window_size': 64,
    'overlap': 0.5,
    'noise_threshold': 0.1,
})
Defensive patterns

Strategy: validation

Validate before calling

REQUIRED_CSI_KEYS = {'sampling_rate', 'window_size', 'overlap', 'noise_threshold'}

def is_valid_csi_config(config: dict) -> bool:
    return REQUIRED_CSI_KEYS.issubset(config)

Type guard

from typing import TypeGuard

REQUIRED_CSI_KEYS = ('sampling_rate', 'window_size', 'overlap', 'noise_threshold')

def has_required_keys(config: dict) -> TypeGuard[dict]:
    return all(k in config for k in REQUIRED_CSI_KEYS)

Try / catch

try:
    processor = CSIProcessor(config)
except ValueError as e:
    if str(e).startswith('Missing required configuration'):
        missing = {'sampling_rate', 'window_size', 'overlap', 'noise_threshold'} - config.keys()
        raise ValueError(f'Fill in {missing} in the CSI config') from e
    raise

Prevention

When it happens

Trigger: Calling CSIProcessor(config) with a dict missing one or more of the four required keys, e.g. CSIProcessor({'sampling_rate': 100, 'window_size': 64, 'overlap': 0.5}) without noise_threshold. Also happens when keys are present but misspelled ('windowSize', 'over_lap'), or when YAML/JSON config files use different key names than the code expects.

Common situations: Porting configs from an older pipeline version whose schema used different key names; building config from a dataclass or TypedDict and dropping a field; empty dict `CSIProcessor({})` in early scaffolding; config loaded from JSON where a key was renamed during a merge; tests constructing minimal configs.

Related errors


AI-assisted analysis of ruvnet/RuView@4685618388 (2026-08-16). Data as JSON: /api/errors/3be6d567d3c92b66. Report an issue: GitHub.