[PR #5161] [MERGED] Batch native hook API numbers from fragments #6109

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

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/5161
Author: @arismoko
Created: 10/31/2026
Status: ✅ Merged
Merged: 10/31/2026
Merged by: @rdbtCVS

Base: main ← Head: hook-fragments


📝 Commits (3)

  • e7c2951 Batch native hook API numbers from fragments
  • 17ca398 Support helper-only API fragments
  • baf72e4 Clarify fragment documentation

📊 Changes

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

View changed files

📝 crates/horizon-client/src/game/native_hooks.rs (+17 -2)
📝 docs/native-mods.md (+2 -0)
➕ tests/test_stamp_native_hooks.py (+99 -0)
➕ tools/native-hook-fragments/README.md (+29 -0)
➕ tools/stamp_native_hooks.py (+103 -0)

📄 Description

🤖 Opened by Aria's agent swarm, Dyna, not by Aria.

Fixes #5144.

Hook and helper PRs can add independent fragments instead of choosing the next API number. A maintainer stamps all pending fragments in first-parent merge order and opens a follow-up PR. The catalog's per-hook contract version remains separate from the global API number. Pending hooks are not yet API.

The script replays API 38, 39 and 40 from #4725, #4677 and #4669. Both history files match the manual results; catalog entries match by content, with new entries appended. The catalog round trip without changes is byte-identical.

In-game proof: A throwaway native mod targeted a newly stamped API 41 hook. The transformed game started a world on its server thread, and the hook wrote a marker. A launcher test parsed a bundle with "hooks": 41, read 41 from the stamped source, and accepted that revision. horizon-machine-sample is the recommended end-to-end route; it was not used here because this check needed a throwaway hook and a mod that fires exactly that new hook.

The friends_integration harness timed out waiting for guest chat twice on this branch. It also failed at the same point on clean upstream main at bd541458c, with the same display and host environment.

pr_ready (tools/pr_ready.py --base upstream/main on desktop, against upstream/main at bd541458c, 7 min 13 s)

Check Result
Scope ✅ 5 files, +250 −2
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ✅ 498 passed (33 s)
rustfmt ✅ (8 s)
clippy ✅ (1 min 16 s)
tests: horizon-client ✅ 1340 passed (2 min 53 s)
doc tests ✅ 0 passed (2 s)
content root tests ➖ content root untouched
tokens.css up to date ➖ theme untouched
launcher rustfmt ➖ launcher untouched
launcher clippy ➖ launcher untouched
launcher tests ➖ launcher untouched
Parity ❌ 11 affected, 5 passed, failed: friends_integration (2 min 16 s)
Label player-facing: feature if players get something new, no label for a fix (release-now if urgent)

🔄 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/5161 **Author:** [@arismoko](https://github.com/arismoko) **Created:** 10/31/2026 **Status:** ✅ Merged **Merged:** 10/31/2026 **Merged by:** [@rdbtCVS](https://github.com/rdbtCVS) **Base:** `main` ← **Head:** `hook-fragments` --- ### 📝 Commits (3) - [`e7c2951`](https://github.com/horizon-rust/horizon/commit/e7c2951d4ce2822c44a4be48156259c9a47cd981) Batch native hook API numbers from fragments - [`17ca398`](https://github.com/horizon-rust/horizon/commit/17ca3981f03c4dcd3f6d921eb84a12a1f66bcff3) Support helper-only API fragments - [`baf72e4`](https://github.com/horizon-rust/horizon/commit/baf72e46c16212e054168c130a2d9461997a5cdb) Clarify fragment documentation ### 📊 Changes **5 files changed** (+250 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game/native_hooks.rs` (+17 -2) 📝 `docs/native-mods.md` (+2 -0) ➕ `tests/test_stamp_native_hooks.py` (+99 -0) ➕ `tools/native-hook-fragments/README.md` (+29 -0) ➕ `tools/stamp_native_hooks.py` (+103 -0) </details> ### 📄 Description > 🤖 Opened by Aria's agent swarm, Dyna, not by Aria. Fixes #5144. Hook and helper PRs can add independent fragments instead of choosing the next API number. A maintainer stamps all pending fragments in first-parent merge order and opens a follow-up PR. The catalog's per-hook contract version remains separate from the global API number. Pending hooks are not yet API. The script replays API 38, 39 and 40 from #4725, #4677 and #4669. Both history files match the manual results; catalog entries match by content, with new entries appended. The catalog round trip without changes is byte-identical. **In-game proof:** A throwaway native mod targeted a newly stamped API 41 hook. The transformed game started a world on its server thread, and the hook wrote a marker. A launcher test parsed a bundle with `"hooks": 41`, read 41 from the stamped source, and accepted that revision. [horizon-machine-sample](https://github.com/arismoko/horizon-machine-sample) is the recommended end-to-end route; it was not used here because this check needed a throwaway hook and a mod that fires exactly that new hook. The `friends_integration` harness timed out waiting for guest chat twice on this branch. It also failed at the same point on clean [upstream main at bd541458c](https://github.com/horizon-rust/horizon/commit/bd541458c), with the same display and host environment. **pr_ready** (`tools/pr_ready.py --base upstream/main` on desktop, against upstream/main at bd541458c, 7 min 13 s) | Check | Result | | --- | --- | | Scope | ✅ 5 files, +250 −2 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ✅ 498 passed (33 s) | | rustfmt | ✅ (8 s) | | clippy | ✅ (1 min 16 s) | | tests: horizon-client | ✅ 1340 passed (2 min 53 s) | | doc tests | ✅ 0 passed (2 s) | | content root tests | ➖ content root untouched | | tokens.css up to date | ➖ theme untouched | | launcher rustfmt | ➖ launcher untouched | | launcher clippy | ➖ launcher untouched | | launcher tests | ➖ launcher untouched | | Parity | ❌ 11 affected, 5 passed, failed: friends_integration (2 min 16 s) | | Label | player-facing: `feature` if players get something new, no label for a fix (`release-now` if urgent) | --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 06:11:52 +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#6109
No description provided.