WIP: test: the checks mod-api fails only on Windows pass there: their stand-ins follow the branch's host code #2826

Draft
llun wants to merge 3 commits from llun/Longshot:fix/mod-api-win-checks into mod-api
Member

Summary

For #2822 (into mod-api). Seven game-free checks fail on mod-api on Windows and pass on main at the merge base. Their stand-ins and fixtures don't yet follow what the branch changed in the host code, or they assume POSIX. Tests only, no product code:

Check On mod-api, Windows Here
test_audio_output_devices ld.lld: error: undefined symbol: game_setting_line (options_path.h's hos_options_line now asks the game) a stand-in game_setting_line that reads the test's longshot_options.ini line, as the file did
test_audio_source_load 'sandbox_win_plan.h' file not found (romfs_index.c's Windows side) sandbox_win_plan.h and sandbox_plan.h copied in with the other host files
test_windows_stop implicit declaration of function 'hos_sandbox_in_container' a stand-in: not confined
test_present_sites call to undeclared function 'unsetenv' _putenv("NAME=") on Windows, in the fixture
test_dev_packs packs: through the builder beside it, when it has one (the fixture writes longshot-builder, which Windows' BUILDER_NAMES never matches) the name from BUILDER_NAMES (longshot-builder.exe on Windows)
test_longshot_ctl KeyError: 'game_path'; shot_stage returns None ShotStaging's two staging tests skipped on Windows, as shot_stage documents (a named pipe has no folder: nothing is staged); its third runs there and checks the client takes nothing the game names; the session's shot is checked without the staged path there
test_menu_hooks the dlss lock by key is not lock_dlss: the same line at two addresses compared as text. The line is made again at each call, and Windows' heap gives the new copy another address

Testing

Tested: Windows 11 (llvm-mingw clang, MSYS2's tools), mise run test -- <check> for each of the seven: each fails on mod-api @ eaf4a48b as the table says, and passes here. They also pass on Linux (WSL Ubuntu 24.04, tests/run_all.py --strict). mise run lint passes.

Two sandbox checks added since. windows_stop's confined case fails with the rule's line taken out of host/hos_relaunch.c and passes with it in. ShotStaging's staging tests are Windows-less and its third runs on Windows, where the player's file the game names elsewhere is neither read nor removed. Both pass on Windows and Linux.

Still to test: None.

Measurements

Nothing to measure: tests only.

Risks

The sandbox: tests only, and the sandbox's checks come out stronger. windows_stop now checks the AppContainer's rule that a confined game the builder didn't restart only exits (it starts no process); with that rule's line taken out of host/hos_relaunch.c, the check fails. longshot_ctl's shot check runs on Windows too, for what holds there: the dev tool reads, moves and removes nothing the game names. The audio_source_load fixture copies the sandbox's plan header as it is.

None for players: only tests/ changes, and no check is weakened. Each still checks what it checked on Linux, and on Windows what it can. A revert is enough.

Checklist

Ready for review

  • One topic, on current mod-api (#2822's head); the title is a Conventional Commit.
  • Tested on my own PC, as Testing says (tests only: no game run).
  • mise run test passes (any failure that also fails on main is named). (These seven pass. test_sampler_admission's concurrent cases also fail on main on this PC, as a flake. Other failures on mod-api also fail on main, or need an MSVC host build, which is not fixed here.)
  • 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 check under tests/ that reads changed source is updated, not weakened.
  • 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

## Summary For [#2822](https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/2822) (into `mod-api`). Seven game-free checks fail on `mod-api` on Windows and pass on `main` at the merge base. Their stand-ins and fixtures don't yet follow what the branch changed in the host code, or they assume POSIX. Tests only, no product code: | Check | On `mod-api`, Windows | Here | |---|---|---| | `test_audio_output_devices` | `ld.lld: error: undefined symbol: game_setting_line` (`options_path.h`'s `hos_options_line` now asks the game) | a stand-in `game_setting_line` that reads the test's `longshot_options.ini` line, as the file did | | `test_audio_source_load` | `'sandbox_win_plan.h' file not found` (`romfs_index.c`'s Windows side) | `sandbox_win_plan.h` and `sandbox_plan.h` copied in with the other host files | | `test_windows_stop` | `implicit declaration of function 'hos_sandbox_in_container'` | a stand-in: not confined | | `test_present_sites` | `call to undeclared function 'unsetenv'` | `_putenv("NAME=")` on Windows, in the fixture | | `test_dev_packs` | `packs: through the builder beside it, when it has one` (the fixture writes `longshot-builder`, which Windows' `BUILDER_NAMES` never matches) | the name from `BUILDER_NAMES` (`longshot-builder.exe` on Windows) | | `test_longshot_ctl` | `KeyError: 'game_path'`; `shot_stage` returns `None` | `ShotStaging`'s two staging tests skipped on Windows, as `shot_stage` documents (a named pipe has no folder: nothing is staged); its third runs there and checks the client takes nothing the game names; the session's shot is checked without the staged path there | | `test_menu_hooks` | `the dlss lock by key is not lock_dlss`: the same line at two addresses | compared as text. The line is made again at each call, and Windows' heap gives the new copy another address | ## Testing **Tested:** Windows 11 (llvm-mingw clang, MSYS2's tools), `mise run test -- <check>` for each of the seven: each fails on `mod-api` @ eaf4a48b as the table says, and passes here. They also pass on Linux (WSL Ubuntu 24.04, `tests/run_all.py --strict`). `mise run lint` passes. Two sandbox checks added since. `windows_stop`'s confined case fails with the rule's line taken out of `host/hos_relaunch.c` and passes with it in. `ShotStaging`'s staging tests are Windows-less and its third runs on Windows, where the player's file the game names elsewhere is neither read nor removed. Both pass on Windows and Linux. **Still to test:** None. ## Measurements Nothing to measure: tests only. ## Risks **The sandbox:** tests only, and the sandbox's checks come out stronger. `windows_stop` now checks the AppContainer's rule that a confined game the builder didn't restart only exits (it starts no process); with that rule's line taken out of `host/hos_relaunch.c`, the check fails. `longshot_ctl`'s shot check runs on Windows too, for what holds there: the dev tool reads, moves and removes nothing the game names. The `audio_source_load` fixture copies the sandbox's plan header as it is. None for players: only `tests/` changes, and no check is weakened. Each still checks what it checked on Linux, and on Windows what it can. A revert is enough. ## Checklist ### Ready for review - [x] One topic, on current `mod-api` (#2822's head); the title is a Conventional Commit. - [x] Tested on my own PC, as Testing says (tests only: no game run). - [ ] `mise run test` passes (any failure that also fails on `main` is named). (These seven pass. `test_sampler_admission`'s concurrent cases also fail on `main` on this PC, as a flake. Other failures on `mod-api` also fail on `main`, or need an MSVC host build, which is not fixed here.) - [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 check under `tests/` that reads changed source is updated, not weakened. - [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)
feat(game)!: the game side and the whole mod API in Rust, with system mods and the sandbox on by default
Some checks failed
CI / Third-party parts and guide screenshots (pull_request) Successful in 28s
PR description / Title and description (pull_request_target) Successful in 47s
CI / What the change needs (pull_request) Successful in 2m21s
CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request) Successful in 1m48s
CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request) Has been cancelled
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Has been cancelled
CI / Renderer build check (Windows, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Renderer build check (Linux, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 1/2) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 2/2) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled
9e6b9c5782
The game side (between the C host and the lifted game) and the mod API move from C to Rust (game/crates), every game
setting and feature becomes a system mod (game/mods, Rust or TypeScript), and longshot-builder becomes the game's only
entrypoint, its sandboxer (Landlock and seccomp on Linux, an AppContainer on Windows) and its broker over one framed
channel. Native C mods and wasm are removed. The Insert menu is the menu system mod. One squashed commit of the former
mod-api branch (#2434).

Co-authored-by: Chloe Christley <[email protected]>
Co-authored-by: Jer9 <[email protected]>
Co-authored-by: snaildev99 <[email protected]>
Co-authored-by: SqueezyLemonade <[email protected]>
Co-authored-by: flashman4 <[email protected]>
Co-authored-by: dyst <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
test: the checks mod-api fails only on Windows pass there: their stand-ins follow the branch's host code
All checks were successful
PR description / Title and description (pull_request_target) Successful in 35s
501c6cab0d
Each failed on Windows (mise run test, llvm-mingw clang, Windows 11) and passed on main at the merge base; each passes
here on Windows and on Linux:
- audio_output_devices: options_path.h's hos_options_line now asks the game's game_setting_line: a stand-in that
  reads the test's longshot_options.ini line, as the file did (was: ld.lld undefined symbol game_setting_line);
- audio_source_load: romfs_index.c's Windows side includes sandbox_win_plan.h (and sandbox_plan.h): both copied in
  (was: 'sandbox_win_plan.h' file not found);
- windows_stop: hos_window_closed_exit's Windows side asks hos_sandbox_in_container: a stand-in, not confined (was:
  implicit declaration of hos_sandbox_in_container);
- present_sites: the fixture's unsetenv, which Windows' C runtime lacks, is _putenv("NAME=") there (was: call to
  undeclared function 'unsetenv');
- dev_packs: the builder beside an older runtime is named as BUILDER_NAMES names it, longshot-builder.exe on Windows
  (was: "packs: through the builder beside it, when it has one");
- longshot_ctl: ShotStaging skipped on Windows, where a named pipe has no folder and nothing is staged (shot_stage is
  None there by design), and the session's shot checked without the staged path there (was: KeyError 'game_path',
  shot_stage None);
- menu_hooks: the dlss lock's line compared as text: it is made again at each call, and Windows' heap gives the new
  one another address than the first (was: "the dlss lock by key is not lock_dlss", same text at two addresses).

Assisted-by: Claude Code
Co-Authored-By: Claude Opus 5.5 <[email protected]>
llun force-pushed fix/mod-api-win-checks from 501c6cab0d
All checks were successful
PR description / Title and description (pull_request_target) Successful in 35s
to 5642e46e59
All checks were successful
PR description / Title and description (pull_request_target) Successful in 11s
2026-11-29 22:15:18 +00:00
Compare
Author
Member

Rebased onto mod-api's new squash eaf4a48b (the same tree as 9e6b9c57, which this branch was on): the diff is this PR's own commits again. The checks and runs above hold as they are (the tree under them is unchanged); the description's commits are the new ones.

Rebased onto mod-api's new squash eaf4a48b (the same tree as 9e6b9c57, which this branch was on): the diff is this PR's own commits again. The checks and runs above hold as they are (the tree under them is unchanged); the description's commits are the new ones.
test: on Windows the shot check still holds the client to taking nothing the game names
All checks were successful
PR description / Title and description (pull_request_target) Successful in 7s
7684c6d413
ShotStaging was skipped on Windows as a whole. Only its two staging tests are Windows-less now (a named pipe has no
folder: nothing is staged, so nothing is moved, and no link can be left to follow); the third runs there too and checks
what holds on Windows: the game is asked to write the path itself, and the player's file the game names elsewhere is
neither read into the shot nor removed. Linux checks it as before.

Assisted-by: Claude Code
Co-Authored-By: Claude Opus 5.5 <[email protected]>
test: windows_stop checks a confined game the builder did not restart only exits, starting no process
All checks were successful
PR description / Title and description (pull_request_target) Successful in 8s
acc20f25ee
The close chain's stand-in for hos_sandbox_in_container answered "not confined" alone, so the check never reached the
Windows rule beside it in hos_window_closed_exit: a confined game starts no process (Windows refuses it one), and a
restart the builder did not take only exits. A case with the game in the AppContainer now: relaunch asked, the builder
not taking it: it exits, never started again. With that rule's line taken out of host/hos_relaunch.c the check fails.

Assisted-by: Claude Code
Co-Authored-By: Claude Opus 5.5 <[email protected]>
llun force-pushed fix/mod-api-win-checks from acc20f25ee
All checks were successful
PR description / Title and description (pull_request_target) Successful in 8s
to 8c26aa677c
All checks were successful
PR description / Title and description (pull_request_target) Successful in 12s
2026-11-29 23:21:44 +00:00
Compare
Author
Member

Pushed two sandbox checks: windows_stop now checks the AppContainer's rule that a confined game the builder did not restart only exits (it starts no process); the check fails with that rule's line taken out of host/hos_relaunch.c. ShotStaging's two staging tests alone are skipped on Windows; its third runs there and checks the client reads, moves and removes nothing the game names. Both pass on Windows and Linux. Risks says how this stands with the sandbox.

Pushed two sandbox checks: windows_stop now checks the AppContainer's rule that a confined game the builder did not restart only exits (it starts no process); the check fails with that rule's line taken out of host/hos_relaunch.c. ShotStaging's two staging tests alone are skipped on Windows; its third runs there and checks the client reads, moves and removes nothing the game names. Both pass on Windows and Linux. Risks says how this stands with the sandbox.
llun force-pushed fix/mod-api-win-checks from 8c26aa677c
All checks were successful
PR description / Title and description (pull_request_target) Successful in 12s
to 24a7b4cd6a
All checks were successful
PR description / Title and description (pull_request_target) Successful in 18s
2026-11-29 23:27:30 +00:00
Compare
Author
Member

Rebased onto mod-api's newest (4cc50ca1: main's newest merged in), with no conflict; this PR's own checks were run again on the rebased head and pass as before. The merge touched none of this PR's files (#2827: only a comment in host/hos_main.c, far from its change), so the measurements and runs above hold; the After commit is the rebased head.

Rebased onto mod-api's newest (4cc50ca1: main's newest merged in), with no conflict; this PR's own checks were run again on the rebased head and pass as before. The merge touched none of this PR's files (#2827: only a comment in host/hos_main.c, far from its change), so the measurements and runs above hold; the After commit is the rebased head.
llun force-pushed fix/mod-api-win-checks from 24a7b4cd6a
All checks were successful
PR description / Title and description (pull_request_target) Successful in 18s
to 71f97aeb7f
All checks were successful
PR description / Title and description (pull_request_target) Successful in 14s
2026-11-29 23:58:33 +00:00
Compare
Author
Member

Rebased onto mod-api @ 816d2354 (#2837, headless shots of the mods' UI), now 71f97aeb. No conflict, and the diff is the same as before (same git patch-id). #2837 touches none of this PR's files. #2837 changes vk_menu, vk_replay and two checks near this PR's, so on the rebased head I ran test_menu_hooks, test_audio_output_devices, test_present_sites, test_fps_overlay_order and test_ui_renderer on Windows: 5 passed.

Rebased onto `mod-api` @ 816d2354 ([#2837](https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/2837), headless shots of the mods' UI), now 71f97aeb. No conflict, and the diff is the same as before (same `git patch-id`). #2837 touches none of this PR's files. #2837 changes `vk_menu`, `vk_replay` and two checks near this PR's, so on the rebased head I ran `test_menu_hooks`, `test_audio_output_devices`, `test_present_sites`, `test_fps_overlay_order` and `test_ui_renderer` on Windows: 5 passed.
llun force-pushed fix/mod-api-win-checks from 71f97aeb7f
All checks were successful
PR description / Title and description (pull_request_target) Successful in 14s
to f4cd59630d
All checks were successful
PR description / Title and description (pull_request_target) Successful in 1m40s
2026-11-30 00:39:03 +00:00
Compare
llun force-pushed fix/mod-api-win-checks from f4cd59630d
All checks were successful
PR description / Title and description (pull_request_target) Successful in 1m40s
to e68510ff9f
All checks were successful
PR description / Title and description (pull_request_target) Successful in 17s
2026-11-30 00:43:00 +00:00
Compare
Author
Member

Rebased onto mod-api @ c5e5b676: it was re-squashed onto main @ 46291934 (#2833) twice today (cdbb8551, then c5e5b676), which made this PR show main's and the whole mod API's diff. Now e68510ff, the same diff as before (same git patch-id), no conflict. The changes underneath touch none of this PR's files, so its checks still hold.

Rebased onto `mod-api` @ c5e5b676: it was re-squashed onto main @ 46291934 (#2833) twice today (cdbb8551, then c5e5b676), which made this PR show main's and the whole mod API's diff. Now e68510ff, the same diff as before (same `git patch-id`), no conflict. The changes underneath touch none of this PR's files, so its checks still hold.
All checks were successful
PR description / Title and description (pull_request_target) Successful in 17s
This pull request is marked as a work in progress.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u 'fix/mod-api-win-checks:llun-fix/mod-api-win-checks'
git switch 'llun-fix/mod-api-win-checks'

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 'llun-fix/mod-api-win-checks'
git switch 'llun-fix/mod-api-win-checks'
git rebase 'mod-api'
git switch 'mod-api'
git merge --ff-only 'llun-fix/mod-api-win-checks'
git switch 'llun-fix/mod-api-win-checks'
git rebase 'mod-api'
git switch 'mod-api'
git merge --no-ff 'llun-fix/mod-api-win-checks'
git switch 'mod-api'
git merge --squash 'llun-fix/mod-api-win-checks'
git switch 'mod-api'
git merge --ff-only 'llun-fix/mod-api-win-checks'
git switch 'mod-api'
git merge 'llun-fix/mod-api-win-checks'
git push origin 'mod-api'
Sign in to join this conversation.
No reviewers
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
MagicBeanDev/Longshot!2826
No description provided.