src.dackar.RCA.pm_compliance.effectiveness_analyzer¶
PMEffectivenessAnalyzer — as-found trend signals (advisory, data-quality limited).
Functions¶
|
Return degradation_trend label based on as-found text. |
|
Return fraction of PM executions with as-found data that recorded a defect. |
|
Use |
|
Prefer structured as-found columns from export rows. |
Module Contents¶
- src.dackar.RCA.pm_compliance.effectiveness_analyzer.analyze_degradation(as_found_texts, data_dir=None)[source]¶
Return degradation_trend label based on as-found text.
When data_dir points to the DACKAR data directory, uses the curated
health_status_keywords_negative/positive.csvvocabulary. Falls back to hardcoded stems when data_dir isNoneor the files are absent.Classification logic (in priority order): 1. No non-empty texts →
"unknown"2. Improving terms match AND no degrading terms match →"improving"3. Degrading terms match →"degrading"4. Otherwise →"stable"- Parameters:
as_found_texts (List[str])
data_dir (Optional[pathlib.Path])
- Return type:
str
- src.dackar.RCA.pm_compliance.effectiveness_analyzer.compute_pm_found_defect_rate(rows, data_dir=None)[source]¶
Return fraction of PM executions with as-found data that recorded a defect.
Iterates all export rows (not cycle-limited) to give a statistical signal over the full lookback history. Returns
Nonewhen no rows carry as-found data (avoids a misleading 0.0 rate).A row is counted as a defect when its as-found text classifies as
"degrading"peranalyze_degradation.- Parameters:
rows (List[src.dackar.RCA.pm_compliance.types.JsonDict])
data_dir (Optional[pathlib.Path])
- Return type:
Optional[float]
- src.dackar.RCA.pm_compliance.effectiveness_analyzer.collect_as_found_from_checks(checks)[source]¶
Use
details(as-found) from checks when available.- Parameters:
checks (List[src.dackar.RCA.pm_compliance.types.JsonDict])
- Return type:
List[str]
- src.dackar.RCA.pm_compliance.effectiveness_analyzer.collect_as_found_from_rows(rows, max_cycles=None)[source]¶
Prefer structured as-found columns from export rows.
When max_cycles is set, only the most-recent N rows (by
completed_date) are considered — honouringPMComplianceConfig.effectiveness_lookback_cycles.- Parameters:
rows (List[src.dackar.RCA.pm_compliance.types.JsonDict])
max_cycles (Optional[int])
- Return type:
List[str]