Skip to content

Commit fa34016

Browse files
authored
Merge pull request #1 from rivet-dev/check-python-support
feat(secure-exec): add Python runtime with Pyodide driver
2 parents d2e78d1 + 597cd37 commit fa34016

File tree

40 files changed

+930
-403
lines changed

40 files changed

+930
-403
lines changed

CLAUDE.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,13 @@
3737
- the matrix runs each fixture in host Node and secure-exec and compares normalized `code`, `stdout`, and `stderr`
3838
- no known-mismatch classification is allowed; parity mismatches stay failing until runtime/bridge behavior is fixed
3939

40+
## Test Structure
41+
42+
- `tests/test-suite/{node,python}.test.ts` are integration suite drivers; `tests/test-suite/{node,python}/` hold the shared suite definitions
43+
- test suites test generic runtime functionality with any pluggable SystemDriver (exec, run, stdio, env, filesystem, network, timeouts, log buffering); prefer adding tests here because they run against all environments (node, browser, python)
44+
- `tests/runtime-driver/` tests behavior specific to a single runtime driver (e.g. Node-only `memoryLimit`/`timingMitigation`, Python-only warm state or `secure_exec` hooks) that cannot be expressed through the shared suite context
45+
- within `test-suite/{node,python}/`, files are named by domain (e.g. `runtime.ts`, `network.ts`)
46+
4047
## Comment Pattern
4148

4249
Follow the style in `packages/secure-exec/src/index.ts`.

docs-internal/friction.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
# Sandboxed Node Friction Log
22

3+
## 2026-03-09
4+
5+
1. **[resolved]** Python `exec()` env overrides bypassed `permissions.env`.
6+
- Symptom: `PyodideRuntimeDriver` filtered constructor-level runtime env, but per-execution `exec(..., { env })` overrides were forwarded into the worker without permission filtering.
7+
- Fix: Python `exec()` now filters override keys through the shared `filterEnv(...)` path before applying them in the worker, matching Node runtime behavior.
8+
- Follow-up: keep future Python capability additions on the same host-side permission boundary so worker-facing APIs never receive unapproved capability input.
9+
310
## 2026-03-03
411

512
1. **[resolved]** Python runtime contract split needed explicit cross-runtime `exec()` parity and warm-state guardrails.

docs-internal/todo.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,10 @@
6464

6565
## Security & Hardening
6666

67+
- [x] Filter Python `exec(..., { env })` overrides through `permissions.env`.
68+
- Fix: `PyodideRuntimeDriver.exec()` now applies the shared `filterEnv(...)` gate before env overrides reach the worker, and runtime-driver tests cover both denied-by-default and explicitly-allowed cases.
69+
- `packages/secure-exec/src/python/driver.ts`, `packages/secure-exec/tests/runtime-driver/python.test.ts`
70+
6771
- [x] Bridge `crypto.getRandomValues` / `randomUUID` to host `node:crypto` instead of `Math.random()`.
6872
- Fix: runtime now wires host `node:crypto` references from `packages/secure-exec/src/index.ts` into the isolate and uses them in `packages/secure-exec/src/bridge/process.ts`.
6973
- Fail-closed contract: bridge throws deterministic `crypto.getRandomValues is not supported in sandbox` / `crypto.randomUUID is not supported in sandbox` errors when host entropy hooks are unavailable.

openspec/changes/add-python-runtime-driver/.openspec.yaml renamed to openspec/changes/archive/2026-03-09-add-python-runtime-driver/.openspec.yaml

File renamed without changes.

openspec/changes/add-python-runtime-driver/design.md renamed to openspec/changes/archive/2026-03-09-add-python-runtime-driver/design.md

File renamed without changes.

openspec/changes/add-python-runtime-driver/proposal.md renamed to openspec/changes/archive/2026-03-09-add-python-runtime-driver/proposal.md

File renamed without changes.

openspec/changes/add-python-runtime-driver/specs/compatibility-governance/spec.md renamed to openspec/changes/archive/2026-03-09-add-python-runtime-driver/specs/compatibility-governance/spec.md

File renamed without changes.

openspec/changes/add-python-runtime-driver/specs/node-runtime/spec.md renamed to openspec/changes/archive/2026-03-09-add-python-runtime-driver/specs/node-runtime/spec.md

File renamed without changes.

openspec/changes/add-python-runtime-driver/specs/python-runtime/spec.md renamed to openspec/changes/archive/2026-03-09-add-python-runtime-driver/specs/python-runtime/spec.md

File renamed without changes.

openspec/changes/add-python-runtime-driver/tasks.md renamed to openspec/changes/archive/2026-03-09-add-python-runtime-driver/tasks.md

File renamed without changes.

0 commit comments

Comments
 (0)