{
  "item_type": "chapter",
  "chapter_id": "tiered-prioritization",
  "chapter_title": "Tiered Prioritization",
  "chapter_file": "book/src/tiered-prioritization.md",
  "drift_detected": true,
  "severity": "high",
  "quality_assessment": "Chapter is mostly accurate for terminal output but has critical inconsistencies in the JSON output section. The codebase has TWO different display tier systems: (1) `Tier` enum (90/70/50 thresholds) used for terminal/markdown output, and (2) `Priority` enum (100/50/20 thresholds) used for JSON output. Documentation shows 90/70/50 thresholds which is correct for terminal but incorrect for JSON output. Also uses 'moderate' but JSON uses 'medium'.",
  "issues": [
    {
      "type": "outdated_information",
      "severity": "high",
      "section": "Interpreting Tier Output > JSON Output",
      "description": "Documentation states incorrect priority score thresholds for JSON output. JSON output uses Priority enum (100/50/20) not Tier enum (90/70/50)",
      "current_content": "The `priority` field is derived from the `score` field using these thresholds:\n- `critical`: score >= 90.0\n- `high`: score >= 70.0\n- `moderate`: score >= 50.0\n- `low`: score < 50.0",
      "should_be": "The `priority` field is derived from the `score` field using these thresholds:\n- `critical`: score >= 100.0\n- `high`: score >= 50.0\n- `medium`: score >= 20.0\n- `low`: score < 20.0",
      "fix_suggestion": "Update lines 340-344 to reflect actual thresholds from src/output/unified/priority.rs:23-32. Note: JSON uses 'medium' not 'moderate'.",
      "source_reference": "src/output/unified/priority.rs:23-32"
    },
    {
      "type": "outdated_information",
      "severity": "medium",
      "section": "Interpreting Tier Output > JSON Output",
      "description": "JSON output example uses 'moderate' but actual JSON output uses 'medium' due to serde rename_all lowercase",
      "current_content": "\"moderate\": 12",
      "should_be": "\"medium\": 12",
      "fix_suggestion": "Update JSON example to use 'medium' instead of 'moderate' to match actual serde serialization in Priority enum",
      "source_reference": "src/output/unified/priority.rs:14"
    },
    {
      "type": "incorrect_source_reference",
      "severity": "medium",
      "section": "Interpreting Tier Output > JSON Output",
      "description": "Source reference points to wrong location. Priority enum is in src/output/unified/priority.rs, not src/priority/mod.rs",
      "current_content": "**Source**: Priority tier thresholds defined in src/priority/mod.rs:478-484",
      "should_be": "**Source**: Priority tier thresholds defined in src/output/unified/priority.rs:23-32",
      "fix_suggestion": "Update the source reference to point to the correct file location",
      "source_reference": "src/output/unified/priority.rs:23-32"
    },
    {
      "type": "incomplete_explanation",
      "severity": "medium",
      "section": "Overview",
      "description": "Documentation mentions two tier systems but doesn't explain that JSON output uses different thresholds than terminal output",
      "current_content": "**Two Tier Systems**: Debtmap uses two complementary tier systems:\n1. **RecommendationTier** (T1-T4): Used internally to classify items based on architectural significance and testing needs\n2. **Display Tier** (Critical/High/Moderate/Low): Score-based tiers shown in terminal output, derived from final calculated scores",
      "should_be": "**Three Display Systems**: Debtmap uses:\n1. **RecommendationTier** (T1-T4): Internal classification for tier weight application\n2. **Tier** (Critical/High/Moderate/Low): Score-based tiers for terminal/markdown output using 90/70/50 thresholds\n3. **Priority** (critical/high/medium/low): Score-based tiers for JSON output using 100/50/20 thresholds",
      "fix_suggestion": "Clarify that JSON output uses a different threshold system than terminal output",
      "source_reference": "src/priority/mod.rs:371-386, src/output/unified/priority.rs:12-33"
    },
    {
      "type": "inconsistency",
      "severity": "medium",
      "section": "The Four Tiers > Tier 1",
      "description": "Documentation references src/priority/tiers.rs:183-216 but tiers module has been refactored into multiple files (mod.rs, pure.rs, predicates.rs)",
      "current_content": "**Classification Criteria** (src/priority/tiers.rs:183-216)",
      "should_be": "**Classification Criteria** (src/priority/tiers/pure.rs:26-41 and src/priority/tiers/predicates.rs)",
      "fix_suggestion": "Update the source reference to reflect the modular structure of the tiers implementation",
      "source_reference": "src/priority/tiers/pure.rs:26-41"
    },
    {
      "type": "inconsistency",
      "severity": "medium",
      "section": "The Four Tiers > Tier 2",
      "description": "Documentation references src/priority/tiers.rs:257-302 but that file has been refactored",
      "current_content": "**Classification Criteria** (src/priority/tiers.rs:257-302)",
      "should_be": "**Classification Criteria** (src/priority/tiers/pure.rs:64-99)",
      "fix_suggestion": "Update the source reference to point to the correct file and line numbers",
      "source_reference": "src/priority/tiers/pure.rs:64-99"
    }
  ],
  "positive_aspects": [
    "Comprehensive explanation of the four-tier RecommendationTier system (T1-T4)",
    "Clear tier weight configuration examples with correct default values",
    "Accurate preset configurations (balanced, strict, lenient) matching implementation",
    "Terminal output section uses correct thresholds (90/70/50) for Tier enum",
    "Good documentation of TierConfig fields and their effects",
    "Useful troubleshooting section addressing common issues",
    "Well-structured use cases section with practical examples",
    "All internal links are valid (scoring-strategies.md, configuration.md, analysis-guide/index.md)"
  ],
  "improvement_suggestions": [
    "Add a comparison table showing the different threshold systems (Tier vs Priority) used in different output formats",
    "Consider unifying the thresholds between terminal and JSON output to reduce confusion",
    "Add examples showing actual JSON output to help users understand the priority field values they'll see",
    "Add a section explaining why there are different thresholds for different output formats"
  ],
  "metadata": {
    "analyzed_at": "2025-12-27T09:55:00Z",
    "feature_inventory": ".prodigy/book-analysis/features.json",
    "topics_covered": [
      "Tier 1: Critical Architecture",
      "Tier 2: Complex Untested",
      "Tier 3: Testing Gaps",
      "Tier 4: Maintenance",
      "Tier weights and configuration",
      "Customizing tier thresholds"
    ],
    "validation_focus": "Check that tier strategy, weights, and configuration options are documented with examples",
    "internal_links_validated": [
      "scoring-strategies.md",
      "configuration.md",
      "analysis-guide/index.md"
    ],
    "all_links_valid": true,
    "key_finding": "Two different display threshold systems exist: Tier (terminal, 90/70/50) and Priority (JSON, 100/50/20)"
  }
}
