Skip to content

Preserve wrapped Composer overlay package layouts#2057

Open
chubes4 wants to merge 1 commit into
mainfrom
fix/2055-overlay-package-layout
Open

Preserve wrapped Composer overlay package layouts#2057
chubes4 wants to merge 1 commit into
mainfrom
fix/2055-overlay-package-layout

Conversation

@chubes4

@chubes4 chubes4 commented Jul 25, 2026

Copy link
Copy Markdown
Collaborator

Summary

Preserve a Composer dependency overlay as one coherent package when the consumer adds a common wrapper directory to its PSR-4 paths. This keeps package bootstraps, package-local Composer metadata, and source files aligned instead of relocating only source directories.

What changed

  • Detect when every comparable PSR-4 mapping adds the same safe wrapper prefix.
  • Stage the complete hydrated package under that wrapper and retain the actual package root for source-reference metadata.
  • Preserve the existing source-directory relocation behavior for non-wrapper layout changes.
  • Strengthen the overlay smoke test to execute a package bootstrap through its relocated classmap and verify no bootstrap or autoloader remains at the old root.

Compatibility

Overlay target paths, checkout immutability, cleanup ownership, source references, and non-wrapper relocation behavior remain unchanged. Wrapper detection fails closed when mappings disagree or any comparable mapping remains unwrapped.

Verification

  • npm run test:composer-package-overlay-autoload-layout
  • npm run build
  • git diff --check

Evidence

Lab run 10b9a5f5-4782-4f77-9b29-cf2afe61d1ac executed WP Codebox #2054 commit 789b5aa5806f914afd4f0c1684af690f4947f930. The repaired WP-CLI response retained 1,047,387 characters, proving the lazy-response fix, but the overlay emitted 138 missing-source classmap warnings and the payload ended mid-JSON. Raw output SHA-256: 1dc2de341beb689dcbc6b37373ed2dcafecd25b3d28534f9567362e7b27409be.

Closes #2055

AI assistance

  • AI assistance: Yes
  • Tool: Homeboy and OpenCode
  • Model: openai/gpt-5.6-sol
  • Used for: Traced the Lab-only warning and truncation chain, drafted the generic wrapper-layout repair and executable regression, reviewed the generated edge cases, and ran deterministic verification.

@chubes4

chubes4 commented Jul 25, 2026

Copy link
Copy Markdown
Collaborator Author

Lab integration evidence is available from run 50eadcfc-23c9-450a-929f-cb47f08f2a65, using combined WP Codebox commit 427cd1514bd157cc4fcf07cf6744acb1eb7d7d98 (#2054 + this PR).

The package-layout repair removes the previous 138 autoload warnings and allows the structured WP-CLI payload to parse. The fixture now retains the import report, blocks-engine/wordpress-site-plan/v2, a completed materialization receipt, and all eight bounded page provenance records.

The matrix remains red for fixture quality findings, as expected. Evidence readiness improved from five missing fields to one: transformer_reference. That remaining clean-source reference propagation gap is independently tracked in #2058 rather than attributed to this layout repair.

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.

Preserve package layout when reconciling dependency overlays

1 participant