fix: prove managed runtime candidates are self-contained - #134
Closed
brxs wants to merge 1 commit into
Closed
Conversation
Collaborator
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
gpu_broker.pyandsa3_cuda.pyto the embedded, sealed backend source closure and bind that closure digest into service provenancesys.pathenv_clear()at the launch boundary while adding only explicitly declared Windows essentials:SYSTEMROOT,WINDIR,TEMP, andTMPGetWindowsDirectoryW, and reject linked/reparse or escaping app-owned temp directories before injecting themPATH, home/profile values, credentials, Python path injection, and developer overrides remain absentWhy
Managed installs previously sealed most backend sources without the new GPU broker and SA3 CUDA policy modules. A candidate could therefore pass file validation but fail only when the promoted runtime imported a transitive module. Fully clearing the environment is the right launch boundary, but Windows children still need a small host-owned system/temp contract to start reliably.
Root cause
The sealed source list had drifted behind the runtime import graph, there was no import viability check against the materialized candidate, and the command verifier had no separately validated path for the minimal Windows process environment.
Impact
Incomplete candidates now fail before promotion. Managed Windows children receive exactly four OS/runtime values plus the service's declared paths and its own launch secret. This PR does not enable CUDA, alter sidecar/controller orchestration, change generation behavior, or modify release workflows.
Checks
cargo test --locked --workspace --manifest-path src-tauri/Cargo.toml(301 app tests passed, 2 ignored; 116 engine tests passed)cargo test --locked --workspace --features managed-runtime --manifest-path src-tauri/Cargo.toml(298 app tests passed, 2 ignored; 116 engine tests passed)cargo clippy --locked --workspace --all-targets --manifest-path src-tauri/Cargo.toml -- -D warningscargo clippy --locked --workspace --all-targets --features managed-runtime --manifest-path src-tauri/Cargo.toml -- -D warningsgit diff --checkNative Windows CI remains the platform proof for the Win32 helper. A macOS cross-check resolved and compiled
windows-sys, then stopped in the unrelatedringC build because a Windows C SDK is not installed on the macOS host.