src.dackar.RCA.pm_compliance.scope_analyzer =========================================== .. py:module:: src.dackar.RCA.pm_compliance.scope_analyzer .. autoapi-nested-parse:: PMScopeAnalyzer — FMEA/KG ↔ PM task coverage and scope gaps. Attributes ---------- .. autoapisummary:: src.dackar.RCA.pm_compliance.scope_analyzer._FIELD_COVERAGE_TYPE Functions --------- .. autoapisummary:: src.dackar.RCA.pm_compliance.scope_analyzer._fm_ids_from_kg src.dackar.RCA.pm_compliance.scope_analyzer._explicit_pm_fm_links src.dackar.RCA.pm_compliance.scope_analyzer.analyze_scope Module Contents --------------- .. py:data:: _FIELD_COVERAGE_TYPE :type: Dict[str, str] .. py:function:: _fm_ids_from_kg(kg_context) .. py:function:: _explicit_pm_fm_links(kg_context) Return True if any failure mode advertises PM linkage fields. .. py:function:: analyze_scope(kg_context, checks) Build per-component scope view. :returns: * *components_out* -- Per-component list with ``scope_covers_failure_modes``, ``scope_gaps``. * *linkage_flag* -- True when the KG carries explicit PM↔FM tags. * *covered_fms* -- FM IDs covered by at least one passing check. * *all_fms* -- All FM IDs present in the KG. * *check_to_coverage_type* -- Maps check_id → ``"preventive"`` | ``"detective"`` for every check whose task ID appears in a KG FM linkage field. Empty when linkage is absent. Used by the aggregator to set ``pm_tasks[].coverage_type``.