← Back to Pull requests

Admin report: Activation (signup week + time to first item) #232

Closed
unknown closed this pull request without merging on Nov 29, 2026 04:28 UTC
View on GitHub
unknown unknown commented on Nov 29, 2026 04:04 UTC
Author

<!-- CURSOR_AGENT_PR_BODY_BEGIN -->

Summary

Adds an Activation (current collection) entry to the Admin Reports registry with:

  • Current items by signup week (UTC): new accounts, how many currently have at least one collection item (quantity &gt; 0 or ISO/UFT), and share %.

  • Signup → earliest current item (accounts with items now): median time and a simple distribution (under 1h, 1–24h, 1–7d, 7–30d, 30d+).
  • Data loads one-shot on mount via Refresh (no live listeners). Weekly aggregation and timing stats are computed client-side from the callable payload.

    Data sources

    | Metric | Source |
    |--------|--------|
    | Signup time | Firebase Auth metadata.creationTime (admin callable) |
    | Has item / timing | Current Firestore snapshot: earliest qualifying collections.updatedAt per ownerUid |

    Not tracked yet

  • Durable first-item event — collection rows are hard-deleted on remove/decrement-to-zero; this report does not count past adds after the user clears their collection. PostHog has item_added (client-only, fires on every add, no server query in this stack), so the callable does not use it.

  • Dedicated collection createdAt — rules only allow updatedAt; timing is an earliest-updatedAt proxy among current rows (footnote in UI).
  • Admin-only

  • UI: existing AdminGate / reports route.

  • Data: new getAdminActivationReport callable reuses assertSiteAdmin (same pattern as listAdminCollectors). No Firestore rules changes.
  • Tests

  • functions/adminActivationReport.test.js — row building + handler auth

  • aggregateActivationReport.test.js — week bucketing, median, buckets

  • useActivationReport.test.js, ActivationReport.test.jsx — hook + UI
  • Setup after merge

    1. Deploy Cloud Functions — required for getAdminActivationReport.
    2. Deploy frontend hosting — for /admin/reports/activation.
    3. Firestore rules / indexes — none.
    4. Config / secrets — none.
    <!-- CURSOR_AGENT_PR_BODY_END -->

    <div><a href="https://cursor.com/agents/bc-fca65408-dc06-5dd0-a381-afdd82819ebd?cursor_ref=pr_footer&cursor_cta=open_in_web"><picture><source media="(prefers-color-scheme: dark)" srcset="https://cursor.com/assets/images/open-in-web-dark.png"><source media="(prefers-color-scheme: light)" srcset="https://cursor.com/assets/images/open-in-web-light.png"><img alt="Open in Web" width="114" height="28" src="https://cursor.com/assets/images/open-in-web-dark.png"></picture></a>&nbsp;<a href="https://cursor.com/background-agent?bcId=bc-fca65408-dc06-5dd0-a381-afdd82819ebd&cursor_ref=pr_footer&cursor_cta=open_in_cursor"><picture><source media="(prefers-color-scheme: dark)" srcset="https://cursor.com/assets/images/open-in-cursor-dark.png"><source media="(prefers-color-scheme: light)" srcset="https://cursor.com/assets/images/open-in-cursor-light.png"><img alt="Open in Cursor" width="131" height="28" src="https://cursor.com/assets/images/open-in-cursor-dark.png"></picture></a>&nbsp;</div>

    Diff: 375 lines (+281 / -94) across 4 files Reviewer: cursor[bot] Review duration: 24m
    All Vouch review confidence checks passed
    Residual risk 0.21 = Change Risk (0.48) × (1 − Review Confidence (0.57)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.48 · 375 lines diff across 4 files
    0.48
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    56%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.355
    Shallow Review Depth shallow_review_depth
    0.289
    Ai Authored ai_authored
    0.050
    Real PR Conversation Timeline
    1 comments
    "Review active on #232"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 56.8% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 47.9% (MEDIUM) · Higher = larger blast radius
    47.9%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 56.8% · Lower = rushed or shallow review
    56.8%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 20.7% · Safe to merge
    20.7%