Skip to content

Tracer C: cohort funnel queries + /funnel cohort section behind the existing gate #7031

Description

@usirin

Stories: 1, 2
TDD: yes
Containment: flag (default-off — the display gates separately from the always-on capture per founder ruling R1.2 on #7028)

What to build

The read surface of epic #6767: the five-stage per-signup-cohort week-1 survival funnel and D1/D7 return rates shown as a visibly separated section on /funnel.

  • Query builders in apps/web/worker/features/funnel/queries.ts beside the existing pool queries (each predicate .toSQL()-inspectable): stages over rows that already exist — user.created_at, first contribution via MIN(created_at) across definition_record/post_record/comment_record, authorship_vouch.created_at, user.promoted_at — plus D1/D7 return rates off user_activity_day and tracer B's rollup table.
  • Known data holes surfaced as unmeasurable counts, never reconstructed: pre-Stamp promoted_at at yazar promotion (both mod-direct and vouch-tandem paths) #1590 founding cohort (promoted_at null), withdrawn vouches (ledger row deleted).
  • A second fate data view beside FunnelSummaryView (views.ts), folded through a service extension of Funnel.
  • The /funnel section renders below the existing pool snapshot, separated by its own heading and framing copy that names the numbers directional at current volume; all reads already behind requireFunnelAccess (funnel/gate.ts) — no new gate seam for moderation.
  • The cohort view resolution sits behind a default-off flag so the display can be enabled independently of capture.

Monitoring acceptance (founder ruling R1.2 on #7028, folded here as this tracer's criteria — this child closes the epic's loop end-to-end):

  1. Errors surface via the existing worker error pipeline (Sentry) automatically — verify the capture and cron paths emit there.
  2. Silence detection verified end-to-end: with sessions present and zero new user_activity_day rows over a window, the weekly cron raises the flag.
  3. Day-one sanity: after deploy, run a manual query confirming today's user_activity_day rows exist, and post the result to this issue.

Acceptance criteria

  • all five stage builders plus D1/D7 return builders are .toSQL()-asserted with no engine
  • unmeasurable populations appear as explicit counts, never dropped or back-computed
  • the cohort section renders separated from the pool snapshot with directional framing, behind requireFunnelAccess
  • the display flag default-off leaves the existing /funnel readout byte-identical when disabled
  • the three monitoring points above are demonstrated and recorded on this issue

Metadata

Metadata

Assignees

No one assigned

    Labels

    p1Medium priorityready-for:agentAn execution engine may pick this up.status:plannedplan-epic child: planned, not yet verified by review-plan, not pickabletype:featureNew capability, directly implementable

    Type

    No type

    Projects

    Status
    Todo

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions