fix(sandbox): Windows: a sandboxed test run finds a mod outside the mods folder #2747

Open
ChloeNow wants to merge 5 commits from ChloeNow/Longshot:fix/sandbox-dev-mods-start into mod-api
Contributor

fix(sandbox): Windows: a sandboxed test run finds a mod outside the mods folder

Summary

On Windows, a sandboxed in-game test run (dev.py game-tests <folder>, Longshot.exe mod test --game <folder>) of a
mod outside the mods folder found no mod: "no mod to test was found (a folder with mod.toml, or a folder of them)". That
covers any folder of one's own, and the repository's examples. Two causes, both fixed here:

  • The builder never gave the game the folder (build_core::sandbox_windows::gather). The builder plans the
    confined game's grants from its command line and environment. It skipped the test mode's folder (--mod-tests <folder>, else HOS_MOD_TESTS): the old game-side sandbox planned after the test mode's start had set
    LONGSHOT_DEV_MODS, and the builder plans before. The folder is now read first among the development mods.
  • The game read it too early (host/hos_main.c). The confined game ran the test mode's start (game_start_args)
    before hos_sandbox_start installs the file layer that reaches the builder. It could read neither the folder's
    mod.toml nor its list, took it for an empty folder of mods, and set LONGSHOT_DEV_MODS empty. Inside the container
    the start now runs after the sandbox's start; outside it, and with the sandbox off, it runs first as before.
  • docs/dev/reference/sandbox.md: the file layer's section says so.

mod run <folder> was not affected: only the test mode sets LONGSHOT_DEV_MODS itself. Neither is the fake game's
mod test, which starts no game.

On mod-api, to see it: Windows, sandboxed (the default): dev.py game-tests of a mod in a folder outside the mods
folder. The game's log has no "allowed read ... (a development mod)" line, and ends "no mod to test was found".

Read first: gather.rs (args_of, the development mods), then the Windows start in host/hos_main.c.

Testing

Tested: Windows 11, NVIDIA GeForce RTX 4060 Laptop GPU, driver 621.24.

  • build-core sandbox_windows::gather::test_mode_folder (new): plan_for on a game in a temporary folder, with the
    test folder named by HOS_MOD_TESTS and by --mod-tests. On mod-api it fails with "the test mode's folder by
    HOS_MOD_TESTS (...) read: roots [...]". Here it passes, with the rest of sandbox_windows (28).
  • tests/test_sandbox_test_mode_start.py (new): the Windows start of hos_main.c's main, cut from the source, with
    stand-ins that record the order. On mod-api it fails with "FAIL (inside the container): args_order > sandbox_order".
    Here it passes; with the container's later call removed, it fails with "args_calls == 1".
  • In the game: dev.py game-tests of a probe mod in test-mods\nav-probe (outside the mods folder), sandboxed,
    headless, with the builder confining the game. The branch was merged locally with #2726 (which a sandboxed start
    with a profile needs) and #2745 (the probe's call); that merge was not pushed. The log says "allowed read
    ...\test-mods\nav-probe (a development mod), served by the builder", the mod starts, and its test passes: 1 passed,
    exit 0.

Still to test:

  • @Beanstalk: Linux, dev.py game-tests of a mod outside the mods folder (Linux's sandbox is unchanged here).
The 118 checks that fail on Windows on mod-api (`eaf4a48b9`) too

test_antilag.py, test_astc_decoder_gpu.py, test_async_safe_frees.py, test_audio_output_devices.py, test_audio_source_load.py, test_auto_handheld.py, test_bc_copy_layer_pitch.py, test_builder_channel.py, test_builtin_compute_unoptimized.py, test_capture_dimensions.py, test_capture_readback_visibility.py, test_capture_resources.py, test_coopmat_probe_failures.py, test_crash_record.py, test_desc_counts.py, test_dev_ab.py, test_dev_build.py, test_dev_migrate.py, test_dev_packs.py, test_dev_update.py, test_device_policy.py, test_draw_binds.py, test_draw_stream_visibility.py, test_drs.py, test_dummy_views.py, test_dump_readback.py, test_fallback_pipeline_state.py, test_float_add_subgroup.py, test_framegen_resources.py, test_framelog_sink.py, test_fsr3_release_frees.py, test_fsr3fi_hud_mask.py, test_fsr4_bind_dispatch.py, test_fsr4_tune.py, test_fsr_image_retirement.py, test_fsr_uniform_ownership.py, test_game_menu_mouse_buttons.py, test_gcn_mesh_shared_warp.py, test_image_view_retry.py, test_import_buffer_binding.py, test_import_log.py, test_import_reach.py, test_inline_write_order.py, test_input_background.py, test_input_movie.py, test_job_queue.py, test_lifter.py, test_linux_pressure.py, test_loaded_modules_drop.py, test_longshot_builder.py, test_longshot_ctl.py, test_lost_wait_said.py, test_low_vram_texture_mips.py, test_menu_hooks.py, test_mesh_fallback_strict_fmul.py, test_mesh_first_types.py, test_pads_after_menu.py, test_parity_gates.py, test_pass_barrier.py, test_pass_hazard.py, test_pcache_header_read.py, test_pipeline_key_values.py, test_pipeline_state_portable.py, test_pipeline_states.py, test_present_probe.py, test_present_queue_default.py, test_present_sites.py, test_present_source_crop.py, test_program_answer_domains.py, test_program_cache_cleanup.py, test_program_cache_one_variant.py, test_push_state.py, test_queue_priority.py, test_recorder_own_idle.py, test_recorder_parts.py, test_recorder_sync.py, test_recording_admission.py, test_replay_write_order.py, test_reshade_fx.py, test_run_all_mingw.py, test_same_draw.py, test_same_dyn.py, test_sampler_admission.py, test_seed_reader.py, test_shader_store.py, test_sparse_bind_failure.py, test_sparse_bind_ranges.py, test_split_ub_flush.py, test_staging_burst.py, test_taau_typed_dispatch.py, test_table_track.py, test_target_layouts.py, test_target_reuse_memory.py, test_temporal_present_bandwidth.py, test_texel_buffer_ownership.py, test_texture_init_barrier.py, test_texture_staging_publication.py, test_ub_snapshot_default.py, test_ub_update_batch.py, test_ui_record.py, test_ui_texture_upload.py, test_vcore_video_acquire.py, test_vendor_fixes.py, test_vertex_bind.py, test_vertex_bind_range.py, test_video_catchup.py, test_video_hold_early.py, test_video_input_limit.py, test_vk_occlusion_queries.py, test_vulkan_clear_mip.py, test_vulkan_copy_span.py, test_vulkan_copy_span_gpu_compile.py, test_wb_diff_observations_gpu.py, test_widen_alpha.py, test_windows_on_linux.py, test_windows_stop.py, test_wmma16_zero_c_kchain.py, test_xinput_thread.py

Measurements

Nothing to measure: the start's order and one more read grant.

Risks

  • One more folder read by the confined game: the one the test mode was given, as a development mod's. A folder at or
    above the player's own is refused, as any grant is.
  • Inside the container, --mod-dev and the test mode's results folder are set after the sandbox's start. Neither
    is read before it.
  • A revert is enough.

Checklist

Ready for review

  • One topic, on current mod-api; 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): Windows, with #2726 and #2745 merged: 669 passed, 122 failed, 47 skipped. The same 118 fail on mod-api; test_invalidate_vcore, test_mesh_args_cleanup and test_present_semaphores pass on rerun (flaky under the full run); test_sandbox_save_dir_early failed only with #2726 and this merged, fixed in #2726 (952b4ec3c).
  • 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.
  • A check under tests/ that reads changed source is updated, not weakened.
  • Host code builds on Windows (llvm-mingw) and Linux, with UTF-8 paths.
  • Docs updated.
  • 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.

🤖 Generated with Claude Code

fix(sandbox): Windows: a sandboxed test run finds a mod outside the mods folder ## Summary On Windows, a sandboxed in-game test run (`dev.py game-tests <folder>`, `Longshot.exe mod test --game <folder>`) of a mod outside the mods folder found no mod: "no mod to test was found (a folder with mod.toml, or a folder of them)". That covers any folder of one's own, and the repository's examples. Two causes, both fixed here: - **The builder never gave the game the folder** (`build_core::sandbox_windows::gather`). The builder plans the confined game's grants from its command line and environment. It skipped the test mode's folder (`--mod-tests <folder>`, else `HOS_MOD_TESTS`): the old game-side sandbox planned after the test mode's start had set `LONGSHOT_DEV_MODS`, and the builder plans before. The folder is now read first among the development mods. - **The game read it too early** (`host/hos_main.c`). The confined game ran the test mode's start (`game_start_args`) before `hos_sandbox_start` installs the file layer that reaches the builder. It could read neither the folder's `mod.toml` nor its list, took it for an empty folder of mods, and set `LONGSHOT_DEV_MODS` empty. Inside the container the start now runs after the sandbox's start; outside it, and with the sandbox off, it runs first as before. - **`docs/dev/reference/sandbox.md`**: the file layer's section says so. `mod run <folder>` was not affected: only the test mode sets `LONGSHOT_DEV_MODS` itself. Neither is the fake game's `mod test`, which starts no game. **On mod-api, to see it:** Windows, sandboxed (the default): `dev.py game-tests` of a mod in a folder outside the mods folder. The game's log has no "allowed read ... (a development mod)" line, and ends "no mod to test was found". Read first: `gather.rs` (`args_of`, the development mods), then the Windows start in `host/hos_main.c`. ## Testing **Tested:** Windows 11, NVIDIA GeForce RTX 4060 Laptop GPU, driver 621.24. - `build-core` `sandbox_windows::gather::test_mode_folder` (new): `plan_for` on a game in a temporary folder, with the test folder named by `HOS_MOD_TESTS` and by `--mod-tests`. On mod-api it fails with "the test mode's folder by HOS_MOD_TESTS (...) read: roots [...]". Here it passes, with the rest of `sandbox_windows` (28). - `tests/test_sandbox_test_mode_start.py` (new): the Windows start of `hos_main.c`'s `main`, cut from the source, with stand-ins that record the order. On mod-api it fails with "FAIL (inside the container): args_order > sandbox_order". Here it passes; with the container's later call removed, it fails with "args_calls == 1". - **In the game:** `dev.py game-tests` of a probe mod in `test-mods\nav-probe` (outside the mods folder), sandboxed, headless, with the builder confining the game. The branch was merged locally with #2726 (which a sandboxed start with a profile needs) and #2745 (the probe's call); that merge was not pushed. The log says "allowed read ...\test-mods\nav-probe (a development mod), served by the builder", the mod starts, and its test passes: 1 passed, exit 0. **Still to test:** - @Beanstalk: Linux, `dev.py game-tests` of a mod outside the mods folder (Linux's sandbox is unchanged here). <details><summary>The 118 checks that fail on Windows on mod-api (`eaf4a48b9`) too</summary> `test_antilag.py`, `test_astc_decoder_gpu.py`, `test_async_safe_frees.py`, `test_audio_output_devices.py`, `test_audio_source_load.py`, `test_auto_handheld.py`, `test_bc_copy_layer_pitch.py`, `test_builder_channel.py`, `test_builtin_compute_unoptimized.py`, `test_capture_dimensions.py`, `test_capture_readback_visibility.py`, `test_capture_resources.py`, `test_coopmat_probe_failures.py`, `test_crash_record.py`, `test_desc_counts.py`, `test_dev_ab.py`, `test_dev_build.py`, `test_dev_migrate.py`, `test_dev_packs.py`, `test_dev_update.py`, `test_device_policy.py`, `test_draw_binds.py`, `test_draw_stream_visibility.py`, `test_drs.py`, `test_dummy_views.py`, `test_dump_readback.py`, `test_fallback_pipeline_state.py`, `test_float_add_subgroup.py`, `test_framegen_resources.py`, `test_framelog_sink.py`, `test_fsr3_release_frees.py`, `test_fsr3fi_hud_mask.py`, `test_fsr4_bind_dispatch.py`, `test_fsr4_tune.py`, `test_fsr_image_retirement.py`, `test_fsr_uniform_ownership.py`, `test_game_menu_mouse_buttons.py`, `test_gcn_mesh_shared_warp.py`, `test_image_view_retry.py`, `test_import_buffer_binding.py`, `test_import_log.py`, `test_import_reach.py`, `test_inline_write_order.py`, `test_input_background.py`, `test_input_movie.py`, `test_job_queue.py`, `test_lifter.py`, `test_linux_pressure.py`, `test_loaded_modules_drop.py`, `test_longshot_builder.py`, `test_longshot_ctl.py`, `test_lost_wait_said.py`, `test_low_vram_texture_mips.py`, `test_menu_hooks.py`, `test_mesh_fallback_strict_fmul.py`, `test_mesh_first_types.py`, `test_pads_after_menu.py`, `test_parity_gates.py`, `test_pass_barrier.py`, `test_pass_hazard.py`, `test_pcache_header_read.py`, `test_pipeline_key_values.py`, `test_pipeline_state_portable.py`, `test_pipeline_states.py`, `test_present_probe.py`, `test_present_queue_default.py`, `test_present_sites.py`, `test_present_source_crop.py`, `test_program_answer_domains.py`, `test_program_cache_cleanup.py`, `test_program_cache_one_variant.py`, `test_push_state.py`, `test_queue_priority.py`, `test_recorder_own_idle.py`, `test_recorder_parts.py`, `test_recorder_sync.py`, `test_recording_admission.py`, `test_replay_write_order.py`, `test_reshade_fx.py`, `test_run_all_mingw.py`, `test_same_draw.py`, `test_same_dyn.py`, `test_sampler_admission.py`, `test_seed_reader.py`, `test_shader_store.py`, `test_sparse_bind_failure.py`, `test_sparse_bind_ranges.py`, `test_split_ub_flush.py`, `test_staging_burst.py`, `test_taau_typed_dispatch.py`, `test_table_track.py`, `test_target_layouts.py`, `test_target_reuse_memory.py`, `test_temporal_present_bandwidth.py`, `test_texel_buffer_ownership.py`, `test_texture_init_barrier.py`, `test_texture_staging_publication.py`, `test_ub_snapshot_default.py`, `test_ub_update_batch.py`, `test_ui_record.py`, `test_ui_texture_upload.py`, `test_vcore_video_acquire.py`, `test_vendor_fixes.py`, `test_vertex_bind.py`, `test_vertex_bind_range.py`, `test_video_catchup.py`, `test_video_hold_early.py`, `test_video_input_limit.py`, `test_vk_occlusion_queries.py`, `test_vulkan_clear_mip.py`, `test_vulkan_copy_span.py`, `test_vulkan_copy_span_gpu_compile.py`, `test_wb_diff_observations_gpu.py`, `test_widen_alpha.py`, `test_windows_on_linux.py`, `test_windows_stop.py`, `test_wmma16_zero_c_kchain.py`, `test_xinput_thread.py` </details> ## Measurements Nothing to measure: the start's order and one more read grant. ## Risks - **One more folder read by the confined game:** the one the test mode was given, as a development mod's. A folder at or above the player's own is refused, as any grant is. - **Inside the container, `--mod-dev` and the test mode's results folder are set after the sandbox's start.** Neither is read before it. - A revert is enough. ## Checklist ### Ready for review - [x] One topic, on current `mod-api`; 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): Windows, with #2726 and #2745 merged: 669 passed, 122 failed, 47 skipped. The same 118 fail on mod-api; `test_invalidate_vcore`, `test_mesh_args_cleanup` and `test_present_semaphores` pass on rerun (flaky under the full run); `test_sandbox_save_dir_early` failed only with #2726 and this merged, fixed in #2726 (`952b4ec3c`). - [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] A check under `tests/` that reads changed source is updated, not weakened. - [x] Host code builds on Windows (llvm-mingw) and Linux, with UTF-8 paths. <!-- Windows: built (the in-game run). Linux: not built here; the C change is inside #ifdef _WIN32 and the Rust is cfg(windows) --> - [x] Docs updated. - [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. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
On Windows the confined game (the same program started again in the AppContainer) runs
game_start_args before hos_sandbox_start installs the broker's file layer, so the test mode
sees its folder as empty and sets LONGSHOT_DEV_MODS empty over the outer process's. The check
compiles the Windows start of hos_main.c's main, cut from the source, with stand-ins that
record the order. It fails on mod-api: "inside the container: args_order > sandbox_order".

Co-Authored-By: Claude Opus 5.5 <[email protected]>
fix(sandbox): the test mode's start reads its folder in the container after the broker's file layer is in
All checks were successful
PR description / Title and description (pull_request_target) Successful in 7s
96f2bce6ce
On Windows the confined game ran game_start_args before hos_sandbox_start, which installs the
broker's file layer inside the container. The test mode's start then could not read the folder
it tests (outside the folders the container reaches by itself), took it for an empty folder of
mods, and set LONGSHOT_DEV_MODS empty over the outer process's: "no mod to test was found" for
the in-game test mode (`Longshot.exe mod test --game <folder>`, dev.py game-tests) of a mod outside the mods folder, though
the sandbox had granted the folder. Inside the container the start now runs after the sandbox's
start; outside it, and with the sandbox off, it runs first as before (the sandbox grants the
folders it sets).

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

Tested in game: Windows 11, RTX 4060 Laptop, dev.py game-tests sandboxed of docs/modding/examples/debug-hitboxes from the repository on this head (with #2726 and #2742 merged locally): LONGSHOT_DEV_MODS reaches the confined game, the mod starts and its test file runs (its tests are the fake game's: FakeOnlyError). Before, a mod outside the mods folder: 'no mod to test was found'.

Tested in game: Windows 11, RTX 4060 Laptop, dev.py game-tests sandboxed of docs/modding/examples/debug-hitboxes from the repository on this head (with #2726 and #2742 merged locally): LONGSHOT_DEV_MODS reaches the confined game, the mod starts and its test file runs (its tests are the fake game's: FakeOnlyError). Before, a mod outside the mods folder: 'no mod to test was found'.
Owner
@review
BeanBot left a comment

Recommendation: Request changes. The change fixes the reported single-mod case, but a test folder containing multiple mods still appears empty inside the container because its parent folder is not granted to the broker.

The confined Windows process now starts test mode after installing the broker file layer. That lets a directly supplied development mod be found, but the same approach does not yet support a folder of mods outside the container’s existing grants.

Blocking (1): must change before merging.

  1. L1 host/hos_main.c:1083: The delayed start cannot enumerate a test folder containing mods when that folder itself is outside the container’s grants. (more on the line) Do: Grant the test folder enough access to enumerate it, or retain the outer process’s resolved mod list inside the container, and add a regression test for a folder of mods outside existing grants.

@fix can do L1.

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

Does it help: Yes for the reported single-mod case: the author reports that the development mod loaded and its test file ran on Windows 11 with an RTX 4060 Laptop GPU, with #2726 and #2742 merged locally. The folder-of-mods case remains broken.

Other systems: Linux retains its existing start order. Windows sandbox-off runs retain the early call. The changed Windows path also applies to an existing AppContainer and depends on its broker or native folder access; no separate run of that setup was reported.

Switches: None added, changed, or removed.

Reviewed: 96f2bce6ce against 5c1cd9f5b1: Read AGENTS.md, CONTRIBUTING.md, the pull request template, relevant standards, the complete diff, commit messages, the new test, the changed startup region and its sandbox, broker, options and test-mode dependencies. Skimmed the sandbox reference and the rest of hos_main.c; no generated files or translations changed. docs/review-checklist.md and the sibling Tooling checkout were absent.; nothing run (a code review).

Checked and fine:

  • Both commits include AI-assistance trailers.
  • The new order test checks that the call occurs once on each modeled path and would fail if the delayed call were removed.
  • No game-derived files, generated files, renderer API changes, or third-party changes appear in the diff.

Testing: No commands that build, run tests, or execute project code were run during review. The author reports a game-free order test and a Windows game run; Linux checks and the stated sibling changes remain outstanding.

Overlaps and merge order: The author reports that the sandboxed game run required locally merged #2726 and #2742; their merge order and current status are not available in the supplied review data.


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

**Recommendation: Request changes.** The change fixes the reported single-mod case, but a test folder containing multiple mods still appears empty inside the container because its parent folder is not granted to the broker. The confined Windows process now starts test mode after installing the broker file layer. That lets a directly supplied development mod be found, but the same approach does not yet support a folder of mods outside the container’s existing grants. **Blocking (1)**: must change before merging. 1. **L1** `host/hos_main.c:1083`: The delayed start cannot enumerate a test folder containing mods when that folder itself is outside the container’s grants. (more on the line) **Do:** Grant the test folder enough access to enumerate it, or retain the outer process’s resolved mod list inside the container, and add a regression test for a folder of mods outside existing grants. `@fix` can do L1. <details> <summary>More: does it help, other systems, switches, what was read</summary> **Does it help:** Yes for the reported single-mod case: the author reports that the development mod loaded and its test file ran on Windows 11 with an RTX 4060 Laptop GPU, with #2726 and #2742 merged locally. The folder-of-mods case remains broken. **Other systems:** Linux retains its existing start order. Windows sandbox-off runs retain the early call. The changed Windows path also applies to an existing AppContainer and depends on its broker or native folder access; no separate run of that setup was reported. **Switches:** None added, changed, or removed. **Reviewed:** 96f2bce6ceb5 against 5c1cd9f5b1ac: Read AGENTS.md, CONTRIBUTING.md, the pull request template, relevant standards, the complete diff, commit messages, the new test, the changed startup region and its sandbox, broker, options and test-mode dependencies. Skimmed the sandbox reference and the rest of hos_main.c; no generated files or translations changed. docs/review-checklist.md and the sibling Tooling checkout were absent.; nothing run (a code review). **Checked and fine:** - Both commits include AI-assistance trailers. - The new order test checks that the call occurs once on each modeled path and would fail if the delayed call were removed. - No game-derived files, generated files, renderer API changes, or third-party changes appear in the diff. **Testing:** No commands that build, run tests, or execute project code were run during review. The author reports a game-free order test and a Windows game run; Linux checks and the stated sibling changes remain outstanding. **Overlaps and merge order:** The author reports that the sandboxed game run required locally merged #2726 and #2742; their merge order and current status are not available in the supplied review data. </details> --- <sub>Automated code review by BeanBot (gpt-6.1-terra), asked for by HumanBean. Nothing was run; a maintainer decides.</sub>
host/hos_main.c Outdated
@ -1077,6 +1080,10 @@ static int game_main(int argc, char **argv) {
const int sandbox = hos_sandbox_start(argc, argv);
if (sandbox < 0) return 1;
if (sandbox > 0) return hos_sandbox_exit_code();
if (hos_sandbox_in_container()) { /* (the test mode's start, its folder reached through the file layer now) */
Member

L1 (blocking): The delayed start cannot enumerate a test folder containing mods when that folder itself is outside the container’s grants.

When: For a folder such as C:\suite containing mod subfolders, the outer start sets LONGSHOT_DEV_MODS to the individual subfolders. The sandbox plan grants those subfolders, not C:\suite; the inner start then calls read_dir on C:\suite, the broker denies its list request, and the empty result overwrites LONGSHOT_DEV_MODS, so no mod is tested.

Do: Grant the test folder enough access to enumerate it, or retain the outer process’s resolved mod list inside the container, and add a regression test for a folder of mods outside existing grants.

**L1** (blocking): The delayed start cannot enumerate a test folder containing mods when that folder itself is outside the container’s grants. *When:* For a folder such as C:\suite containing mod subfolders, the outer start sets LONGSHOT_DEV_MODS to the individual subfolders. The sandbox plan grants those subfolders, not C:\suite; the inner start then calls read_dir on C:\suite, the broker denies its list request, and the empty result overwrites LONGSHOT_DEV_MODS, so no mod is tested. **Do:** Grant the test folder enough access to enumerate it, or retain the outer process’s resolved mod list inside the container, and add a regression test for a folder of mods outside existing grants.
Author
Contributor

Rebased onto the squashed mod-api (eaf4a48b9) and adapted to the builder-confined start: the bug is still there (game_start_args still runs before hos_sandbox_start), and the fix keeps the test mode's start inside the container after it. The test's stand-ins follow the new start (started_by_builder, a game the builder did not confine ends the start): it fails on the new mod-api for the bug's reason and passes here. An in-game run on the new mod-api is next.

Rebased onto the squashed mod-api (`eaf4a48b9`) and adapted to the builder-confined start: the bug is still there (game_start_args still runs before hos_sandbox_start), and the fix keeps the test mode's start inside the container after it. The test's stand-ins follow the new start (started_by_builder, a game the builder did not confine ends the start): it fails on the new mod-api for the bug's reason and passes here. An in-game run on the new mod-api is next.
ChloeNow force-pushed fix/sandbox-dev-mods-start from 96f2bce6ce
All checks were successful
PR description / Title and description (pull_request_target) Successful in 7s
to c0973f8945
All checks were successful
PR description / Title and description (pull_request_target) Successful in 19s
2026-11-29 21:48:31 +00:00
Compare
The builder now starts the game confined, planning its grants from the game's command line and
environment. The test mode's folder (--mod-tests <folder>, or HOS_MOD_TESTS) is where the game reads
the mod to test, but the plan skips it: a test run of a mod outside the mods folder (dev.py
game-tests of a repository example, or of a folder of one's own) finds "no mod to test". The check
runs plan_for on a game in a temporary folder with the folder named each way. Fails on mod-api:
"the test mode's folder by HOS_MOD_TESTS (...) read: roots [...]".

Co-Authored-By: Claude Opus 5.5 <[email protected]>
fix(sandbox): the builder's Windows plan gives the confined game the test mode's folder, read
Some checks failed
PR description / Title and description (pull_request_target) Has been cancelled
4af183ddc6
The test mode's folder (--mod-tests <folder>, else HOS_MOD_TESTS) is read by the confined game
itself (its start, longshot-game's mod_tests.rs: the mod in it, or the mods of a folder of them).
The old game-side sandbox planned its grants after that start had set LONGSHOT_DEV_MODS; the
builder plans them from the game's command line and environment, where LONGSHOT_DEV_MODS is not
set yet, and skipped the folder. It is now read first among the development mods (four at most).

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

One more fix here for the builder design, test first: the builder plans the confined game's grants from its command line and environment, and skipped the test mode's folder (--mod-tests <folder> / HOS_MOD_TESTS), so a test run of a mod outside the mods folder found "no mod to test". The builder's Windows plan now reads that folder first among the development mods (gather.rs; the test fails on mod-api, passes here). In game (Windows 11, sandboxed, with #2726 and #2745): test-mods av-probe served by the builder ("allowed read ... (a development mod)"), found and run: 1 passed, exit 0.

One more fix here for the builder design, test first: the builder plans the confined game's grants from its command line and environment, and skipped the test mode's folder (`--mod-tests <folder>` / `HOS_MOD_TESTS`), so a test run of a mod outside the mods folder found "no mod to test". The builder's Windows plan now reads that folder first among the development mods (`gather.rs`; the test fails on mod-api, passes here). In game (Windows 11, sandboxed, with #2726 and #2745): `test-mods av-probe` served by the builder ("allowed read ... (a development mod)"), found and run: 1 passed, exit 0.
ChloeNow changed title from WIP: fix(sandbox): the test mode's start reads its folder in the container after the broker's file layer is in to WIP: fix(sandbox): Windows: a sandboxed test run finds a mod outside the mods folder 2026-11-30 00:17:46 +00:00
ChloeNow changed title from WIP: fix(sandbox): Windows: a sandboxed test run finds a mod outside the mods folder to fix(sandbox): Windows: a sandboxed test run finds a mod outside the mods folder 2026-11-30 00:22:23 +00:00
Some checks failed
PR description / Title and description (pull_request_target) Has been cancelled
This pull request has changes conflicting with the target branch.
  • builder/crates/build-compile/src/packages.rs
  • builder/crates/build-compile/src/toolchain.rs
  • builder/crates/build-core/src/game_layout.rs
  • builder/crates/build-core/src/sandbox_linux.rs
  • builder/crates/build-core/src/sandbox_windows/gather.rs
  • builder/crates/build-core/src/settings_folder.rs
  • builder/crates/build-driver/src/build.rs
  • builder/crates/build-driver/src/folder.rs
  • builder/crates/build-driver/src/shaders.rs
  • builder/crates/build-driver/src/sources.rs
  • builder/crates/build-driver/src/verify.rs
  • builder/crates/synthetic-game/game/host/synthetic_host.c
  • builder/crates/synthetic-game/tests/end_to_end.rs
  • docs/dev/developing.md
  • docs/dev/reference/architecture.md
  • docs/dev/reference/build-events.md
  • docs/dev/reference/build.md
  • docs/dev/reference/control-bridge.md
  • docs/dev/reference/profiles.md
  • docs/dev/reference/sandbox.md
  • docs/dev/reference/switches.md
  • docs/dev/reference/upscalers.md
  • docs/dev/setup.md
  • docs/modding/content.md
  • docs/modding/permissions.md
  • docs/modding/reference.md
  • docs/modding/scripting.md
  • docs/modding/settings.md
  • docs/user/advanced.md
  • docs/user/common-issues.md
  • docs/user/graphics-and-controls.md
  • docs/user/images/guide/README.md
  • docs/user/requirements.md
  • docs/user/updates-and-saves.md
  • game/crates/api/src/services/renderer_lines.rs
  • game/crates/api/src/services/settings_host.rs
  • game/crates/api/src/settings/decl.rs
  • game/crates/api/src/settings/mod.rs
  • game/crates/cloth/build.rs
  • game/crates/game-core/src/debug.rs
  • game/crates/game-core/src/travel.rs
  • game/crates/game-core/src/video.rs
  • game/crates/host-sys/src/settings_abi.rs
  • game/crates/host-sys/src/settings_link.rs
  • game/crates/longshot-game/src/options_store.rs
  • game/crates/longshot-game/src/perf.rs
  • game/crates/longshot-game/src/settings_file.rs
  • game/crates/longshot-game/src/settings_file/tests.rs
  • game/crates/longshot-game/src/settings_now.rs
  • game/crates/longshot-game/tests/menu_places.tsv
  • game/crates/schema/src/emit/settings_abi.rs
  • game/game.h
  • game/modapi/schema/types.toml
  • game/mods/controls/mod.toml
  • game/mods/developer/mod.toml
  • game/mods/gameplay/mod.toml
  • game/mods/graphics/mod.toml
  • game/mods/grass/Cargo.toml
  • game/mods/grass/README.md
  • game/mods/grass/mod.toml
  • game/mods/grass/src/lib.rs
  • game/mods/grass/src/tests.rs
  • game/mods/grass/test/grass.test.ts
  • game/mods/interface/mod.toml
  • game/mods/menu/src/credits.ts
  • game/mods/menu/src/layout.ts
  • game/mods/menu/strings/de.json
  • game/mods/menu/strings/es-419.json
  • game/mods/menu/strings/es.json
  • game/mods/menu/strings/fr.json
  • game/mods/menu/strings/it.json
  • game/mods/menu/strings/ja.json
  • game/mods/menu/strings/ko.json
  • game/mods/menu/strings/nl.json
  • game/mods/menu/strings/pl.json
  • game/mods/menu/strings/pt-BR.json
  • game/mods/menu/strings/ru.json
  • game/mods/menu/strings/zh-Hans.json
  • game/mods/menu/strings/zh-Hant.json
  • game/mods/menu/test/text-keys.test.ts
  • game/settings_abi.h
  • game/settings_caps.h
  • gpu/vk/menu/framegen.cpp
  • gpu/vk/menu/framegen.h
  • gpu/vk/menu/language.cpp
  • gpu/vk/menu/sim_turf.cpp
  • gpu/vk/menu/sim_turf.h
  • gpu/vk/menu/threads.cpp
  • gpu/vk/renderer_guard.h
  • gpu/vk/switches.def
  • gpu/vk/vk_api.h
  • gpu/vk/vk_dlssg.cpp
  • gpu/vk/vk_draw.cpp
  • gpu/vk/vk_framegen.cpp
  • gpu/vk/vk_menu.cpp
  • gpu/vk/vk_menu.h
  • gpu/vk/vk_menu_i18n.cpp
  • gpu/vk/vk_shader.cpp
  • gpu/vk/vk_ui.cpp
  • host/control.c
  • host/control.h
  • host/display.c
  • host/hos_main.c
  • host/nn_applet.c
  • host/nn_hid.c
  • host/nn_vi.c
  • host/options_path.c
  • host/posix/display_sdl.c
  • host/rx_backend.c
  • scripts/devtools/ab.py
  • scripts/shaders.py
  • scripts/sl_sdk.py
  • tests/test_device_policy.py
  • tests/test_fps_overlay_order.py
  • tests/test_frame_rate_cap_30.py
  • tests/test_framegen_by_row.py
  • tests/test_hos_ab.py
  • tests/test_key_press_queue.py
  • tests/test_menu_ini_keys.py
  • tests/test_menu_slider_ends.py
  • tests/test_pipeline_state_counts.py
  • tests/test_program_hooks.py
  • tests/test_stick_dead_zone.py
  • tests/test_temporal_present_bandwidth.py
  • tests/test_ui_renderer.py
  • tests/upscale_independent_test.cpp
  • website/public/schemas/mod.schema.json
View command line instructions

Manual merge helper

Use this merge commit message when completing the merge manually.

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u 'fix/sandbox-dev-mods-start:ChloeNow-fix/sandbox-dev-mods-start'
git switch 'ChloeNow-fix/sandbox-dev-mods-start'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'mod-api'
git merge --no-ff 'ChloeNow-fix/sandbox-dev-mods-start'
git switch 'ChloeNow-fix/sandbox-dev-mods-start'
git rebase 'mod-api'
git switch 'mod-api'
git merge --ff-only 'ChloeNow-fix/sandbox-dev-mods-start'
git switch 'ChloeNow-fix/sandbox-dev-mods-start'
git rebase 'mod-api'
git switch 'mod-api'
git merge --no-ff 'ChloeNow-fix/sandbox-dev-mods-start'
git switch 'mod-api'
git merge --squash 'ChloeNow-fix/sandbox-dev-mods-start'
git switch 'mod-api'
git merge --ff-only 'ChloeNow-fix/sandbox-dev-mods-start'
git switch 'mod-api'
git merge 'ChloeNow-fix/sandbox-dev-mods-start'
git push origin 'mod-api'
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!2747
No description provided.