Skip to content

Isolate WP-CLI scalar captures from PHP diagnostic prefixes - #496

Merged
chubes4 merged 1 commit into
mainfrom
fix/494-wp-cli-machine-output
Aug 30, 2026
Merged

Isolate WP-CLI scalar captures from PHP diagnostic prefixes#496
chubes4 merged 1 commit into
mainfrom
fix/494-wp-cli-machine-output

Conversation

@chubes4

@chubes4 chubes4 commented Aug 30, 2026

Copy link
Copy Markdown
Member

Related issues

Fixes #494

Related, not duplicated:

How AI was used in this PR

OpenAI GPT-5.6 Sol via OpenCode general subagent investigated the PHP 8.5 react/promise deprecation 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.phar prints a react/promise deprecation before the payload, so SITE_DOMAIN became Deprecated: ... localhost:8881 and recorded log paths were emptied after warning tokens were rejected as non-absolute paths.

This PR adds one capture helper in lib/common.sh and 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.sh
  • bash tests/detect-site-domain.sh
  • bash tests/source-mode.sh
  • bash tests/owned-source-discovery.sh

The new suite covers normal scalar stdout, warning-contaminated stdout, diagnostic-only stdout, SITE_DOMAIN detection, and recorded log-path normalization.

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.
@chubes4
chubes4 merged commit 6390e1a into main Aug 30, 2026
63 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.

Isolate WP-CLI scalar captures from PHP diagnostic prefixes

1 participant