[PR #7165] [MERGED] Fix two catalog hooks the package split broke: living_breathe and menu_slot_rules #7388

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

📋 Pull Request Information

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

Base: main ← Head: hooks-catalog-targets


📝 Commits (1)

  • 8cf7173 Fix two catalog hooks the package split broke: living_breathe and menu_slot_rules

📊 Changes

2 files changed (+33 additions, -4 deletions)

View changed files

📝 crates/horizon-client/src/game/native_hooks.rs (+31 -2)
📝 native-hooks.json (+2 -2)

📄 Description

🤖 Opened by Qwerner88880's AI agent (ZCode, GLM-5.3), not by Qwerner88880 personally.

Fixes #6662.

What and why

Since #5446, breathing.rs and menu.rs compile into horizon-client-lib, but native-hooks.json still targeted horizon_client::breathing::… and horizon_client::menu::…, so horizon-mixins refused a bundle naming either hook — no mod could use them. The targets name horizon_client_lib now, and catalog_matches_hook_points expects that.

The test also checks every target's crate really compiles its module: the first path segment after horizon_client or horizon_client_lib must be a module of that crate's lib root. A file moved between the two packages then fails the test even if the catalog string and the expectation agree — which is how these two went unnoticed.

xtask's mod-api generator already maps horizon_client_lib:: to the horizon-client package (with legacy aliases for the old names), so the trait dispatch for both hooks is unchanged.

Proven

  • horizon-mixins apply on this branch: minimal bundles on living_breathe and menu_slot_rules by name both reach status: ok, their helpers compiled into the staged breathing.rs and menu.rs.
  • The module check, independently: with the old target and the test's expectation made to agree, the test still fails with horizon_client does not compile module menu.

Note for the reviewer

mod API up to date fails locally on this Windows machine — on clean main locally too — while main's own CI run is green, so it looks machine-local (line endings or a slightly older local run). This diff doesn't change the generator's output.

Self-check

tools/pr_ready.py on DESKTOP-H7P5E7K against origin/main at 73f5486b9, 5 min 8 s:

Check Result
Scope ✅ 2 files, +33 −4
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ✅ 612 passed
rustfmt / clippy ✅ / ✅
tests: horizon-client ✅ 660 passed
doc tests ✅
mod API up to date ❌ machine-local, see the note above

🤖 Generated with ZCode AI agent (GLM-5.3)


🔄 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/7165 **Author:** [@Qwerner88880](https://github.com/Qwerner88880) **Created:** 11/2/2026 **Status:** ✅ Merged **Merged:** 11/2/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `hooks-catalog-targets` --- ### 📝 Commits (1) - [`8cf7173`](https://github.com/horizon-rust/horizon/commit/8cf71732d032460401c503e712b7b4a3a4b2a9be) Fix two catalog hooks the package split broke: living_breathe and menu_slot_rules ### 📊 Changes **2 files changed** (+33 additions, -4 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game/native_hooks.rs` (+31 -2) 📝 `native-hooks.json` (+2 -2) </details> ### 📄 Description > 🤖 Opened by Qwerner88880's AI agent (ZCode, GLM-5.3), not by Qwerner88880 personally. Fixes #6662. ## What and why Since #5446, `breathing.rs` and `menu.rs` compile into `horizon-client-lib`, but `native-hooks.json` still targeted `horizon_client::breathing::…` and `horizon_client::menu::…`, so horizon-mixins refused a bundle naming either hook — no mod could use them. The targets name `horizon_client_lib` now, and `catalog_matches_hook_points` expects that. The test also checks every target's crate really compiles its module: the first path segment after `horizon_client` or `horizon_client_lib` must be a module of that crate's lib root. A file moved between the two packages then fails the test even if the catalog string and the expectation agree — which is how these two went unnoticed. `xtask`'s mod-api generator already maps `horizon_client_lib::` to the `horizon-client` package (with legacy aliases for the old names), so the trait dispatch for both hooks is unchanged. ## Proven - horizon-mixins `apply` on this branch: minimal bundles on `living_breathe` and `menu_slot_rules` by name both reach `status: ok`, their helpers compiled into the staged `breathing.rs` and `menu.rs`. - The module check, independently: with the old target and the test's expectation made to agree, the test still fails with `horizon_client does not compile module menu`. ## Note for the reviewer `mod API up to date` fails locally on this Windows machine — on clean `main` locally too — while main's own CI run is green, so it looks machine-local (line endings or a slightly older local run). This diff doesn't change the generator's output. ## Self-check `tools/pr_ready.py` on DESKTOP-H7P5E7K against `origin/main` at 73f5486b9, 5 min 8 s: | Check | Result | | --- | --- | | Scope | ✅ 2 files, +33 −4 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ✅ 612 passed | | rustfmt / clippy | ✅ / ✅ | | tests: horizon-client | ✅ 660 passed | | doc tests | ✅ | | mod API up to date | ❌ machine-local, see the note above | 🤖 Generated with ZCode AI agent (GLM-5.3) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 06:38:48 +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#7388
No description provided.