src.dackar.RCA.orchestrators.causality_engine_v31¶
causality_engine_v31 — Rule-based causality engine, baseline variant.
Role in the pipeline¶
This engine produces failure-mode candidates scored on five weighted dimensions: structural, temporal, telemetry, evidence, and governance. It operates purely from structured KG context and telemetry summary inputs, without consuming TSKR temporal-pattern metadata.
Relationship to v32¶
causality_engine_v32 is the production engine. It extends v31 with
TSKR-aware scoring (Allen interval relations, latency alignment) and NER-based
entity normalisation via EntityNormalizer.
Both engines are intentionally retained. Running v31 alongside v32 on the same inputs provides an independent baseline that can be used to:
validate that TSKR enrichment improves — and does not regress — candidate ranking relative to the simpler structural/evidence model;
detect edge cases where temporal patterns over-penalise the correct root cause (e.g. delayed-onset failure modes);
support ablation studies during model development and audit.
Intended usage: pass RuleBasedCausalityEngineV31 as the causality_engine
argument of RCAReasoningOrchestrator when running a baseline/validation
pass, and RuleBasedCausalityEngineV32 for the primary production pass.
Attributes¶
Classes¶
TSKR-aware deterministic causality engine. |
Functions¶
|
Module Contents¶
- src.dackar.RCA.orchestrators.causality_engine_v31.parse_dt(value)[source]¶
- Parameters:
value (Optional[str])
- Return type:
Optional[datetime.datetime]
- class src.dackar.RCA.orchestrators.causality_engine_v31.RuleBasedCausalityEngineV31(config=None)[source]¶
TSKR-aware deterministic causality engine.
- Parameters:
config (Optional[CausalityEngineConfig])
- generate(event, telemetry_summary, kg_context, tskr_patterns, operational_context, pm_compliance, run_context)[source]¶
- _build_failure_mode_candidates(event, event_time, telemetry_summary, kg_context, tskr_index, pm_compliance)[source]¶
- _build_past_event_candidates(event, event_time, telemetry_summary, kg_context, tskr_index, pm_compliance)[source]¶
- _symptom_match_score(event, fm, telemetry_summary)[source]¶
Score [0, 1] for how well the event’s observed symptoms match what this failure mode is expected to produce.
0.5 = neutral (no symptom data available in either direction) >0.5 = symptoms consistent with this failure mode <0.5 = symptoms inconsistent with this failure mode
- Two sub-signals combined by available weight:
Anomaly pattern match (weight 0.6): dominant observed pattern vs. fm.expected_anomaly_pattern. Observed pattern is taken from the most frequently occurring anomaly pattern in telemetry (more objective), falling back to event.symptom_signature.anomaly_pattern.
Symptom type overlap (weight 0.4): F1-score between event’s symptom_types and fm.expected_symptom_types.
When a sub-signal has no data, its weight is excluded and the remaining signal is used alone. When neither sub-signal has data, returns 0.5.
- static _dominant_telemetry_pattern(telemetry_summary)[source]¶
Return the most frequently occurring anomaly pattern across all signals, or None if no anomalies are present.
- static _recency_factor(time_distance_days)[source]¶
Map time_distance_days to a [0.55, 1.0] recency multiplier.
None (unknown age) receives a conservative 0.75 — neither penalised nor given full credit. Values are intentionally coarse so that small differences in document age do not create artificial score cliffs.
- Return type:
float
- _governance_score(pm_compliance, fm_name=None, fm_superclass=None, component_name=None)[source]¶
Candidate-specific governance score from PM compliance data.
- Returns 0.5 (neutral) when:
no PM data is available,
all checks passed (no maintenance contribution signal), or
PM checks failed elsewhere on the asset but none are relevant to this specific failure mode / component.
Returns > 0.5 when at least one failed check is relevant to this candidate, scaled by the number of relevant failures and how overdue they are. Maximum value is 0.95 (never certain from PM alone).
- static _pm_check_relevant(check, candidate_text)[source]¶
Return True if a PM check type matches keywords in the candidate’s text.