feat(insights): investigate saved activation and return outcomes - #775
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
2 Skipped Deployments
|
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: ASSERTIVE Plan: Advanced Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
The latest updates on your projects. Learn more about Unkey Deploy
|
…ant reads" This reverts commit b931b4d.
Greptile SummaryThis PR adds organization-level activation/return definitions and integrates independently measured identified-profile retention cohorts into Insights.
Confidence Score: 3/5The PR is not yet safe to merge because stale plans can bypass save-time binding validation and edited definitions can leave obsolete investigations perpetually due; the explicit dashboard typography requirement must also be satisfied. Two concrete lifecycle failures remain: omission-based saves persist unvalidated inherited bindings, and definition changes defer old retention cases without retiring them. The new dashboard component also violates an explicit repository typography rule. Files Needing Attention: packages/services/src/organization-business-context.ts, apps/insights/src/measurement-plan.ts, apps/dashboard/app/(main)/organizations/components/measurement-plan-editor.tsx Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Organization settings] --> B[Save measurement plan]
B --> C[Organization metadata]
C --> D[Load current website-bound plan]
D --> E[Query previous cohort independently]
D --> F[Query current cohort independently]
E --> G[Validate complete identified-profile counts]
F --> G
G --> H[Create retention signal]
H --> I[Portfolio selection]
I --> J[Investigation agent]
J --> K[Persist case and observation]
C --> L[AI business-context delivery]
Reviews (1): Last reviewed commit: "Revert "fix(insights): finish from suffi..." | Re-trigger Greptile |
Saved business context could describe meaningful behavior without measuring whether the same identified profiles returned. Add an editable activation/return definition per website and feed independently measured, complete weekly cohorts into the existing investigation pipeline. For example, steady event volume can now coexist with a measured 140/200 → 60/200 return decline, with no invented cause or customer-churn claim.
Definitions share the organization settings/oRPC save, draft recovery, revision and restore flows; AI brief regeneration preserves them. Saves and restores reject stale or foreign website bindings. The UI uses shared components and event suggestions with manual editing. Existing organization metadata is the durable store; no migration or parallel agent engine is added.
Each week is queried independently so repeat activators can belong to both cohorts. Exact event selectors, eligible denominators, maturity bounds and event-level identity coverage remain explicit. Weak/incomplete comparisons are withheld; priorities and newer team replies still participate in selection. Cohort entities preserve valid product outcomes without weakening the raw-traffic publication guard. Query discovery exposes supported filters and accepts its documented canonical order.
Validation: repository lint, 33 typecheck tasks, full 27-task test pipeline, 608 Insights tests, 37 synthetic PostgreSQL service tests, 32 AI-context tests, 11 browser regressions, and desktop/mobile inspection. Real ClickHouse regression with 600 events/100 overlapping profiles reproduced a false 50% → 0% combined-window result and verified the independent-week 50% → 50% result.
Fresh live-model evaluation: three preserved trials, 72 case-arm runs. The selected source version delivers 8/8 material scheduled findings and suppresses all four candidate non-actionable/explained cases. This is synthetic aggregate replay through production model/agent/parser code, separate from SQL execution, and not a production ROI benchmark. Remaining limitations include small-sample wording, missing presentation qualifiers and verbose requested answers. Independent code and semantic reviews found no remaining blocker for this slice.
Builds on merged #774 and current staging; the obsolete schema proposal #751 is not a dependency. Scope: saved definitions, settings, context delivery and native cohort detection. AI-assisted implementation and independent agent reviews under maintainer authorization.