3.2 KiB
Local Integration Isolation Implementation Plan
For agentic workers: REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (
- [ ]) syntax for tracking.
Goal: Make local WordPress fixtures, Playwright scenarios, show archive links, and image rebuild checks deterministic, isolated, reversible, and safe.
Architecture: Browser readers run in three dependency roots while a serial Chromium scenario project mutates the local database only after all roots finish. Snapshot and restore lifecycle tests execute only in the isolated WordPress PHPUnit database; automated tests never run a destructive lifecycle harness against the development E2E database. The local seeder owns fixture records, merges unrelated sticky posts, and restores exact original option bytes explicitly.
Tech Stack: WordPress PHP, WP-CLI/wp-env on Colima, Playwright, Node test runner, POSIX shell.
Task 1: Isolate Playwright database scenarios
Files: playwright.config.mjs, tests/e2e/visual-states.spec.mjs, tests/e2e/visual-scenarios.spec.mjs, tests/smoke/e2e-harness.test.mjs
- Write smoke contracts for read-only specs and dependent serial scenario project.
- Run smoke test and record the expected RED failure.
- Move mutation coverage into the dedicated serial spec and configure dependencies.
- Run smoke and focused scenario tests GREEN.
Task 2: Restore local WordPress configuration exactly
Files: scripts/seed-test-content.php, scripts/lib/fixture-environment.php, tests/php/FixtureEnvironmentTest.php, README.md
- Write adversarial WP/PHP integration tests for snapshot, sticky merge, scenarios, and exact restore.
- Run the tests and record the expected RED failure.
- Add versioned snapshot ownership and explicit restore scenario.
- Prove exact restoration and scenario ownership in the isolated PHPUnit DB.
Task 3: Preserve show archive routing
Files: inc/queries.php, blocks/journal-stream/render.php, tests/php/BlockRenderingTest.php
- Write pretty/plain/subdirectory URL tests for
chrnx_showarchive context and rejected raw input. - Run focused PHP tests and record RED.
- Add show to internal archive base and pagination values without public request parsing.
- Run focused PHP tests GREEN.
Task 4: Harden responsive rebuild destinations
Files: scripts/build-responsive-images.sh, tests/smoke/visual-integration.test.mjs, README.md
- Write tests for the documented exact command and symlink/nested/outside rejection.
- Run smoke and record RED.
- Canonicalize TMPDIR and require a non-symlink direct
chrnx-*child. - Rebuild and byte-compare all 35 outputs GREEN.
Task 5: Verify and commit
- Run adversarial seed lifecycle and leave default state.
- Run the full E2E matrix twice and the complete
npm testchain. - Run PHP/JS/CSS/PHPCS, asset, parse, HTTP, diff, and secret checks.
- Stage only intentional files, inspect cached diff, and commit
fix: isolate CHRNX local integration state. - Confirm a clean worktree and do not push or deploy.