{
  "item_type": "chapter",
  "chapter_id": "parallel-processing",
  "chapter_title": "Parallel Processing",
  "chapter_file": "book/src/parallel-processing.md",
  "drift_detected": true,
  "severity": "medium",
  "quality_assessment": "Overall comprehensive documentation with good coverage of parallel processing features, but contains several broken links and minor inaccuracies in code references",
  "issues": [
    {
      "type": "broken_links",
      "severity": "medium",
      "section": "See Also",
      "description": "Found 3 broken or incorrect internal link(s)",
      "broken_links": [
        {
          "link_text": "CLI Reference - Performance & Caching",
          "target_path": "./cli-reference.md#performance--caching",
          "issue": "Anchor #performance--caching does not exist. The correct anchor is #performance (section 'Performance' at line 400 of cli-reference.md)",
          "suggested_fix": "./cli-reference.md#performance"
        },
        {
          "link_text": "Troubleshooting - Slow Analysis",
          "target_path": "./troubleshooting.md#slow-analysis-performance",
          "issue": "Anchor #slow-analysis-performance does not exist in troubleshooting.md. The content has been reorganized into subsections. There is no dedicated 'slow-analysis-performance' section.",
          "suggested_fix": "./troubleshooting.md#performance-issues or ./troubleshooting/quick-fixes.md#slow-analysis"
        },
        {
          "link_text": "Troubleshooting - High Memory Usage",
          "target_path": "./troubleshooting.md#high-memory-usage",
          "issue": "Anchor #high-memory-usage does not exist in troubleshooting.md. The section is 'Out of Memory Errors' not 'High Memory Usage'.",
          "suggested_fix": "./troubleshooting.md#out-of-memory-errors"
        }
      ],
      "fix_suggestion": "Update links to point to correct anchors. The troubleshooting chapter has been reorganized into subsections."
    },
    {
      "type": "outdated_information",
      "severity": "low",
      "section": "AST Parsing Optimization (Spec 132)",
      "description": "Reference to 'docs/spec-132-benchmark-results.md' which does not exist",
      "current_content": "See `docs/spec-132-benchmark-results.md` for detailed benchmarks validating these improvements.",
      "should_be": "Either remove the reference or point to an actual existing document",
      "fix_suggestion": "Remove the reference to spec-132-benchmark-results.md since the file does not exist",
      "source_reference": "book/src/parallel-processing.md:250"
    },
    {
      "type": "outdated_information",
      "severity": "low",
      "section": "Thread Pool Configuration",
      "description": "Code reference shows line numbers that may be outdated",
      "current_content": "// From src/builders/parallel_call_graph.rs:48-53",
      "should_be": "Thread pool configuration is now handled in src/cli/setup.rs (configure_thread_pool function at lines 15-26). The ParallelCallGraphBuilder.with_config() method no longer configures the thread pool as per the comment 'Config is no longer used as thread pool is configured globally'.",
      "fix_suggestion": "Update the code reference to point to src/cli/setup.rs:15-26 for configure_thread_pool function",
      "source_reference": "src/cli/setup.rs:15-26"
    },
    {
      "type": "outdated_information",
      "severity": "low",
      "section": "Worker Thread Selection",
      "description": "Code reference shows outdated line numbers for get_worker_count",
      "current_content": "// From src/main.rs:828-836",
      "should_be": "Function get_worker_count is now located in src/cli/setup.rs at lines 29-37",
      "fix_suggestion": "Update the code reference from src/main.rs:828-836 to src/cli/setup.rs:29-37",
      "source_reference": "src/cli/setup.rs:29-37"
    },
    {
      "type": "outdated_information",
      "severity": "low",
      "section": "Parallel File Processing",
      "description": "Code references show outdated line numbers for parallel_call_graph.rs",
      "current_content": "// From src/builders/parallel_call_graph.rs:115-143",
      "should_be": "File reading and parsing is now in parallel_parse_files_batch (lines 217-249) and parallel_parse_files_with_progress (lines 253-319). The implementation has changed with batched processing (Spec 210) using BATCH_SIZE of 200 files.",
      "fix_suggestion": "Update code references to reflect new line numbers and batch processing architecture",
      "source_reference": "src/builders/parallel_call_graph.rs:217-249"
    },
    {
      "type": "incomplete_explanation",
      "severity": "low",
      "section": "Phase 2: All-Files-At-Once Extraction",
      "description": "Documentation mentions chunking was removed but doesn't explain the new batch processing introduced by Spec 210",
      "current_content": "Process ALL files at once (no chunking)",
      "should_be": "The implementation now uses batch processing (BATCH_SIZE = 200 files) to prevent proc-macro2 SourceMap overflow, with SourceMap reset between batches. This is different from the 'all-at-once' approach described.",
      "fix_suggestion": "Update to explain the new batch processing approach introduced in Spec 210 that processes files in batches of 200 to prevent SourceMap overflow",
      "source_reference": "src/builders/parallel_call_graph.rs:128-181"
    }
  ],
  "positive_aspects": [
    "Comprehensive documentation of Rayon parallel iterators and DashMap concurrent data structures",
    "Clear explanation of the three-phase parallel pipeline architecture",
    "Detailed performance characteristics and scaling behavior tables",
    "Good coverage of CLI flags (--jobs, --no-parallel) and environment variables (DEBTMAP_JOBS, DEBTMAP_PARALLEL)",
    "Thorough troubleshooting section with common issues and solutions",
    "Well-documented ParallelCallGraph and ParallelStats implementations",
    "Accurate description of cross-file call resolution two-phase approach",
    "Good coverage index optimization documentation",
    "Clear tuning guidelines for different environments (workstation, CI/CD, containers)"
  ],
  "improvement_suggestions": [
    "Update all code references to use current line numbers from the codebase",
    "Add documentation about Spec 210 batch processing to prevent SourceMap overflow",
    "Fix broken links to troubleshooting and CLI reference sections",
    "Remove reference to non-existent spec-132-benchmark-results.md",
    "Consider adding a note that thread pool configuration is now centralized in cli/setup.rs",
    "Update Phase 2 documentation to reflect batch processing approach"
  ],
  "metadata": {
    "analyzed_at": "2025-12-27T08:32:00Z",
    "feature_inventory": ".prodigy/book-analysis/features.json",
    "topics_covered": [
      "Rayon parallel iterators",
      "Thread pool configuration",
      "Worker thread tuning",
      "Lock-free concurrent access with DashMap",
      "Performance benchmarks",
      "Scaling strategies"
    ],
    "validation_focus": "Check that parallel processing features, thread configuration, and performance characteristics are documented",
    "internal_links_validated": 7,
    "broken_links_found": 3
  }
}
