src.dackar.RCA.signal_evidence.builder

Attributes

JsonDict

UPSTREAM_RELATIONS

_MIN_INITIATOR_LAG_HOURS

_COTEMPORAL_INITIATOR_FACTOR

_PROP_RELATION_WEIGHT

_COTEMPORAL_EDGE_FACTOR

Functions

_utcnow_iso()

_to_float(value[, default])

_component_sensor_map(kg_context)

_event_window(event, kg_context, fetch_lookback_hours, ...)

_baseline_anomalies(telemetry_summary, sensor_to_component)

_merge_anomalies(baseline, historian, *[, ...])

_build_propagation_dag(anomalies, neo4j_client, database)

_classify_nodes(anomalies, edges)

_extract_contributing_candidates(node_topology, edges, ...)

_find_maximal_paths(anomalies, edges, *, max_paths, ...)

_build_node_object(idx, next_idx, anomalies, ...)

_score_chain(path, anomalies, edges, node_topology)

_per_candidate_scores(failure_modes, chains, ...)

build_signal_evidence(*, run_id, event, ...[, ...])

Build the Stage B.5 signal-evidence bundle for one RCA run.

Module Contents

src.dackar.RCA.signal_evidence.builder.JsonDict[source]
src.dackar.RCA.signal_evidence.builder.UPSTREAM_RELATIONS[source]
src.dackar.RCA.signal_evidence.builder._MIN_INITIATOR_LAG_HOURS = 0.5[source]
src.dackar.RCA.signal_evidence.builder._COTEMPORAL_INITIATOR_FACTOR = 0.6[source]
src.dackar.RCA.signal_evidence.builder._PROP_RELATION_WEIGHT: Dict[str, float][source]
src.dackar.RCA.signal_evidence.builder._COTEMPORAL_EDGE_FACTOR = 0.6[source]
src.dackar.RCA.signal_evidence.builder._utcnow_iso()[source]
Return type:

str

src.dackar.RCA.signal_evidence.builder._to_float(value, default=0.0)[source]
Parameters:
  • value (Any)

  • default (float)

Return type:

float

src.dackar.RCA.signal_evidence.builder._component_sensor_map(kg_context)[source]
Parameters:

kg_context (JsonDict)

Return type:

Tuple[Dict[str, str], Dict[str, Set[str]]]

src.dackar.RCA.signal_evidence.builder._event_window(event, kg_context, fetch_lookback_hours, fetch_lookahead_hours)[source]
Parameters:
  • event (JsonDict)

  • kg_context (JsonDict)

  • fetch_lookback_hours (float)

  • fetch_lookahead_hours (float)

Return type:

Tuple[datetime.datetime, datetime.datetime]

src.dackar.RCA.signal_evidence.builder._baseline_anomalies(telemetry_summary, sensor_to_component)[source]
Parameters:
  • telemetry_summary (JsonDict)

  • sensor_to_component (Dict[str, str])

Return type:

List[src.dackar.RCA.signal_evidence.models.AnomalyRecord]

src.dackar.RCA.signal_evidence.builder._merge_anomalies(baseline, historian, *, dedup_tolerance_min=5.0)[source]
Parameters:
Return type:

List[src.dackar.RCA.signal_evidence.models.AnomalyRecord]

src.dackar.RCA.signal_evidence.builder._build_propagation_dag(anomalies, neo4j_client, database)[source]
Parameters:
Return type:

Tuple[List[src.dackar.RCA.signal_evidence.models.PropagationEdge], List[dict]]

src.dackar.RCA.signal_evidence.builder._classify_nodes(anomalies, edges)[source]
Parameters:
Return type:

Dict[int, src.dackar.RCA.signal_evidence.models.NodeTopology]

src.dackar.RCA.signal_evidence.builder._extract_contributing_candidates(node_topology, edges, failure_modes, anomalies)[source]
Parameters:
Return type:

Dict[str, dict]

src.dackar.RCA.signal_evidence.builder._find_maximal_paths(anomalies, edges, *, max_paths, chain_warnings)[source]
Parameters:
Return type:

List[List[int]]

src.dackar.RCA.signal_evidence.builder._build_node_object(idx, next_idx, anomalies, edge_lookup, node_topology)[source]
Parameters:
Return type:

dict

src.dackar.RCA.signal_evidence.builder._score_chain(path, anomalies, edges, node_topology)[source]
Parameters:
Return type:

src.dackar.RCA.signal_evidence.models.ScoredChain

src.dackar.RCA.signal_evidence.builder._per_candidate_scores(failure_modes, chains, anomalies, node_topology, contributing_candidates)[source]
Parameters:
Return type:

Dict[str, dict]

src.dackar.RCA.signal_evidence.builder.build_signal_evidence(*, run_id, event, telemetry_summary, kg_context, neo4j_client=None, neo4j_database=None, historian_adapter=None, fetch_lookback_hours=72.0, fetch_lookahead_hours=4.0, dedup_tolerance_min=5.0, max_paths=20, max_chains=10)[source]

Build the Stage B.5 signal-evidence bundle for one RCA run.

Merges baseline telemetry anomalies with historian-fetched anomalies, builds a component-level propagation DAG from Allen temporal relations and KG reachability, classifies node topology, enumerates and scores propagation chains, and derives per-failure-mode chain-position scores.

Parameters:
  • run_id (str) – Identifier for this analysis run; echoed into the bundle.

  • event (JsonDict) – Triggering event; timestamp_start / timestamp and timestamp_end seed the analysis window.

  • telemetry_summary (JsonDict) – Stage-B summary whose signals[].anomalies supply the baseline anomaly set.

  • kg_context (JsonDict) – KG context providing components[].monitored_variable_ids (the sensor↔component map) and failure_modes.

  • neo4j_client (Optional[Any]) – Optional live graph client. When None (the default), is_upstream degrades to False and resolve_edge_type to "mixed", so no propagation edges are built and the DAG, all propagation chains, and per-candidate scores come back empty; a {"type": "topology_unavailable"} entry is added to chain_warnings so consumers can tell this apart from “analyzed, no propagation found”.

  • neo4j_database (Optional[str]) – Target Neo4j database; None uses the driver default.

  • historian_adapter (Optional[src.dackar.RCA.signal_evidence.historian_adapter.HistorianAdapter]) – Anomaly source; defaults to NullHistorianAdapter (records a gap per sensor and returns no anomalies).

  • fetch_lookback_hours (float) – Hours before the event to widen the window (raised to the largest failure-mode expected_latency_max_hours when that is greater).

  • fetch_lookahead_hours (float) – Hours after the event to widen the window.

  • dedup_tolerance_min (float) – Minutes within which a historian anomaly is treated as a duplicate of a same-sensor baseline anomaly.

  • max_paths (int) – Cap on enumerated propagation paths (DFS guard).

  • max_chains (int) – Cap on scored chains retained in the bundle.

Returns:

run_id, generated_at, augmented_anomaly_set, propagation_chains (scored, ranked), per_candidate_chain_score, dag_topology_summary, chain_coverage, augmented_anomaly_count, historian_anomaly_count, fetch_gaps and chain_warnings.

Return type:

A JSON-serializable dict with keys