feat(cli): track init onboarding journeys

Merged
WC
3mo ago
+468-32

Summary

  • add per-invocation run IDs and resumable journey IDs to classic capgo init
  • persist resume lineage and enrich existing onboarding-v2 milestones plus lifecycle boundaries
  • preserve terminal replay, analytics opt-out, and the existing markSnag/sendEvent delivery path

Scope

  • classic capgo init only; no build init, frontend, backend, replay delivery, or generic prompt instrumentation changes
  • 460 additions and 30 deletions (490 total changed lines)

Test plan

  • bun run cli:check
  • focused init telemetry, replay, guardrail, and analytics suites
  • CLI lint, typecheck, build, and final whole-change review

View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

Summary by CodeRabbit

  • New Features

    • Added telemetry for CLI initialization, including milestones, resume and restart tracking, app scoping, and explicit completion, cancellation, or failure outcomes.
    • Preserved telemetry metadata across resumed sessions and supported replay-session correlation.
    • Added telemetry opt-out support; analytics failures do not interrupt initialization.
  • Documentation

    • Added a design specification covering initialization telemetry identities, events, persistence, and opt-out behavior.
  • Tests

    • Added comprehensive coverage for telemetry, progress handling, lifecycle events, and command integration.