Skip to content

Commit 096e389

Browse files
Merge pull request #3 from SymPress/phase-3-default-steps
feat: implement all default setup steps with verified content publication
2 parents cf9d428 + 63d7a0d commit 096e389

36 files changed

Lines changed: 2408 additions & 49 deletions

‎.github/workflows/differential.yml‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,10 @@ jobs:
3131
coverage: none
3232
- name: Install candidate dependencies
3333
run: composer install --no-interaction --no-progress --no-plugins --no-scripts
34+
- name: Install VCS fixture tools
35+
run: sudo apt-get update -qq && sudo apt-get install -y -qq mercurial subversion
36+
- name: Verify real VCS integrations
37+
run: php vendor/bin/phpunit --filter VcsIgnoreStepTest --no-progress --fail-on-skipped
3438
- name: Compare pinned oracles and candidate
3539
run: python3 tools/differential/run.py --oracle-php /usr/bin/php8.2 --candidate-php /usr/bin/php8.5 --composer "$(command -v composer)"
3640
- name: Preserve exact comparison evidence
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# ADR 0012: WP-CLI arguments and diagnostic boundaries
2+
3+
Status: implementation decision, 2026-09-29.
4+
5+
WP-CLI command strings are tokenized with Symfony Console, and file descriptors remain argument arrays. The process adapter quotes each argument exactly once. Array arguments are never converted back through StringInput: that round trip removes literal backslashes. Quoted paths, whitespace, apostrophes and shell metacharacters reach WP-CLI as values. Trusted shell programs remain available through the separate SystemProcess string API.
6+
7+
Configured `--path=value` and `--path value` options are removed before the `--` terminator; the resolved core path is inserted before that terminator or appended when none exists. Values after `--` remain positional values. This makes the configured core authoritative without corrupting an option-looking argument.
8+
9+
## D24 argument fidelity
10+
11+
Upstream `WpCliFileData::setup` filters arguments with array_filter, dropping both empty strings and the string `"0"`. The runtime keeps this zero filtering in legacy profiles; native mode retains `"0"` as a usable argument. Empty strings are filtered in both. Whitespace inside nonempty arguments is preserved rather than trimmed. Nonstring/null-byte input is rejected under D01. Upstream's unquoted eval-file concatenation can split paths/arguments or perform shell expansion; the capability to pass these values is preserved through literal argument arrays, as required by the work order. Exact argument-vector fixtures cover these changes.
12+
13+
PHP providers receive both local `$services`/`$locator` and a temporarily installed global locator. Any previous global value is restored, including on failure. Evaluation occurs once during selected execution; listing and static validation do not execute the PHP file. Provider errors expose a generic diagnostic, not exception contents or returned values.
14+
15+
Process failure messages report the exit code without repeating the command line, which may contain credentials. Child stdout/stderr continue to stream as command output; explicit capture still returns its error object to the caller. Step progress reports command numbers rather than argv. This changes diagnostic wording while retaining the failure, exit status and command output.
16+
17+
Verification includes captured argument-vector processes, provider success/failure/cleanup, missing files, first-failure termination and a real WP-CLI 2.12.0 fixture invoking eval-file without WordPress and reading WordPress 7.1.1's core version.
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# ADR 0013: Content publication and VCS verification
2+
3+
Status: implementation decision, 2026-09-29.
4+
5+
This implements D10, D11, D18 and D20 from ADR 0005. Package dropin sources are retained, including metadata and licenses. File publication prepares a sibling file or relative symlink before replacing the target; a failed copy/download leaves existing bytes intact. Directory publication and core-content moves preflight destination types and overwrite protection before starting. Physical ancestor/descendant overlaps are rejected even for explicit symlink operations. Move-content still transfers the entire core wp-content tree and removes its source on success; theme registration disables it.
6+
7+
The dropin catalog is the twelve-name union from the inventoried WordPress core and both WP Starter baselines. All four multisite filenames are available in every publication route; WordPress itself decides whether to load them. Release-profile unknown names retain false/ask/true handling. Native and dev profiles accept explicitly mapped filenames. Each catalog entry has execution assertions for package, map and development-content sources.
8+
9+
## D02 release publication
10+
11+
The release has no dropins-op option and always copies dropins. The release compatibility profile retains copy; native/dev honor auto/symlink/copy/none/ask. Differential fixtures record all ten upstream-catalog file-to-link differences individually with exact hashes and normalized link targets.
12+
13+
The pinned release's copy operation copies each complete plugins/themes/mu-plugins/languages directory, including hidden and VCS entries. Its symlink operation uses an immediate-child glob, which omits dotfiles but includes non-dot VCS directories. Dev uses Finder's dotfile/VCS filtering for immediate children in both modes. Runtime preserves these discovery differences in the release profile; native follows the dev behavior. The differential fixture records the exact hidden-file hash present only in the release output and verifies that the release compatibility profile restores it. This extends the D02 baseline-default decision with a source-proven discovery difference.
14+
15+
In selected mode, native content-dev ask means auto publication under D21. The dev compatibility profile retains the upstream no-operation result when its optional question was bypassed. Release confirmation defaults to symlink.
16+
17+
## Actual VCS evidence
18+
19+
Git metadata may be a directory or worktree pointer file. Git checks include tracked files, even if an ignore pattern matches; an existing generated marker grants no exemption. Mercurial status and Subversion ignore properties are inspected using their command-line tools. Missing tools or metadata produce an explicit unknown diagnostic rather than a success. A failed or incomplete inspection returns an error. Repositories without commits are still checked.
20+
21+
Only missing Git/Mercurial ignore files are created. Existing user entries and custom templates remain untouched; generated template output is checked immediately. Literal paths are escaped for the relevant ignore syntax. Native rules name the actual targets instead of grouping unrelated public assets under a shared parent. Environment variants, runtime caches and build dumps are included when present. Native also includes wp-cli.yml before it exists, because the required default order creates it in the following step. Subversion properties are read without changing repository properties or creating a fictitious .svnignore.
22+
23+
Verification uses disposable real Git, Mercurial and Subversion repositories, a Git worktree, tracked-sensitive-file failures, custom templates and filenames containing spaces/brackets. Complete differential coverage of every publication failure and ignore-file format remains an acceptance task.

‎docs/adr/README.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,5 @@ Implementation decisions after Phase 0:
1818
9. [Independent payload publication and path guards](0009-independent-payload-and-path-guards.md)
1919
10. [Managed configuration regeneration and build dumps](0010-managed-config-regeneration-and-dumps.md)
2020
11. [Pinned oracle default environment directory defect](0011-oracle-default-env-directory.md)
21+
12. [WP-CLI arguments and diagnostics](0012-wp-cli-argument-and-diagnostic-boundaries.md)
22+
13. [Content publication and VCS verification](0013-content-publication-and-vcs-verification.md)

‎docs/differential.md‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,11 @@ Current comparisons:
2121
- The real upstream Composer command and standalone candidate generate index/wp-config files, then a fresh process executes the index through a stub core. Runtime reports compare constants, debug defaults, URLs, content/core paths, database defaults, salts, prefix and boot count across four canonical environments. Only the two path fields substitute the fixture root. D13 explicitly requires an upstream Composer classloader and a candidate without one.
2222
- Warm caches must bypass malformed environment files and retain the exact cold runtime report. A real DB_PASSWORD override is checked separately: D06 requires the oracle's cached value and the candidate's actual process value.
2323
- The dev oracle's omitted `env-dir` failure is preserved as `dev/default-env-dir` under D23. Generated-runtime comparisons explicitly set `env-dir: "."` on both sides; the candidate default also has to generate and boot successfully. See ADR 0011.
24+
- Content publication compares complete target trees with exact file hashes and normalized symlink destinations in copy/symlink modes. Core-content moves compare the full destination and source removal. D02 records the release's hidden-file copy and copy-only dropins; the release compatibility profile also restores hidden-file publication.
25+
- A synthetic installed dropin package reproduces D10: both oracles remove its source and license; the dev oracle leaves a dangling symlink. The candidate must retain source/license and expose a working link with the expected content hash. Only fixture package metadata is added; upstream source is never patched.
26+
- WP-CLI fixtures compare exact argument queues. D17 records the release validator's missing eval-file execution; D24 records dev's splitting of a spaced argument and filtering of zero, versus native literal arguments.
27+
- The dev VCS fixture has an upstream generation marker but no ignore rules. D18 requires the oracle's accepted marker and the candidate's failing actual protection check. A separate CI test executes real Git, Mercurial and SVN and fails if their tests are skipped.
2428

2529
The report is `build/differential/report.json`, uploaded by the dedicated CI job. An unregistered mismatch or non-executable oracle fails the run. Temporary oracle sources and dependencies are removed on exit.
2630

27-
This is incremental acceptance evidence. Complete normalized file snapshots, additional cache edge cases, callbacks, the remaining default steps, and real consumer/admin/kernel checks remain required. No whole-file or whole-section exclusion grants acceptance to untested statements. Use `--scope constants`, `--scope environment` or `--scope generated` for a focused rerun; the report identifies that reduced scope.
31+
This is incremental acceptance evidence. Complete generated PHP/template snapshots, additional cache and publication failure cases, callbacks, and real consumer/admin/kernel checks remain required. No whole-file or whole-section exclusion grants acceptance to untested statements. Use `--scope constants`, `--scope environment`, `--scope generated` or `--scope steps` for a focused rerun; the report identifies that reduced scope.

0 commit comments

Comments
 (0)