src.dackar.RCA.pm_compliance.scope_analyzer

PMScopeAnalyzer — FMEA/KG ↔ PM task coverage and scope gaps.

Attributes

_FIELD_COVERAGE_TYPE

Functions

_fm_ids_from_kg(kg_context)

_explicit_pm_fm_links(kg_context)

Return True if any failure mode advertises PM linkage fields.

analyze_scope(kg_context, checks)

Build per-component scope view.

Module Contents

src.dackar.RCA.pm_compliance.scope_analyzer._FIELD_COVERAGE_TYPE: Dict[str, str][source]
src.dackar.RCA.pm_compliance.scope_analyzer._fm_ids_from_kg(kg_context)[source]
Parameters:

kg_context (src.dackar.RCA.pm_compliance.types.JsonDict)

Return type:

Set[str]

Return True if any failure mode advertises PM linkage fields.

Parameters:

kg_context (src.dackar.RCA.pm_compliance.types.JsonDict)

Return type:

bool

src.dackar.RCA.pm_compliance.scope_analyzer.analyze_scope(kg_context, checks)[source]

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.

Parameters:
Return type:

Tuple[List[Dict[str, Any]], bool, Set[str], Set[str], Dict[str, str]]