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.

4.2 KB
Raw Blame
//! Pure domain layer for the cohort seeder; depends only on `cohort-core`.
//!
//! No module here reaches into PostgreSQL, ClickHouse, or Kafka. The internal
//! dependency order is strictly downward:
//! `ids` ← {`condition`, `window`} ← `chunk` ← `pinned` ← `plan` ← `aggregate` ←
//! {`person_relevance`, `person_analysis`} ← `person`,
//! except that `chunk` reaches back into `person` for the `PersonRange` vocabulary its spec
//! carries. The seed wire contract (`SeedTile`/`PersonSeed` and the ids that ride them) lives in
//! `cohort_core::seed` — shared with the processor — and is re-exported here.

pub mod aggregate;
pub mod backoff;
pub mod chunk;
pub mod columns;
pub mod compare;
pub mod completion;
pub mod condition;
pub mod condition_analysis;
pub mod fair_share;
pub mod ids;
pub mod ledger;
pub mod newest_day;
pub mod partition;
pub mod person;
pub mod person_analysis;
pub mod person_relevance;
pub mod pinned;
pub mod plan;
pub mod projection;
pub mod row_filter;
pub mod window;

pub use aggregate::{
    AggregateError, ChunkAccumulator, OutcomeKind, RecordOutcome, RecordStats, VmFailureCounts,
};
pub use backoff::{AttemptCount, BackoffPolicyError, RetryBackoffPolicy};
pub use chunk::{
    BandSpec, BandSpecError, CancelCause, ChunkDomainError, ChunkLease, ChunkSpec, ChunkStatus,
    ClaimKind, ClaimedChunk, EnqueuedChunk, HaltReason, Halted, ProduceHwms, ProducedChunk,
    ScanVolume, ScannedChunk, StreamedChunk, UnknownChunkStatus,
};
pub use cohort_core::seed::{
    BehavioralShapeHash, CatalogMiss, CoverageStartMs, PersonSeed, PersonShapeHash,
    ReconcileCompleteMarker, ReconcileMarker, ReconcileScope, ReconcileTile,
    ReconcileWithheldMarker, RunBoundaryMs, ScopeKind, SeedTile, ShapeHashError, UnknownScopeKind,
    WithheldReason,
};
pub use columns::{ColumnName, MaterializedColumns};
pub use compare::{diff_tiles, Divergence, DivergenceClass, TileDiff, MAX_EXEMPLARS_PER_CLASS};
pub(crate) use completion::MARKER_WATCH_SCHEMA;
pub use completion::{
    CommittedOffset, CompletionParts, CompletionPhase, CompletionStatus, DispatchEpoch,
    DispatchedReconcile, LivenessCheck, MarkerNovelty, MarkerPartition, MarkerPartitionError,
    MarkerVerdict, MarkerWatch, NextOffset, ObservationEnds, ObservedMarker, PartitionBitmap,
    PartitionBitmapError, ProducedOffset, ReconcileHwms, ReconcileHwmsError, SeedGroupCommits,
    SettleProof, UndispatchedReason, WatchPartition, WatchPositions,
};
pub use condition::{EventNameSet, Lookback, PinnedCondition};
pub use condition_analysis::{
    ConditionAnalyses, ConditionCensus, ConditionClass, MISSING_BYTECODE_REASON,
};
pub use fair_share::{ClaimCandidate, ClaimCandidates, SlotLoad};
pub use ids::{
    Band, ChunkId, ClaimEpoch, ConditionHash, ConditionHashError, DayIdx, RunId, SChunkMs,
    ScannedAtMs, UtcMillis, UtcMsRange, UtcRangeError,
};
pub use ledger::{MarkerFold, MarkerLedger, SettledVerdict, WithheldCohort};
pub use newest_day::{ConditionSlot, NewestDayConditions};
pub use partition::{SeedPartition, SeedPartitionCountError, SeedPartitions};
pub use person::{
    person_chunk_sentinel_day, tile_ranges, EvaluatedConditions, PersonChunkSpec,
    PersonChunkSpecError, PersonEmissionPolicy, PersonEvaluator, PersonPinnedSnapshot,
    PersonPlanError, PersonRange, PersonRangeError, PersonRowOutcome, PersonRowSkip,
    PersonRunValidation, PersonSeedContext, PinnedPersonRun, ValidatedPinnedPersonRun,
    MAX_PERSON_CHUNKS,
};
pub use person_analysis::{AlwaysEvaluateReason, PersonAnalysisCensus};
pub use pinned::{
    PinnedDropReason, PinnedError, PinnedParticipation, PinnedParticipationState, PinnedRun,
    PinnedRunSnapshot, PinnedWarning, ScanTable, TriggerKind, UncoveredCohort,
    UncoveredParticipations, UncoveredReason, UnknownTriggerKind, ValidatedPinnedRun,
};
pub use plan::{
    bands_for_day, conditions_active_on, plan_days, table_scans, ActiveConditions, TableScan,
};
pub use projection::{
    BlobSource, ChunkProjection, ColumnBackedKeys, ColumnExactKeys, ColumnPlan, ColumnUpgrade,
    ProjectedKeys, PropertiesOutcome, PropertiesSource, PropertiesSourcing, RebuildReason,
    ScalarColumn, SourcedProjection, Unbacked,
};
pub use row_filter::{ConditionConjuncts, ScanRowFilter};
pub use window::{Boundary, DaySchedule, DomainError, PlanCaps, PlannedDay, SeedDomain};