Skip to content

Commit b1c1662

Browse files
Merge pull request #6 from SymPress/phase-6-compatibility-migration
feat: migrate WP Starter configuration and finalize compatibility
2 parents 8e99e9d + cc17ab8 commit b1c1662

80 files changed

Lines changed: 2990 additions & 106 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.github/workflows/differential.yml‎

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,20 @@ jobs:
3535
run: sudo apt-get update -qq && sudo apt-get install -y -qq mercurial subversion
3636
- name: Verify real VCS integrations
3737
run: php vendor/bin/phpunit --filter VcsIgnoreStepTest --no-progress --fail-on-skipped
38+
- name: Verify executed evidence for every parity row
39+
run: |
40+
php vendor/bin/phpunit --no-progress
41+
php vendor/bin/phpunit --no-logging --list-tests-xml build/test-list.xml
42+
python3 -m unittest discover -s tools/tests
43+
python3 tools/parity-evidence.py
3844
- name: Compare pinned oracles and candidate
3945
run: python3 tools/differential/run.py --oracle-php /usr/bin/php8.2 --candidate-php /usr/bin/php8.5 --composer "$(command -v composer)"
4046
- name: Preserve exact comparison evidence
4147
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
4248
with:
4349
name: wpstarter-differential
44-
path: build/differential/report.json
50+
path: |
51+
build/differential/report.json
52+
build/parity-evidence.json
53+
build/phpunit.xml
4554
if-no-files-found: error
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: WordPress package installation
2+
3+
on:
4+
pull_request:
5+
workflow_dispatch:
6+
7+
permissions:
8+
contents: read
9+
10+
jobs:
11+
wpackagist:
12+
runs-on: ubuntu-24.04
13+
timeout-minutes: 15
14+
steps:
15+
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
16+
- uses: shivammathur/setup-php@f3e473d116dcccaddc5834248c87452386958240 # v2
17+
with:
18+
php-version: '8.5.9'
19+
extensions: curl, dom, mbstring, mysqli
20+
tools: composer:2.10.3
21+
coverage: none
22+
- name: Compare normal and offline placement with real repository packages
23+
run: python3 tools/wpackagist-smoke.py --php php --composer "$(command -v composer)"
24+
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
25+
with:
26+
name: wpackagist-installation
27+
path: build/consumer-smoke/wpackagist-report.json
28+
if-no-files-found: error

‎.gitignore‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,5 @@
33
/.phpunit.cache/
44
/.phpstan.cache/
55
/build/
6+
/.subversion/
7+
__pycache__/

‎NOTICE‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ revisions and individual file references are recorded in docs/source-evidence.md
99
and docs/upstream-inventory.json. The upstream notice is retained for any
1010
source-derived portions, including the salt catalog, section-edit format,
1111
WordPress constant/type catalog and environment alias order.
12+
resources/legacy-mu-loader.php.txt and resources/legacy-mu-loader-dev.php.txt are
13+
the pinned upstream MU loader templates, retained only for byte-exact
14+
recognition of generated files during migration.
1215

1316
The MIT License (MIT)
1417

‎README.md‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
`sympress/runtime` will replace WP Starter across the SymPress ecosystem.
44

5-
**Status: Phases 1-4 are available as stacked draft PRs; Phase 5 implements kernel integration and diagnostics. Phase 0 was approved on 2026-09-29. Full parity acceptance and consumer migration remain open.**
5+
**Status: Phases 1-5 are available as stacked draft PRs. Phase 6 implements migration and compatibility diagnostics; full parity acceptance and consumer migration remain open. Phase 0 was approved on 2026-09-29.**
66

7-
Requires PHP 8.5 and Symfony 8.1. The Composer plugin runs application code in a separate PHP process, with a standalone binary for installs performed using `--no-plugins`.
7+
Requires PHP 8.5 and Symfony 8.1. The Composer plugin runs application code in a separate PHP process. The standalone binary also recovers standard WordPress package paths after `composer install --no-plugins`, before loading project code. WPackagist, private repositories and local Composer packages keep the regular installer workflow; dependency resolution and downloads stay with Composer. See [the package-layout boundaries](docs/adr/0019-standalone-wordpress-package-layout.md) and [the acceptance record](docs/acceptance.md).
88

99
```sh
1010
composer install
@@ -28,5 +28,7 @@ All twelve inventoried setup steps are implemented, together with scripts/events
2828
- [Configuration](docs/configuration.md)
2929
- [CLI](docs/cli.md)
3030
- [Custom steps and services](docs/custom-steps.md)
31+
- [Migration](docs/migration.md)
32+
- [Phase 6 progress](docs/phase6-progress.md)
3133

3234
All inventoried functionality remains in scope, including features not used by the current starter or demo. No `wecodemore/*` package is required. The isolated differential job installs its pinned oracles separately. See [NOTICE](NOTICE) for upstream attribution.

‎bin/prepare-layout.php‎

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
// Private child entrypoint: no project autoload.php or Composer plugins/scripts.
6+
try {
7+
[$script, $root, $vendor, $manifest] = $argv;
8+
require_once dirname(__DIR__) . '/src/Composer/LayoutAutoload.php';
9+
SymPress\Runtime\Composer\LayoutAutoload::register($vendor);
10+
$context = new SymPress\Runtime\Application\RunContext($root, $vendor, $vendor . '/bin', manifest: $manifest);
11+
$command = new SymPress\Runtime\Console\RuntimeCommand($context);
12+
$command->setApplication(new Symfony\Component\Console\Application());
13+
$command->mergeApplicationDefinition(false);
14+
$input = new Symfony\Component\Console\Input\ArgvInput([$script, ...array_slice($argv, 4)], $command->getDefinition());
15+
if ($input->getOption('skip') && $input->getArgument('steps') === []) {
16+
throw new InvalidArgumentException('--skip requires step names.');
17+
}
18+
(new SymPress\Runtime\Composer\PackageLayout())->prepare($root, $vendor, $manifest);
19+
} catch (Throwable $error) {
20+
fwrite(STDERR, 'SymPress package layout: ' . $error->getMessage() . PHP_EOL);
21+
exit(2);
22+
}

‎bin/sympress-runtime‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ try {
4040
if (!is_file($autoload)) {
4141
throw new RuntimeException('Project autoloader is missing. Run composer install first.');
4242
}
43+
require_once dirname(__DIR__) . '/src/Composer/LayoutBootstrap.php';
44+
SymPress\Runtime\Composer\LayoutBootstrap::prepare($root, $vendor, $manifestPath, array_values($arguments));
4345
require $autoload;
4446
exit(SymPress\Runtime\Console\Application::main(array_values($arguments), $root, $vendor, $context));
4547
} catch (Throwable $error) {

‎composer.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
"require": {
77
"php": "^8.5",
88
"composer-plugin-api": "^2.6",
9+
"composer/composer": "^2.8",
910
"composer/semver": "^3.4",
1011
"opis/json-schema": "^2.6",
1112
"symfony/console": "^8.1",
@@ -17,7 +18,6 @@
1718
"symfony/process": "^8.1"
1819
},
1920
"require-dev": {
20-
"composer/composer": "^2.8",
2121
"phpunit/phpunit": "^13.0",
2222
"sympress/kernel": "dev-main",
2323
"sympress/qa": "dev-main"

‎docs/acceptance.md‎

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# Runtime acceptance record
2+
3+
The implementation is available through the six stacked Runtime PRs, ending at [Phase 6](https://github.com/SymPress/runtime/pull/6). Consumer changes are separate drafts: [starter #29](https://github.com/SymPress/starter/pull/29) and [demo #49](https://github.com/SymPress/demo/pull/49). Their lockfiles pin Runtime commit `cfc5ffd`. This record deliberately keeps final acceptance open.
4+
5+
## Reproduced evidence
6+
7+
- Full local package QA passes with 1,043 tests / 7,298 assertions, no skips, coding standards and PHPStan max.
8+
- All 407 source-inventory rows map to executed PHPUnit behavioral tests. The evidence checker also rejects duplicate or unknown IDs, missing results, failed tests and skipped-only rows. It does not claim complete branch coverage from a passing test count.
9+
- The isolated differential harness passes 249 cases against the exact release and development commits in `upstream-inventory.json`. It compares constant types and values, environment precedence, generated configuration execution, cache behavior, content hashes/links, WP-CLI arguments, lifecycle callbacks, extension loading, effective step order, all nineteen section edits, MU-loader execution, parsed WP-CLI YAML and active env-example assignments. Intentional differences are asserted as exact expected values, not unrestricted exclusions.
10+
- Real WordPress SHORTINIT connects to a disposable MariaDB database without a Composer autoloader. Its production build dump also boots under an unprivileged identity with read-only project files and unchanged file hashes. A separate actual SiteKernel test loads a precompiled production container under the same permission constraint.
11+
- Fresh, separate DDEV starter and demo projects install WordPress, authenticate into the admin dashboard, boot the kernel once and run `wp console debug:container`. Browser checks capture HTTP 200 responses and zero JavaScript errors. Starter QA passes 6 tests / 47 assertions; demo QA passes 27 tests / 213 assertions plus REST/block/render/ORM smoke.
12+
- Repeated normal Composer installation, a global `composer install --no-plugins`, and the standalone runner preserve 543 starter and 664 demo artifact hashes/link targets. The replay follows each project's configured content path and includes built demo assets and the deterministic package-layout record. Both consumer QA suites pass again after this recovery.
13+
- Real WPackagist `classic-editor` and `twentytwentyfive`, together with Composer WordPress core, install at configured paths both normally and through fresh no-plugins installation plus standalone recovery. The dedicated [GitHub job](https://github.com/SymPress/runtime/actions/runs/36630166059/job/109617080698) passes too. Project autoload files execute after placement, once per standalone invocation; recovery does not replay Composer scripts. Package tests cover all five WordPress types, metadata drift, updates with retained backups, path changes, repository links, authoritative autoload and executable proxies.
14+
15+
## Open acceptance gates
16+
17+
1. **Layout boundary review.** The reproduced starter/demo and WPackagist no-plugins gaps are fixed by offline package placement and metadata/autoload recovery, documented in [ADR 0019](adr/0019-standalone-wordpress-package-layout.md). Root-directory installs, overlapping package destinations and arbitrary third-party installer semantics still require the regular Composer installers. Unknown destination conflicts fail while preserving files. This is a deliberate safety boundary, not a claim that every possible Composer installer layout has been verified.
18+
2. **Consumer CI access.** The [QA PHPUnit 13 PR](https://github.com/SymPress/qa/pull/3) and Runtime phases 1–5 were reviewed and merged after successful CI. All six Runtime PRs passed remote QA before the final Phase 6 review fixes; those fixes pass the complete local suite above and require their own final CI result before merging. Starter and demo still need CI read access to the private Runtime repository and must move their dependency to Runtime main after Phase 6 merges. No CI credentials or repository access have been changed.
19+
3. **Final parity sign-off.** Matrix rows remain `partial` until the preceding gates are resolved and the complete acceptance record is reviewed. The implementation and behavioral evidence are present; there is no claim of complete drop-in acceptance yet.
20+
21+
## Review corrections
22+
23+
The standards review found that offline recovery restrictions also rejected already-correct root and nested package layouts. Preparation now preserves those regular-installer layouts, with regression tests for repeated setup and rejection without mutation when recovery is actually required. The specification review found that URL dropins ignored `--force` when the destination was a symlink. Verified downloads now replace only the link; failed checksum verification leaves the link and its source intact. Both corrections are covered by the full local suite above.
24+
25+
## Reproduction
26+
27+
Run `composer qa` with the dedicated `RUNTIME_TEST_DB_HOST`, `RUNTIME_TEST_WORDPRESS_DIR` and `RUNTIME_TEST_WPCLI_BOOTSTRAP` fixtures configured. Then run:
28+
29+
```sh
30+
vendor/bin/phpunit --no-logging --list-tests-xml build/test-list.xml
31+
python3 -m unittest discover -s tools/tests
32+
python3 tools/parity-evidence.py
33+
python3 tools/differential/run.py --oracle-php php8.2 --candidate-php php8.5 --composer /path/to/composer
34+
python3 tools/consumer-replay.py /path/to/starter /path/to/demo
35+
python3 tools/consumer-replay.py --disable-all-plugins /path/to/starter /path/to/demo
36+
python3 tools/wpackagist-smoke.py --php php8.5 --composer /path/to/composer
37+
node tools/consumer-smoke.mjs /path/to/demo/packages/sympress-demo /path/to/browser build/consumer-smoke /path/to/starter /path/to/demo
38+
```
39+
40+
The test-list command needs `--no-logging`: otherwise PHPUnit overwrites the execution report while listing tests. Local reports and screenshots live under ignored `build/`; CI uploads the differential, execution-map and JUnit reports. Source-only tests require no WP Starter dependency; the oracle exists only in temporary harness projects.

‎docs/adr/0002-names.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,4 @@ Status: accepted by the project owner on 2026-09-29 with Phase 0 approval.
2525

2626
Legacy `extra.wpstarter`, `wpstarter.json`, `wpstarter-autoload.php`, extension metadata/type, runtime names and step slugs remain recognized with deprecations while compatibility is on. Native settings win over legacy settings; within each family the root file wins over the inline object or referenced file. Mixing conflicting sources emits a precise provenance diagnostic. Unknown extension-owned settings remain available via Config with registered validators; strict schema validation must not erase this extension point.
2727

28-
The internal runner DI container and SiteKernel's application container are separate. The runtime package does not replace the kernel, scaffolding CLI, core installer or DDEV.
28+
The internal runner DI container and SiteKernel's application container are separate. The runtime package does not replace the kernel, scaffolding CLI, core download or DDEV. [ADR 0019](0019-standalone-wordpress-package-layout.md) narrows the original core-installer exclusion: regular installers remain in use, with offline placement of already downloaded WordPress packages for the work order's explicit `--no-plugins` path.

0 commit comments

Comments
 (0)