feat(launcher): verify prebuilt runtime identity before launch #540

Open
mauroalvare wants to merge 3 commits from upstream-pr/540 into main
mauroalvare commented 2026-11-27 19:05:58 +00:00 (Migrated from github.com)

Imported from LooperSalty/AnyXboxX. Originally posted by mauroalvare on 2026-11-27T19:05:58Z.


Change

OPT-SEC-001. --victory-exe accepts a standalone prebuilt in the CLI and graphical launcher. Set ANYXBOXX_VICTORY_MANIFEST_SHA256 to opt in to checking the adjacent manifest against an independently trusted SHA-256 and checking the executable against that manifest. This detects changes to the selected executable even when its local manifest has been replaced. Schema 1 records the executable SHA-256 and size, full source commit, TomBox gitlink, target, profile, and translator version. Windows sharing guards keep the resolved executable and directories open through process creation. Warm and run recheck the file identity at the spawn boundary. The open directory handles block renames and moves while held. The CLI keeps them through the game process.

Both launchers emit a VICTORY_RUNTIME_IDENTITY= JSON record for a verified prebuilt. The graphical warm marker uses the manifest digest as its build identity. The CLI source-build path continues to select the executable from Cargo's artifact message. PR #315

Updated to ec3b7348 after #545. The verified launcher keeps game_command_as and the Series S arguments from #523. Tested commit 5588a03fb0f5e5f896549b998caa45a03aca01f1.

Verification

  • cargo test --locked --offline -p anyxboxx -p anyxboxx-launcher passed on Windows x64. The CLI library passed 31 tests and the graphical launcher passed 221 tests with one ignored.
  • The launcher built on Windows and passed all 36 cases in tests/test_anyxboxx_run.py, including standalone warm and run and pinned Series S launch. The touched Python test file passed Ruff.
  • GE-Proton11-12 ran the exact head using a synthetic Windows runtime on a Z: path with spaces. Both launch modes completed warm and run. The pinned path forwarded Series S and detected a changed executable before spawning it. Proton smoke test
  • The three pure manifest tests passed on Linux in a harness that compiles the production parser and test module. The full native Linux CLI build is blocked by Win32 dependencies in victory-loader. Manifest tests
  • The initial Windows full-suite run on c5d78244 reported 1534 passed and 437 skipped.

Oracle and test data

The prebuilt tests use inert bytes created in temporary directories and inspect planned commands. They cover a substituted manifest, an executable with altered bytes and unchanged length, malformed or ambiguous metadata, diagnostic profile selection, and attempts to write or rename the guarded file or its parent. The existing source-build tests exercise Cargo artifact selection with a helper compiled from test source.

AI assistance was used to implement and verify the change.

<!-- greyfinch-sync:LooperSalty/AnyXboxX:issue:5531801169 --> Imported from [LooperSalty/AnyXboxX](https://github.com/LooperSalty/AnyXboxX/pull/540). Originally posted by [mauroalvare](https://github.com/mauroalvare) on 2026-11-27T19:05:58Z. --- ## Change OPT-SEC-001. `--victory-exe` accepts a standalone prebuilt in the CLI and graphical launcher. Set `ANYXBOXX_VICTORY_MANIFEST_SHA256` to opt in to checking the adjacent manifest against an independently trusted SHA-256 and checking the executable against that manifest. This detects changes to the selected executable even when its local manifest has been replaced. Schema 1 records the executable SHA-256 and size, full source commit, TomBox gitlink, target, profile, and translator version. Windows sharing guards keep the resolved executable and directories open through process creation. Warm and run recheck the file identity at the spawn boundary. The open directory handles block renames and moves while held. The CLI keeps them through the game process. Both launchers emit a `VICTORY_RUNTIME_IDENTITY=` JSON record for a verified prebuilt. The graphical warm marker uses the manifest digest as its build identity. The CLI source-build path continues to select the executable from Cargo's artifact message. [PR #315](https://github.com/LooperSalty/AnyXboxX/pull/315) Updated to `ec3b7348` after #545. The verified launcher keeps `game_command_as` and the Series S arguments from #523. Tested commit `5588a03fb0f5e5f896549b998caa45a03aca01f1`. ## Verification - `cargo test --locked --offline -p anyxboxx -p anyxboxx-launcher` passed on Windows x64. The CLI library passed 31 tests and the graphical launcher passed 221 tests with one ignored. - The launcher built on Windows and passed all 36 cases in `tests/test_anyxboxx_run.py`, including standalone warm and run and pinned Series S launch. The touched Python test file passed Ruff. - GE-Proton11-12 ran the exact head using a synthetic Windows runtime on a `Z:` path with spaces. Both launch modes completed warm and run. The pinned path forwarded Series S and detected a changed executable before spawning it. [Proton smoke test](https://github.com/mauroalvare/AnyXboxX/actions/runs/46059268911/job/140709984655) - The three pure manifest tests passed on Linux in a harness that compiles the production parser and test module. The full native Linux CLI build is blocked by Win32 dependencies in `victory-loader`. [Manifest tests](https://github.com/mauroalvare/AnyXboxX/actions/runs/46059268911/job/140709277363) - The initial Windows full-suite run on `c5d78244` reported 1534 passed and 437 skipped. ## Oracle and test data The prebuilt tests use inert bytes created in temporary directories and inspect planned commands. They cover a substituted manifest, an executable with altered bytes and unchanged length, malformed or ambiguous metadata, diagnostic profile selection, and attempts to write or rename the guarded file or its parent. The existing source-build tests exercise Cargo artifact selection with a helper compiled from test source. AI assistance was used to implement and verify the change.
LooperSalty commented 2026-11-27 19:11:27 +00:00 (Migrated from github.com)

Imported from LooperSalty/AnyXboxX. Originally posted by LooperSalty on 2026-11-27T19:11:27Z.


Thanks. The check only covers victory.exe (sha256 and size against <exe>.identity.json, itself pinned by ANYXBOXX_VICTORY_MANIFEST_SHA256), so no game data is involved. Before merge:

  1. Breaking change for --victory-exe. It used to work with a bare exe, which is how Proton users run a cross-built VIctory. It now fails with MissingPin unless a sidecar and an out-of-band pin exist (steps.rs:57, identity.rs). Please explain the threat this protects against, and either make verification opt-in or add an explicit, loudly logged opt-out (e.g. --unverified). Then update docs/running-gta6.md and docs/fr/lancer-gta6.md, which still describe the old flow.
  2. Proton. locked_path.rs opens every ancestor directory with FILE_SHARE_READ | FILE_FLAG_BACKUP_SEMANTICS and rechecks before spawn. Wine's sharing and Z:\ paths are untested, and a failure would block the launch with an I/O error. Please report a run under Proton. Also note that holding every parent directory open blocks renaming or moving the folder while the game runs.
  3. French docs. docs/launcher.md gets a new section, but its French copy under docs/fr/ is not updated (AGENTS.md: both together).
  4. Minor: identity.rs log_line uses .expect(...) in production code; and identity_tests is cfg(all(test, windows)), so the pure manifest parsing is not tested on Linux.
<!-- greyfinch-sync:LooperSalty/AnyXboxX:comment:7226279512 --> Imported from [LooperSalty/AnyXboxX](https://github.com/LooperSalty/AnyXboxX/pull/540#issuecomment-7226279512). Originally posted by [LooperSalty](https://github.com/LooperSalty) on 2026-11-27T19:11:27Z. --- Thanks. The check only covers `victory.exe` (sha256 and size against `<exe>.identity.json`, itself pinned by `ANYXBOXX_VICTORY_MANIFEST_SHA256`), so no game data is involved. Before merge: 1. **Breaking change for `--victory-exe`.** It used to work with a bare exe, which is how Proton users run a cross-built VIctory. It now fails with `MissingPin` unless a sidecar and an out-of-band pin exist (`steps.rs:57`, `identity.rs`). Please explain the threat this protects against, and either make verification opt-in or add an explicit, loudly logged opt-out (e.g. `--unverified`). Then update `docs/running-gta6.md` and `docs/fr/lancer-gta6.md`, which still describe the old flow. 2. **Proton.** `locked_path.rs` opens every ancestor directory with `FILE_SHARE_READ | FILE_FLAG_BACKUP_SEMANTICS` and rechecks before `spawn`. Wine's sharing and `Z:\` paths are untested, and a failure would block the launch with an I/O error. Please report a run under Proton. Also note that holding every parent directory open blocks renaming or moving the folder while the game runs. 3. **French docs.** `docs/launcher.md` gets a new section, but its French copy under `docs/fr/` is not updated (AGENTS.md: both together). 4. Minor: `identity.rs` `log_line` uses `.expect(...)` in production code; and `identity_tests` is `cfg(all(test, windows))`, so the pure manifest parsing is not tested on Linux.
LooperSalty commented 2026-11-27 19:43:44 +00:00 (Migrated from github.com)

Imported from LooperSalty/AnyXboxX. Originally posted by LooperSalty on 2026-11-27T19:43:44Z.


Thanks: verification is now opt-in (only when the pin is set), a bare --victory-exe works again, and the French docs are in. After #545 this conflicts with main in crates/anyxboxx/src/run/steps.rs (the --console change from #523 is in now). Please rebase, keep game_command_as and the console arguments, and force-push. A Proton run with the pin set is still worth reporting, given the parent-directory handles.

<!-- greyfinch-sync:LooperSalty/AnyXboxX:comment:7226812929 --> Imported from [LooperSalty/AnyXboxX](https://github.com/LooperSalty/AnyXboxX/pull/540#issuecomment-7226812929). Originally posted by [LooperSalty](https://github.com/LooperSalty) on 2026-11-27T19:43:44Z. --- Thanks: verification is now opt-in (only when the pin is set), a bare `--victory-exe` works again, and the French docs are in. After #545 this conflicts with main in `crates/anyxboxx/src/run/steps.rs` (the `--console` change from #523 is in now). Please rebase, keep `game_command_as` and the console arguments, and force-push. A Proton run with the pin set is still worth reporting, given the parent-directory handles.
mauroalvare commented 2026-11-27 19:53:26 +00:00 (Migrated from github.com)

Imported from LooperSalty/AnyXboxX. Originally posted by mauroalvare on 2026-11-27T19:53:26Z.


Thanks, @LooperSalty. In 5588a03f, game_command_as keeps the Series S arguments from #523 and still holds the verified executable and directory handles through process creation. A standalone --victory-exe works again, and setting ANYXBOXX_VICTORY_MANIFEST_SHA256 opts into verification. The English and French guides cover the trust model and how long the directory handles are held.

I ran this commit under GE-Proton11-12 with an original test executable on a Z: path that includes spaces. The standalone and pinned launches both completed warm and run. The pinned launch forwarded --console series-s, and changing the executable was rejected before launch. All 36 Windows CLI integration cases and the three isolated Linux manifest tests passed. Proton smoke test · Linux manifest tests

<!-- greyfinch-sync:LooperSalty/AnyXboxX:comment:7226969248 --> Imported from [LooperSalty/AnyXboxX](https://github.com/LooperSalty/AnyXboxX/pull/540#issuecomment-7226969248). Originally posted by [mauroalvare](https://github.com/mauroalvare) on 2026-11-27T19:53:26Z. --- Thanks, @LooperSalty. In `5588a03f`, `game_command_as` keeps the Series S arguments from #523 and still holds the verified executable and directory handles through process creation. A standalone `--victory-exe` works again, and setting `ANYXBOXX_VICTORY_MANIFEST_SHA256` opts into verification. The English and French guides cover the trust model and how long the directory handles are held. I ran this commit under GE-Proton11-12 with an original test executable on a `Z:` path that includes spaces. The standalone and pinned launches both completed warm and run. The pinned launch forwarded `--console series-s`, and changing the executable was rejected before launch. All 36 Windows CLI integration cases and the three isolated Linux manifest tests passed. [Proton smoke test](https://github.com/mauroalvare/AnyXboxX/actions/runs/46059268911/job/140709984655) · [Linux manifest tests](https://github.com/mauroalvare/AnyXboxX/actions/runs/46059268911/job/140709277363)
LooperSalty commented 2026-11-27 22:12:33 +00:00 (Migrated from github.com)

Imported from LooperSalty/AnyXboxX. Originally posted by LooperSalty on 2026-11-27T22:12:33Z.


#557 was just merged and this now conflicts in crates/anyxboxx-launcher/src/app.rs, session.rs and ui_pages.rs. Please rebase on main, keep the new DLSS / Frame Generation launch options alongside the identity check, and force-push; it is otherwise ready (#543 goes in after it).

<!-- greyfinch-sync:LooperSalty/AnyXboxX:comment:7229123703 --> Imported from [LooperSalty/AnyXboxX](https://github.com/LooperSalty/AnyXboxX/pull/540#issuecomment-7229123703). Originally posted by [LooperSalty](https://github.com/LooperSalty) on 2026-11-27T22:12:33Z. --- #557 was just merged and this now conflicts in `crates/anyxboxx-launcher/src/app.rs`, `session.rs` and `ui_pages.rs`. Please rebase on main, keep the new DLSS / Frame Generation launch options alongside the identity check, and force-push; it is otherwise ready (#543 goes in after it).
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/540:upstream-pr/540'
git switch 'upstream-pr/540'

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 'main'
git merge --no-ff 'upstream-pr/540'
git switch 'upstream-pr/540'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/540'
git switch 'upstream-pr/540'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/540'
git switch 'main'
git merge --squash 'upstream-pr/540'
git switch 'main'
git merge --ff-only 'upstream-pr/540'
git switch 'main'
git merge 'upstream-pr/540'
git push origin 'main'
Sign in to join this conversation.
No reviewers
No labels
No milestone
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.

Reference
LooperSalty/AnyXboxX!540
No description provided.