Skip to content

fix(playground): honor declared sourceRoot as the readonly mount symlink boundary - #2614

Merged
chubes4 merged 2 commits into
mainfrom
fix/issue-2613-wp-codebox
Dec 2, 2026
Merged

chubes4 merged 2 commits into
mainfrom
fix/issue-2613-wp-codebox

Conversation

@chubes4

@chubes4 chubes4 commented Dec 2, 2026

Copy link
Copy Markdown
Collaborator

Summary

In a CLI recipe-run with the monorepo fixture, wordpress.run-php read /wordpress/wp-content/plugins/myplug/vendor-link/lib.php and printed VIA_LINK=yes CONTENT=library. Mounting the same plugin without sourceRoot printed VIA_LINK=no and recorded readonly-mount-symlink-skipped with reason: source-escape, confirming that the wider boundary is opt-in.

What changed

  • Carry the declared sourceRoot through CLI and runtime-core plugin preparation to readonly mount staging.
  • Use the same resolved containment boundary for snapshot staging and cache fingerprinting.
  • Reject a root that does not contain the resolved mount source; keep diagnostics for escaping, dangling, and cyclic symlinks.
  • Additive: plugins without sourceRoot keep the plugin directory as their containment boundary.

Verification

All gates passed on a5b04b9. Base main@27c50a5 unchanged.

  • HOMEBOY_LINT_BASE=27c50a58c9759dd030313d7ba3f3655147bf96fa homeboy --placement local review lint wp-codebox --path . --…: passed, 85101 ms; retained gate metadata.
  • npm run build: passed, 602 ms; retained gate metadata.
  • npx tsx --test tests/playground-readonly-mounts.test.ts: passed, 11361 ms; retained gate metadata.
  • repro: none (no repro gate was declared, so these gates do not prove the issue).
  • CI: pending

Cook run
  • Cook ID: agent-task-5323920f-ea42-405b-be7f-aa6323a97e14
  • Attempt run ID: agent-task-5323920f-ea42-405b-be7f-aa6323a97e14-attempt-1-186699be
  • Gate 1: tree 2811f48898ed891ee3a6ce93003da57876d24c22
  • Gate 2: tree 2811f48898ed891ee3a6ce93003da57876d24c22
  • Gate 3: tree 2811f48898ed891ee3a6ce93003da57876d24c22

Evidence

  • The CLI fixture read the linked library with a declared root and logged source-escape without it. An unrelated root was rejected with invalid-source-root.
  • The new staging regression failed before the fix because the linked file was missing. Focused local tests and TypeScript compilation passed after the fix; deterministic 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: 27m53s.

The AI traced plugin preparation, implemented containment and validation, added regression coverage, and verified the behavior through the CLI, 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 #2613

… not an error

Agent-task recipes stage prepared plugin copies while keeping the original
sourceRoot. Restore the existing contract: a sourceRoot that does not contain
the source is ignored, and only a containing sourceRoot widens the readonly
symlink boundary.
@chubes4

chubes4 commented Dec 2, 2026

Copy link
Copy Markdown
Collaborator Author

End-to-end check through the CLI (recipe-run, wordpress.run-php probe): with sourceRoot + sourceSubpath declared, plugins/myplug/vendor-link -> ../../packages/lib materializes (VIA_LINK=yes). Without sourceRoot it's still skipped. Follow-up 0164888 restores the existing contract that a non-containing sourceRoot is ignored, not rejected (agent-task recipes stage prepared plugin copies under the original root, which component-contracts-agent-task-smoke caught). Escaping symlinked subpaths are still rejected. The browser failure (service-worker preview proxy) also fails on main at c27151b.

AI disclosure: Claude Opus (Pi, via Roadie) reviewed this, wrote the follow-up commit, and ran the end-to-end check. The initial implementation is GPT-6.2 Sol (Homeboy Cook).

@chubes4
chubes4 marked this pull request as ready for review December 2, 2026 16:39
@chubes4
chubes4 merged commit 3ada50d 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