src.dackar.RCA.pm_compliance.scope_analyzer¶
PMScopeAnalyzer — FMEA/KG ↔ PM task coverage and scope gaps.
Attributes¶
Functions¶
|
|
|
Return True if any failure mode advertises PM linkage fields. |
|
Build per-component scope view. |
Module Contents¶
- 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]
- src.dackar.RCA.pm_compliance.scope_analyzer._explicit_pm_fm_links(kg_context)[source]¶
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 setpm_tasks[].coverage_type.
- Parameters:
kg_context (Optional[src.dackar.RCA.pm_compliance.types.JsonDict])
checks (List[src.dackar.RCA.pm_compliance.types.JsonDict])
- Return type:
Tuple[List[Dict[str, Any]], bool, Set[str], Set[str], Dict[str, str]]