build(victory): record locked runtime build provenance #543

Open
mauroalvare wants to merge 2 commits from upstream-pr/543 into main
mauroalvare commented 2026-11-27 19:28:48 +00:00 (Migrated from github.com)

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


Change

OPT-SEC-002. Apply --locked to the launchers' source build command and add a release build command that verifies the checkout, both lockfiles, the TomBox gitlink, the vendored VIctory tree, and the pinned x64 toolchain. The release tool selects the exact executable reported by Cargo. It emits a schema 1 identity manifest for the launcher and a build record with the lock hashes and toolchain evidence. Launcher identity contract

Base 3e3dd53e269f69f90ca77563fc23216d05ea913e. Tested implementation 9491dc41f1b02280c552c90d8519dee42a09baf2.

Verification

  • cargo test --locked --offline -j 6 -p anyxboxx --lib finished with 26 passed.
  • cargo build --release --locked --offline -j 6 -p anyxboxx passed.
  • python -m pytest -q tests/test_build_victory_identity.py finished with 8 passed.
  • python -m pytest -q finished with 1540 passed and 437 skipped. The skipped tests require components outside the launcher build in this worktree.
  • python -m ruff check --select W605,F,E9 PrototypeScarlett tests tools passed.
  • Ran python tools/build_victory_identity.py --repo <clean-checkout> --target-dir <fresh-dir> --offline twice with source commit c5d78244b562cb17865e6e84704ad975bb0b026f, Rust 1.98.1, MSVC 14.44 and SDK 10.0.26100.0. Each executable was 12,172,288 bytes. The executables differed in 20 bytes across the COFF timestamp, three debug-directory timestamps, and the CodeView GUID. These fields account for every differing byte.
  • The #540 launcher accepted the generated manifest and reached the missing-game check. The command exited before launching the artifact.

Integration

Merge #540 first. It provides the launcher verifier that consumes the identity manifest emitted here.

The executable SHA-256 pins the exact bytes of one build. PE timestamps and the CodeView GUID can differ across builds with identical recorded inputs. Compare the recorded source, toolchain, and lockfile fields and pin each executable with its own manifest.

Every launcher source build uses Cargo's --locked flag. A change that requires updating Cargo.lock now fails until the lockfile is regenerated.

The documentation follow-up in 829e8bd6 passed all 40 build-identity and launcher integration cases and Ruff on the touched sources.

Oracle and test data

Temporary Git checkouts and inert data cover gitlink drift, dirty locks, a toolchain mismatch, and Cargo's artifact selection. A minimal source fixture confirms Cargo rejects stale lock resolution with --locked. Rebuild evidence comes from the vendored project source and the installed SDK.

AI assistance was used to implement and verify the change.

<!-- greyfinch-sync:LooperSalty/AnyXboxX:issue:5532052146 --> Imported from [LooperSalty/AnyXboxX](https://github.com/LooperSalty/AnyXboxX/pull/543). Originally posted by [mauroalvare](https://github.com/mauroalvare) on 2026-11-27T19:28:48Z. --- ## Change OPT-SEC-002. Apply `--locked` to the launchers' source build command and add a release build command that verifies the checkout, both lockfiles, the TomBox gitlink, the vendored VIctory tree, and the pinned x64 toolchain. The release tool selects the exact executable reported by Cargo. It emits a schema 1 identity manifest for the launcher and a build record with the lock hashes and toolchain evidence. [Launcher identity contract](https://github.com/LooperSalty/AnyXboxX/pull/540) Base `3e3dd53e269f69f90ca77563fc23216d05ea913e`. Tested implementation `9491dc41f1b02280c552c90d8519dee42a09baf2`. ## Verification - `cargo test --locked --offline -j 6 -p anyxboxx --lib` finished with 26 passed. - `cargo build --release --locked --offline -j 6 -p anyxboxx` passed. - `python -m pytest -q tests/test_build_victory_identity.py` finished with 8 passed. - `python -m pytest -q` finished with 1540 passed and 437 skipped. The skipped tests require components outside the launcher build in this worktree. - `python -m ruff check --select W605,F,E9 PrototypeScarlett tests tools` passed. - Ran `python tools/build_victory_identity.py --repo <clean-checkout> --target-dir <fresh-dir> --offline` twice with source commit `c5d78244b562cb17865e6e84704ad975bb0b026f`, Rust 1.98.1, MSVC 14.44 and SDK 10.0.26100.0. Each executable was 12,172,288 bytes. The executables differed in 20 bytes across the COFF timestamp, three debug-directory timestamps, and the CodeView GUID. These fields account for every differing byte. - The #540 launcher accepted the generated manifest and reached the missing-game check. The command exited before launching the artifact. ## Integration Merge #540 first. It provides the launcher verifier that consumes the identity manifest emitted here. The executable SHA-256 pins the exact bytes of one build. PE timestamps and the CodeView GUID can differ across builds with identical recorded inputs. Compare the recorded source, toolchain, and lockfile fields and pin each executable with its own manifest. Every launcher source build uses Cargo's `--locked` flag. A change that requires updating `Cargo.lock` now fails until the lockfile is regenerated. The documentation follow-up in `829e8bd6` passed all 40 build-identity and launcher integration cases and Ruff on the touched sources. ## Oracle and test data Temporary Git checkouts and inert data cover gitlink drift, dirty locks, a toolchain mismatch, and Cargo's artifact selection. A minimal source fixture confirms Cargo rejects stale lock resolution with `--locked`. Rebuild evidence comes from the vendored project source and the installed SDK. AI assistance was used to implement and verify the change.
LooperSalty commented 2026-11-27 19:46:26 +00:00 (Migrated from github.com)

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


Thanks; no user names or absolute paths end up in the manifest or build.json. Three points:

  1. Your own measurement shows two builds differ in about 20 bytes (COFF and debug timestamps, CodeView GUID), so executable_sha256 is a per-build pin, not a reproducible one. docs/architecture-rust.md says to "compare the executable SHA-256 values across builds", which will always differ. Please say the pin is per build, or make builds reproducible (/Brepro).
  2. The docs describe the identity.json verifier from #540, which is not on main yet. Please state the dependency in the description, so they are merged in order.
  3. --locked (crates/anyxboxx/src/run/steps.rs) now applies to every anyxboxx run source build: a dependency edited without updating Cargo.lock now fails instead of resolving. That is probably what you want, but please call it out in the description.
<!-- greyfinch-sync:LooperSalty/AnyXboxX:comment:7226857259 --> Imported from [LooperSalty/AnyXboxX](https://github.com/LooperSalty/AnyXboxX/pull/543#issuecomment-7226857259). Originally posted by [LooperSalty](https://github.com/LooperSalty) on 2026-11-27T19:46:26Z. --- Thanks; no user names or absolute paths end up in the manifest or `build.json`. Three points: 1. Your own measurement shows two builds differ in about 20 bytes (COFF and debug timestamps, CodeView GUID), so `executable_sha256` is a per-build pin, not a reproducible one. `docs/architecture-rust.md` says to "compare the executable SHA-256 values across builds", which will always differ. Please say the pin is per build, or make builds reproducible (`/Brepro`). 2. The docs describe the `identity.json` verifier from #540, which is not on main yet. Please state the dependency in the description, so they are merged in order. 3. `--locked` (`crates/anyxboxx/src/run/steps.rs`) now applies to every `anyxboxx run` source build: a dependency edited without updating `Cargo.lock` now fails instead of resolving. That is probably what you want, but please call it out in the description.
mauroalvare commented 2026-11-27 20:06:05 +00:00 (Migrated from github.com)

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


Thanks, @LooperSalty. The English and French guides in 829e8bd6 describe the executable SHA-256 as a pin for one build and tell readers which recorded inputs to compare across rebuilds. The PR description now asks to merge #540 first and explains that source launches fail when --locked requires a lockfile update. The Windows build, all 40 build-identity and launcher cases, and Ruff passed.

<!-- greyfinch-sync:LooperSalty/AnyXboxX:comment:7227174982 --> Imported from [LooperSalty/AnyXboxX](https://github.com/LooperSalty/AnyXboxX/pull/543#issuecomment-7227174982). Originally posted by [mauroalvare](https://github.com/mauroalvare) on 2026-11-27T20:06:05Z. --- Thanks, @LooperSalty. The English and French guides in `829e8bd6` describe the executable SHA-256 as a pin for one build and tell readers which recorded inputs to compare across rebuilds. The PR description now asks to merge #540 first and explains that source launches fail when `--locked` requires a lockfile update. The Windows build, all 40 build-identity and launcher cases, and Ruff passed.
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/543:upstream-pr/543'
git switch 'upstream-pr/543'

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/543'
git switch 'upstream-pr/543'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/543'
git switch 'upstream-pr/543'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/543'
git switch 'main'
git merge --squash 'upstream-pr/543'
git switch 'main'
git merge --ff-only 'upstream-pr/543'
git switch 'main'
git merge 'upstream-pr/543'
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!543
No description provided.