Skip to content

feat(telemetry): weekly funnel rollup — downloads, init, first run, second run, login attempts #1209

Description

@kokevidaurre

Summary

Produce a weekly acquisition/activation funnel rollup from data that already exists: npm downloads, local telemetry events, and .agents/observability/executions.jsonl. Today nobody can answer "of N downloads this week, how many ran an agent twice?" — the single number that tells us whether the OSS motion is a funnel or a hobby.

Spec

Command: squads telemetry rollup

Flags:

  • --weeks <n> (default 4) — trailing calendar weeks
  • --out <path> (default .agents/observability/funnel-<YYYY>-W<ww>.md; also print table to stdout)
  • --offline — skip the npm fetch, local data only

Funnel stages (weekly buckets):

  1. Downloads — npm registry downloads API for the package (public endpoint, e.g. https://api.npmjs.org/downloads/point/last-week/<pkg>; use the range API for multi-week)
  2. Installs with telemetry — distinct install IDs seen in first-party telemetry events (opt-in, disclosed — count only what the disclosure covers)
  3. init ran — telemetry command events
  4. First run — command events
  5. Second run (returning activation) — same install ID, distinct week or ≥24h later
  6. login attempts — command events including failed/degraded ones

Local-only mode (when telemetry pipe has no data — e.g. analyzing a single project's own usage) buckets stages 3–6 from executions.jsonl + telemetry events on this machine and says so in the header.

Output: markdown table, one row per week, one column per stage, with week-over-week deltas. Header states data sources and coverage honestly (e.g. "telemetry covers opt-in installs only — true funnel is wider at the top"). Missing source → column renders , never interpolated.

Rules:

  • No new dependencies (native fetch)
  • No PII: counts only, no install IDs in the output
  • No network in --offline mode; tests must use --offline + fixtures

Acceptance criteria

  • --offline on fixtures produces the correct weekly buckets and deltas
  • Missing sources render , not zeros
  • Output file written with honest header
  • Tests for bucketing logic (esp. "second run" definition)
  • docs/commands.md entry

Out of scope

  • Dashboards/charts, GA4 integration, hosted collection

One branch, one PR to develop, Closes #<this-issue>.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions