breakage_drivers_for_causal_impact (causal.rs)

clawdstrike · analytics

Builds causal impact data for changed policy events by extracting their causal context from a causal graph, identifying breakage drivers through root node analysis.

// Source: https://github.com/backbay-labs/clawdstrike | License: Apache-2.0 | Copyright You must retain, in the Source form of any Derivative Works
// Provided via justclaw.it.com; keep this notice with the code.
use super::*;

pub(crate) fn build_policy_event_history_causal_impact(
    selection: &EdrPolicyEventHistorySelection,
    changes: &[EdrPolicyEventImpactEntry],
    graph: &CausalGraph,
    context_depth: usize,
    promotion_stage: Option<&str>,
    cross_window_hashes: Option<(&str, &str)>,
) -> EdrPolicyEventHistoryCausalImpact {
    let observations = selection
        .observations
        .iter()
        .map(|observation| (observation.observation_id.as_str(), observation))
        .collect::<BTreeMap<_, _>>();
    let changed = changes
        .iter()
        .filter(|cha

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search 40K more like it.

Get a free API key