[PR #1642] [MERGED] Mod registry: cargo horizon-mod check, each kind's own checks #3655

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

📋 Pull Request Information

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

Base: main ← Head: feat/mod-check


📝 Commits (2)

  • bffb68b Mod registry index: schema 1, .hpack and the checks before install
  • 59281c5 Mod registry: cargo horizon-mod check, each kind's own checks

📊 Changes

18 files changed (+1632 additions, -13 deletions)

View changed files

📝 Cargo.lock (+9 -1)
📝 crates/cargo-horizon-mod/Cargo.toml (+2 -2)
➕ crates/cargo-horizon-mod/src/check.rs (+268 -0)
📝 crates/cargo-horizon-mod/src/main.rs (+37 -1)
📝 crates/horizon-mods/Cargo.toml (+5 -0)
➕ crates/horizon-mods/src/index.rs (+612 -0)
➕ crates/horizon-mods/src/index/tests.rs (+165 -0)
📝 crates/horizon-mods/src/lib.rs (+3 -0)
📝 crates/horizon-mods/src/manifest.rs (+6 -3)
➕ crates/horizon-mods/src/modpack.rs (+299 -0)
📝 crates/horizon-mods/src/runtime.rs (+1 -4)
➕ crates/horizon-mods/tests/index/coords_hud-0.1.0.hmod (+0 -0)
➕ crates/horizon-mods/tests/index/coords_hud-0.1.0.hmod.minisig (+4 -0)
➕ crates/horizon-mods/tests/index/cozy-1.0.0.hpack (+0 -0)
➕ crates/horizon-mods/tests/index/index-v1.json (+109 -0)
➕ crates/horizon-mods/tests/index/test.pub (+2 -0)
➕ docs/api/mod-index.md (+95 -0)
📝 docs/mods.md (+15 -2)

📄 Description

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

Stacked on #1634 (the index); review that first. The registry repository's tools that use these checks come next in #1646.

What

What the registry checks of a submission, runnable by authors before they submit.

  • horizon_mods::index::inspect: each kind's own check, returning what the file says (a mod's id, version, API, side and capabilities; a modpack's manifest and mods; a resource pack's pack format). check_file now compares those facts with the index. Shader packs say they open when Horizon's own format is out; unknown kinds are refused.
  • horizon_mods::index::open: the kinds the registry takes. Shader submissions are closed until Horizon's own shader pack format exists (Iris and OptiFine packs stay on Modrinth).
  • cargo horizon-mod check <file> [--json]: those checks, the signature with --key/--signature, and for a mod a trial run in the sandbox (40 ticks, 120 frames, a chat line, each of its commands; it must start and never trap or overrun, and import no more than its capabilities).
  • Docs: check in docs/mods.md.

cargo-horizon-mod now builds the runtime (wasmtime) to run the trial: cargo install takes longer.

Checked

  • cargo test -p horizon-mods --features index --lib: 19 pass; cargo test -p cargo-horizon-mod: 2 pass (each kind checked its own way); clippy -D warnings clean.
  • The real coords-hud built with the SDK: check passes (imports game, chat, hud; /where and /coords answer):
coords_hud 0.1.0 (mod, API 0.1, client)
  25166 bytes, SHA-256 612335e4e00d638f8b97b6c2f5c718c069c7a13811ba922557c27cb2612daf59, unsigned
  may see your position, health and the time
  may draw text on your screen
  may show you chat messages
  trial run: started, 40 ticks, 120 frames, a chat line, /where, /coords: ok

pr_ready (tools/pr_ready.py --quick --base feat/mod-index on ludovics-mac-mini, against feat/mod-index at bffb68b0c, 5 min 55 s)

Check Result
Scope ✅ 6 files, +444 −51
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ➖ no Python change
rustfmt ✅ (37 s)
clippy ✅ (2 min 39 s)
tests: cargo-horizon-mod, horizon-mods ✅ 36 passed (34 s)
doc tests ✅ 0 passed (1 s)
tokens.css up to date ➖ theme untouched
launcher rustfmt ✅ (4 s)
launcher clippy ✅ (6 s)
launcher tests ✅ 118 passed (8 s)
Parity ➖ no harness affected
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/1642 **Author:** [@ludovic111](https://github.com/ludovic111) **Created:** 10/24/2026 **Status:** ✅ Merged **Merged:** 10/25/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `feat/mod-check` --- ### 📝 Commits (2) - [`bffb68b`](https://github.com/horizon-rust/horizon/commit/bffb68b0c59168f4354f9664023e18f4bed0b9f9) Mod registry index: schema 1, .hpack and the checks before install - [`59281c5`](https://github.com/horizon-rust/horizon/commit/59281c5c7357c8e8659c491f3312b3db229607c6) Mod registry: cargo horizon-mod check, each kind's own checks ### 📊 Changes **18 files changed** (+1632 additions, -13 deletions) <details> <summary>View changed files</summary> 📝 `Cargo.lock` (+9 -1) 📝 `crates/cargo-horizon-mod/Cargo.toml` (+2 -2) ➕ `crates/cargo-horizon-mod/src/check.rs` (+268 -0) 📝 `crates/cargo-horizon-mod/src/main.rs` (+37 -1) 📝 `crates/horizon-mods/Cargo.toml` (+5 -0) ➕ `crates/horizon-mods/src/index.rs` (+612 -0) ➕ `crates/horizon-mods/src/index/tests.rs` (+165 -0) 📝 `crates/horizon-mods/src/lib.rs` (+3 -0) 📝 `crates/horizon-mods/src/manifest.rs` (+6 -3) ➕ `crates/horizon-mods/src/modpack.rs` (+299 -0) 📝 `crates/horizon-mods/src/runtime.rs` (+1 -4) ➕ `crates/horizon-mods/tests/index/coords_hud-0.1.0.hmod` (+0 -0) ➕ `crates/horizon-mods/tests/index/coords_hud-0.1.0.hmod.minisig` (+4 -0) ➕ `crates/horizon-mods/tests/index/cozy-1.0.0.hpack` (+0 -0) ➕ `crates/horizon-mods/tests/index/index-v1.json` (+109 -0) ➕ `crates/horizon-mods/tests/index/test.pub` (+2 -0) ➕ `docs/api/mod-index.md` (+95 -0) 📝 `docs/mods.md` (+15 -2) </details> ### 📄 Description > 🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself. Stacked on #1634 (the index); review that first. The registry repository's tools that use these checks come next in #1646. ## What What the registry checks of a submission, runnable by authors before they submit. - `horizon_mods::index::inspect`: each kind's own check, returning what the file says (a mod's id, version, API, side and capabilities; a modpack's manifest and mods; a resource pack's pack format). `check_file` now compares those facts with the index. Shader packs say they open when Horizon's own format is out; unknown kinds are refused. - `horizon_mods::index::open`: the kinds the registry takes. Shader submissions are closed until Horizon's own shader pack format exists (Iris and OptiFine packs stay on Modrinth). - `cargo horizon-mod check <file> [--json]`: those checks, the signature with `--key`/`--signature`, and for a mod a trial run in the sandbox (40 ticks, 120 frames, a chat line, each of its commands; it must start and never trap or overrun, and import no more than its capabilities). - Docs: `check` in `docs/mods.md`. `cargo-horizon-mod` now builds the runtime (wasmtime) to run the trial: `cargo install` takes longer. ## Checked - `cargo test -p horizon-mods --features index --lib`: 19 pass; `cargo test -p cargo-horizon-mod`: 2 pass (each kind checked its own way); clippy `-D warnings` clean. - The real coords-hud built with the SDK: `check` passes (imports `game`, `chat`, `hud`; `/where` and `/coords` answer): ``` coords_hud 0.1.0 (mod, API 0.1, client) 25166 bytes, SHA-256 612335e4e00d638f8b97b6c2f5c718c069c7a13811ba922557c27cb2612daf59, unsigned may see your position, health and the time may draw text on your screen may show you chat messages trial run: started, 40 ticks, 120 frames, a chat line, /where, /coords: ok ``` **pr_ready** (`tools/pr_ready.py --quick --base feat/mod-index` on ludovics-mac-mini, against feat/mod-index at bffb68b0c, 5 min 55 s) | Check | Result | | --- | --- | | Scope | ✅ 6 files, +444 −51 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ➖ no Python change | | rustfmt | ✅ (37 s) | | clippy | ✅ (2 min 39 s) | | tests: cargo-horizon-mod, horizon-mods | ✅ 36 passed (34 s) | | doc tests | ✅ 0 passed (1 s) | | tokens.css up to date | ➖ theme untouched | | launcher rustfmt | ✅ (4 s) | | launcher clippy | ✅ (6 s) | | launcher tests | ✅ 118 passed (8 s) | | Parity | ➖ no harness affected | | 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 04:11:12 +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#3655
No description provided.