Add structured verify JSON reports and safe Blueprint materialize export to @wp-playground/cli

Đang mở
#4,792 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức phù hợp với người mới
35/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
javascript, wasm, wordpress
Lĩnh vực
backend-api-design, cli

Hướng nghiên cứu

Start by reading the @wp-playground/cli implementation and the linked reference patterns wpai verify and wpai export, then review the staged proposal and related PR for the proposed report and state schemas. Agree on the command or Blueprint convention and safety invariants before implementation; done means the upstream interface and minimal PR scope are agreed, with verification and materialization behavior specified.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

Problem

@wp-playground/cli already gives agents a one-command, zero-MySQL path to boot Blueprints. Two adjacent contracts are still missing for reliable agent loops:

  1. Structured verify / JSON report — run-blueprint executes steps, but agents lack a first-class, machine-parseable pass/fail report for site options, content presence, REST routes, Abilities, and PHP fatals. Today they scrape logs or invent ad-hoc runPHP probes.
  2. Materialize export — Blueprints often use runPHP / importWxr during ephemeral Playground boots. Replaying raw PHP on production MySQL/MariaDB hosts is unsafe and non-idempotent. Agents need a declarative handoff (WXR + allowlisted state + changed wp-content/) with zero raw runPHP replay.

Proposal

Two thin CLI surfaces (or equivalent Blueprint step + report conventions) in official Playground:

1. Structured verify / JSON report
npx @wp-playground/cli verify \
  --blueprint=./blueprint.json \
  --checks=./verify.json \
  --out=./report.json
# exit 0 iff all checks pass; report.json always written

verify.json would declare expectations only (no agent-supplied executable PHP): site options, published pages/posts by slug/title, CPT counts, terms, theme/plugin presence, REST route presence, Abilities API presence/count, optional live HTTP checks.

report.json should include at least: ok, wordpress_version, php_version, per-check { name, passed, detail }, and php_last_error on failure.

2. Materialize export (WXR + declarative state)
npx @wp-playground/cli materialize \
  --blueprint=./blueprint.json \
  --out=./dist/
# Writes content.wxr + state.json + changed wp-content/; never emits runPHP source

Invariants:

  • Zero raw runPHP replay in the export artifact
  • No secrets (admin accounts, password hashes, salts, SQLite drop-ins)
  • No symlink following under wp-content/
  • Fail safe on host-level untranslatable steps unless an explicit --allow-partial (or equivalent) is set

Non-goal

This is not a proposal to adopt a second official CLI. wpai is a research harness / reference implementation that wraps pinned @wp-playground/cli. After upstream adoption, wpai should call the official commands and shrink.

Reference implementation

Empirical context (honest scope)

Verified in-repo: 63 controlled runs within a single model family; Condition C (verify in the loop) reached 15/15 suitable WordPress selections with live Playground verification and 100% negative-control restraint. Multi-vendor Harbor trials are prepared but not yet run — no cross-vendor claims here.

Ask

  • Schema bikeshed on report + state JSON
  • Willingness to accept a minimal PR after design agreement
  • Preference: new CLI subcommands vs Blueprint step/report conventions
Ngôn ngữ chính
JavaScript
Star
2k
Fork
504
Merge trung bình
1 ngày 18 giờ
Pull request đã merge (30 ngày)
146

Chuẩn bị môi trường

Mở trong Codespaces

Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của WordPress/wordpress-playground

Tất cả issue của WordPress/wordpress-playground

Issue tương tự

Thêm issue về JavaScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.