Skip to content

feat(insights): adoption tab with active members by surface, member table, breakdowns and CSV export - #10540

Merged
waleedlatif1 merged 9 commits into
stagingfrom
feat/organization-adoption-insights
Dec 1, 2026
Merged

waleedlatif1 merged 9 commits into
stagingfrom
feat/organization-adoption-insights

Conversation

@waleedlatif1

Copy link
Copy Markdown
Collaborator

Summary

  • New Adoption tab in organization Insights (after Activity), read from organization_member_activity_daily (feat(insights): record daily member activity per surface for organization adoption #10532), for organization admins and owners with usage monitoring
  • Headline: members active today, over 7 days and 28 days (ending at the period's end or now), coverage (members active in the period / all members) and stickiness (average daily active members / members active in the period), plus a daily active members chart (UTC days)
  • Per-surface table: active members and uses for the Assistant, agent chats, the Search page, Search MCP, Slack and workflow runs
  • Members table: every current member, inactive ones included, with department, days active, per-surface uses and last active; sorted by days active, uses, recency or name; paged in the URL (adoption-sort, adoption-page)
  • Breakdown (adoption-group): departments from People profiles (members without one grouped as "No department"), Search MCP tools and Search MCP clients (client name, or the API key kind), each with active members, totals and error rate
  • CSV export per member through GET /api/organizations/[id]/usage/adoption/export (the Insights Export action switches to it on this tab); same session auth, no-store, formula-injection-safe cells and X-Export-Truncated as the usage export
  • Contracts in lib/api/contracts/organization-adoption.ts (defineRouteContract), routes on defineInternalJsonRoute with the usage error policy, operations organization_usage.adoption.read / .export under organization admin authority, React Query hooks in hooks/queries/organization-adoption.ts
  • Only current members count toward the headline, surfaces and members; the Search MCP breakdown reads the invocation log over the period's exact instants
  • formatFailureRate renamed formatPercent, now shared by both tabs

Type of Change

  • New feature

Testing

  • lib/billing/core/organization-adoption.integration.ts against real Postgres (6 tests): a former member and another organization's member never count; 1/7/28-day bounds; coverage and stickiness from the daily series; every member listed with zeros for the inactive; ordering by days, uses and recency; department breakdown with the no-department group; Search MCP tool and client breakdowns bounded to the period. Removing the membership join or the Search MCP period bound turns their tests red
  • Unit suites: ee/organization-usage, app/api/organizations/[id]/usage
  • check:api-validation:strict, check:client-boundary, check:boundaries, check:unused-exports, bun run generate, lint

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing (new tests pass the test-audit authoring gate)
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

@vercel

vercel Bot commented Dec 1, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
docs Skipped Skipped Dec 1, 2026 6:33am UTC

Request Review

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 17 files

Reply with feedback, questions, or to request a fix.

Turn on auto-fix | Re-trigger cubic

@greptile-apps

greptile-apps Bot commented Dec 1, 2026 •

Copy link
Copy Markdown
Contributor

Confidence Score: 5/5 · The PR appears safe to merge, with no outstanding findings.RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge, with no outstanding findings.

Summary

Adds an Adoption tab with member activity, daily charts, surface totals, breakdowns, and CSV export.

  • Organization Insights shows adoption across Sim surfaces and member groups.
  • The Adoption tab downloads a CSV of member activity for the selected period.

Reviews (7) · Last reviewed commit: "fix(insights): classify export outages l..." · Reviewed by Greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@waleedlatif1 I have started the AI code review. It will take a few minutes to complete.

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 17 files

Reply with feedback, questions, or to request a fix.

Turn on auto-fix | Re-trigger cubic

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@waleedlatif1 I have started the AI code review. It will take a few minutes to complete.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 17 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Turn on auto-fix | Re-trigger cubic

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@waleedlatif1 I have started the AI code review. It will take a few minutes to complete.

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 17 files

Reply with feedback, questions, or to request a fix.

Turn on auto-fix | Re-trigger cubic

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@waleedlatif1 I have started the AI code review. It will take a few minutes to complete.

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 17 files

You've manually re-run cubic several times on this PR. Each manual re-review checks the full PR again and counts toward your usage quota. To preserve your usage limits, we recommend letting cubic automatically review new commits.

Turn on auto-fix | Re-trigger cubic

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@waleedlatif1 I have started the AI code review. It will take a few minutes to complete.

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 17 files

You've manually re-run cubic several times on this PR. Each manual re-review checks the full PR again and counts toward your usage quota. To preserve your usage limits, we recommend letting cubic automatically review new commits.

Turn on auto-fix | Re-trigger cubic

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@waleedlatif1 I have started the AI code review. It will take a few minutes to complete.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 18 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

You've manually re-run cubic several times on this PR. Each manual re-review checks the full PR again and counts toward your usage quota. To preserve your usage limits, we recommend letting cubic automatically review new commits.

Turn on auto-fix | Re-trigger cubic

@waleedlatif1
waleedlatif1 merged commit ada4653 into staging Dec 1, 2026
84 checks passed
@waleedlatif1
waleedlatif1 deleted the feat/organization-adoption-insights branch December 1, 2026 07:03

This branch was previously deployed

1 inactive deployment
Preview — 975773e8 Deployed Dec 1, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant