: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
# Rules for the determinator crate.
#
# Custom rules are processed before default rules. Default rules already handle:
# - .cargo/config, .cargo/config.toml → mark-changed = "all"
# - Cargo.toml (workspace root) → mark-changed = "all"
# - Cargo.lock → mark-changed = [] (ignored; the graph diff covers it)
# - README, LICENSE, .gitignore, etc. → mark-changed = []
#
# Paths are workspace-relative (strip the `rust/` repo prefix before passing).
use-default-rules = true
# Cargo.lock intentionally has no rule: the default (mark-changed = []) is
# correct, because the determinator's graph diff already re-simulates each
# member's feature sets and marks every dependent of a changed dependency.
# Do not re-add mark-changed = "all" — it fires on every lockfile touch, so one
# added dev-dependency rebuilds the whole workspace and blows the build timeout.
# When the old graph is missing there is nothing to diff, and compute_affected()
# forces rebuild-all in code instead.
# Dockerfiles and CI image config — cross-cutting build changes.
[[path-rule]]
globs = ["Dockerfile", "Dockerfile.sqlx-migrate", "../.github/rust-images.yml"]
mark-changed = "all"
# sqlx offline query metadata — affects all sqlx-using crates.
[[path-rule]]
globs = [".sqlx/**"]
mark-changed = "all"
# Proto files trigger every build-script crate that reads them. The
# proto_build_scripts_are_in_determinator_rules test fails if a crate compiles
# protos and is missing here, so keep this list complete rather than counted.
[[path-rule]]
globs = ["../proto/**"]
mark-changed = [
"personhog-proto",
"kafka-assigner-proto",
"cymbal-proto",
"ingestion-worker-proto",
"prometheus-rw-proto",
"usage-ingestion-proto",
]
# Hypercache contract: Python serializer changes may break Rust deserialization.
# Must come BEFORE the catch-all rule below.
[[path-rule]]
globs = [
"../posthog/api/feature_flag.py",
"../posthog/models/feature_flag/flags_cache.py",
"../posthog/models/feature_flag/feature_flag.py",
]
mark-changed = ["feature-flags", "hypercache-server", "common-hypercache"]
# common-cohort-team-access tests its query against the table that these migrations build.
# Must come BEFORE the catch-all rule below.
[[path-rule]]
globs = ["../products/cohorts/backend/migrations/**"]
mark-changed = ["common-cohort-team-access"]
# replay-core-v4's tests read the encryption vectors the Node writers pin.
# Must come BEFORE the catch-all rule below.
[[path-rule]]
globs = [
"../nodejs/src/ingestion/pipelines/sessionreplay/ml-mirror/keys/encryption-vector*.json",
"../nodejs/src/ingestion/pipelines/sessionreplay/ai-research/v4-keys/encryption-vector*.json",
]
mark-changed = ["replay-core-v4"]
# Django migrations and test environment setup — needed for Rust integration tests.
[[path-rule]]
globs = [
"../posthog/migrations/**",
"../ee/migrations/**",
"../posthog/management/commands/setup_test_environment.py",
"../docker-compose.dev.yml",
]
mark-changed = "all"
# CI harness inputs that the rust test/build jobs depend on — a change here
# should run all rust CI to catch regressions.
[[path-rule]]
globs = [
"../manage.py",
"../posthog/settings/**",
"../bin/download-mmdb",
"../.github/workflows/ci-rust.yml",
"../.github/actions/setup-protoc/**",
"../.github/actions/setup-rust/**",
"../.github/actions/setup-sccache/**",
"../.github/actions/setup-sqlx-cli/**",
"../.github/actions/rust-compute-affected/**",
]
mark-changed = "all"
# The out-of-band domain list: common-dns mirrors it, and a parity test in that crate
# fails when the two differ. Must come BEFORE the catch-all rule below.
[[path-rule]]
globs = ["../posthog/security/crosslang/**"]
mark-changed = ["common-dns"]
# The AI event limits: capture mirrors them, and a parity test in that crate fails when
# the two differ. Must come BEFORE the catch-all rule below.
[[path-rule]]
globs = ["../products/ai_observability/shared/crosslang/**"]
mark-changed = ["capture"]
# Catch-all for files outside the rust workspace (Python, frontend, CI, docs,
# etc.) — these are not crate source and should not trigger rust rebuilds.
# Must come AFTER all specific rules for files outside the workspace.
[[path-rule]]
globs = ["../**"]
mark-changed = []
# An unmatched workspace-root file marks every crate, and the default rules
# do not match AGENTS.md.
[[path-rule]]
globs = ["AGENTS.md"]
mark-changed = []
# Migration directories are not cargo crates. Tell the determinator to
# ignore them (don't try ancestor-walk package matching). The sqlx-migrate
# image trigger is handled in custom code outside the determinator.
[[path-rule]]
globs = [
"persons_migrations/**",
"behavioral_cohorts_migrations/**",
"cyclotron-node-migrations/**",
"flags_read_store_migrations/**",
"bin/migrate-*",
]
mark-changed = []
# The e2e test harness exercises the personhog services as spawned
# binaries — a runtime dependency the cargo graph cannot see (compile-time
# deps like personhog-proto flow through the graph already). Mark the
# harness affected whenever a service it spawns changes so the CI gate
# runs against those changes.
#
# The merge queue needs the same edge to keep a harness change out of a lane
# parallel to one of these services. It gets it from here: the lane script
# (.github/scripts/trunk-impacted-targets.js) takes this binary's affected set
# as its rust:crate: answer, so this rule is the edge's only home.
[[package-rule]]
on-affected = [
"personhog-replica",
"personhog-router",
"personhog-leader",
"personhog-writer",
"personhog-identity",
]
mark-changed = ["personhog-test-harness"]