[PR #18] feat(native): support dependencies between declared bundle crates #20

Open
opened 2026-11-02 15:32:33 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon-mixins/pull/18
Author: @finalpantasy
Created: 11/1/2026
Status: 🔄 Open

Base: main ← Head: feat/bundle-sibling-crates


📝 Commits (4)

  • 00a8371 fix: index production test cfg modules
  • 3ac63df feat(native): support dependencies between declared bundle crates
  • ddd9700 Merge pull request #17 from arismoko/fix/cfg-test-modules
  • 6757cc1 Local test snapshot: combine current SDK main and sibling crate support

📊 Changes

26 files changed (+1563 additions, -99 deletions)

View changed files

📝 README.md (+4 -3)
📝 crates/horizon-mixins-cli/tests/cases/advanced.rs (+1 -1)
📝 crates/horizon-mixins-cli/tests/cases/effects.rs (+1 -1)
📝 crates/horizon-mixins-cli/tests/cases/native.rs (+670 -1)
📝 crates/horizon-mixins-cli/tests/cases/scoped.rs (+1 -1)
📝 crates/horizon-mixins-cli/tests/integration.rs (+22 -0)
📝 crates/horizon-mixins-cli/tests/snapshots/advanced-plan.json (+1 -1)
📝 crates/horizon-mixins-cli/tests/snapshots/boundary-plan.json (+1 -1)
📝 crates/horizon-mixins-cli/tests/snapshots/effects-plan.json (+1 -1)
📝 crates/horizon-mixins-cli/tests/snapshots/plan.json (+1 -1)
📝 crates/horizon-mixins-cli/tests/snapshots/scoped-plan.json (+1 -1)
📝 crates/horizon-mixins-core/src/index.rs (+110 -16)
📝 crates/horizon-mixins-core/src/native.rs (+647 -18)
📝 crates/horizon-mixins-core/src/plan.rs (+13 -3)
📝 docs/advanced-injections.md (+2 -2)
📝 docs/architecture.md (+8 -5)
📝 docs/boundary-head-and-modules.md (+10 -9)
📝 docs/crates-data-and-named-hooks.md (+44 -15)
📝 docs/effects-and-state.md (+1 -1)
📝 docs/implementation.md (+3 -2)

...and 6 more files

📄 Description

🤖 Opened by finalpantasy's AI agent (OpenAI Codex), not by finalpantasy personally.

A native bundle cannot currently split its logic into libraries that depend on each other: a dependency such as engine_math = { package = "utility-kernel", path = "../../shared/math" } is rejected even when both crates are explicitly declared by the same bundle.

This adds same-bundle crate dependencies while retaining the existing registry lock allowlist. Planning resolves forward references, aliases, version requirements and nested source paths, and rejects undeclared targets, escapes, linked paths, self-dependencies and cycles. Staging verifies original file hashes before rewriting only the staged dependency paths. Source manifests remain unchanged. Plan schema 7 records the resolved edges.

Cycle checks conservatively include normal, build, dev and inactive optional edges. Cross-bundle, arbitrary filesystem and git dependencies remain unsupported. Existing loose .toml mods continue to work. Related to #12; this addresses its sibling-crate request only.

Current-base Windows self-check

The original feature revision is 3ac63df26d332bc344ba645d5d23497b7d4ad985. The tested combined revision 6757cc1f08be368f20e98fa23d22e560f853325b merges upstream main ddd9700b21997c95d95ac6ee5ecafe3830cf622a with that feature. The feature diff against the new base remains 24 files, 1,422 insertions and 75 deletions. No unrelated repair is included.

Both snapshots were tested separately on Windows, serially with one Cargo job and one test thread:

Check Current upstream main Combined feature
cargo fmt --all -- --check Pass Pass
cargo clippy --workspace --all-targets --offline --locked -- -D warnings Pass Pass
cargo test --workspace --locked --offline --no-fail-fast -- --test-threads=1 91 passed, 7 failed 103 passed, the same 7 failed

The full test commands used Rust 1.99.1 GNU; formatting and Clippy used the installed Rust/Clippy 1.98.1 MSVC toolchain. All workspace test binaries and both doctest suites completed. All 98 existing test outcomes were retained, and all 12 additional sibling-crate tests passed. Each invocation exited naturally with confirmed cleanup and unchanged source/tool inputs. Independent raw-evidence review covers these results.

The added tests compile separate libraries through the SDK, including forward/nested/aliased dependencies, optional/default features, build scripts and dev dependencies; exercise invalid paths, cycles and altered plans; and cover loose .toml compatibility. Separate earlier Windows probes also accepted an ordinary sibling dependency and rejected junctions in both declared crate roots and dependency paths.

The full Windows suite is not all green. Its seven reproduced upstream failures remain four existing-stage replacement tests, two direct workspace-indexing path tests, and one stage-ownership diagnostic assertion. Earlier Windows findings on #3 and #4 describe the same limitations. No assertion was weakened to hide them. Linux, Unix-only symlink tests and the repository-pinned Rust 1.95 toolchain were not run locally; upstream CI remains a separate gate.

The historical checks at the original feature head remain 101 passed/7 failed versus 89 passed/the same 7 failed on upstream a2af5c0. The table above is the fresh current-base result, not a relabeling of those older runs.

Launcher and installed-runtime follow-up

The companion launcher validation fix has merged as horizon-rust/horizon#5756. With the original SDK feature head (3ac63df26d332bc344ba645d5d23497b7d4ad985), a native bundle containing declared dependent crates passed the normal launcher build/install workflow and four real offscreen save/reopen sessions. The sessions used normal content-mod discovery, exited naturally, and preserved machine and player state without output duplication. The portable source and scoped verification metadata are published in gtnh-native-rust dce6efc.

That installed-game proof remains bound to the original SDK feature revision. The combined current-base revision above was checked at the SDK level; it has not replaced the installed game build. Unmodified upstream SDK support for sibling crates is not established by this PR.

The current-base SDK self-check is complete. This PR remains draft while the seven existing Windows failures await resolution or explicit review. No all-platform or all-green CI claim is made.

🤖 Generated with OpenAI Codex


🔄 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-mixins/pull/18 **Author:** [@finalpantasy](https://github.com/finalpantasy) **Created:** 11/1/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `feat/bundle-sibling-crates` --- ### 📝 Commits (4) - [`00a8371`](https://github.com/horizon-rust/horizon-mixins/commit/00a837175a79ab41c13cd0dbbf8d480a04c93ec4) fix: index production test cfg modules - [`3ac63df`](https://github.com/horizon-rust/horizon-mixins/commit/3ac63df26d332bc344ba645d5d23497b7d4ad985) feat(native): support dependencies between declared bundle crates - [`ddd9700`](https://github.com/horizon-rust/horizon-mixins/commit/ddd9700b21997c95d95ac6ee5ecafe3830cf622a) Merge pull request #17 from arismoko/fix/cfg-test-modules - [`6757cc1`](https://github.com/horizon-rust/horizon-mixins/commit/6757cc1f08be368f20e98fa23d22e560f853325b) Local test snapshot: combine current SDK main and sibling crate support ### 📊 Changes **26 files changed** (+1563 additions, -99 deletions) <details> <summary>View changed files</summary> 📝 `README.md` (+4 -3) 📝 `crates/horizon-mixins-cli/tests/cases/advanced.rs` (+1 -1) 📝 `crates/horizon-mixins-cli/tests/cases/effects.rs` (+1 -1) 📝 `crates/horizon-mixins-cli/tests/cases/native.rs` (+670 -1) 📝 `crates/horizon-mixins-cli/tests/cases/scoped.rs` (+1 -1) 📝 `crates/horizon-mixins-cli/tests/integration.rs` (+22 -0) 📝 `crates/horizon-mixins-cli/tests/snapshots/advanced-plan.json` (+1 -1) 📝 `crates/horizon-mixins-cli/tests/snapshots/boundary-plan.json` (+1 -1) 📝 `crates/horizon-mixins-cli/tests/snapshots/effects-plan.json` (+1 -1) 📝 `crates/horizon-mixins-cli/tests/snapshots/plan.json` (+1 -1) 📝 `crates/horizon-mixins-cli/tests/snapshots/scoped-plan.json` (+1 -1) 📝 `crates/horizon-mixins-core/src/index.rs` (+110 -16) 📝 `crates/horizon-mixins-core/src/native.rs` (+647 -18) 📝 `crates/horizon-mixins-core/src/plan.rs` (+13 -3) 📝 `docs/advanced-injections.md` (+2 -2) 📝 `docs/architecture.md` (+8 -5) 📝 `docs/boundary-head-and-modules.md` (+10 -9) 📝 `docs/crates-data-and-named-hooks.md` (+44 -15) 📝 `docs/effects-and-state.md` (+1 -1) 📝 `docs/implementation.md` (+3 -2) _...and 6 more files_ </details> ### 📄 Description > 🤖 Opened by finalpantasy's AI agent (OpenAI Codex), not by finalpantasy personally. A native bundle cannot currently split its logic into libraries that depend on each other: a dependency such as `engine_math = { package = "utility-kernel", path = "../../shared/math" }` is rejected even when both crates are explicitly declared by the same bundle. This adds same-bundle crate dependencies while retaining the existing registry lock allowlist. Planning resolves forward references, aliases, version requirements and nested source paths, and rejects undeclared targets, escapes, linked paths, self-dependencies and cycles. Staging verifies original file hashes before rewriting only the staged dependency paths. Source manifests remain unchanged. Plan schema 7 records the resolved edges. Cycle checks conservatively include normal, build, dev and inactive optional edges. Cross-bundle, arbitrary filesystem and git dependencies remain unsupported. Existing loose `.toml` mods continue to work. Related to #12; this addresses its sibling-crate request only. ## Current-base Windows self-check The original feature revision is `3ac63df26d332bc344ba645d5d23497b7d4ad985`. The tested combined revision `6757cc1f08be368f20e98fa23d22e560f853325b` merges upstream main `ddd9700b21997c95d95ac6ee5ecafe3830cf622a` with that feature. The feature diff against the new base remains 24 files, 1,422 insertions and 75 deletions. No unrelated repair is included. Both snapshots were tested separately on Windows, serially with one Cargo job and one test thread: | Check | Current upstream main | Combined feature | | --- | --- | --- | | `cargo fmt --all -- --check` | Pass | Pass | | `cargo clippy --workspace --all-targets --offline --locked -- -D warnings` | Pass | Pass | | `cargo test --workspace --locked --offline --no-fail-fast -- --test-threads=1` | 91 passed, 7 failed | 103 passed, the same 7 failed | The full test commands used Rust 1.99.1 GNU; formatting and Clippy used the installed Rust/Clippy 1.98.1 MSVC toolchain. All workspace test binaries and both doctest suites completed. All 98 existing test outcomes were retained, and all 12 additional sibling-crate tests passed. Each invocation exited naturally with confirmed cleanup and unchanged source/tool inputs. Independent raw-evidence review covers these results. The added tests compile separate libraries through the SDK, including forward/nested/aliased dependencies, optional/default features, build scripts and dev dependencies; exercise invalid paths, cycles and altered plans; and cover loose `.toml` compatibility. Separate earlier Windows probes also accepted an ordinary sibling dependency and rejected junctions in both declared crate roots and dependency paths. The full Windows suite is **not all green**. Its seven reproduced upstream failures remain four existing-stage replacement tests, two direct workspace-indexing path tests, and one stage-ownership diagnostic assertion. Earlier Windows findings on #3 and #4 describe the same limitations. No assertion was weakened to hide them. Linux, Unix-only symlink tests and the repository-pinned Rust 1.95 toolchain were not run locally; upstream CI remains a separate gate. The historical checks at the original feature head remain 101 passed/7 failed versus 89 passed/the same 7 failed on upstream `a2af5c0`. The table above is the fresh current-base result, not a relabeling of those older runs. ## Launcher and installed-runtime follow-up The companion launcher validation fix has merged as [horizon-rust/horizon#5756](https://github.com/horizon-rust/horizon/pull/5756). With the original SDK feature head (`3ac63df26d332bc344ba645d5d23497b7d4ad985`), a native bundle containing declared dependent crates passed the normal launcher build/install workflow and four real offscreen save/reopen sessions. The sessions used normal content-mod discovery, exited naturally, and preserved machine and player state without output duplication. The portable source and scoped verification metadata are published in [gtnh-native-rust dce6efc](https://github.com/finalpantasy/gtnh-native-rust/commit/dce6efcdc902c6b4b7c327b9e8cd2fd894c4bb06). That installed-game proof remains bound to the original SDK feature revision. The combined current-base revision above was checked at the SDK level; it has not replaced the installed game build. Unmodified upstream SDK support for sibling crates is not established by this PR. The current-base SDK self-check is complete. This PR remains draft while the seven existing Windows failures await resolution or explicit review. No all-platform or all-green CI claim is made. 🤖 Generated with [OpenAI Codex](https://openai.com/codex/) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No labels
pull-request
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-mixins#20
No description provided.