Problem
The public PHPUnit recipe executes one suite per workspace lifecycle. A large suite matrix therefore creates a fresh Playground runtime and disposable database service for every entry. This is correct for isolated one-off execution but prohibitively expensive for CI-scale plans where entries intentionally share one immutable source tree and service allocation while isolating their process/database identities.
The immediate consumer is a 680-entry PHPUnit parity manifest, but the owning primitive must remain generic and contain no WPCOM or TeamCity knowledge.
Expected contract
WP Codebox should accept a deterministic PHPUnit execution plan and run it inside one prepared workspace recipe lifecycle:
- Materialize the workspace/runtime once.
- Start declared disposable services once.
- Execute plan entries with configurable bounded concurrency.
- Give every entry its own argv, environment overrides, timeout, process identity, artifact namespace, and deterministic input index.
- Preserve stable output ordering independent of completion order.
- Isolate entry failures/timeouts so remaining entries complete unless an explicit fail-fast policy is selected.
- Stop services and dispose the runtime exactly once after all admitted entries terminalize.
- Return a typed aggregate with per-entry exit status, timeout/early-exit state, stdout/stderr refs, duration, and aggregate counts.
- Resume/retry selected failed entries without rerunning successful entries when the caller supplies a prior aggregate.
Safety and compatibility
- Keep production credentials, APIs, data, and writes outside the contract.
- Preserve the existing single PHPUnit recipe behavior and schemas.
- Make concurrency explicit and bounded; default to one.
- Maintain existing secret redaction and reviewer-safe artifact projection.
- Keep database-index isolation caller-supplied through per-entry environment/argv rather than adding product-specific policy.
Acceptance criteria
- Deterministic lifecycle coverage proves one runtime prepare, one service start, one service stop, and one runtime disposal for a multi-entry plan.
- Deterministic scheduler coverage proves the concurrency ceiling, stable result ordering, failure isolation, timeout classification, and selective retry.
- A real disposable MariaDB integration executes at least two PHPUnit entries against one service allocation with distinct database identities.
- The CLI/API/schema contract is documented and validated.
- Existing build, schema, public API, and PHPUnit recipe tests remain green.
Tracked downstream by https://linear.app/a8c/issue/BET-12/local-wordpresscom-development-with-wpcom-codebox.
Problem
The public PHPUnit recipe executes one suite per workspace lifecycle. A large suite matrix therefore creates a fresh Playground runtime and disposable database service for every entry. This is correct for isolated one-off execution but prohibitively expensive for CI-scale plans where entries intentionally share one immutable source tree and service allocation while isolating their process/database identities.
The immediate consumer is a 680-entry PHPUnit parity manifest, but the owning primitive must remain generic and contain no WPCOM or TeamCity knowledge.
Expected contract
WP Codebox should accept a deterministic PHPUnit execution plan and run it inside one prepared workspace recipe lifecycle:
Safety and compatibility
Acceptance criteria
Tracked downstream by https://linear.app/a8c/issue/BET-12/local-wordpresscom-development-with-wpcom-codebox.