Problem
materializePlaygroundStagedInputs() does not scale to large host directory mounts. A WPCOM readonly tree with roughly 257,000 entries completes host-side readonly staging in 31.7 seconds, then times out after 1,500 seconds in input.materialize before any recipe command runs.
The materializer calls playground.writeFile() serially for every UTF-8 file and adds a verification call every 100 files. This makes runtime startup proportional to hundreds of thousands of cross-boundary calls rather than bounded batches.
Evidence
Runtime facts from an isolated parity run:
runtime.workers: 1
- readonly host staging: completed in
31,681ms
- active operation at timeout:
input.materialize
- timeout:
1,500,000ms
- commands executed:
0
- managed MariaDB reached ready state and was released cleanly
The relevant loop is in packages/runtime-playground/src/mount-materialization.ts: each text file awaits server.playground.writeFile(target, text) independently. Binary files already use the PHP batch path.
Reproduction
- Generate a directory tree containing at least 250,000 small UTF-8 files.
- Add it as a readonly directory mount to a minimal Playground recipe.
- Run
wp-codebox recipe-run --recipe recipe.json --artifacts artifacts --timeout 1500000ms --json.
- Observe readonly staging complete, followed by timeout in
input.materialize with no workflow commands executed.
Expected
Large host trees should be transferred through a bounded bulk/streaming primitive with deterministic progress and verification, avoiding one Playground call per file. Existing binary fidelity, readonly isolation, symlink policy, nested mounts, diagnostics, and timeout behavior must remain intact.
Problem
materializePlaygroundStagedInputs()does not scale to large host directory mounts. A WPCOM readonly tree with roughly 257,000 entries completes host-side readonly staging in 31.7 seconds, then times out after 1,500 seconds ininput.materializebefore any recipe command runs.The materializer calls
playground.writeFile()serially for every UTF-8 file and adds a verification call every 100 files. This makes runtime startup proportional to hundreds of thousands of cross-boundary calls rather than bounded batches.Evidence
Runtime facts from an isolated parity run:
runtime.workers:131,681msinput.materialize1,500,000ms0The relevant loop is in
packages/runtime-playground/src/mount-materialization.ts: each text file awaitsserver.playground.writeFile(target, text)independently. Binary files already use the PHP batch path.Reproduction
wp-codebox recipe-run --recipe recipe.json --artifacts artifacts --timeout 1500000ms --json.input.materializewith no workflow commands executed.Expected
Large host trees should be transferred through a bounded bulk/streaming primitive with deterministic progress and verification, avoiding one Playground call per file. Existing binary fidelity, readonly isolation, symlink policy, nested mounts, diagnostics, and timeout behavior must remain intact.