* Default-on consent is gated by a one-time stderr notice (interactive * installs record their choice explicitly and never reach this).
()
| 361 | * installs record their choice explicitly and never reach this). |
| 362 | */ |
| 363 | private firstRunNotice(): void { |
| 364 | const config = this.readConfig(); |
| 365 | if (config?.first_run_notice_shown) return; |
| 366 | if (!config) { |
| 367 | this.writeConfig({ |
| 368 | enabled: true, |
| 369 | machine_id: randomUUID(), |
| 370 | consent_source: 'default-notice', |
| 371 | first_run_notice_shown: true, |
| 372 | updated_at: this.now().toISOString(), |
| 373 | }); |
| 374 | } else { |
| 375 | this.writeConfig({ ...config, first_run_notice_shown: true, updated_at: this.now().toISOString() }); |
| 376 | } |
| 377 | this.writeStderr( |
| 378 | `codegraph collects anonymous usage stats (no code, paths, or names) — ` + |
| 379 | `"codegraph telemetry off" or CODEGRAPH_TELEMETRY=0 disables. Details: ${TELEMETRY_DOCS}\n`, |
| 380 | ); |
| 381 | } |
| 382 | |
| 383 | /** |
| 384 | * Synchronous, tiny, exit-safe: drain in-memory deltas to the JSONL queue. |
no test coverage detected