Skip to content

feat(wt-invokers): require --environment-tar-digest and verify before unpack#196

Merged
cisaacstern merged 1 commit into
mainfrom
cs/env-tar-digest
Jun 18, 2026
Merged

feat(wt-invokers): require --environment-tar-digest and verify before unpack#196
cisaacstern merged 1 commit into
mainfrom
cs/env-tar-digest

Conversation

@cisaacstern

Copy link
Copy Markdown
Member

🌎 Summary

closes #191

📦 Proposed Changes

Add a mandatory sha256 integrity check on the sandbox invoker so a tampered or corrupted environment.tar never executes (closes #191).

  • utils: add validate_environment_tar_digest() enforcing the sha256:<64 hex>
    format, shared by the sandbox CLI and CloudRunJobsSandboxInvoker
  • exceptions: add EnvironmentTarDigestError(InvokerError)
  • mixins: PixiUnpackMixin now requires environment_tar_digest and verifies the downloaded tarball's sha256 before pixi-unpack; on mismatch it raises EnvironmentTarDigestError before unpacking (activate_path left unset), mirroring the adjacent PixiUnpackError pre-run failure mode
  • sandbox: add the required --environment-tar-digest CLI flag with format validation and forward it through to the invoker
  • cloud_run_jobs: add the required environment_tar_digest kwarg with eager format validation and forward it to the sandbox CLI container args

Both upload and --dangerously-skip-results-archive-upload modes behave identically: the run fails before unpacking, raising and exiting non-zero with no result.json written. The deployment detects failure via the exit code / Cloud Run execution status, the same signal it already needs for OOMs, segfaults, and pixi-unpack failures.

BREAKING CHANGE: --environment-tar-digest is now required on the sandbox CLI and environment_tar_digest is a required kwarg on CloudRunJobsSandboxInvoker.run(). Callers populating invoker_kwargs for wt-runner must now include environment_tar_digest.

…e unpack

Add a mandatory sha256 integrity check on the sandbox invoker so a tampered
or corrupted environment.tar never executes (closes #191).

- utils: add validate_environment_tar_digest() enforcing the sha256:<64 hex>
  format, shared by the sandbox CLI and CloudRunJobsSandboxInvoker
- exceptions: add EnvironmentTarDigestError(InvokerError)
- mixins: PixiUnpackMixin now requires environment_tar_digest and verifies the
  downloaded tarball's sha256 before pixi-unpack; on mismatch it raises
  EnvironmentTarDigestError before unpacking (activate_path left unset),
  mirroring the adjacent PixiUnpackError pre-run failure mode
- sandbox: add the required --environment-tar-digest CLI flag with format
  validation and forward it through to the invoker
- cloud_run_jobs: add the required environment_tar_digest kwarg with eager
  format validation and forward it to the sandbox CLI container args

Both upload and --dangerously-skip-results-archive-upload modes behave
identically: the run fails before unpacking, raising and exiting non-zero with
no result.json written. The deployment detects failure via the exit code /
Cloud Run execution status, the same signal it already needs for OOMs,
segfaults, and pixi-unpack failures.

BREAKING CHANGE: --environment-tar-digest is now required on the sandbox CLI
and environment_tar_digest is a required kwarg on CloudRunJobsSandboxInvoker.run().
Callers populating invoker_kwargs for wt-runner must now include
environment_tar_digest.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@cisaacstern cisaacstern requested a review from atmorling June 18, 2026 19:21
@cisaacstern cisaacstern added the run-reverse-integration Triggers reverse integration tests to be run on PRs. label Jun 18, 2026
@cisaacstern cisaacstern merged commit 341258c into main Jun 18, 2026
33 of 35 checks passed
@cisaacstern cisaacstern deleted the cs/env-tar-digest branch June 18, 2026 19:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

run-reverse-integration Triggers reverse integration tests to be run on PRs.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add optional --environment-tar-digest verification to the sandbox invoker

2 participants