Skip to content

Conversation

@CSRessel
Copy link
Collaborator

Motivation

  • Unify Nori CLI install/session reporting with other CLIs so analytics aggregate identical lifecycle events and client identifiers.
  • Persist a robust local install state that supports churn/resurrection detection and per-user opt-out control.
  • Send telemetry to the Nori analytics proxy using a flat event schema and non-blocking delivery with strict timeout requirements.

Description

  • Replace prior user-id with a deterministic client_id UUID derived from SHA256("nori_salt:<hostname>:<username>") and add an opt_out boolean to the install state file schema.
  • Update launch tracking to emit four event types (app_install, app_update, user_resurrected, session_start), detect semver upgrades via the semver crate, and flag resurrection when last launch > 30 days.
  • Revamp analytics payload to a flat JSON shape (event, client_id, session_id, timestamp, properties) and post to NORI_ANALYTICS_URL (default https://noriskillsets.dev/api/analytics/track) with a 500ms timeout and fire-and-forget semantics.
  • Honor opt-out precedence with NORI_NO_ANALYTICS=1 overriding local opt_out, keep state updates even when opted out, and document the new schema and behavior in docs.md.
  • Add dependencies (semver, uuid) and update tests and code to use the new API names (generate_client_id, create_event, etc.).

Testing

  • Ran formatting: just fmt completed successfully.
  • Ran lints/fixes: just fix -p nori-installed completed successfully.
  • Ran unit tests for the crate: cargo test -p nori-installed and all tests passed (26 passed; 0 failed).

Codex Task

@CSRessel CSRessel changed the title feat(installed): align install/session tracking with new analytics schema feat(installed): Align install and session lifecycle with new schema Jan 20, 2026
CSRessel and others added 3 commits January 20, 2026 15:26
…eout

- Make analytics sending a no-op in debug builds using cfg attributes
- Skip analytics when CI=true environment variable is set
- Treat version downgrades the same as upgrades (emit AppUpdate event)
- Change HTTP timeout from 500ms to 5 seconds

Adds tests for downgrade handling and CI environment detection.
🤖 Generated with [Nori](https://nori.ai)

Co-Authored-By: Nori <contact@tilework.tech>
@CSRessel
Copy link
Collaborator Author

Just pending the API proxy for analytics events, in the new Nori public registry

@CSRessel CSRessel marked this pull request as ready for review January 20, 2026 21:51
@CSRessel CSRessel merged commit 60075c9 into dev Jan 21, 2026
3 checks passed
@CSRessel CSRessel deleted the codex/implement-robust-install-and-session-tracking-27izll branch January 21, 2026 07:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants