src.dackar.RCA.pm_compliance

PM Compliance Verification — build pm_compliance.json for the RCA pipeline.

The artifact matches RCA/schemas/pm_compliance.json and feeds Stage D governance (causality_engine_v32 checks array) and analyst-facing summaries.

Phase 1: export-row ingestion and deterministic verification. See diagrams/april_20/PM_Compliance_Module_Architecture.md for design notes and integration points (orchestrator wiring to follow).

Submodules

Classes

PMComplianceConfig

Tuning parameters for schedule vs. execution analysis and reporting.

Functions

build_pm_compliance(event[, kg_context, export_rows, ...])

Assemble a pm_compliance object validated by schemas/pm_compliance.json.

Package Contents

src.dackar.RCA.pm_compliance.build_pm_compliance(event, kg_context=None, export_rows=None, config=None, primary_fm_id=None)[source]

Assemble a pm_compliance object validated by schemas/pm_compliance.json.

Parameters:
Returns:

A pm_compliance artifact conforming to schemas/pm_compliance.json: asset_id, window (start/end), checks[] (per-PM pass/fail/unknown rows for governance scoring), and summary (aggregate counts, compliance_rate over evaluable checks, overall_compliance, maintenance_induced_risk, data_quality_confidence). Optional keys — event_id, assessment_date, look_back_window_days, fmea_pm_linkage_available, data_quality_notes, components[] (per-component detail) and overdue_items[] — appear when applicable. The artifact is schema-validated before return, raising ValueError on a non-conforming build.

Return type:

JsonDict

class src.dackar.RCA.pm_compliance.PMComplianceConfig[source]

Tuning parameters for schedule vs. execution analysis and reporting.

look_back_window_days: int = 730

Window [event - N days, event] for CMMS PM / WO history (export / API phase).

effectiveness_lookback_cycles: int = 3

How many past PM cycles to read for as-found / degradation trend.

pm_frequency_concern_ratio: float = 0.5

Flag PM frequency concern when pm_interval > ratio * mean_failure_interval (advisory).

data_dir: pathlib.Path | None = None

Path to the DACKAR data directory containing health-status keyword CSVs.

When set, analyze_degradation and compute_pm_found_defect_rate use the curated vocabulary files (health_status_keywords_negative/positive.csv). When None, the original hardcoded stem fallback is used.