[PR #3140] [MERGED] Mod registry: validate source-only native mod bundles #4820

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

📋 Pull Request Information

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

Base: main ← Head: feat/native-mod-bundles


📝 Commits (2)

  • 137045e feat(mods): validate source-only native mod bundles
  • c050542 fix(launcher): keep native sources hidden until build integration lands

📊 Changes

5 files changed (+260 additions, -2 deletions)

View changed files

📝 crates/cargo-horizon-mod/src/check.rs (+4 -0)
📝 crates/horizon-mods/src/index.rs (+8 -1)
➕ crates/horizon-mods/src/index/native.rs (+238 -0)
📝 launcher/src/browser/horizon.rs (+2 -1)
📝 launcher/src/browser/horizon/tests.rs (+8 -0)

📄 Description

🤖 Opened by levzzz5154's AI agent (Hermes Agent, OpenAI), not by levzzz5154 themselves.

Summary

  • Add the explicitly unsandboxed native-mod registry kind and source-only .hnmod format.
  • Validate schema, exact Horizon/Mixins revisions, matching mixin identity, archive size/path/type limits, and source-only Rust/TOML contents without executing code.
  • Teach cargo horizon-mod check to inspect native bundles and print the native-code warning. Existing size/checksum/signature/revocation checks remain in force.

This is the small format/validator prerequisite for the native launcher integration and Veinminer registry submission #20. It does not enable automatic compilation or claim to sandbox native code. Deploy the registry validator at a revision containing this change before taking native entries.

Verification

Vanilla reference: none; package-format/registry tooling only, no gameplay changes.

  • Native registry tests: 17 passed; cargo-horizon-mod binary tests: 3 passed on the existing nightly development checkout.
  • Main-based pr_ready --quick: 78 touched-crate tests, 5 content-root tests, 398 Python tests and 205 launcher tests passed; formatting, launcher Clippy, and separately scoped Clippy for horizon-mods/cargo-horizon-mod passed. The broader transitive Clippy gate still reports 12 existing horizon-world lints in files unchanged from the base (for example manual_range_contains in aquifer/noise_based.rs).
  • The format-only launcher explicitly hides native entries until the separate build integration lands; its compile/exhaustive-match regression is fixed and covered by a search test.
  • Independently downloaded the published 10,305-byte Veinminer bundle, verified SHA-256 ec308c02c65bad64043828a19ef6254d1eb9d422bb1123cd065cb9e6e7b126c8, and successfully inspected it with this main-based validator.
  • Source-only packaging, archive traversal/non-source rejection, malformed/mismatched identity and revision tests are included.

No game files, prepared resources, personal history or build artifacts are committed. Native execution and full game behavior are validated separately by the launcher/Veinminer work, not by this archive inspector.

Full local gate receipt

pr_ready (tools/pr_ready.py --quick --base horizon-official/main on cachyos-x8664, against horizon-official/main at b6c936f82, 52 s)

Check Result
Scope ⚠️ 5 files, +260 −2; mixes game, launcher
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ✅ 398 passed (22 s)
rustfmt ✅ (5 s)
clippy ❌ failed (11 s)
tests: cargo-horizon-mod, horizon-mods ✅ 78 passed (9 s)
doc tests ✅ 0 passed
content root tests ✅ 5 passed
tokens.css up to date ➖ theme untouched
launcher rustfmt ✅ (1 s)
launcher clippy ✅
launcher tests ✅ 205 passed (4 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 Hermes Agent (OpenAI).


🔄 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/3140 **Author:** [@levzzz5154](https://github.com/levzzz5154) **Created:** 10/28/2026 **Status:** ✅ Merged **Merged:** 10/28/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `feat/native-mod-bundles` --- ### 📝 Commits (2) - [`137045e`](https://github.com/horizon-rust/horizon/commit/137045e321d554004cc69f14f5f21736483534a2) feat(mods): validate source-only native mod bundles - [`c050542`](https://github.com/horizon-rust/horizon/commit/c0505424bdb8e03ffac3171792e03056ec48d7d8) fix(launcher): keep native sources hidden until build integration lands ### 📊 Changes **5 files changed** (+260 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `crates/cargo-horizon-mod/src/check.rs` (+4 -0) 📝 `crates/horizon-mods/src/index.rs` (+8 -1) ➕ `crates/horizon-mods/src/index/native.rs` (+238 -0) 📝 `launcher/src/browser/horizon.rs` (+2 -1) 📝 `launcher/src/browser/horizon/tests.rs` (+8 -0) </details> ### 📄 Description > 🤖 Opened by levzzz5154's AI agent (Hermes Agent, OpenAI), not by levzzz5154 themselves. ## Summary - Add the explicitly unsandboxed `native-mod` registry kind and source-only `.hnmod` format. - Validate schema, exact Horizon/Mixins revisions, matching mixin identity, archive size/path/type limits, and source-only Rust/TOML contents without executing code. - Teach `cargo horizon-mod check` to inspect native bundles and print the native-code warning. Existing size/checksum/signature/revocation checks remain in force. This is the small format/validator prerequisite for the native launcher integration and [Veinminer registry submission #20](https://github.com/horizon-rust/horizon-mods/pull/20). It does **not** enable automatic compilation or claim to sandbox native code. Deploy the registry validator at a revision containing this change before taking native entries. ## Verification Vanilla reference: none; package-format/registry tooling only, no gameplay changes. - Native registry tests: 17 passed; cargo-horizon-mod binary tests: 3 passed on the existing nightly development checkout. - Main-based `pr_ready --quick`: 78 touched-crate tests, 5 content-root tests, 398 Python tests and 205 launcher tests passed; formatting, launcher Clippy, and separately scoped Clippy for horizon-mods/cargo-horizon-mod passed. The broader transitive Clippy gate still reports 12 existing horizon-world lints in files unchanged from the base (for example manual_range_contains in aquifer/noise_based.rs). - The format-only launcher explicitly hides native entries until the separate build integration lands; its compile/exhaustive-match regression is fixed and covered by a search test. - Independently downloaded the published 10,305-byte Veinminer bundle, verified SHA-256 `ec308c02c65bad64043828a19ef6254d1eb9d422bb1123cd065cb9e6e7b126c8`, and successfully inspected it with this main-based validator. - Source-only packaging, archive traversal/non-source rejection, malformed/mismatched identity and revision tests are included. No game files, prepared resources, personal history or build artifacts are committed. Native execution and full game behavior are validated separately by the launcher/Veinminer work, not by this archive inspector. ## Full local gate receipt **pr_ready** (`tools/pr_ready.py --quick --base horizon-official/main` on cachyos-x8664, against horizon-official/main at b6c936f82, 52 s) | Check | Result | | --- | --- | | Scope | ⚠️ 5 files, +260 −2; mixes game, launcher | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ✅ 398 passed (22 s) | | rustfmt | ✅ (5 s) | | clippy | ❌ failed (11 s) | | tests: cargo-horizon-mod, horizon-mods | ✅ 78 passed (9 s) | | doc tests | ✅ 0 passed | | content root tests | ✅ 5 passed | | tokens.css up to date | ➖ theme untouched | | launcher rustfmt | ✅ (1 s) | | launcher clippy | ✅ | | launcher tests | ✅ 205 passed (4 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 [Hermes Agent](https://github.com/NousResearch/hermes-agent) (OpenAI). --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 05:08: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#4820
No description provided.