ruvnet/RuView · error · NotImplementedError

Mock pose generation is disabled. Real pose estimation requi

Error message

Mock pose generation is disabled. Real pose estimation requires CSI data from configured hardware and trained model weights. Set mock_pose_data=True in settings for development, or provide real CSI input. See docs/hardware-setup.md.

What it means

PoseService._generate_mock_poses() is an intentional guard: when settings.mock_pose_data is False it raises NotImplementedError rather than fabricating people. The service is designed so mock data only exists in development mode; reaching this method with mock disabled means a code path fell back to mock generation without the setting that authorizes it (production runs must use real CSI input and trained weights).

Source

Thrown at archive/v1/src/services/pose_service.py:410

            x = float(torch.sigmoid(output[bbox_start]).item())
            y = float(torch.sigmoid(output[bbox_start + 1]).item())
            w = float(torch.sigmoid(output[bbox_start + 2]).item())
            h = float(torch.sigmoid(output[bbox_start + 3]).item())
            return {"x": x, "y": y, "width": w, "height": h}
        else:
            return {"x": 0.0, "y": 0.0, "width": 0.0, "height": 0.0}
    
    def _generate_mock_poses(self) -> List[Dict[str, Any]]:
        """Generate mock pose data for development.

        Delegates to the testing module. Only callable when mock_pose_data is True.

        Raises:
            NotImplementedError: If called without mock_pose_data enabled,
                indicating that real CSI data and trained models are required.
        """
        if not self.settings.mock_pose_data:
            raise NotImplementedError(
                "Mock pose generation is disabled. Real pose estimation requires "
                "CSI data from configured hardware and trained model weights. "
                "Set mock_pose_data=True in settings for development, or provide "
                "real CSI input. See docs/hardware-setup.md."
            )
        from src.testing.mock_pose_generator import generate_mock_poses
        return generate_mock_poses(max_persons=self.settings.pose_max_persons)

    def _classify_activity(self, features: torch.Tensor) -> str:
        """Classify activity from model features.

        Uses the magnitude of the feature tensor to make a simple threshold-based
        classification. This is a basic heuristic; a proper activity classifier
        should be trained and loaded alongside the pose model.
        """
        feature_norm = float(torch.norm(features).item())
        # Deterministic classification based on feature magnitude ranges
        if feature_norm > 2.0:

View on GitHub (pinned to 4685618388)

Solutions

  1. For development, enable mock data: set mock_pose_data=True in the environment/settings (never in production).
  2. For production, ensure real CSI data flows in from hardware collection so the mock path is never entered.
  3. Audit call sites of _generate_mock_poses() and gate them on settings.mock_pose_data before calling.
  4. Point developers at docs/hardware-setup.md for the real CSI setup when mocks are off.

Example fix

# before
poses = pose_service._generate_mock_poses()  # NotImplementedError in prod

# after
if not pose_service.settings.mock_pose_data:
    raise RuntimeError('mock poses disabled; provide real CSI data or enable mock_pose_data for dev')
poses = pose_service._generate_mock_poses()
Defensive patterns

Strategy: validation

Validate before calling

if not pose_service.settings.mock_pose_data:
    raise RuntimeError('mock path disabled; supply real CSI data')
poses = pose_service._generate_mock_poses()

Prevention

When it happens

Trigger: Running with production settings (mock_pose_data=False) while a path still calls _generate_mock_poses(), e.g. estimate flow with no CSI data; running tests against production settings; a stale caller that used mocks before the setting was introduced.

Common situations: Deploying to production with a config that still exercises dev code paths; CI suites importing prod settings; refactoring that left a mock call site reachable when mock_pose_data is off.

Related errors


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