Skip to content

Isolate the PythonInterpreter Deno cache - #10206

Merged
isaacbmiller merged 6 commits into
mainfrom
deno-cache-isolation
Aug 14, 2026
Merged

isaacbmiller merged 6 commits into
mainfrom
deno-cache-isolation

Conversation

@isaacbmiller

@isaacbmiller isaacbmiller commented Aug 14, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • preserve the shared Deno cache so already-warm installations still start offline
  • revoke the runner's cache read permission after Pyodide has loaded, preventing guest code from reading unrelated cache contents
  • reject write mounts overlapping either the bundled runner or its Deno cache
  • leave custom deno_command behavior unchanged

Scope

The production diff is 17 changed lines across python_interpreter.py and runner.js (14 additions, 3 deletions).

Verification

  • uv run pytest tests/primitives/test_python_interpreter.py -q --deno — 102 passed
  • focused live tests verify both that a cache canary is unreadable to guest code and that a warm shared cache starts under --cached-only
  • ruff check --fix-only --diff --exit-non-zero-on-fix ... — clean
  • git diff --check — clean

ampagent and others added 5 commits August 14, 2026 04:09
This reverts commit 6a5d268.

Co-authored-by: Isaac Miller <isaac@cmpnd.ai>
This reverts commit 37722fa.

Co-authored-by: Isaac Miller <isaac@cmpnd.ai>
@isaacbmiller isaacbmiller changed the title Limit PythonInterpreter access to Deno dependencies Isolate the PythonInterpreter Deno cache Aug 14, 2026
@isaacbmiller
isaacbmiller marked this pull request as ready for review August 14, 2026 10:49
@greptile-apps

greptile-apps Bot commented Aug 14, 2026 •

Copy link
Copy Markdown
Contributor

Greptile Summary

PythonInterpreter now starts from the existing warmed Deno cache in offline environments and revokes generated code’s access to unrelated cache files after Pyodide initialization. The exercised offline startup path returned the expected result, and focused cache-access coverage passed.

Confidence Score: 5/5

Safe to merge: offline startup succeeds from a warmed shared cache while unrelated cache contents remain inaccessible to generated code.

No blocking failure remains.

T-Rex T-Rex Logs

What T-Rex did

  • The end-to-end Python validation ran to warm a fresh shared Deno cache, ensured no child cache existed, forced cached-only startup, and executed the default interpreter.
  • The warm-cache command exited successfully and the offline interpreter evaluated 40 + 2 as 42, while an attempt to read an unrelated shared-cache canary was denied.
  • All four PythonInterpreter cache tests passed, confirming offline-warmed startup and that cache access is revoked after initialization.
  • The code-path validation notes that python_interpreter.py obtains the active Deno directory for initial runtime loading and forwards it as --dspy-deno-dir, while runner.js loads Pyodide and revokes read permission on the cache directory.
  • The test-suite validation confirms which tests cover cache confidentiality and revocation (test_python_interpreter.py ranges 272–303 and 533–547) and shows the validation script exited successfully.

View all artifacts

T-Rex Ran code and verified through T-Rex

Reviews (2): Last reviewed commit: "Revoke Deno cache access after startup" | Re-trigger Greptile

Comment thread dspy/primitives/python_interpreter.py Outdated
Co-authored-by: Isaac Miller <isaac@cmpnd.ai>
@isaacbmiller
isaacbmiller merged commit ab8a765 into main Aug 14, 2026
20 checks passed
@isaacbmiller
isaacbmiller deleted the deno-cache-isolation branch August 14, 2026 14:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants