[PR #1839] [MERGED] Telemetry server: the hub's bug reports (opened as GitHub issues) and suggestions (queued for Kira) #3804

Closed
opened 2026-11-03 04:12:25 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

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

Base: main ← Head: feat/hub-intake


📝 Commits (1)

  • bac51e3 Telemetry server: the hub's bug reports and suggestions

📊 Changes

11 files changed (+990 additions, -22 deletions)

View changed files

📝 crates/horizon-telemetry-server/Cargo.lock (+52 -0)
📝 crates/horizon-telemetry-server/Cargo.toml (+2 -0)
📝 crates/horizon-telemetry-server/README.md (+15 -3)
➕ crates/horizon-telemetry-server/src/github.rs (+128 -0)
📝 crates/horizon-telemetry-server/src/hub.rs (+8 -5)
➕ crates/horizon-telemetry-server/src/intake.rs (+370 -0)
📝 crates/horizon-telemetry-server/src/lib.rs (+77 -3)
📝 crates/horizon-telemetry-server/src/main.rs (+3 -0)
📝 crates/horizon-telemetry-server/src/store.rs (+1 -0)
➕ crates/horizon-telemetry-server/tests/github.rs (+41 -0)
📝 crates/horizon-telemetry-server/tests/hub.rs (+293 -11)

📄 Description

🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself.

Stacked on #1838. This is the hub's intake, in the formats agreed with Kira's side (kira PRs #10–#14). The website's forms come in a later PR.

POST /hub/report: a bug report from the hub's form, {"title", "did", "happened", "expected", "version"?, "system", "name"?}.

  • The server opens the GitHub issue itself, with labels bug and from-website. The body follows the #horizon-bugs template that Kira's /report uses (What I did / What happened / What I expected / Horizon version / OS, CPU, GPU), quoted, followed by "Reported on playhorizon.dev".
  • It answers 201 {"id", "issue": "<url>"}, so the page can link the issue.
  • Every template field is required (empty → 400). The version is optional ("not given").
  • People's text is made inert, with the same rules as Kira's neutralise: no @ mentions, no #123 or issue-URL cross-references, no HTML, no closing keywords.
  • The same report sent twice in a day (a double click) answers the first one's issue and opens nothing new.
  • If GitHub fails, the report is kept and the answer is 202 {"issue": null}. The 10-minute upkeep tries again (off the async workers) for a week, then gives up.
  • Without HORIZON_TELEMETRY_GITHUB_TOKEN the endpoint answers 503, and the form points to GitHub and Discord instead.

POST /hub/suggest: {"text", "item"?, "name"?} goes into the queue and answers 202 {"id"}. Nothing is ever published.

GET /hub/suggestions?after=<id>&limit=100: Kira's relay, as asked: {"suggestions": [{"id", "text", "item"?, "name"?, "created_at"}]}, oldest first.

  • It needs Authorization: Bearer <HORIZON_TELEMETRY_HUB_TOKEN>. The comparison takes constant time. A wrong token gets 401; without a token configured it answers 404.

Abuse limits:

  • Per address: 20 posts an hour, bursts of 2, keyed by the same hashed address as the votes.
  • From everyone: 30 reports a day (each one opens an issue) and 200 suggestions a day.
  • Bodies are limited to 24 KiB, with a length limit per field.
  • A honeypot website field: a filled one gets 202 and is dropped.
  • Entries are kept 90 days. No IP address is stored.

New dependency: ureq 2.12 (rustls, already in the game's and the launcher's lockfiles), for the one blocking call to GitHub.

To deploy (the coordinator, not me):

  • HORIZON_TELEMETRY_GITHUB_TOKEN: a fine-grained token with Issues read/write on ludovic111/horizon only.
  • HORIZON_TELEMETRY_HUB_TOKEN: the same secret goes into Kira's config for the relay.
  • The from-website label in the repo (GitHub creates a missing label when the token can push; creating it first sets its colour).

Self-check

In the crate's own workspace: cargo fmt --check, cargo clippy --all-targets -- -D warnings and cargo test are clean (lib 6, github 2, hub 9, live 5, server 9, summary 4). The hub tests use a fake GitHub and cover: the issue template and labels; double sends; required fields; the honeypot; GitHub down, then the upkeep's retry; the 503 without a token; the queue's token, after and text cleaning; the rate limit and daily cap; expiry; CORS.

About 590 lines of code (tests and lockfile not counted). That is over the ~500 guideline: reports and suggestions share the queue, the limits and the tests, so they stay in one 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/1839 **Author:** [@ludovic111](https://github.com/ludovic111) **Created:** 10/25/2026 **Status:** ✅ Merged **Merged:** 10/25/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `feat/hub-intake` --- ### 📝 Commits (1) - [`bac51e3`](https://github.com/horizon-rust/horizon/commit/bac51e3fba6922c0a10eb4105cfc68886d6ae573) Telemetry server: the hub's bug reports and suggestions ### 📊 Changes **11 files changed** (+990 additions, -22 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-telemetry-server/Cargo.lock` (+52 -0) 📝 `crates/horizon-telemetry-server/Cargo.toml` (+2 -0) 📝 `crates/horizon-telemetry-server/README.md` (+15 -3) ➕ `crates/horizon-telemetry-server/src/github.rs` (+128 -0) 📝 `crates/horizon-telemetry-server/src/hub.rs` (+8 -5) ➕ `crates/horizon-telemetry-server/src/intake.rs` (+370 -0) 📝 `crates/horizon-telemetry-server/src/lib.rs` (+77 -3) 📝 `crates/horizon-telemetry-server/src/main.rs` (+3 -0) 📝 `crates/horizon-telemetry-server/src/store.rs` (+1 -0) ➕ `crates/horizon-telemetry-server/tests/github.rs` (+41 -0) 📝 `crates/horizon-telemetry-server/tests/hub.rs` (+293 -11) </details> ### 📄 Description > 🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself. Stacked on #1838. This is the hub's intake, in the formats agreed with Kira's side (kira PRs #10–#14). The website's forms come in a later PR. **`POST /hub/report`**: a bug report from the hub's form, `{"title", "did", "happened", "expected", "version"?, "system", "name"?}`. - The server opens the GitHub issue itself, with labels `bug` and `from-website`. The body follows the `#horizon-bugs` template that Kira's `/report` uses (What I did / What happened / What I expected / Horizon version / OS, CPU, GPU), quoted, followed by "Reported on playhorizon.dev". - It answers 201 `{"id", "issue": "<url>"}`, so the page can link the issue. - Every template field is required (empty → 400). The version is optional ("not given"). - People's text is made inert, with the same rules as Kira's `neutralise`: no `@` mentions, no `#123` or issue-URL cross-references, no HTML, no closing keywords. - The same report sent twice in a day (a double click) answers the first one's issue and opens nothing new. - If GitHub fails, the report is kept and the answer is 202 `{"issue": null}`. The 10-minute upkeep tries again (off the async workers) for a week, then gives up. - Without `HORIZON_TELEMETRY_GITHUB_TOKEN` the endpoint answers 503, and the form points to GitHub and Discord instead. **`POST /hub/suggest`**: `{"text", "item"?, "name"?}` goes into the queue and answers 202 `{"id"}`. Nothing is ever published. **`GET /hub/suggestions?after=<id>&limit=100`**: Kira's relay, as asked: `{"suggestions": [{"id", "text", "item"?, "name"?, "created_at"}]}`, oldest first. - It needs `Authorization: Bearer <HORIZON_TELEMETRY_HUB_TOKEN>`. The comparison takes constant time. A wrong token gets 401; without a token configured it answers 404. **Abuse limits:** - Per address: 20 posts an hour, bursts of 2, keyed by the same hashed address as the votes. - From everyone: 30 reports a day (each one opens an issue) and 200 suggestions a day. - Bodies are limited to 24 KiB, with a length limit per field. - A honeypot `website` field: a filled one gets 202 and is dropped. - Entries are kept 90 days. No IP address is stored. **New dependency:** `ureq` 2.12 (rustls, already in the game's and the launcher's lockfiles), for the one blocking call to GitHub. **To deploy (the coordinator, not me):** - `HORIZON_TELEMETRY_GITHUB_TOKEN`: a fine-grained token with Issues read/write on `ludovic111/horizon` only. - `HORIZON_TELEMETRY_HUB_TOKEN`: the same secret goes into Kira's config for the relay. - The `from-website` label in the repo (GitHub creates a missing label when the token can push; creating it first sets its colour). ### Self-check In the crate's own workspace: `cargo fmt --check`, `cargo clippy --all-targets -- -D warnings` and `cargo test` are clean (lib 6, github 2, hub 9, live 5, server 9, summary 4). The hub tests use a fake GitHub and cover: the issue template and labels; double sends; required fields; the honeypot; GitHub down, then the upkeep's retry; the 503 without a token; the queue's token, `after` and text cleaning; the rate limit and daily cap; expiry; CORS. About 590 lines of code (tests and lockfile not counted). That is over the ~500 guideline: reports and suggestions share the queue, the limits and the tests, so they stay in one 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-03 04:12:25 +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#3804
No description provided.