:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.
Python ab-testingai-analyticsanalyticscdpdata-warehouseexperimentsfeature-flagsjavascriptproduct-analyticspythonreactsession-replaysurveystypescriptweb-analytics
//! Evaluate compiled cohort-filter bytecode against an event, coercing non-bool results to
//! `false` to match `@posthog/hogvm`'s semantics.
//!
//! ## Metric-emission contract
//!
//! The `bool`-collapsing path ([`CohortEvaluator::evaluate`]) is self-counting: a failed result (VM
//! error or unknown function) increments a `STAGE1_HOGVM_*` counter, while a non-bool result is
//! coerced to `false` silently. That is the processor's path. The
//! [`EvalOutcome`]-returning path ([`CohortEvaluator::evaluate_detailed`] and [`evaluate_detailed`])
//! is bring-your-own-metrics: it emits nothing and hands the caller the classified outcome. The
//! seeder uses it so failures land on its own `seeder_hogvm_*` counters, not these.
pub mod analysis;
mod executor;
mod globals;
mod program;
pub use analysis::{GlobalsBuild, GlobalsPlan};
pub use executor::{
classify_vm_error, evaluate_detailed, CohortEvaluator, EvalOutcome, VmErrorClass,
};
pub use globals::{
build_behavioral_globals, build_person_property_globals, build_person_scan_globals,
parse_person_scan_properties, person_scan_globals, GlobalsError,
};
pub use program::ConditionProgram;