fix(builder): fetch <tag> takes only the release it asked for #3034

Merged
HumanBean merged 2 commits from PedroRossi/Longshot:fix/fetch-tag-is-the-one-asked into main 2026-12-02 21:38:54 +00:00
Contributor

Summary

longshot-builder fetch of a tag, what the launcher runs to install a version, can install another release than the
one asked for. When the tag isn't in the release list it read, Forge::by_tag (builder/crates/release/src/forge.rs) asks
the forge for that tag by name and takes the answer as it comes: every later check, the release's signature and its
manifest, reads the answer's own tag. The signature says a release is Longshot's, not that it is the one asked for, so
an answer for v3.2.0 that carries the signed v3.1.0 installs v3.1.0 in v3.2.0's place, exit 0. Whatever answers in
the forge's place (a compromised account or server, or a proxy in front of it) could put players back on an older,
withdrawn or known-broken release without holding the signing key.

by_tag now refuses an answer whose tag is not the one asked for (no_such_release, naming the tag that came back).

How to see it on main: the new test's fake forge answers a tag with another signed release, and main installs it.

Read first: Forge::by_tag.

Testing

Tested: on this PC (Linux): the new test (a_tag_asked_for_is_the_release_installed) fails on main, the
other release installed, and passes here; the release crate's tests, clippy -D warnings, rustfmt. As pr create asks
for a builder change: Debian 13, GeForce GTX 1660 SUPER, NVIDIA 550.163.01: the game built by a builder from main @ b40214d2 with this change merged (with #3035), through the PC's job queue, played twice from the Market entrance repository save into play (after loading it shows a menu state first, as main @ b40214d2 does on this PC in 2 of 3 runs), then the control bridge's quit; exit 0. The release code this changes runs when a version is fetched, not in a build or the game. mise run test (--strict) on main @ b40214d2, and on main with this change merged (with #3035, from the same audit), through the PC's job queue: 763 passed, 167 failed, 10 skipped both ways, so none fails only with it. The 167 are named at the end.

Still to test:
None: no forge answers a tag with another release to try it on by hand; the test's fake one does.

Measurements

Nothing to measure: one comparison of two strings per fetch of a tag the release list lacks.

Risks

A forge answering a tag with the same release under another tag would now be refused; a fetch of a tag the release
list has never takes this path. A revert is enough.

Checklist

Ready for review

  • One topic, on current main; the title is a Conventional Commit.
  • Tested on my own PC, in the game for a change the game runs, as Testing says.
  • mise run test passes (any failure that also fails on main is named).
  • Measured against main, or Measurements says why there is nothing to measure.
  • No game files, build output or hand-edited generated files; third_party/ untouched; nothing GPL-incompatible.

When it applies

  • A fix: a game-free test that fails on main and passes here.
  • AI assistance recorded with Assisted-by: / Co-Authored-By: trailers.

Ready to merge

  • Everything in Still to test has run, its results in Tested.
  • Tier 1 hardware it can affect is tested (docs/dev/standards.md, "Hardware tiers").
  • Approved in review, every comment answered.
  • CI passes on the head; on current main, measured again or a comment says why the numbers still hold.
The 167 checks of mise run test that fail on main @ b40214d2 on this PC too, with or without this change

99 need a tool this PC doesn't have on PATH (--strict fails them):

  • clang (63): test_audio_output_devices.py, test_box_light_reuse.py, test_camera_centering.py, test_camera_speed.py, test_drive_target.py, test_dynres_sites.py, test_exclusive_marks.py, test_fixed_scale_sites.py, test_floor_carry_step.py, test_frame_rate_cap_step.py, test_frame_whole.py, test_free_view_anchor.py, test_fullscreen_monitor_platform.py, test_high_fps_fixes.py, test_horse_jump_step.py, test_hos_ab.py, test_hud_layout.py, test_jump_takeoff_step.py, test_linux_audio_output.py, test_loop_step.py, test_menu_hooks.py, test_microphone_test_gain.py, test_monitor_friendly_names.py, test_mouse_native.py, test_movement_speed.py, test_movie_frame_count.py, test_nvn_null_pool.py, test_nvn_tex_builder_guard.py, test_ocarina_wait.py, test_ocb_hold.py, test_oot_barrier.py, test_oot_camera_clearance.py, test_oot_cloth.py, test_oot_cloth_60.py, test_oot_cloth_time.py, test_oot_damage.py, test_oot_fov.py, test_oot_heap_retry.py, test_oot_jitter.py, test_oot_shadow.py, test_oot_shadow_fit.py, test_oot_transition_autosave.py, test_oot_voice_option.py, test_oot_wide_bubble.py, test_oot_wide_save_picture.py, test_player_update_sites.py, test_sampler_stack_walk.py, test_saved_turn_rate.py, test_scarecrow_timing.py, test_scene_format.py, test_sdl_monitor_names.py, test_shadow_slot.py, test_song_note_cue.py, test_sound_held_frames.py, test_sprint.py, test_svc_core_mask.py, test_tex_compact.py, test_text_speed.py, test_title_card_sites.py, test_water_substeps.py, test_web_floor_steps.py, test_wide_sites.py, test_wide_ui.py
  • spirv-val (20): f2i_immediate, global_load_16, native_suatom, test_coop_spirv.py, test_default_point_size.py, test_depth_sample_types.py, test_draw_parameters.py, test_fsr4_tune.py, test_guest_page_fast32.py, test_image_arrays.py, test_mesh_fallback_layout.py, test_mesh_unreachable_outputs.py, test_mma_software.py, test_native_float_atomic_add.py, test_nonuniform_image_arrays.py, test_spirv_struct_identity.py, test_texture_phi_dominance.py, test_unsigned_image_types.py, test_vendor_translation.py, test_wmma16_spirv_val.py
  • clang++ (7): test_dead_targets_sweep.py, test_lower_depbar.py, test_lower_lds_after_sts.py, test_lower_register_markers.py, test_native_suatom.py, test_program_answer_domains.py, test_target_pool_cap.py
  • glslang (7): test_dlssg_hud_ui.py, test_dlssg_hudless_pq.py, test_framegen_hdr.py, test_fsr3fi_hud_layer.py, test_fsr3fi_hudless_colour.py, test_host_shaders.py, test_temporal_present_bandwidth.py
  • glslang, spirv-val (1): test_fsr3_shaders.py
  • llvm-mc (1): test_lifter.py

68 fail on main itself: test_astc_upload_chunking.py, test_async_astc_upload_chunks.py, test_bind_memo.py, test_blocks_at_start.py, test_bug_report.py, test_cloth_kernels.py, test_cloth_loops.py, test_cloth_sphere.py, test_cloth_step12.py, test_cloth_step8.py, test_cloth_step9.py, test_control_picture.py, test_crash_record.py, test_crt_options.py, test_dev_update.py, test_dlssg_pace.py, test_draw_stream_visibility.py, test_drawn_page_map.py, test_early_split_before_draw.py, test_flat_map.py, test_framegen_resources.py, test_fsr_image_retirement.py, test_fsr_uniform_ownership.py, test_game_boundary.py, test_guest_holes.py, test_image_reaper_threads.py, test_image_view_retry.py, test_import_reach.py, test_input_background.py, test_keyboard_option.py, test_late_fix_build.py, test_linux_pressure.py, test_loaded_modules_drop.py, test_log_levels.py, test_menu_keys.py, test_menu_save_atomic.py, test_mesh_first_types.py, test_mirror_bookkeeping.py, test_oot_occ_raster.py, test_option_ids.py, test_pass_barrier.py, test_perf_send.py, test_pipeline_tour.py, test_present_acquire_ahead.py, test_present_image_free.py, test_present_source_crop.py, test_program_cache_cleanup.py, test_program_cache_one_variant.py, test_readback_timeout_reuse.py, test_recorder_sync.py, test_recording_admission.py, test_report_words.py, test_screensaver.py, test_staging_burst.py, test_switch_table.py, test_target_retention.py, test_tex_desc_memo.py, test_thinlto_tls.py, test_ub_snapshot_default.py, test_ub_snapshot_gpu_writes.py, test_upscaler_round_trip.py, test_vk_wb_cpu_words_fast.py, test_vram_compact.py, test_wb_diff_stale_shadow.py, test_wb_pending_capture.py, test_windows_display_startup.py, test_windows_on_linux.py, test_wrote_regions.py


Found in an AI-assisted audit of the repository. The test, the fix, the runs and this description were made with Claude Code; I reviewed them.

Co-Authored-By: Claude Opus 5.5 [email protected]

🤖 Generated with Claude Code

## Summary `longshot-builder fetch` of a tag, what the launcher runs to install a version, can install another release than the one asked for. When the tag isn't in the release list it read, `Forge::by_tag` (`builder/crates/release/src/forge.rs`) asks the forge for that tag by name and takes the answer as it comes: every later check, the release's signature and its manifest, reads the answer's own tag. The signature says a release is Longshot's, not that it is the one asked for, so an answer for v3.2.0 that carries the signed v3.1.0 installs v3.1.0 in v3.2.0's place, exit 0. Whatever answers in the forge's place (a compromised account or server, or a proxy in front of it) could put players back on an older, withdrawn or known-broken release without holding the signing key. `by_tag` now refuses an answer whose tag is not the one asked for (`no_such_release`, naming the tag that came back). How to see it on main: the new test's fake forge answers a tag with another signed release, and main installs it. Read first: `Forge::by_tag`. ## Testing **Tested:** on this PC (Linux): the new test (`a_tag_asked_for_is_the_release_installed`) fails on main, the other release installed, and passes here; the release crate's tests, clippy -D warnings, rustfmt. As `pr create` asks for a builder change: Debian 13, GeForce GTX 1660 SUPER, NVIDIA 550.163.01: the game built by a builder from main @ b40214d2 with this change merged (with #3035), through the PC's job queue, played twice from the Market entrance repository save into play (after loading it shows a menu state first, as main @ b40214d2 does on this PC in 2 of 3 runs), then the control bridge's quit; exit 0. The release code this changes runs when a version is fetched, not in a build or the game. `mise run test` (`--strict`) on main @ b40214d2, and on main with this change merged (with #3035, from the same audit), through the PC's job queue: 763 passed, 167 failed, 10 skipped both ways, so none fails only with it. The 167 are named at the end. **Still to test:** None: no forge answers a tag with another release to try it on by hand; the test's fake one does. ## Measurements Nothing to measure: one comparison of two strings per fetch of a tag the release list lacks. ## Risks A forge answering a tag with the same release under another tag would now be refused; a fetch of a tag the release list has never takes this path. A revert is enough. ## Checklist ### Ready for review - [x] One topic, on current `main`; the title is a Conventional Commit. - [x] Tested on my own PC, in the game for a change the game runs, as Testing says. - [x] `mise run test` passes (any failure that also fails on `main` is named). - [x] Measured against `main`, or Measurements says why there is nothing to measure. - [x] No game files, build output or hand-edited generated files; `third_party/` untouched; nothing GPL-incompatible. ### When it applies - [x] A fix: a game-free test that fails on `main` and passes here. - [x] AI assistance recorded with `Assisted-by:` / `Co-Authored-By:` trailers. ### Ready to merge - [ ] Everything in Still to test has run, its results in Tested. - [ ] Tier 1 hardware it can affect is tested (docs/dev/standards.md, "Hardware tiers"). - [ ] Approved in review, every comment answered. - [ ] CI passes on the head; on current `main`, measured again or a comment says why the numbers still hold. <details><summary>The 167 checks of <code>mise run test</code> that fail on main @ b40214d2 on this PC too, with or without this change</summary> 99 need a tool this PC doesn't have on PATH (`--strict` fails them): - clang (63): test_audio_output_devices.py, test_box_light_reuse.py, test_camera_centering.py, test_camera_speed.py, test_drive_target.py, test_dynres_sites.py, test_exclusive_marks.py, test_fixed_scale_sites.py, test_floor_carry_step.py, test_frame_rate_cap_step.py, test_frame_whole.py, test_free_view_anchor.py, test_fullscreen_monitor_platform.py, test_high_fps_fixes.py, test_horse_jump_step.py, test_hos_ab.py, test_hud_layout.py, test_jump_takeoff_step.py, test_linux_audio_output.py, test_loop_step.py, test_menu_hooks.py, test_microphone_test_gain.py, test_monitor_friendly_names.py, test_mouse_native.py, test_movement_speed.py, test_movie_frame_count.py, test_nvn_null_pool.py, test_nvn_tex_builder_guard.py, test_ocarina_wait.py, test_ocb_hold.py, test_oot_barrier.py, test_oot_camera_clearance.py, test_oot_cloth.py, test_oot_cloth_60.py, test_oot_cloth_time.py, test_oot_damage.py, test_oot_fov.py, test_oot_heap_retry.py, test_oot_jitter.py, test_oot_shadow.py, test_oot_shadow_fit.py, test_oot_transition_autosave.py, test_oot_voice_option.py, test_oot_wide_bubble.py, test_oot_wide_save_picture.py, test_player_update_sites.py, test_sampler_stack_walk.py, test_saved_turn_rate.py, test_scarecrow_timing.py, test_scene_format.py, test_sdl_monitor_names.py, test_shadow_slot.py, test_song_note_cue.py, test_sound_held_frames.py, test_sprint.py, test_svc_core_mask.py, test_tex_compact.py, test_text_speed.py, test_title_card_sites.py, test_water_substeps.py, test_web_floor_steps.py, test_wide_sites.py, test_wide_ui.py - spirv-val (20): f2i_immediate, global_load_16, native_suatom, test_coop_spirv.py, test_default_point_size.py, test_depth_sample_types.py, test_draw_parameters.py, test_fsr4_tune.py, test_guest_page_fast32.py, test_image_arrays.py, test_mesh_fallback_layout.py, test_mesh_unreachable_outputs.py, test_mma_software.py, test_native_float_atomic_add.py, test_nonuniform_image_arrays.py, test_spirv_struct_identity.py, test_texture_phi_dominance.py, test_unsigned_image_types.py, test_vendor_translation.py, test_wmma16_spirv_val.py - clang++ (7): test_dead_targets_sweep.py, test_lower_depbar.py, test_lower_lds_after_sts.py, test_lower_register_markers.py, test_native_suatom.py, test_program_answer_domains.py, test_target_pool_cap.py - glslang (7): test_dlssg_hud_ui.py, test_dlssg_hudless_pq.py, test_framegen_hdr.py, test_fsr3fi_hud_layer.py, test_fsr3fi_hudless_colour.py, test_host_shaders.py, test_temporal_present_bandwidth.py - glslang, spirv-val (1): test_fsr3_shaders.py - llvm-mc (1): test_lifter.py 68 fail on main itself: test_astc_upload_chunking.py, test_async_astc_upload_chunks.py, test_bind_memo.py, test_blocks_at_start.py, test_bug_report.py, test_cloth_kernels.py, test_cloth_loops.py, test_cloth_sphere.py, test_cloth_step12.py, test_cloth_step8.py, test_cloth_step9.py, test_control_picture.py, test_crash_record.py, test_crt_options.py, test_dev_update.py, test_dlssg_pace.py, test_draw_stream_visibility.py, test_drawn_page_map.py, test_early_split_before_draw.py, test_flat_map.py, test_framegen_resources.py, test_fsr_image_retirement.py, test_fsr_uniform_ownership.py, test_game_boundary.py, test_guest_holes.py, test_image_reaper_threads.py, test_image_view_retry.py, test_import_reach.py, test_input_background.py, test_keyboard_option.py, test_late_fix_build.py, test_linux_pressure.py, test_loaded_modules_drop.py, test_log_levels.py, test_menu_keys.py, test_menu_save_atomic.py, test_mesh_first_types.py, test_mirror_bookkeeping.py, test_oot_occ_raster.py, test_option_ids.py, test_pass_barrier.py, test_perf_send.py, test_pipeline_tour.py, test_present_acquire_ahead.py, test_present_image_free.py, test_present_source_crop.py, test_program_cache_cleanup.py, test_program_cache_one_variant.py, test_readback_timeout_reuse.py, test_recorder_sync.py, test_recording_admission.py, test_report_words.py, test_screensaver.py, test_staging_burst.py, test_switch_table.py, test_target_retention.py, test_tex_desc_memo.py, test_thinlto_tls.py, test_ub_snapshot_default.py, test_ub_snapshot_gpu_writes.py, test_upscaler_round_trip.py, test_vk_wb_cpu_words_fast.py, test_vram_compact.py, test_wb_diff_stale_shadow.py, test_wb_pending_capture.py, test_windows_display_startup.py, test_windows_on_linux.py, test_wrote_regions.py </details> --- Found in an AI-assisted audit of the repository. The test, the fix, the runs and this description were made with Claude Code; I reviewed them. Co-Authored-By: Claude Opus 5.5 <[email protected]> 🤖 Generated with [Claude Code](https://claude.com/claude-code)
A tag not in the release list is asked of the forge by name (Forge::by_tag), and the answer's own tag is what every
later check reads: a forge, or whatever answers in its place, that answers v3.2.0 with the signed v3.1.0 has it
installed as asked, exit 0. The test's forge answers a tag with another release; fails on main (v3.1.0 installed).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
fix(builder): fetch <tag> takes only the release it asked for
Some checks are pending
CI / Game-free checks (run_all.py, part 2/2) (pull_request) Blocked by required conditions
CI / What the change needs (pull_request) Blocked by required conditions
CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request) Blocked by required conditions
CI / Third-party parts and guide screenshots (pull_request) Blocked by required conditions
CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request) Blocked by required conditions
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Blocked by required conditions
CI / Renderer build check (Windows, compile --only renderer, without and with FSR 4) (pull_request) Blocked by required conditions
CI / Renderer build check (Linux, compile --only renderer, without and with FSR 4) (pull_request) Blocked by required conditions
CI / Game-free checks (run_all.py, part 1/2) (pull_request) Blocked by required conditions
CI / Website build and checks (pull_request) Blocked by required conditions
PR description / Title and description (pull_request_target) Successful in 6s
acbbc4fcd6
by_tag refuses an answer whose tag is not the one asked for (no_such_release): the signature says a release is
Longshot's, not that it is the one asked for, so no older signed release is installed under a newer one's name.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Author
Contributor

Tested in game: Debian 13, GeForce GTX 1660 SUPER, NVIDIA 550.163.01: the game built by a builder from main @ b40214d2 with this change merged, through the PC's job queue, played twice from the Market entrance repository save into play (after loading it shows a menu state first, as main @ b40214d2 does on this PC in 2 of 3 runs), then the control bridge's quit; exit 0. The release code this changes runs when a version is fetched, not in a build or the game.

Tested in game: Debian 13, GeForce GTX 1660 SUPER, NVIDIA 550.163.01: the game built by a builder from main @ b40214d2 with this change merged, through the PC's job queue, played twice from the Market entrance repository save into play (after loading it shows a menu state first, as main @ b40214d2 does on this PC in 2 of 3 runs), then the control bridge's quit; exit 0. The release code this changes runs when a version is fetched, not in a build or the game.
PedroRossi changed title from WIP: fix(builder): fetch <tag> takes only the release it asked for to fix(builder): fetch <tag> takes only the release it asked for 2026-12-02 21:02:04 +00:00
Owner
@review
BeanBot left a comment

Recommendation: Approve. The tag check closes the reported substitution path, and the new test exercises it. CI is still running and must pass before merge. Nothing blocking is left. Recommend approval; not approved on the forge.

A fetch for a specific tag now refuses a forge response naming another release. The change adds one string comparison on the fallback lookup path.

Checks: Still running: 11 checks.

More: does it help, other systems, switches, what was read

Does it help: Yes. The author reports that the fake-forge test installs the older signed release on base b40214d2 and returns no_such_release on this head.

Other systems: The comparison is platform-independent and affects builder fetches on Windows and Linux. Release-list matches and channel fetches do not use the changed path; the signed manifest is still checked against the selected tag. The Rust CI check is pending.

Switches: None.

Reviewed: acbbc4fcd6 against b40214d2bb: Read AGENTS.md, CONTRIBUTING.md, the PR template, standards, both changed files, and the relevant installation, manifest and version-selection paths. Skimmed the reported game and check runs. docs/review-checklist.md and the adjacent Tooling checkout were absent.; nothing run (a code review).

Checked and fine:

  • The test supplies a signed older release and would fail if the tag comparison were removed.
  • The new code introduces no shared state, path handling, allocation lifecycle, switches, generated files or API changes.
  • Both commits record AI assistance; the diff contains no game-derived output.

Testing: Read-only review; no commands from the project or tests were run. The author reports the release tests, clippy and rustfmt passed; CI remains in progress.

Overlaps and merge order: None identified from the supplied context; network access was unavailable.


Automated code review by BeanBot (gpt-6.1-terra), asked for by HumanBean. Nothing was run; a maintainer decides.

**Recommendation: Approve.** The tag check closes the reported substitution path, and the new test exercises it. CI is still running and must pass before merge. Nothing blocking is left. Recommend approval; not approved on the forge. A fetch for a specific tag now refuses a forge response naming another release. The change adds one string comparison on the fallback lookup path. **Checks:** Still running: 11 checks. <details> <summary>More: does it help, other systems, switches, what was read</summary> **Does it help:** Yes. The author reports that the fake-forge test installs the older signed release on base b40214d2 and returns no_such_release on this head. **Other systems:** The comparison is platform-independent and affects builder fetches on Windows and Linux. Release-list matches and channel fetches do not use the changed path; the signed manifest is still checked against the selected tag. The Rust CI check is pending. **Switches:** None. **Reviewed:** acbbc4fcd6c5 against b40214d2bb8d: Read AGENTS.md, CONTRIBUTING.md, the PR template, standards, both changed files, and the relevant installation, manifest and version-selection paths. Skimmed the reported game and check runs. docs/review-checklist.md and the adjacent Tooling checkout were absent.; nothing run (a code review). **Checked and fine:** - The test supplies a signed older release and would fail if the tag comparison were removed. - The new code introduces no shared state, path handling, allocation lifecycle, switches, generated files or API changes. - Both commits record AI assistance; the diff contains no game-derived output. **Testing:** Read-only review; no commands from the project or tests were run. The author reports the release tests, clippy and rustfmt passed; CI remains in progress. **Overlaps and merge order:** None identified from the supplied context; network access was unavailable. </details> --- <sub>Automated code review by BeanBot (gpt-6.1-terra), asked for by HumanBean. Nothing was run; a maintainer decides.</sub>
HumanBean deleted branch fix/fetch-tag-is-the-one-asked 2026-12-02 21:38:54 +00:00
Some checks are pending
CI / Game-free checks (run_all.py, part 2/2) (pull_request) Blocked by required conditions
CI / What the change needs (pull_request) Blocked by required conditions
CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request) Blocked by required conditions
CI / Third-party parts and guide screenshots (pull_request) Blocked by required conditions
CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request) Blocked by required conditions
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Blocked by required conditions
CI / Renderer build check (Windows, compile --only renderer, without and with FSR 4) (pull_request) Blocked by required conditions
CI / Renderer build check (Linux, compile --only renderer, without and with FSR 4) (pull_request) Blocked by required conditions
CI / Game-free checks (run_all.py, part 1/2) (pull_request) Blocked by required conditions
CI / Website build and checks (pull_request) Blocked by required conditions
PR description / Title and description (pull_request_target) Successful in 6s
Some workflows are waiting to be reviewed.
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
3 participants
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
MagicBeanDev/Longshot!3034
No description provided.