Repository navigation
feat(agents): add playground-verifier, the kit's first runtime gate - #3
Merged
Merged
Conversation
This was referenced Sep 16, 2026
pluginslab
force-pushed
the
feat/playground-verifier
branch
from
September 21, 2026 16:40
71fd83a to
73fad7c
Compare
Every gate in this kit is static: phpcs reads syntax, security-reviewer reads patterns, plan-reviewer reads markdown. Nothing boots WordPress. That gap has a receipt. v1.0.2 fixed a scaffold that fataled the instant it was activated, and the note said it plainly: "None of the static gates caught it, because nothing in quality.sh boots WordPress." It passed phpcs, passed the security review, and shipped in two releases. playground-verifier boots the plugin in an ephemeral Playground instance at the WP and PHP versions the plugin's own header declares, mounts the working tree, activates, reads the error log, confirms every registered REST route resolves at runtime, deactivates, uninstalls, and checks nothing is left behind. Read-only plus the wp-playground MCP tools. The definition was corrected against two live runs before shipping. The first surfaced 13 defects in its own playbook, two of which would have produced false passes: get_playground_logs surfaces the Node process's output and NOT PHP errors, and the unauthenticated-REST check could not run at all because Playground's auto-login mu-plugin redirects every cookie-less request. The second found a third: WP_DEBUG_DISPLAY is false by default, so the "notices in the page body" check was a no-op that looked like a pass. Contract tests pin those traps so a future edit that drops the debug.log warning or the auto-login recipe reintroduces a gate that cannot fail. The read-only guarantee is asserted structurally too: a prompt saying "you do not modify code" is advisory, an omitted Edit is enforced. Suite: 56 -> 99 assertions. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
pluginslab
force-pushed
the
feat/playground-verifier
branch
from
September 21, 2026 16:40
73fad7c to
c0d99a8
Compare
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.
Why
Every gate in this kit is static. phpcs reads syntax,
security-reviewerreads patterns,plan-reviewerreads markdown. Nothing boots WordPress.That gap has a receipt. From the v1.0.2 changelog, fixing a scaffold that fataled the instant it was activated:
It passed phpcs. It passed the security review. It shipped in two releases.
What
playground-verifier— read-only plus thewp-playgroundMCP tools, noEdit, noWrite. It boots the plugin in an ephemeral Playground instance at the WP and PHP versions the plugin's own header declares, mounts the working tree, then activates, reads the error log, confirms everyregister_rest_routecall resolves at runtime, checks mutating routes reject unauthenticated requests, deactivates, uninstalls, and verifies nothing is left behind.Design decisions worth reviewing:
Requires at least: 6.7that calls a 6.8 function only fails on 6.7. Testing on latest hides exactly the bug the header exists to prevent.Corrected against two live runs before shipping
This is the part I'd most want a second opinion on. Dispatching it at the kit's own
pl-exampletemplate found 13 defects in its own playbook, two of which would have produced false passes:get_playground_logsdoes not surface PHP errors. It reports the Node process's output. The original playbook made it the primary evidence channel. In the first run it returned one npm warning while a realPHP Fatal errorlanded inwp-content/debug.log, invisible. An agent following those instructions literally would report "no errors" on a fataling plugin.A second run found a third:
WP_DEBUG_DISPLAYis false by default, so the "notices in the page body" check was structurally incapable of failing.The playbook now names
debug.logas the evidence channel, requires a deliberatetrigger_errorprobe to prove logging is on before an empty log means anything, carries working recipes for the commands the MCP bridge doesn't implement, and confirms booted versions from inside the instance — the CLI banner reported PHP 8.3 / WP latest for an instance serving 8.2.33 / 6.7.7.It also gained one deliberate carve-out from "never edit": VFS-only scratch copies at non-mounted paths, with a mandatory
git status --porcelaincheck afterwards. Forbidding it absolutely made the agent weaker for no safety gain — it's what let the agent prove the v1.0.2 autoload fix is real rather than masked by a Composer classmap.Tests
tests/agents/test-agent-contracts.sh, 43 assertions. The read-only guarantee lives in each agent'stools:allowlist, not its prompt body — a prompt saying "you do not modify code" is advisory, an omittedEditis enforced. These assert the structural half, and pin the three false-pass traps so a future edit that drops thedebug.logwarning or the auto-login recipe reintroduces a gate that cannot fail.Verified by negative control: a fixture agent declaring
Editturns the suite red on exactly that assertion.Suite: 56 → 99 assertions.
./scripts/quality.shgreen.Follow-up
A stacked PR fixes the two template bugs this agent found (
vendor/autoload.phpfataling on a fresh clone, and thePL_Example_Pluginsubstitution gap).🤖 Generated with Claude Code