{
  "item_type": "subsection",
  "chapter_id": "analysis-guide",
  "subsection_id": "risk-scoring",
  "subsection_title": "Risk Scoring",
  "subsection_file": "book/src/analysis-guide/risk-scoring.md",
  "feature_mappings": ["risk_assessment", "semantic_classification", "coverage_integration"],
  "drift_detected": true,
  "severity": "low",
  "quality_assessment": "Documentation is comprehensive and well-maintained. The formulas, role classifications, and scoring strategies accurately match the implementation. Minor source reference updates needed for line numbers and two broken links to source files.",
  "issues": [
    {
      "type": "broken_links",
      "severity": "medium",
      "section": "Source References",
      "description": "Found 2 broken internal source file links",
      "broken_links": [
        {
          "link_text": "src/priority/tiers.rs",
          "target": "../../src/priority/tiers.rs",
          "actual_location": "src/priority/tiers/mod.rs",
          "fix": "Update link to ../../src/priority/tiers/mod.rs"
        },
        {
          "link_text": "src/priority/debt_aggregator/",
          "target": "../../src/priority/debt_aggregator/",
          "actual_location": "src/priority/debt_aggregator.rs",
          "fix": "Update link to ../../src/priority/debt_aggregator.rs (it's a file, not a directory)"
        }
      ],
      "fix_suggestion": "Update source references to point to correct file locations"
    },
    {
      "type": "outdated_line_numbers",
      "severity": "low",
      "section": "Multiple Sections",
      "description": "Several source reference line numbers have drifted due to code evolution",
      "details": [
        {
          "reference": "src/priority/unified_scorer.rs:385-399 (calculate_role_multiplier)",
          "actual_line": "624-634",
          "note": "Function has moved significantly in the file"
        },
        {
          "reference": "src/priority/unified_scorer.rs:22-291",
          "note": "The file has grown; UnifiedScore struct is now around lines 97-144"
        },
        {
          "reference": "src/priority/unified_scorer.rs:170-291 (calculate_unified_priority_with_debt)",
          "actual_line": "300-325",
          "note": "Function has moved"
        }
      ],
      "fix_suggestion": "Update line number references to match current source locations. Consider using function names as primary references instead of line numbers."
    },
    {
      "type": "minor_discrepancy",
      "severity": "low",
      "section": "Role-Based Prioritization / Role Multipliers Table",
      "description": "Documentation shows multiplier values that match calculate_role_multiplier() but differ from config defaults in scoring.rs",
      "current_content": "EntryPoint: 1.5×, PureLogic (complex): 1.3×, Orchestrator: 0.8×, IOWrapper: 0.5×, PatternMatch: 0.6×, Debug: 0.3×",
      "implementation_note": "calculate_role_multiplier in unified_scorer.rs uses: EntryPoint=1.5, PureLogic(complex)=1.3, PureLogic(simple)=1.0, Orchestrator=0.8, IOWrapper=0.5, PatternMatch=0.6, Debug=0.3 (MATCHES documentation). Config defaults in scoring.rs:307-331 differ: PureLogic=1.2, IOWrapper=0.7, EntryPoint=0.9",
      "fix_suggestion": "The documentation correctly reflects the hardcoded values in calculate_role_multiplier. Consider adding a note that configuration allows overriding these defaults with different values.",
      "source_reference": "src/priority/unified_scorer.rs:624-634 and src/config/scoring.rs:307-331"
    }
  ],
  "positive_aspects": [
    "Comprehensive and accurate coverage of the unified scoring system with correct formulas",
    "Clear explanation of how coverage acts as a dampening multiplier (not additive)",
    "Excellent worked examples showing score calculations step-by-step with source references",
    "Good documentation of role classification heuristics with detection rules and line references",
    "Thorough coverage propagation explanation with multiple scenarios and formulas",
    "Clear distinction between unified (0-10) and legacy scoring systems",
    "Accurate test effort estimation with difficulty levels and hour estimates",
    "Comprehensive ROI formula documentation with component breakdown",
    "Source references throughout documentation aid verification",
    "Well-structured progression from basic concepts to advanced topics"
  ],
  "improvement_suggestions": [
    "Consider using function names instead of line numbers for source references to improve long-term maintainability",
    "Add a cross-reference to complexity-metrics.md for the detailed explanation of cyclomatic vs cognitive complexity",
    "Consider documenting how to customize role multipliers via debtmap.toml configuration file"
  ],
  "cross_references": [
    "complexity-metrics",
    "interpreting-results",
    "debt-patterns"
  ],
  "metadata": {
    "analyzed_at": "2025-12-27T08:30:00Z",
    "feature_inventory": ".prodigy/book-analysis/features.json",
    "topics_covered": [
      "Unified scoring system",
      "Risk categories",
      "Coverage propagation",
      "ROI calculation",
      "Role-based prioritization",
      "Test effort estimation",
      "Legacy risk scoring",
      "Transitive coverage"
    ],
    "validation_focus": "Check risk scoring formulas and prioritization strategies",
    "internal_links_checked": true,
    "broken_links_found": 2,
    "source_references_validated": true
  }
}
