Skip to content

feat: Cohort & retention analysis API #623

@joelpeace48-cell

Description

@joelpeace48-cell

Background & current state

There's no cohort/retention computation. Operators can't answer "of users who registered in week N, how many claimed by week N+k?"

Goal

Add a cohort & retention analysis API computed from indexed data, with deterministic, testable outputs.

Technical design

  • Endpoints computing cohorts (by registration period) and retention curves (subsequent activity by offset) from indexed events/rollups (NEW-024/026). Parameterized by campaign, cohort granularity, and metric (claimed/active).
  • Precompute where feasible; cache results.

Edge cases

  • Timezone/period boundaries (UTC).
  • Small cohorts → suppress or flag low-n.
  • Re-computation after reconciliation.

Task breakdown

  • Cohort/retention computation over indexed data.
  • Endpoints + caching.
  • Deterministic fixture tests.

Acceptance criteria

  • A known fixture yields the expected cohort/retention curves.

Testing & verification

  • Deterministic fixture test with hand-computed expected values.

Out of scope

  • The dashboard UI (NEW-099) — consumes this.

Dependencies / related

  • Requires NEW-024/026; feeds NEW-099.

Difficulty: medium · Effort: M · indexer

Metadata

Metadata

Assignees

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions