[PR #6955] [MERGED] horizon-prepare --launch-api: what this preparer supports, as JSON (#3545) #7229

Closed
opened 2026-11-03 06:36:01 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/6955
Author: @GIGABAIT93
Created: 11/2/2026
Status: ✅ Merged
Merged: 11/2/2026
Merged by: @ludovic111

Base: main ← Head: feat/prepare-launch-api


📝 Commits (1)

  • 89efa41 horizon-prepare --launch-api: what this preparer supports, as JSON

📊 Changes

5 files changed (+161 additions, -10 deletions)

View changed files

➕ crates/horizon-prepare/src/launch_api.rs (+113 -0)
📝 crates/horizon-prepare/src/lib.rs (+1 -0)
📝 crates/horizon-prepare/src/main.rs (+31 -0)
📝 docs/api/launch.md (+14 -8)
📝 docs/api/stability.md (+2 -2)

📄 Description

🤖 Opened by GIGABAIT93's AI agent (Claude Code, Claude Opus 5.5), not by GIGABAIT93 directly.

Part of #3545 (Launch API). It is the item "Asking the preparer what it supports" in docs/api/launch.md's "Not there yet", promised there and in the review of #3567.

What

horizon-prepare --launch-api prints what this preparer supports as one JSON object and exits 0, the way horizon-client --launch-api does for the game. A launcher that runs a preparer it didn't build (Prism, a custom launcher) asks it first:

{
  "launch_api": "0.1.0",
  "horizon": "0.1.0",
  "minecraft": "26.3",
  "java_major": 25,
  "schema": 7,
  "output_version": 3,
  "options": [{"name": "--prepare", "value": null}, {"name": "--server-jar", "value": "PATH"}, "…", {"name": "--progress", "value": "json"}, {"name": "--launch-api", "value": null}],
  "exit_codes": [0, 1, 2]
}
  • launch_api is the client's version, and a test keeps the two equal.
  • minecraft and java_major come from research-lock.json. They tell a launcher which game files to pass and which Java --java-home must be.
  • schema and output_version are what --check compares, so a launcher can tell whether resources it already has will pass.
  • options lists only what a launcher may pass. The asset commands (sounds, fonts…) stay out, because --complete covers them.

With no research-lock.json beside the preparer or at --root, it exits 1 with an error: line, like --check.

Changes

  • crates/horizon-prepare/src/launch_api.rs (new): VERSION, OPTIONS, EXIT_CODES and reply(), written with the crate's own pyjson because horizon-prepare has no serde.
  • main.rs: the flag, its usage line and its --help entry.
  • docs/api/launch.md: the option documented under Preparing, the Overview and Changelog updated, and the item removed from "Not there yet". Only finding a build and the guide are left there.
  • docs/api/stability.md: what keeps the reply honest.

Tests

  • launch_api::tests::the_reply_names_the_pins_and_the_layout: the reply parses, and it carries the version, the pins from a research-lock.json, SCHEMA, OUTPUT_VERSION and --progress's value.
  • launch_api::tests::the_client_speaks_the_same_version: horizon-client's launch_api::VERSION is the same.
  • tests::launch_api_options_are_in_the_help: every promised option is one --help documents.
  • Manually on Windows: cargo run -p horizon-prepare -- --launch-api prints the reply above with exit 0. --root /nonexistent exits 1.

pr_ready (tools/pr_ready.py --quick --base upstream/main on GIGABAIT, against upstream/main at ce8d86cb2, 5 min 37 s)

Check Result
Scope ✅ 5 files, +161 −10
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ✅ 610 passed (46 s)
rustfmt ✅ (11 s)
clippy ✅ (1 min 35 s)
tests: horizon-prepare ✅ 61 passed (10 s)
doc tests ✅ 0 passed
content root tests ➖ content root untouched
mod API up to date ➖ native hooks untouched
tokens.css up to date ➖ theme untouched
launcher rustfmt ✅ (2 s)
launcher clippy ✅ (53 s)
launcher tests ✅ 444 passed (1 min 59 s)
Parity ➖ not run (--quick): CI's parity job picks the affected harnesses
Label player-facing: feature if players get something new, no label for a fix (release-now if urgent)

🤖 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/6955 **Author:** [@GIGABAIT93](https://github.com/GIGABAIT93) **Created:** 11/2/2026 **Status:** ✅ Merged **Merged:** 11/2/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `feat/prepare-launch-api` --- ### 📝 Commits (1) - [`89efa41`](https://github.com/horizon-rust/horizon/commit/89efa41590907dbe01fee7172e9ce7adf9d98b17) horizon-prepare --launch-api: what this preparer supports, as JSON ### 📊 Changes **5 files changed** (+161 additions, -10 deletions) <details> <summary>View changed files</summary> ➕ `crates/horizon-prepare/src/launch_api.rs` (+113 -0) 📝 `crates/horizon-prepare/src/lib.rs` (+1 -0) 📝 `crates/horizon-prepare/src/main.rs` (+31 -0) 📝 `docs/api/launch.md` (+14 -8) 📝 `docs/api/stability.md` (+2 -2) </details> ### 📄 Description > 🤖 Opened by GIGABAIT93's AI agent (Claude Code, Claude Opus 5.5), not by GIGABAIT93 directly. Part of #3545 (Launch API). It is the item "Asking the preparer what it supports" in `docs/api/launch.md`'s "Not there yet", promised there and in the review of #3567. ## What `horizon-prepare --launch-api` prints what this preparer supports as one JSON object and exits 0, the way `horizon-client --launch-api` does for the game. A launcher that runs a preparer it didn't build (Prism, a custom launcher) asks it first: ```json { "launch_api": "0.1.0", "horizon": "0.1.0", "minecraft": "26.3", "java_major": 25, "schema": 7, "output_version": 3, "options": [{"name": "--prepare", "value": null}, {"name": "--server-jar", "value": "PATH"}, "…", {"name": "--progress", "value": "json"}, {"name": "--launch-api", "value": null}], "exit_codes": [0, 1, 2] } ``` - `launch_api` is the client's version, and a test keeps the two equal. - `minecraft` and `java_major` come from `research-lock.json`. They tell a launcher which game files to pass and which Java `--java-home` must be. - `schema` and `output_version` are what `--check` compares, so a launcher can tell whether resources it already has will pass. - `options` lists only what a launcher may pass. The asset commands (`sounds`, `fonts`…) stay out, because `--complete` covers them. With no `research-lock.json` beside the preparer or at `--root`, it exits 1 with an `error:` line, like `--check`. ## Changes - `crates/horizon-prepare/src/launch_api.rs` (new): `VERSION`, `OPTIONS`, `EXIT_CODES` and `reply()`, written with the crate's own `pyjson` because horizon-prepare has no serde. - `main.rs`: the flag, its usage line and its `--help` entry. - `docs/api/launch.md`: the option documented under Preparing, the Overview and Changelog updated, and the item removed from "Not there yet". Only finding a build and the guide are left there. - `docs/api/stability.md`: what keeps the reply honest. ## Tests - `launch_api::tests::the_reply_names_the_pins_and_the_layout`: the reply parses, and it carries the version, the pins from a `research-lock.json`, `SCHEMA`, `OUTPUT_VERSION` and `--progress`'s value. - `launch_api::tests::the_client_speaks_the_same_version`: `horizon-client`'s `launch_api::VERSION` is the same. - `tests::launch_api_options_are_in_the_help`: every promised option is one `--help` documents. - Manually on Windows: `cargo run -p horizon-prepare -- --launch-api` prints the reply above with exit 0. `--root /nonexistent` exits 1. **pr_ready** (`tools/pr_ready.py --quick --base upstream/main` on GIGABAIT, against upstream/main at ce8d86cb2, 5 min 37 s) | Check | Result | | --- | --- | | Scope | ✅ 5 files, +161 −10 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ✅ 610 passed (46 s) | | rustfmt | ✅ (11 s) | | clippy | ✅ (1 min 35 s) | | tests: horizon-prepare | ✅ 61 passed (10 s) | | doc tests | ✅ 0 passed | | content root tests | ➖ content root untouched | | mod API up to date | ➖ native hooks untouched | | tokens.css up to date | ➖ theme untouched | | launcher rustfmt | ✅ (2 s) | | launcher clippy | ✅ (53 s) | | launcher tests | ✅ 444 passed (1 min 59 s) | | Parity | ➖ not run (--quick): CI's parity job picks the affected harnesses | | Label | player-facing: `feature` if players get something new, no label for a fix (`release-now` if urgent) | 🤖 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 06:36:01 +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#7229
No description provided.