Skip to content

: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.

chore: update stale source paths in Node and Rust comments (#115074)

Paul D'Ambraf5851b5216fb
diff --git a/nodejs/src/common/kafka/murmur2.test.ts b/nodejs/src/common/kafka/murmur2.test.ts
index b165138ad06a..ee6ff242598d 100644
--- a/nodejs/src/common/kafka/murmur2.test.ts
+++ b/nodejs/src/common/kafka/murmur2.test.ts
@@ -2,7 +2,7 @@ import { murmur2, murmur2Partition } from './murmur2'
describe('murmur2', () => {
// Published Kafka murmur2 vectors, identical to the Rust pin in
- // rust/cohort-stream-processor/src/partitions/partitioner.rs. Expected values are signed i32, so
+ // rust/cohort-core/src/partitioner.rs. Expected values are signed i32, so
// we compare the unsigned hash reinterpreted with `| 0`.
const publishedVectors: [string, number][] = [
['21', -973932308],
diff --git a/nodejs/src/common/kafka/murmur2.ts b/nodejs/src/common/kafka/murmur2.ts
index 4e66828c818f..e9b5ca19f287 100644
--- a/nodejs/src/common/kafka/murmur2.ts
+++ b/nodejs/src/common/kafka/murmur2.ts
@@ -4,7 +4,7 @@
* This is the Kafka-Java / python-kafka default, NOT the CRC32 `consistent_random` default of
* librdkafka clients (node-rdkafka). The cohort-stream-processor routes a merge to the worker that
* owns `murmur2(key) mod 64`, so producers feeding it must reproduce this exact math. Mirrors the
- * Rust side at `rust/cohort-stream-processor/src/partitions/partitioner.rs`; both are pinned to the
+ * Rust side at `rust/cohort-core/src/partitioner.rs`; both are pinned to the
* published Kafka test vectors.
*
* `Math.imul` + `>>> 0` reproduce Rust's wrapping `u32` arithmetic (`wrapping_mul` and unsigned
diff --git a/nodejs/src/common/utils/db/utils.ts b/nodejs/src/common/utils/db/utils.ts
index e3f07e9bbac8..2baaee696c42 100644
--- a/nodejs/src/common/utils/db/utils.ts
+++ b/nodejs/src/common/utils/db/utils.ts
@@ -169,7 +169,7 @@ export function getFinalPostgresQuery(queryString: string, values: any[]): strin
return queryString.replace(/\$([0-9]+)/g, (m, v) => JSON.stringify(values[parseInt(v) - 1]))
}
-// keep in sync with posthog/posthog/api/utils.py::safe_clickhouse_string
+// keep in sync with posthog/api/utils.py::safe_clickhouse_string
export function safeClickhouseString(str: string): string {
// character is a surrogate
return str.replace(/[\ud800-\udfff]/gu, (match) => {
diff --git a/nodejs/src/logs/sampling/compile-rules.ts b/nodejs/src/logs/sampling/compile-rules.ts
index e85a86b70358..f8e05ad07c05 100644
--- a/nodejs/src/logs/sampling/compile-rules.ts
+++ b/nodejs/src/logs/sampling/compile-rules.ts
@@ -8,7 +8,7 @@ import { type PropertyFilterLeaf, compileLeafRegex } from './property-filter-mat
* Bound on the total node count (groups + leaves) of a filter_group tree. Depth
* alone does not bound per-record work: a single AND with thousands of sibling
* leaves passes MAX_FILTER_GROUP_DEPTH but costs O(leaves) per log line. Kept
- * in sync with `MAX_FILTER_GROUP_NODES` in `products/logs/backend/sampling_api.py`.
+ * in sync with `MAX_FILTER_GROUP_NODES` in `products/logs/backend/presentation/filter_group_validation.py`.
*/
export const MAX_FILTER_GROUP_NODES = 256
diff --git a/nodejs/src/logs/sampling/property-filter-match.ts b/nodejs/src/logs/sampling/property-filter-match.ts
index 49498340806b..64a707869237 100644
--- a/nodejs/src/logs/sampling/property-filter-match.ts
+++ b/nodejs/src/logs/sampling/property-filter-match.ts
@@ -151,7 +151,6 @@ function matchExact(value: PropertyFilterLeaf['value'], overrideValue: string |
return String(value).toLowerCase() === String(overrideValue).toLowerCase()
}
-// Mirrors `is_truthy_or_falsy_property_value` in posthog/queries/base.py.
function isTruthyOrFalsyValue(v: unknown): boolean {
if (v === true || v === false) {
return true
diff --git a/nodejs/src/types.ts b/nodejs/src/types.ts
index bd5b9624fc97..fb81c7cee35c 100644
--- a/nodejs/src/types.ts
+++ b/nodejs/src/types.ts
@@ -634,7 +634,7 @@ export interface Hook {
updated: string
}
-/** Sync with posthog/frontend/src/types.ts */
+/** Sync with frontend/src/types.ts */
export enum PropertyOperator {
Exact = 'exact',
IsNot = 'is_not',
@@ -655,29 +655,29 @@ export enum PropertyOperator {
IsCleanedPathExact = 'is_cleaned_path_exact',
}
-/** Sync with posthog/frontend/src/types.ts */
+/** Sync with frontend/src/types.ts */
interface PropertyFilterBase {
key: string
value?: string | number | Array<string | number> | null
label?: string
}
-/** Sync with posthog/frontend/src/types.ts */
+/** Sync with frontend/src/types.ts */
export interface PropertyFilterWithOperator extends PropertyFilterBase {
operator?: PropertyOperator
}
-/** Sync with posthog/frontend/src/types.ts */
+/** Sync with frontend/src/types.ts */
export interface EventPropertyFilter extends PropertyFilterWithOperator {
type: 'event'
}
-/** Sync with posthog/frontend/src/types.ts */
+/** Sync with frontend/src/types.ts */
export interface HogQLPropertyFilter extends PropertyFilterWithOperator {
type: 'hogql'
}
-/** Sync with posthog/frontend/src/types.ts */
+/** Sync with frontend/src/types.ts */
export interface PersonPropertyFilter extends PropertyFilterWithOperator {
type: 'person'
}
@@ -690,21 +690,21 @@ export interface DataWarehousePersonPropertyFilter extends PropertyFilterWithOpe
type: 'data_warehouse_person_property'
}
-/** Sync with posthog/frontend/src/types.ts */
+/** Sync with frontend/src/types.ts */
export interface ElementPropertyFilter extends PropertyFilterWithOperator {
type: 'element'
key: 'tag_name' | 'text' | 'href' | 'selector'
value: string | string[]
}
-/** Sync with posthog/frontend/src/types.ts */
+/** Sync with frontend/src/types.ts */
export interface CohortPropertyFilter extends PropertyFilterBase {
type: 'cohort'
key: 'id'
value: number | string
}
-/** Sync with posthog/frontend/src/types.ts */
+/** Sync with frontend/src/types.ts */
export type PropertyFilter =
| EventPropertyFilter
| PersonPropertyFilter
@@ -714,7 +714,7 @@ export type PropertyFilter =
| DataWarehousePersonPropertyFilter
| HogQLPropertyFilter
-/** Sync with posthog/frontend/src/types.ts */
+/** Sync with frontend/src/types.ts */
export enum StringMatching {
Contains = 'contains',
Regex = 'regex',
diff --git a/rust/capture/src/events/analytics.rs b/rust/capture/src/events/analytics.rs
index 5206d865a60b..1bf591c958ed 100644
--- a/rust/capture/src/events/analytics.rs
+++ b/rust/capture/src/events/analytics.rs
@@ -3500,7 +3500,7 @@ mod tests {
/// A `$cookieless_mode` event with heatmap data must produce a redirect
/// that carries every property the cookieless identity hash reads in
- /// `nodejs/src/ingestion/cookieless/cookieless-manager.ts`. Without
+ /// `nodejs/src/ingestion/common/cookieless/cookieless-manager.ts`. Without
/// these, the ingestion pipeline emits `cookieless_missing_user_agent`
/// against the redirect and silently drops every heatmap/scroll-depth
/// data point from cookieless-mode customers.
diff --git a/rust/capture/src/v1/analytics/constants.rs b/rust/capture/src/v1/analytics/constants.rs
index d68c546d3864..7c66f3ee617c 100644
--- a/rust/capture/src/v1/analytics/constants.rs
+++ b/rust/capture/src/v1/analytics/constants.rs
@@ -101,7 +101,7 @@ pub(super) const CAPTURE_V1_DISTINCT_ID_MAX_SIZE: usize = 200;
/// Known-bad distinct_id values that indicate a bug or misconfiguration in the
/// sending SDK. Ported from the Node.js ingestion pipeline
-/// (nodejs/src/worker/ingestion/persons/person-merge-service.ts) with
+/// (nodejs/src/common/persons/person-utils.ts) with
/// additions from the new #ingestion-reports feed.
///
/// All comparisons are case-insensitive after trimming whitespace, which is a
diff --git a/rust/common/symbol_data/src/data_types/sourcemap.rs b/rust/common/symbol_data/src/data_types/sourcemap.rs
index 2359bcdac9fb..619fa16d514b 100644
--- a/rust/common/symbol_data/src/data_types/sourcemap.rs
+++ b/rust/common/symbol_data/src/data_types/sourcemap.rs
@@ -4,7 +4,6 @@ use crate::{
utils::assert_at_least_as_long_as,
};
-// NOTE: see posthog/api/error_tracking.py
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct SourceAndMap {
pub minified_source: String,
diff --git a/rust/feature-flags/src/config.rs b/rust/feature-flags/src/config.rs
index 259b951859c9..306e3edf70d6 100644
--- a/rust/feature-flags/src/config.rs
+++ b/rust/feature-flags/src/config.rs
@@ -675,7 +675,7 @@ pub struct Config {
#[envconfig(from = "GROUP_TYPE_CACHE_MAX_ENTRIES", default = "50000")]
pub group_type_cache_max_entries: u64,
- // cookieless, should match the values in plugin-server/src/types.ts, except we don't use sessions here
+ // cookieless, should match the values in nodejs/src/ingestion/config.ts, except we don't use sessions here
#[envconfig(from = "COOKIELESS_DISABLED", default = "false")]
pub cookieless_disabled: bool,
diff --git a/rust/feature-flags/src/flags/feature_flag_list.rs b/rust/feature-flags/src/flags/feature_flag_list.rs
index 73db38d9959f..85cac0828410 100644
--- a/rust/feature-flags/src/flags/feature_flag_list.rs
+++ b/rust/feature-flags/src/flags/feature_flag_list.rs
@@ -1306,7 +1306,7 @@ mod tests {
/// in a way that breaks deserialization.
///
/// See the expand-and-contract process in the HYPERCACHE CONTRACT comments at:
- /// - posthog/api/feature_flag.py (MinimalFeatureFlagSerializer)
+ /// - products/feature_flags/backend/api/feature_flag.py (MinimalFeatureFlagSerializer)
/// - rust/feature-flags/src/flags/flag_models.rs (FeatureFlag struct)
#[test]
fn test_hypercache_contract() {
diff --git a/rust/feature-flags/src/flags/flag_models.rs b/rust/feature-flags/src/flags/flag_models.rs
index 22493bfe15b4..50cdf62ee09c 100644
--- a/rust/feature-flags/src/flags/flag_models.rs
+++ b/rust/feature-flags/src/flags/flag_models.rs
@@ -301,7 +301,7 @@ pub enum BucketingIdentifier {
// (which, tbh, is probably a better idea)
///
/// HYPERCACHE CONTRACT: These fields are deserialized from JSON written by Python's
-/// MinimalFeatureFlagSerializer (posthog/api/feature_flag.py). Field changes must
+/// MinimalFeatureFlagSerializer (products/feature_flags/backend/api/feature_flag.py). Field changes must
/// follow the expand-and-contract pattern. Golden fixture contract test:
/// cargo test -p feature-flags test_hypercache_contract
///