[GH-ISSUE #4649] Reject packs whose pack_format contradicts their declared range #1409

Closed
opened 2026-11-02 15:46:43 +07:00 by bsakaguchi · 2 comments
Owner

Originally created by @missingnx on GitHub (Oct 30, 2026).
Original GitHub issue: https://github.com/horizon-rust/horizon/issues/4649

🤖 Filed by missingnx's AI agent (Codex, GPT-6), not by missingnx personally.

Part of #3520: PackFormat.IntermediaryFormat.validatePackFormatForRange only.

Horizon currently lists a pack even when its pack_format lies outside its declared supported range. For example, a folder whose pack.mcmeta contains:

{"pack":{"description":"invalid range","pack_format":98,"min_format":97,"max_format":97}}

is discovered by horizon-client-render/src/packs.rs::pack_for; compatibility uses the bounds and ignores the contradictory main format. Vanilla 26.3 rejects this metadata. Vanilla also rejects a declared main format below 15 when an explicit multi-version range is present.

Scope: port the two checks and their error messages from PackFormat.IntermediaryFormat.validatePackFormatForRange, apply them during pack discovery, and add a comparison against the actual Java method plus a pack-discovery regression test. The other PackFormat validation rows in #3520 are separate work.

Checked before starting: the tracker row is unticked; the method is absent from main; all 302 open PRs' file lists were checked. #4008 changes Windows junction creation in the same file, not format parsing. #3048 is the explicitly non-mergeable integration branch. Searches for PackFormat/pack_format found no separate open task or PR implementing this row.

🤖 Generated with Codex.

Originally created by @missingnx on GitHub (Oct 30, 2026). Original GitHub issue: https://github.com/horizon-rust/horizon/issues/4649 > 🤖 Filed by missingnx's AI agent (Codex, GPT-6), not by missingnx personally. Part of #3520: `PackFormat.IntermediaryFormat.validatePackFormatForRange` only. Horizon currently lists a pack even when its `pack_format` lies outside its declared supported range. For example, a folder whose `pack.mcmeta` contains: ```json {"pack":{"description":"invalid range","pack_format":98,"min_format":97,"max_format":97}} ``` is discovered by `horizon-client-render/src/packs.rs::pack_for`; compatibility uses the bounds and ignores the contradictory main format. Vanilla 26.3 rejects this metadata. Vanilla also rejects a declared main format below 15 when an explicit multi-version range is present. Scope: port the two checks and their error messages from `PackFormat.IntermediaryFormat.validatePackFormatForRange`, apply them during pack discovery, and add a comparison against the actual Java method plus a pack-discovery regression test. The other PackFormat validation rows in #3520 are separate work. Checked before starting: the tracker row is unticked; the method is absent from main; all 302 open PRs' file lists were checked. #4008 changes Windows junction creation in the same file, not format parsing. #3048 is the explicitly non-mergeable integration branch. Searches for PackFormat/pack_format found no separate open task or PR implementing this row. 🤖 Generated with [Codex](https://openai.com/codex/).
Author
Owner

@kira-horizon[bot] commented on GitHub (Oct 30, 2026):

Claimed by missingnx on Discord (GitHub: missingnx), to avoid duplicate work. The claim lapses after 14 days without activity (a comment, a pull request or a commit mentioning #4649).

<!-- gh-comment-id:6532663280 --> @kira-horizon[bot] commented on GitHub (Oct 30, 2026): Claimed by `missingnx` on Discord (GitHub: `missingnx`), to avoid duplicate work. The claim lapses after 14 days without activity (a comment, a pull request or a commit mentioning #4649). <!-- kira:work -->
Author
Owner

@kacpherek commented on GitHub (Oct 31, 2026):

Fixed by #4653, which ports validatePackFormatForRange and applies it during pack discovery. If it still happens, please reopen with the version and logs/latest.log.

<!-- gh-comment-id:6541522385 --> @kacpherek commented on GitHub (Oct 31, 2026): Fixed by #4653, which ports validatePackFormatForRange and applies it during pack discovery. If it still happens, please reopen with the version and logs/latest.log.
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#1409
No description provided.