Isolate WP-CLI scalar captures from PHP diagnostic prefixes - #496
Merged
Conversation
SITE_DOMAIN and recorded log paths were reading raw WP-CLI stdout, so a PHP 8.5 deprecation prefix became the site identity and was tokenized as candidate paths.
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.
Related issues
Fixes #494
Related, not duplicated:
react/promisev2.How AI was used in this PR
OpenAI GPT-5.6 Sol via OpenCode general subagent investigated the PHP 8.5
react/promisedeprecation across wp-coding-agents and Data Machine Code, searched existing trackers, identified the untracked scalar-capture gap, implemented the shared stdout isolator, added contaminated/normal fixtures, and opened this PR under human direction.Proposed Changes
Upgrade detection treated raw WP-CLI stdout as machine values. On PHP 8.5, Studio's bundled
wp-cli.pharprints areact/promisedeprecation before the payload, soSITE_DOMAINbecameDeprecated: ... localhost:8881and recorded log paths were emptied after warning tokens were rejected as non-absolute paths.This PR adds one capture helper in
lib/common.shand uses it for the two scalar readers that produced that failure: site URL detection and source-policy option reads. Host-runtime emission stays with Studio/WP-CLI; this defends the wp-coding-agents capture contract.Testing
bash tests/wp-cli-machine-output.shbash tests/detect-site-domain.shbash tests/source-mode.shbash tests/owned-source-discovery.shThe new suite covers normal scalar stdout, warning-contaminated stdout, diagnostic-only stdout,
SITE_DOMAINdetection, and recorded log-path normalization.