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

Aperta
#4,792 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
35/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
javascript, wasm, wordpress

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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
Lingua principale
JavaScript
Stelle
2k
Fork
504
Merge medio
1g 18h
PR unite (30g)
146

Preparare l'ambiente

Apri in Codespaces

Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di WordPress/wordpress-playground

Tutte le issue di WordPress/wordpress-playground

Issue simili

Altre issue su JavaScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.