tools/ai-sandbox: add containerized agent sandbox + wp-verify Playwright stack#49082
Open
dognose24 wants to merge 1 commit into
Open
tools/ai-sandbox: add containerized agent sandbox + wp-verify Playwright stack#49082dognose24 wants to merge 1 commit into
dognose24 wants to merge 1 commit into
Conversation
…ght stack Adds a self-contained subsystem under tools/ai-sandbox/ for running AI-coding-agent flows against a real WordPress instance: Container stack (Docker Compose): * docker-compose.yml — agent container (jetpack-ai-sandbox) with the monorepo bind-mounted; mysql + wordpress + wpcli services live behind a `wp-verify` Compose profile so they only start when explicitly requested via wp-verify.sh. * docker-compose.worktree.yml — co-mounts a host git worktree so multiple parallel agent sessions can share the same sandbox. * docker-compose.wp-verify.yml — opt-in port binding (127.0.0.1) + Docker socket access for host-runnable wp-verify flows. * Dockerfile — Node 24 + pnpm 10 + PHP 8.4 + Composer 2.9 base image. * entrypoint.sh, hooks/pre-push — sandbox-side scope-gate enforcing what an agent can push. wp-verify subsystem (Playwright against a real WP + Gutenberg): * wp-verify.sh — orchestrator that brings up the WP stack, waits for WordPress + Gutenberg readiness, and runs Playwright tests against the running site. * wp-verify/playwright.config.ts — host- or container-runnable test config; uses WP_BASE for the target URL. * wp-verify/global-setup.ts — authenticated storage state for /wp-admin tests. * wp-verify/check.cjs — non-Playwright sanity check. * wp-verify/eslint.config.mjs — local ESLint config. * wp-verify/mu-loader.php — MU-plugin loader for staged plugin code. * wp-verify/tests/ — two example specs (dashboard-mount, pie-chart-tooltip — second one skipped until a chart lands on the dashboard). docs/ — five contract documents that the rest of the harness (skills, review-cycle workflow) reference: * agent-boundaries.md * agent-metrics.md * build-runtime-contract.md * route-contract.md * ui-scope-contract.md README.md — quick-start, env vars (WP_BASE, WP_VERIFY_HOST_PORT, WP_VERIFY_INSTANCE), and the relationship to the rest of the harness. This PR is one of a parallel batch upstreaming the dognose24/jetpack fork's accumulated tooling work. See "Related PRs" in the PR body. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
This was referenced May 22, 2026
Contributor
|
Thank you for your PR! When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:
This comment will be updated as you work on your PR and make changes. If you think that some of those checks are not needed for your PR, please explain why you think so. Thanks for cooperation 🤖 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Proposed changes
Adds a self-contained containerized sandbox under
tools/ai-sandbox/for running AI-coding-agent flows against a real WordPress + Gutenberg instance, plus awp-verifyPlaywright test harness that runs against the sandbox WP.Container stack (Docker Compose)
docker-compose.yml— agent container (jetpack-ai-sandbox) with the monorepo bind-mounted;mysql+wordpress+wpcliservices behind awp-verifyCompose profile so they only start when explicitly requested.docker-compose.worktree.yml— co-mounts a host git worktree for parallel agent sessions on the same sandbox.docker-compose.wp-verify.yml— opt-in port binding (127.0.0.1) + Docker socket access for host-runnable wp-verify flows.Dockerfile— Node 24 + pnpm 10 + PHP 8.4 + Composer 2.9 base image.entrypoint.sh,hooks/pre-push— sandbox-side scope-gate enforcing what an agent can push.wp-verify subsystem
Playwright suite that runs against the sandbox WP:
wp-verify.sh— orchestrator: brings up the WP stack, waits for WordPress + Gutenberg readiness, runs Playwright.wp-verify/playwright.config.ts— host- or container-runnable; usesWP_BASEfor the target URL.wp-verify/global-setup.ts— authenticated storage state for/wp-admintests.wp-verify/check.cjs— non-Playwright sanity check.wp-verify/eslint.config.mjs— local ESLint config.wp-verify/mu-loader.php— MU-plugin loader for staged plugin code.wp-verify/tests/—dashboard-mount.spec.ts(active) andpie-chart-tooltip.spec.ts(skipped until a chart lands on the dashboard).Documentation
README.md— quick-start, env vars (WP_BASE,WP_VERIFY_HOST_PORT,WP_VERIFY_INSTANCE), and the relationship to the rest of the harness.docs/{agent-boundaries,agent-metrics,build-runtime-contract,route-contract,ui-scope-contract}.md— contract documents that the rest of the harness (skills, review-cycle workflow) reference.What this PR is / isn't
tools/ai-sandbox/. Nothing else in the repo references this directory; behavior of every existing package is unaffected.Why parallel batch
This is one of 4 PRs upstreaming accumulated work from
dognose24/jetpack:tools/ai-sandbox/subsystem.agents/skills/+.claude/commands/agent skills + governance.github/workflows/pr-review-cycle.ymlauto-triggered review workflowThis PR's
README.mdreferences the skills in PR #C; that reference is cosmetic — the subsystem itself works as standalone tooling without any skill files present.Does this pull request change what data or activity we track or use?
No. The sandbox is opt-in developer/agent tooling; nothing is enqueued, persisted, or sent outside a developer's local Docker.
Testing instructions
cd tools/ai-sandbox && docker compose up -d --build— verify the agent container builds and starts.tools/ai-sandbox/wp-verify.sh up— verify the WP + MySQL + WPCLI services come up healthy and WordPress finishes installation.pnpm install && pnpm exec playwright test --config tools/ai-sandbox/wp-verify/playwright.config.tsfrom the repo root (withWP_BASEset perREADME.md) — verify the dashboard-mount spec passes; pie-chart-tooltip is intentionally skipped (no chart in the dashboard yet).tools/ai-sandbox/wp-verify.sh down— verify clean teardown.🤖 Generated with Claude Code