mirror of
https://github.com/openprose/prose.git
synced 2026-09-19 05:55:05 +08:00
2346fb9f8a
Add anonymous, content-free product telemetry to @openprose/reactor-cli so we can see how many people use Reactor and for what — without being invasive. - CLI-only: the @openprose/reactor SDK stays silent (zero network egress on import). Telemetry lives entirely in reactor-cli; zero new runtime deps. - Reuses the existing POST /analytics backend (no API change). New event class is isolated by context.library="@openprose/reactor-cli" + reactor.* event names; all payload lives in properties (context carries only the whitelisted library key). - Content-free: anonymous per-machine install id, versions, os/arch, ci, command, outcome, and bucketed counts/durations only. Never paths, content, prompts, names, keys, or model I/O. - Opt-out gate (default on for interactive runs): DO_NOT_TRACK, REACTOR_TELEMETRY=0, REACTOR_OFFLINE=1, CI/non-TTY, reactor.yml telemetry.enabled:false, or ~/.reactor/config.json telemetryEnabled:false all disable it. - Bespoke fire-and-forget fetch client (2s timeout, never blocks/throws). - First-run disclosure surfaced once/machine inside `reactor doctor` (stdout). - New `reactor telemetry status|enable|disable|--dump` inspect/opt-out surface (--dump is read-only; prints the exact payload that would be sent). - Endpoints: prod https://api.openprose.ai/analytics (published default), dev https://api.dev.openprose.ai/analytics, override REACTOR_TELEMETRY_ENDPOINT. Tests: 174 pass (offline gate). Asserts zero egress when disabled/offline/non-TTY and at import; a positive enabled-path egress test; full gate truth table; per-command fire-points; install-id create/reuse/corrupt; once-only notice. Plan + research: planning/plans/2026-06-02-reactor-telemetry/ (in openprose).