Skip to content

fix(phpunit): resolve dependency plugin entrypoints from sourceSubpath - #2618

Merged
chubes4 merged 1 commit into
mainfrom
fix/issue-2617-wp-codebox
Dec 2, 2026
Merged

chubes4 merged 1 commit into
mainfrom
fix/issue-2617-wp-codebox

Conversation

@chubes4

@chubes4 chubes4 commented Dec 2, 2026

Copy link
Copy Markdown
Collaborator

Summary

PHPUnit looked for dependency entrypoints at the repository root even when the plugin was mounted from a nested directory. PHPUnit now shares source-subpath resolution with mounting and activation, so the regression fixture emits demo/demo.php instead of demo/root.php.

What changed

  • Share source-subpath resolution across PHPUnit dependency discovery, plugin mounting, and activation.
  • Keep explicit pluginFile values authoritative.
  • Add a regression fixture that verifies the generated dependency entrypoint matches the mounted plugin.

Verification

All gates passed on 19d2ed8. Base main@d8ea741 unchanged.

  • HOMEBOY_LINT_BASE=d8ea74149cf83d3b3b9a3513a88699f659fbcb5a homeboy --placement local review lint wp-codebox --path . --…: passed, 101568 ms; retained gate metadata.
  • npm run build: passed, 3399 ms; retained gate metadata.
  • npx tsx --test tests/phpunit-discovery-only.test.ts tests/phpunit-project-autoload.test.ts: passed, 1436 ms; retained gate evidence.
  • repro: none (no repro gate was declared, so these gates do not prove the issue).
  • CI: pending

Gate 3 output
✔ wordpress.phpunit discovery-only returns canonical files before execution (1.547067ms)
✔ discovery-only rejects selectors before starting a runtime (0.548718ms)
✔ discovery-only returns its schema-bound result directly (8.619692ms)
✔ relative managed config discovery matches absolute sandbox paths (issue #2601) (42.436612ms)
✔ recipe setup uses canonical boolean parsing and rejects mixed workflows (0.525575ms)
▶ file-only testsuite discovery (issue #2516)
  ✔ case: only <file> declared runs exactly that file, no directory scan (the fix) (15.92727ms)
  ✔ case: <directory> declared stays scoped to it (unchanged) (19.502685ms)
  ✔ case: neither <directory> nor <file> keeps the whole-test-root default (unchanged) (17.070953ms)
✔ file-only testsuite discovery (issue #2516) (53.628311ms)
✔ discovery-only reports an empty test root as an empty result (23.720126ms)
phpunit project autoload ok
✔ tests/phpunit-project-autoload.test.ts (1154.0065ms)
ℹ tests 11
ℹ suites 0
ℹ pass 11
ℹ fail 0
ℹ cancelled 0
ℹ skipped 0
ℹ todo 0
ℹ duration_ms 1160.797712

Cook run
  • Cook ID: agent-task-dee6616f-9740-4a03-954b-217615610230
  • Attempt run ID: agent-task-dee6616f-9740-4a03-954b-217615610230-attempt-1-b3c97b38
  • Gate 1: tree d493d30cf99d27dbd34070e17c1132e6a46ed6e9
  • Gate 2: tree d493d30cf99d27dbd34070e17c1132e6a46ed6e9
  • Gate 3: tree d493d30cf99d27dbd34070e17c1132e6a46ed6e9

Evidence

  • Locally, the new assertion failed before the fix with demo/root.php. After the fix, the PHPUnit project-autoload and nested plugin source tests passed, as did the focused TypeScript compilation. Full gate verification is left to Homeboy.

AI disclosure

Tool: Homeboy Cook. Agent: Homeboy (roadie). Model: roadie · route cook-heavy · served gpt-6.2-sol. Cook time: 25m12s.

The AI reproduced the bug, shared the source-resolution logic, and added regression coverage, under the direction of the Cook requester. Homeboy reports controller verification separately from this account of the AI's work. A human reviews before merge.

Refs #2617

@chubes4

chubes4 commented Dec 2, 2026

Copy link
Copy Markdown
Collaborator Author

End-to-end check against Jetpack's real monorepo layout. recipe build phpunit with the extra plugin declared the way Homeboy's adapter declares it (source = monorepo root, sourceSubpath: projects/plugins/wpcomsh, sourceRoot = monorepo root):

The browser failure also fails on main.

AI disclosure: Claude Opus (Pi, via Roadie) reviewed this and ran the check. The implementation is GPT-6.2 Sol (Homeboy Cook).

@chubes4
chubes4 marked this pull request as ready for review December 2, 2026 19:50
@chubes4
chubes4 merged commit c3f048d into main Dec 2, 2026
4 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant