fix(pipeline): heal diagnosis extraction, role classification, and ICD mapping invariants
- Architecture Audit & Root Cause Analysis: Documented full 10-node runtime architecture, 8 failure root causes, and target architecture in ARCHITECTURE_AUDIT.md, ROOT_CAUSE_ANALYSIS.md, and TARGET_ARCHITECTURE.md.
- Strict Separation of Clinical Extraction and Retrieval: Clinical extraction establishes candidate entities prior to retrieval; retrieval never invents diagnoses.
- Generalized Clinical Entity Extraction: Added unstructured narrative fallback parser in ClinicalExtractor for single-sentence and unstructured discharge text; stripped structural role prefixes ('Primary:', 'Secondary:'); constrained procedural corroboration to entity-relevant keywords.
- UHDDS Role Classification & Admitting Significance: Restored section-aware scoring hierarchy prioritizing discharge diagnoses (+5.0) and admission reasons (+3.5); resolved whole-word regex monitoring checks preventing PMH leaks; added clinical admission synonyms for tie-breaking; prioritized acute conditions and definitive etiologies over non-specific symptoms.
- Subtype Specificity & Etiology Alignment: Guarded against hallucinated and unsupported etiologies (transplant, rheumatic, hypertensive) and subtypes in CandidateRanker and DeterministicValidator; expanded retrieval candidate window (top_k=25) ensuring general leaf codes (e.g. I50.9) remain in candidate pool for realignment.
- Test Suite: 100% pass rate achieved across all 125 repository unit, integration, guardrail, and end-to-end tests.