[PR #7337] [MERGED] The mod API placeholder test reads the stamped hook list #7505

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

📋 Pull Request Information

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

Base: main ← Head: fix/mod-api-test-fragments


📝 Commits (1)

  • f96c17a xtask: the mod-api placeholder test edits the catalog, not a stamped-away fragment

📊 Changes

1 file changed (+13 additions, -6 deletions)

View changed files

📝 xtask/src/mod_api.rs (+13 -6)

📄 Description

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

Fixes mod_api::tests::new_hook_placeholder_is_reported_then_filled, which failed on main with No such file or directory.

What was wrong

The test reads tools/native-hook-fragments/native_item_damaged.json to check that the generator reports a hook with no mod_api entry. Commit 48c63bc09 ("Stamp the pending native hook fragments through API 355") moved that hook into native-hooks.json and deleted the fragment, so the read panicked. Later stamping commits (b11874482) left the folder with only its README.

Fix

The test now removes item_damaged's mod_api entry from its copy of native-hooks.json and expects the same error, hook item_damaged has no mod_api entry: add one. The rest of the test is unchanged.

Vanilla reference

None. This is a tooling test; it touches no game behaviour.

Proof

  • Before, on plain origin/main (fdd290b99): cargo test -p xtask gave 18 passed, 1 failed (this test, panic at xtask/src/mod_api.rs:1675). generated_output_is_current passed, so no regeneration was needed.
  • After: cargo test -p xtask gives 19 passed, 0 failed.
  • Still catches the bug: I temporarily changed the generator to skip a hook with no mod_api entry instead of reporting it. The test failed (panic at the unwrap_err for that case). I restored the generator.
  • python3 tools/pr_ready.py --quick: all checks pass, including "mod API up to date".

Harnesses

cargo test -p xtask and tools/pr_ready.py --quick. No parity harness covers this; it changes only a test in xtask.

🤖 Generated with Claude Code

https://claude.ai/code/session_018zuDTsnyHkP28bzn3u7S3m


🔄 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/7337 **Author:** [@HrafnaValkyrja](https://github.com/HrafnaValkyrja) **Created:** 11/2/2026 **Status:** ✅ Merged **Merged:** 11/2/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/mod-api-test-fragments` --- ### 📝 Commits (1) - [`f96c17a`](https://github.com/horizon-rust/horizon/commit/f96c17a31482ae8dfa52e65e5ea5454b5b426bbb) xtask: the mod-api placeholder test edits the catalog, not a stamped-away fragment ### 📊 Changes **1 file changed** (+13 additions, -6 deletions) <details> <summary>View changed files</summary> 📝 `xtask/src/mod_api.rs` (+13 -6) </details> ### 📄 Description > 🤖 Opened by Valkyrie's AI agent (Claude Code, Opus 5.5), not by Valkyrie herself. Fixes `mod_api::tests::new_hook_placeholder_is_reported_then_filled`, which failed on main with `No such file or directory`. ## What was wrong The test reads `tools/native-hook-fragments/native_item_damaged.json` to check that the generator reports a hook with no `mod_api` entry. Commit 48c63bc09 ("Stamp the pending native hook fragments through API 355") moved that hook into `native-hooks.json` and deleted the fragment, so the read panicked. Later stamping commits (b11874482) left the folder with only its README. ## Fix The test now removes `item_damaged`'s `mod_api` entry from its copy of `native-hooks.json` and expects the same error, `hook item_damaged has no mod_api entry: add one`. The rest of the test is unchanged. ## Vanilla reference None. This is a tooling test; it touches no game behaviour. ## Proof - Before, on plain origin/main (fdd290b99): `cargo test -p xtask` gave 18 passed, 1 failed (this test, panic at `xtask/src/mod_api.rs:1675`). `generated_output_is_current` passed, so no regeneration was needed. - After: `cargo test -p xtask` gives 19 passed, 0 failed. - Still catches the bug: I temporarily changed the generator to skip a hook with no `mod_api` entry instead of reporting it. The test failed (panic at the `unwrap_err` for that case). I restored the generator. - `python3 tools/pr_ready.py --quick`: all checks pass, including "mod API up to date". ## Harnesses `cargo test -p xtask` and `tools/pr_ready.py --quick`. No parity harness covers this; it changes only a test in `xtask`. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_018zuDTsnyHkP28bzn3u7S3m --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 06:40:14 +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#7505
No description provided.