[PR #250] [MERGED] Opt-in data collection (2/5): the launcher asks, Settings changes it, CLI and MCP #2438

Closed
opened 2026-11-02 15:56:09 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/250
Author: @ludovic111
Created: 10/15/2026
Status: ✅ Merged
Merged: 10/15/2026
Merged by: @ludovic111

Base: main ← Head: feat/telemetry-launcher


📝 Commits (1)

  • d53a366 Opt-in data collection (2/5): the launcher asks, and Settings changes it

📊 Changes

10 files changed (+836 additions, -7 deletions)

View changed files

📝 .github/workflows/launcher.yml (+3 -1)
📝 launcher/README.md (+23 -4)
📝 launcher/src/cli.rs (+120 -0)
➕ launcher/src/collection.rs (+307 -0)
📝 launcher/src/lib.rs (+1 -0)
📝 launcher/src/main.rs (+16 -1)
📝 launcher/src/mcp.rs (+47 -0)
➕ launcher/src/telemetry.rs (+317 -0)
📝 tests/test_pr_ready.py (+1 -0)
📝 tools/release_train.py (+1 -1)

📄 Description

What

Second of five PRs for opt-in data collection. Stacked on #248: merge that first, then this one's diff is just the launcher.

  • First-run question (also asked again when CONSENT_VERSION changes), drawn over the launcher in the design system:
    • four switches, all off, each with what it sends in plain words
    • what is never sent
    • "View what would be sent", which shows the exact JSON: what waits, or else one example of each kind made on this machine
    • "Send nothing" and "Save choices". Saying no is one click.
  • Settings → Data collection: the same switches at any time, the install ID and how many items wait, "View what would be sent", and "Delete my data". Deleting asks for confirmation, then makes the server delete everything under the install ID, clears the outbox and takes a new ID. If the server can't be reached, the ID is kept so the deletion can be retried.
  • Sending:
    • The outbox is sent in the background at start, and on close for at most 3 s.
    • Only with a server, and there is none yet: DEFAULT_ENDPOINT stays None until Ludovic picks hosting, and HORIZON_TELEMETRY_URL overrides it.
    • Only kinds the player allows.
  • CLI: horizon-launcher data [status], allow|deny <performance|crashes|bugs|benchmarks|all>, show, delete, send, bug "<text>" [--log], benchmark <report.json>.
    • bug and benchmark refuse while their switch is off, and print the item for the player to confirm (--yes skips the question).
    • Logs are scrubbed and lose [CHAT] lines.
    • Account names, UUIDs and world folder names are scrubbed as known terms.
  • MCP: data_collection, set_data_collection, data_preview, delete_my_data, report_bug. The descriptions say to act only on the player's say-so.
  • crates/horizon-telemetry joins the launcher's paths (launcher.yml, release_train.LAUNCHER_PATHS, pr_ready.launcher_rust, with a test).

How tested

End to end against a local mock HTTP server (scratch HORIZON_HOME / HORIZON_LAUNCHER_HOME):

  • data bug while bug reports were off: refused, 0 requests.
  • data allow bugs, then data bug "…" --log --yes: one POST /v1/batch, zstd, 392 bytes. The log lost its [CHAT] line, and /Users/<user>/… and <ip> were scrubbed.
  • data delete: DELETE /v1/installs/<id>, then a new ID.
  • data deny all and --json data give the expected status.

Window: the consent screen renders in the launcher. It was screenshotted on the Mac mini, and that capture showed the card's buttons below the plate in a 700 px window. I fixed this by making the overlay scroll from the top. I couldn't capture the fixed version: the Mac mini's screen locked. A fresh screenshot is still to come.

pr_ready (tools/pr_ready.py --base feat/telemetry-consent on ludovics-mac-mini, against feat/telemetry-consent at 43138159b, 1 min 2 s)

Check Result
Scope ⚠️ 12 files, +865 −7; 844 lines of code: over 500, split it if it can ship in parts; mixes CI, launcher
Cargo.lock ✅ changes with a Cargo.toml
Public tree ✅
Python tests ❌ 196 run, FAILED (errors=14) (49 s)
rustfmt ➖ no Rust change
clippy ➖ no Rust change
tests ➖ no crate touched
tokens.css up to date ➖ theme untouched
launcher rustfmt ✅
launcher clippy ✅ (1 s)
launcher tests ✅ 32 passed (4 s)
Parity ➖ 230 affected, to run in CI (no vanilla data here): active_effect_tick, active_effects, anchor, attribute_health, attribute_map_queries, attribute, attribute_updates, bamboo, basic_feature, biome_chunk, biome_generation, biome_placement and 218 more
Label player-facing: feature if players get something new, no label for a fix (release-now if urgent)

The Python check runs under the Mac mini's Python 3.9 (no hashlib.file_digest). Under 3.13, 2 tests error (test_parity_runner oracle reuse, test_rust_parity sources changed), and they fail the same way on plain origin/main (macOS /private/var temp paths). The test_pr_ready and test_release_train tests touched here pass. There's no Rust change in the main workspace. The launcher's fmt, clippy and tests pass.

Linux check: the window is the same GPUI code on Linux. It wasn't run on Wayland/X11 (that needs vscreen on the desktop).

Needs Ludovic

Nothing to merge this. Nothing is sent until hosting is approved; that's in the server PR.

🤖 Generated with Claude Code


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/horizon-rust/horizon/pull/250 **Author:** [@ludovic111](https://github.com/ludovic111) **Created:** 10/15/2026 **Status:** ✅ Merged **Merged:** 10/15/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `feat/telemetry-launcher` --- ### 📝 Commits (1) - [`d53a366`](https://github.com/horizon-rust/horizon/commit/d53a3667185e37682606520c078f65eee56b4c6c) Opt-in data collection (2/5): the launcher asks, and Settings changes it ### 📊 Changes **10 files changed** (+836 additions, -7 deletions) <details> <summary>View changed files</summary> 📝 `.github/workflows/launcher.yml` (+3 -1) 📝 `launcher/README.md` (+23 -4) 📝 `launcher/src/cli.rs` (+120 -0) ➕ `launcher/src/collection.rs` (+307 -0) 📝 `launcher/src/lib.rs` (+1 -0) 📝 `launcher/src/main.rs` (+16 -1) 📝 `launcher/src/mcp.rs` (+47 -0) ➕ `launcher/src/telemetry.rs` (+317 -0) 📝 `tests/test_pr_ready.py` (+1 -0) 📝 `tools/release_train.py` (+1 -1) </details> ### 📄 Description ## What Second of five PRs for opt-in data collection. Stacked on #248: merge that first, then this one's diff is just the launcher. - **First-run question** (also asked again when `CONSENT_VERSION` changes), drawn over the launcher in the design system: - four switches, **all off**, each with what it sends in plain words - what is never sent - "View what would be sent", which shows the exact JSON: what waits, or else one example of each kind made on this machine - "Send nothing" and "Save choices". Saying no is one click. - **Settings → Data collection**: the same switches at any time, the install ID and how many items wait, "View what would be sent", and "Delete my data". Deleting asks for confirmation, then makes the server delete everything under the install ID, clears the outbox and takes a new ID. If the server can't be reached, the ID is kept so the deletion can be retried. - **Sending**: - The outbox is sent in the background at start, and on close for at most 3 s. - Only with a server, and there is none yet: `DEFAULT_ENDPOINT` stays `None` until Ludovic picks hosting, and `HORIZON_TELEMETRY_URL` overrides it. - Only kinds the player allows. - **CLI**: `horizon-launcher data [status]`, `allow|deny <performance|crashes|bugs|benchmarks|all>`, `show`, `delete`, `send`, `bug "<text>" [--log]`, `benchmark <report.json>`. - `bug` and `benchmark` refuse while their switch is off, and print the item for the player to confirm (`--yes` skips the question). - Logs are scrubbed and lose `[CHAT]` lines. - Account names, UUIDs and world folder names are scrubbed as known terms. - **MCP**: `data_collection`, `set_data_collection`, `data_preview`, `delete_my_data`, `report_bug`. The descriptions say to act only on the player's say-so. - `crates/horizon-telemetry` joins the launcher's paths (`launcher.yml`, `release_train.LAUNCHER_PATHS`, `pr_ready.launcher_rust`, with a test). ## How tested End to end against a local mock HTTP server (scratch `HORIZON_HOME` / `HORIZON_LAUNCHER_HOME`): - `data bug` while bug reports were off: refused, **0 requests**. - `data allow bugs`, then `data bug "…" --log --yes`: one `POST /v1/batch`, zstd, 392 bytes. The log lost its `[CHAT]` line, and `/Users/<user>/…` and `<ip>` were scrubbed. - `data delete`: `DELETE /v1/installs/<id>`, then a new ID. - `data deny all` and `--json data` give the expected status. Window: the consent screen renders in the launcher. It was screenshotted on the Mac mini, and that capture showed the card's buttons below the plate in a 700 px window. I fixed this by making the overlay scroll from the top. I couldn't capture the fixed version: the Mac mini's screen locked. **A fresh screenshot is still to come.** **pr_ready** (`tools/pr_ready.py --base feat/telemetry-consent` on ludovics-mac-mini, against feat/telemetry-consent at 43138159b, 1 min 2 s) | Check | Result | | --- | --- | | Scope | ⚠️ 12 files, +865 −7; 844 lines of code: over 500, split it if it can ship in parts; mixes CI, launcher | | Cargo.lock | ✅ changes with a Cargo.toml | | Public tree | ✅ | | Python tests | ❌ 196 run, FAILED (errors=14) (49 s) | | rustfmt | ➖ no Rust change | | clippy | ➖ no Rust change | | tests | ➖ no crate touched | | tokens.css up to date | ➖ theme untouched | | launcher rustfmt | ✅ | | launcher clippy | ✅ (1 s) | | launcher tests | ✅ 32 passed (4 s) | | Parity | ➖ 230 affected, to run in CI (no vanilla data here): active_effect_tick, active_effects, anchor, attribute_health, attribute_map_queries, attribute, attribute_updates, bamboo, basic_feature, biome_chunk, biome_generation, biome_placement and 218 more | | Label | player-facing: `feature` if players get something new, no label for a fix (`release-now` if urgent) | The Python check runs under the Mac mini's Python 3.9 (no `hashlib.file_digest`). Under 3.13, 2 tests error (`test_parity_runner` oracle reuse, `test_rust_parity` sources changed), and they fail the same way on plain origin/main (macOS `/private/var` temp paths). The `test_pr_ready` and `test_release_train` tests touched here pass. There's no Rust change in the main workspace. The launcher's fmt, clippy and tests pass. Linux check: the window is the same GPUI code on Linux. It wasn't run on Wayland/X11 (that needs vscreen on the desktop). ## Needs Ludovic Nothing to merge this. Nothing is sent until hosting is approved; that's in the server PR. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-02 15:56:09 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
horizon-rust/horizon#2438
No description provided.