def _calculate_confidence_score(self, question: str, areas: List[ResearchFocus]) -> float:
        """Calculate confidence score for analysis quality"""
        score = 0.0

        # Question quality (0.3)
        if question and len(question.split()) >= 3:
            score += 0.3

        # Areas quality (0.7)
        if areas:
            # Valid areas ratio (0.35) - now based on proportion that are valid vs total
            num_areas = len(areas)
            if num_areas > 0:  # Avoid division by zero
                valid_areas = sum(1 for a in areas if self._is_valid_focus(a))
                score += 0.35 * (valid_areas / num_areas)

            # Priority distribution (0.35) - now based on having different priorities
            if num_areas > 0:  # Avoid division by zero
                unique_priorities = len(set(a.priority for a in areas))
                score += 0.35 * (unique_priorities / num_areas)

        return round(score, 2)
Calculate confidence score for analysis quality
strategic_analysis_parser.py