Skip to content

Run isolated shell commands against the PHP VFS - #4169

Draft
chubes4 wants to merge 6 commits into
WordPress:trunkfrom
chubes4:fix/2304-isolated-shell
Draft

Run isolated shell commands against the PHP VFS#4169
chubes4 wants to merge 6 commits into
WordPress:trunkfrom
chubes4:fix/2304-isolated-shell

Conversation

@chubes4

@chubes4 chubes4 commented Jul 26, 2026

Copy link
Copy Markdown
Contributor

Fixes #2304.

What changed

  • Adds a Node-only shell executor backed exclusively by the active PHP virtual filesystem.
  • Supports compound shell syntax, redirects, pipelines, command substitution, executable scripts, stdin/status propagation, and deployment commands used by CodeDeployments.
  • Adds VFS implementations for unzip, rsync, mktemp, GNU-style ISO dates, and the jq bindings needed by the command logger.
  • Routes shell filesystem operations to the originating PHP instance so files created through proc_open() are immediately visible to the parent PHP process.
  • Retains an acquired PHP worker as the concurrency lease for pipe I/O and as the execution target for actual PHP subprocesses.
  • Keeps the universal/browser package free of Node-specific shell dependencies.

Verification

  • Asyncify focused shell suite: 11/11 passed.
  • JSPI focused shell suite: 11/11 passed.
  • CLI parent-VFS regression passed.
  • php-wasm-node, php-wasm-universal, and Playground CLI typechecks passed.
  • PHP-WASM Node, universal, Playground CLI, and Playground WordPress lint passed.

Downstream status

The source behavior is verified, including parent-visible mutations. The combined WPCOM parity rerun is currently blocked before PHPUnit by the separate external-extension loader ABI stack (resolved is not a function), so this remains draft while that package composition is restored.

AI assistance

OpenCode using openai/gpt-5.6-sol implemented the shell/VFS integration, added the focused regressions, and ran the verification listed above. Chris Huber remains responsible for the submitted change.

AI assistance: OpenAI gpt-5.6-sol via OpenCode was used to review and implement the follow-up fixes and tests.

AI assistance: OpenAI gpt-5.6-terra via OpenCode resolved the upstream merge and verified the ZIP extraction checks.
@github-actions github-actions Bot added the [Type] Documentation Improvements or additions to documentation label Aug 2, 2026
AI assistance: OpenAI gpt-5.6-terra via OpenCode fixed the spawn-handler API boundary and added focused coverage.
AI assistance: OpenAI gpt-5.6-terra via OpenCode isolated the endpoint construction test and verified the remote suite.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Use a real shell (for command substitution, stream redirects, etc.)

1 participant