docs: plan CHRNX grunge stages

This commit is contained in:
chrnx committed 2026-08-13 00:17:24 -05:00
1 parent ecd198b692
commit 90bfc20afa
1 file changed
+615
@@ -0,0 +1,615 @@
# CHRNX Music and Podcast Grunge Stages Implementation Plan
<!-- markdownlint-disable MD013 -->
> **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:** Integrate the approved character system with Related Stories, turn Music into one composed grunge cover, give Podcast an original “Frecuencia pirata” background, and repair the latest-conversation layout.
**Architecture:** Start from the verified `main` branch in an isolated integration worktree, merge `feature/character-led-sections`, and preserve both branches' contracts. Reuse the character stage's atmosphere/content/art layers; add one allowlisted Podcast background and responsive derivatives; move the latest-podcast block into the Podcast landing section; specialize only its card geometry. Keep Projects, About, Related Stories, query behavior, and public data unchanged.
**Tech Stack:** WordPress 6.9.6 block patterns and dynamic blocks, PHP 8.3, CSS Grid, local responsive AVIF/WebP pipeline, built-in image generation, Pillow/pytest, PHPUnit, Node smoke tests, Playwright on Chromium/Firefox/WebKit, PHPCS, WordPress Scripts linting.
---
## Working rules
- Work only in `/Users/chrnx/workspace/chrnx-dev/wp-theme/.worktrees/music-podcast-grunge-stages` on `feature/music-podcast-grunge-stages`.
- Use `@superpowers:test-driven-development` for every behavior change and `@superpowers:verification-before-completion` before every completion claim.
- Use the `imagegen` skill and built-in image tool for the new Podcast raster background. Do not substitute CSS-only art, an SVG, a remote image, or an invented stock asset.
- Stop at the image checkpoint until the user visually approves the generated master.
- Never overwrite or delete an approved source portrait, collage, or the full-body Gaming image.
- Preserve Related Stories configuration, selectors, focus behavior, CSS, and tests.
- Leave Projects and About markup/CSS unchanged after the merge unless a failing regression test proves integration damage; bring any proposed visual change back to the user.
- Do not invent cohost names, episode claims, Buzzsprout data, Spotify/DistroKid links, release status, logos, or show branding.
- Do not push, deploy, publish, or mutate production content.
- Use an isolated local `wp-env` on 8908/8909. Never stop the root site on 8888.
- Never commit `.wp-env.override.json`, `node_modules`, `.superpowers/`, `tmp/`, screenshots, Playwright reports, test results, credentials, or database state.
## File map
### Merge and preserve
- `assets/css/components.css` — retain Related Stories rules and character-stage rules; later add only Music/Podcast specialization.
- `tests/php/BlockRenderingTest.php` — preserve both Related Stories and character/topic-art tests if branch drift turns the currently clean merge into a conflict.
- `blocks/topic-hero/render.php`, `inc/queries.php`, `patterns/about.php`, `patterns/home-music.php`, `patterns/home-projects.php`, `patterns/music-landing.php`, `patterns/podcast-landing.php`, `scripts/build-responsive-images.sh`, `tests/assets/test_alter_ego_assets.py`, `tests/e2e/visual-states.spec.mjs`, `tests/php/PatternsTest.php`, `tests/smoke/visual-integration.test.mjs` — accept the character branch changes while preserving later `main` changes.
- `assets/images/alter-ego-gaming-half-body.png` and `assets/images/generated/alter-ego-gaming-half-body-*` — preserve the approved new Gaming source and derivatives alongside the original full-body image.
### Create
- `assets/images/podcast-frequency-grunge.png` — approved person-free “Frecuencia pirata” master.
- `assets/images/generated/podcast-frequency-grunge-384.avif`
- `assets/images/generated/podcast-frequency-grunge-384.webp`
- `assets/images/generated/podcast-frequency-grunge-768.avif`
- `assets/images/generated/podcast-frequency-grunge-768.webp`
- `assets/images/generated/podcast-frequency-grunge-1536.avif`
- `assets/images/generated/podcast-frequency-grunge-1536.webp`
- `assets/images/generated/podcast-frequency-grunge.json` — derivative manifest.
- `tests/e2e/music-podcast-stages.spec.mjs` — focused live layout, long-copy, accessibility, and regression coverage.
- `tests/e2e/pattern-editor-validity.spec.mjs` — real Post Editor and Site Editor pattern validation without saving.
### Modify after merge
- `inc/queries.php` — allowlist the Podcast atmosphere asset and its exact intrinsic dimensions without changing public query/filter behavior.
- `inc/media.php` — render background-sized responsive sources while preserving existing portrait behavior and escaping.
- `scripts/build-responsive-images.sh` — reproducibly build the new 384/768/1536 Podcast background derivatives.
- `tests/assets/test_alter_ego_assets.py` — add a separate opaque-background contract; do not weaken transparent portrait assertions.
- `tests/php/ResponsiveMediaTest.php` — cover the allowlisted background picture markup, loading, sizes, and unknown-key rejection.
- `patterns/music-landing.php` — make the collage the atmosphere, musician the art layer, concise copy the content, and long process note a later section.
- `patterns/podcast-landing.php` — use the new background atmosphere, approved Podcast portrait, brief copy, and the dynamic latest-podcast block inside the landing section.
- `tests/fixtures/pages.json` — remove the duplicate standalone latest-podcast block because the Podcast pattern now owns it; keep exactly seven pages.
- `tests/php/PatternsTest.php` — verify block-valid structure, ordered stage layers, heading order, image semantics, and one latest block.
- `blocks/latest-podcast/style.css` — own bounded media/content geometry and the content-aware stack breakpoint.
- `assets/css/components.css` — style the two stage variants and integrate the latest band without touching Projects/About/Related Stories.
- `tests/php/BlockRenderingTest.php` — add latest-card long-title/content semantics without removing merged coverage.
- `tests/smoke/visual-integration.test.mjs` — lock asset/build/pattern/capture contracts.
- `scripts/capture-visual-review.mjs` — add Music/Podcast 375/768/1440/2560 light/dark captures with one fresh browser per image.
- `README.md` — document the new asset source, deterministic rebuild, isolated review capture, and approval boundary.
## Task 0: Integrate the approved character branch safely
**Files:**
- Merge: `feature/character-led-sections`
- Resolve if conflicted: `tests/php/BlockRenderingTest.php`
- Create temporarily, never commit: `.wp-env.override.json`
- [ ] **Step 1: Prove the integration worktree starts from verified main**
```bash
git status --short --branch
git rev-parse HEAD
git merge-base --is-ancestor dc2b771 HEAD
node --test tests/smoke/*.test.mjs
npm run test:js
```
Expected: branch is `feature/music-podcast-grunge-stages`; `dc2b771` is an ancestor; 55 smoke and 86 Jest tests pass. The committed plan is present and only ignored `node_modules` may remain untracked.
- [ ] **Step 2: Preview overlapping files before the merge**
```bash
git diff --name-only "$(git merge-base HEAD feature/character-led-sections)"..HEAD | sort > /tmp/chrnx-grunge-main-files
git diff --name-only "$(git merge-base HEAD feature/character-led-sections)"..feature/character-led-sections | sort > /tmp/chrnx-grunge-character-files
comm -12 /tmp/chrnx-grunge-main-files /tmp/chrnx-grunge-character-files
git merge-tree --write-tree HEAD feature/character-led-sections
```
Expected: the overlap is bounded. `tests/php/BlockRenderingTest.php` is the only file changed on both sides, but current `git merge-tree --write-tree HEAD feature/character-led-sections` exits 0; conflict guidance below is conditional protection against branch drift.
- [ ] **Step 3: Merge without discarding either feature line**
```bash
git merge --no-ff feature/character-led-sections
```
If Git stops on `tests/php/BlockRenderingTest.php`, inspect all markers. Preserve the complete Related Stories test group from `main` and the character/topic-art tests from the feature branch. Remove only conflict markers and duplicate identical helpers. Do not choose whole-file `--ours` or `--theirs`.
- [ ] **Step 4: Verify the merge tree and source preservation**
```bash
git diff --check
test -f assets/images/alter-ego-gaming.png
test -f assets/images/alter-ego-gaming-half-body.png
rg -n "Related Stories|related-posts" blocks/related-posts tests/php/BlockRenderingTest.php tests/e2e/related-stories.spec.mjs
rg -n "chrnx-character-stage|gaming-half-body" patterns assets/css/components.css inc/queries.php
```
Expected: diff check passes; both Gaming sources exist; Related Stories and character-stage contracts remain present.
- [ ] **Step 5: Start and prove the isolated WordPress baseline**
Create ignored `.wp-env.override.json`:
```json
{
"port": 8908,
"testsPort": 8909
}
```
Run:
```bash
PATH=/opt/homebrew/opt/docker/bin:$PATH npx wp-env start --update
PATH=/opt/homebrew/opt/docker/bin:$PATH npx wp-env run cli wp theme activate chrnx
PATH=/opt/homebrew/opt/docker/bin:$PATH npm run composer -- install --no-interaction --prefer-dist
PATH=/opt/homebrew/opt/docker/bin:$PATH npx wp-env run cli wp core version
PATH=/opt/homebrew/opt/docker/bin:$PATH npx wp-env run tests-cli wp core version
PATH=/opt/homebrew/opt/docker/bin:$PATH npx wp-env run cli wp eval-file wp-content/themes/chrnx/scripts/seed-test-content.php default
curl -fsS -o /dev/null -w 'ROOT=%{http_code}\n' http://localhost:8888/
curl -fsS -o /dev/null -w 'ISOLATED=%{http_code}\n' http://localhost:8908/
```
Expected: both WordPress versions are 6.9.6; seed reports seven pages and twelve posts; root and isolated probes return 200.
- [ ] **Step 6: Run merged focused regression gates**
```bash
node --test tests/smoke/*.test.mjs
npm run test:js
PATH=/opt/homebrew/opt/docker/bin:$PATH npm run test:php -- --filter 'PatternsTest|ResponsiveMediaTest|BlockRenderingTest|EditorialQueriesTest'
PATH=/opt/homebrew/opt/docker/bin:$PATH npm run phpcs
npm run lint:css
```
Expected: all merged suites pass; Related Stories still reports its expected cards/layout contracts; character patterns/assets pass.
- [ ] **Step 7: Commit only if the merge required a manual resolution**
The merge commit is normally created by `git merge`. If conflict resolution paused the merge:
```bash
git add tests/php/BlockRenderingTest.php
git commit
```
Use the generated merge message. Do not squash or amend the source branch.
## Task 1: Generate and approve the Podcast “Frecuencia pirata” master
**Files:**
- Create: `assets/images/podcast-frequency-grunge.png`
- Modify: `tests/assets/test_alter_ego_assets.py`
- Modify: `tests/smoke/visual-integration.test.mjs`
- [ ] **Step 1: Write the failing opaque-background inventory test**
Add a separate `BACKGROUND_ASSETS` contract. It must require exactly `podcast-frequency-grunge.png`, PNG/RGB or RGBA, landscape ratio between 1.35 and 1.7, at least 1536×960 pixels, and no requirement for transparent corners. Keep `ALTER_EGO_SOURCE_ASSETS` and all alpha coverage tests unchanged.
Add smoke assertions that require the source filename and forbid it from being reused as a portrait/card fallback.
- [ ] **Step 2: Run RED before generation**
```bash
uv run --with pillow --with pytest pytest tests/assets/test_alter_ego_assets.py -q
node --test tests/smoke/visual-integration.test.mjs
```
Expected: FAIL because `assets/images/podcast-frequency-grunge.png` does not exist and the build/usage contract is absent.
- [ ] **Step 3: Generate one project-bound master with the built-in image tool**
Use the `imagegen` skill in built-in mode with this prompt:
```text
Use case: stylized-concept
Asset type: wide WordPress podcast-section background, no transparency
Primary request: create an original grunge collage background called “Frecuencia pirata” for a nocturnal personal podcast section
Scene/backdrop: distressed warm paper fragments, dark analog tape wear, scratched ink, partial radio-wave arcs, subtle abstract waveform fragments, steel-blue shadows, restrained green signal marks, and one small rust-orange accent
Style/medium: tactile Mexican underground print collage, screen print, xerox texture, raw studio ephemera, sophisticated and readable rather than chaotic
Composition/framing: landscape 3:2; preserve calm dark negative space across the left 55 percent for white page copy; concentrate waves and texture toward the right and edges; usable behind a separate foreground portrait
Lighting/mood: nocturnal workshop, intimate conversation, pirate radio signal, thoughtful rather than sensational
Constraints: background only; no person, face, silhouette, body, hands, text, letters, numbers, logo, watermark, microphone, headphones, podcast icon, platform branding, UI, frame, or border
Avoid: concert imagery, stage lights, live-show ambience, generic neon cyberpunk, literal audio equipment, readable scraps, fake branding
```
Move/copy the selected output from the built-in generated-images location to `assets/images/podcast-frequency-grunge.png`. Never overwrite another asset.
- [ ] **Step 4: Inspect the generated master before any code consumes it**
```bash
file assets/images/podcast-frequency-grunge.png
sips -g pixelWidth -g pixelHeight -g hasAlpha assets/images/podcast-frequency-grunge.png
```
Use `view_image` on the saved workspace file. Confirm visually: no person/face/silhouette, no readable text/logo, no literal microphone/headphones, left-side negative space, grunge detail on the right, and the approved steel-blue/green/rust palette.
- [ ] **Step 5: Stop at `AWAITING_VISUAL_APPROVAL`**
Open the master for the user and report its exact absolute path plus the final prompt. Do not add it to a pattern, build derivatives, or commit it until the user approves it.
- [ ] **Step 6: After approval, run GREEN asset inventory and commit the master contract**
```bash
uv run --with pillow --with pytest pytest tests/assets/test_alter_ego_assets.py -q
node --test tests/smoke/visual-integration.test.mjs
git diff --check
git add assets/images/podcast-frequency-grunge.png tests/assets/test_alter_ego_assets.py tests/smoke/visual-integration.test.mjs
git commit -m "feat: add CHRNX podcast grunge background"
```
Expected: asset tests and smoke pass; only the approved master and its contracts enter the commit.
## Task 2: Add responsive Podcast atmosphere media
**Files:**
- Modify: `inc/queries.php`
- Modify: `inc/media.php`
- Modify: `scripts/build-responsive-images.sh`
- Modify: `tests/php/ResponsiveMediaTest.php`
- Modify: `tests/assets/test_alter_ego_assets.py`
- Modify: `tests/smoke/visual-integration.test.mjs`
- Create: `assets/images/generated/podcast-frequency-grunge-384.avif`
- Create: `assets/images/generated/podcast-frequency-grunge-384.webp`
- Create: `assets/images/generated/podcast-frequency-grunge-768.avif`
- Create: `assets/images/generated/podcast-frequency-grunge-768.webp`
- Create: `assets/images/generated/podcast-frequency-grunge-1536.avif`
- Create: `assets/images/generated/podcast-frequency-grunge-1536.webp`
- Create: `assets/images/generated/podcast-frequency-grunge.json`
- [ ] **Step 1: Write failing mapping, markup, and derivative tests**
Require `chrnx_get_topic_art_asset('podcast-frequency')` to return the fixed local PNG and its exact dimensions. Require a responsive background picture with AVIF/WebP 384/768/1536 sources, `(max-width: 780px) 100vw, 1200px` sizes, empty alt, `aria-hidden`, intrinsic dimensions, and lazy loading by default. Unknown keys must still return empty markup.
Extend the asset rebuild smoke/Python checks to require all six derivatives and a manifest that names the master and widths `[384,768,1536]`. Update the generated inventory from 45 post-merge files to exactly 52 after adding this family. Expand the width parser to `/(384|768|1536)/`. Keep every 384/768 derivative under 160 KiB; allow each 1536 Podcast derivative up to 260 KiB; cap the Podcast background family at 620 KiB and the complete generated binary payload at 2.75 MiB. Fail with the exact filename/family/total bytes when a bound is exceeded.
- [ ] **Step 2: Run focused RED**
```bash
PATH=/opt/homebrew/opt/docker/bin:$PATH npm run test:php -- --filter ResponsiveMediaTest
node --test tests/smoke/visual-integration.test.mjs
uv run --with pillow --with pytest pytest tests/assets/test_alter_ego_assets.py -q
```
Expected: FAIL because the key, background-specific source set, derivatives, and manifest do not exist.
- [ ] **Step 3: Implement the allowlisted media path**
Add only the fixed `podcast-frequency` mapping/dimensions. Extend the helper through an explicit allowlisted background mode or a small dedicated `chrnx_get_atmosphere_markup()` wrapper; do not infer arbitrary filenames or accept request input. Escape URI, class, sizes, dimensions, and alt exactly as the existing portrait helper does.
Extend `build-responsive-images.sh` with a dedicated opaque background builder for 384, 768, and 1536 pixels. Preserve current portrait loops and byte output. Use existing `cwebp`/`avifenc`; remove metadata; do not mutate the master.
- [ ] **Step 4: Build and prove deterministic GREEN**
```bash
./scripts/build-responsive-images.sh
chrnx_rebuild_dir=$(mktemp -d "${TMPDIR:-/tmp}/chrnx-responsive.XXXXXX")
./scripts/build-responsive-images.sh "$chrnx_rebuild_dir"
diff -rq assets/images/generated "$chrnx_rebuild_dir"
trash "$chrnx_rebuild_dir"
PATH=/opt/homebrew/opt/docker/bin:$PATH npm run test:php -- --filter ResponsiveMediaTest
node --test tests/smoke/visual-integration.test.mjs
uv run --with pillow --with pytest pytest tests/assets/test_alter_ego_assets.py -q
```
Expected: rebuild diff is empty; exactly 52 generated files are present; each width/format and all byte budgets pass; focused PHP, smoke, and Python pass.
- [ ] **Step 5: Commit responsive atmosphere ownership**
```bash
git add inc/queries.php inc/media.php scripts/build-responsive-images.sh tests/php/ResponsiveMediaTest.php tests/assets/test_alter_ego_assets.py tests/smoke/visual-integration.test.mjs assets/images/generated/podcast-frequency-grunge-*
git commit -m "feat: add responsive CHRNX podcast atmosphere"
```
## Task 3: Compose Music and Podcast as single character stages
**Files:**
- Modify: `patterns/music-landing.php`
- Modify: `patterns/podcast-landing.php`
- Modify: `tests/fixtures/pages.json`
- Modify: `tests/php/PatternsTest.php`
- Modify: `tests/php/BlockRenderingTest.php`
- Modify: `tests/smoke/visual-integration.test.mjs`
- Create: `tests/e2e/pattern-editor-validity.spec.mjs`
- [ ] **Step 1: Write failing block-tree and semantic tests**
Render each pattern into `$content`, call `parse_blocks($content)`, serialize, reparse, and compare ordered block-name trees. Require each stage's direct layer order to be atmosphere → content → art.
Music assertions:
- exactly one `chrnx-character-stage`;
- collage appears once inside atmosphere, not inside content and not as a second vertical figure;
- musician appears once inside art;
- collage and musician retain their approved nonempty alt text; the Music atmosphere wrapper must not use `aria-hidden` because the collage is meaningful;
- content holds the title, tagline, and concise band statement;
- process copy is after the stage but before `Releases in progress`;
- heading order remains page H1 → landing H2 → releases H3 → cards H4.
Podcast assertions:
- atmosphere contains exactly one decorative `podcast-frequency` picture with empty alt and `aria-hidden` on the picture/wrapper;
- content contains landing title and a brief neutral statement;
- art contains exactly one decorative Podcast portrait;
- the pattern contains exactly one `chrnx/latest-podcast` block after the stage;
- retain the existing empty `chrnx/podcast-show-discovery` and `chrnx/podcast-archive` groups for future real data; remove only the now-redundant empty `chrnx/podcast-latest` group because the dynamic latest block replaces it;
- fixture page content contains only `chrnx/podcast-landing`, not a second latest block.
Create `tests/e2e/pattern-editor-validity.spec.mjs`. In the Post Editor, open each seeded Music/Podcasts page and assert every `core/block` tree reports `isValid !== false`, no “Attempt Block Recovery”/“unexpected or invalid content” UI appears, and the expected stage layer order exists in editor state. In the Site Editor, insert each registered pattern into an unsaved temporary editing canvas and assert the same validity and layer order. Record the `wp_template` row count before and after. Never save, publish, or update content.
- [ ] **Step 2: Run focused RED**
```bash
PATH=/opt/homebrew/opt/docker/bin:$PATH npm run test:php -- --filter PatternsTest
node --test tests/smoke/visual-integration.test.mjs
CHRNX_E2E_BASE_URL=http://localhost:8908 npx playwright test tests/e2e/pattern-editor-validity.spec.mjs --project=chromium --grep 'Post Editor|Site Editor'
```
Expected: PHP/smoke fail because Music is vertically stacked and Podcast lacks its atmosphere/copy/latest composition. The four real-editor cases (Music/Podcast × Post/Site Editor) fail on the new required layer structure while proving the test reaches both editors without saving.
- [ ] **Step 3: Implement minimal block-valid pattern changes**
Reuse this exact direct stage API:
```html
<div class="wp-block-group chrnx-character-stage">
<div class="chrnx-character-stage__atmosphere">…background picture…</div>
<div class="wp-block-group chrnx-character-stage__content">…copy…</div>
<div class="chrnx-character-stage__art">…character picture…</div>
</div>
```
Music keeps the meaningful collage visible to assistive technology. Podcast marks its atmosphere picture decorative with empty alt/`aria-hidden`. Keep every WordPress block comment balanced and editable. Use PHP translation/escaping helpers for user-facing copy. Do not add raw remote HTML, inline styles, or scripts.
- [ ] **Step 4: Run GREEN plus parser/runtime proof**
```bash
PATH=/opt/homebrew/opt/docker/bin:$PATH npm run test:php -- --filter 'PatternsTest|BlockRenderingTest'
node --test tests/smoke/visual-integration.test.mjs
PATH=/opt/homebrew/opt/docker/bin:$PATH npx wp-env run cli wp eval 'foreach ( array("chrnx/music-landing","chrnx/podcast-landing") as $slug ) { $pattern = WP_Block_Patterns_Registry::get_instance()->get_registered( $slug ); $blocks = parse_blocks( $pattern["content"] ); echo $slug . "=" . count( $blocks ) . PHP_EOL; }'
```
Expected: PHP/smoke pass; both registered patterns parse to nonzero block trees without freeform corruption.
- [ ] **Step 5: Prove both patterns remain valid in Gutenberg**
Rerun the real-editor contract written during RED. In the Post Editor, confirm both seeded pages have valid blocks and the stage layers in order. In the Site Editor, insert each registered pattern into the unsaved canvas and confirm the same validity/layer order. Leave without saving and compare the `wp_template` row count with the recorded baseline.
Run:
```bash
CHRNX_E2E_BASE_URL=http://localhost:8908 npx playwright test tests/e2e/pattern-editor-validity.spec.mjs --project=chromium --grep 'Post Editor|Site Editor'
```
Expected: four cases pass (Music/Podcast × Post/Site Editor), no recovery UI, no save/publish action, and no new template row.
- [ ] **Step 6: Commit structural composition**
```bash
git add patterns/music-landing.php patterns/podcast-landing.php tests/fixtures/pages.json tests/php/PatternsTest.php tests/php/BlockRenderingTest.php tests/smoke/visual-integration.test.mjs tests/e2e/pattern-editor-validity.spec.mjs
git commit -m "refactor: compose CHRNX music and podcast stages"
```
## Task 4: Repair the latest conversation and stage geometry
**Files:**
- Modify: `blocks/latest-podcast/style.css`
- Modify: `assets/css/components.css`
- Modify: `tests/e2e/visual-states.spec.mjs`
- Create: `tests/e2e/music-podcast-stages.spec.mjs`
- Modify: `tests/smoke/visual-integration.test.mjs`
- [ ] **Step 1: Write failing CSS ownership tests**
Require selectors that give `.chrnx-podcast-card__link` a bounded two-column grid, `.chrnx-podcast-card__content { min-width: 0; }`, bounded media, normal overflow-wrap, and a content-aware stacking breakpoint. Require Music/Podcast stage atmosphere specialization without selectors that change `.chrnx-home-projects`, `.chrnx-about`, or `.chrnx-related-*`.
- [ ] **Step 2: Write failing browser geometry tests**
At 1440 dark/light, require:
- Music collage fills the atmosphere and foreground musician remains a separate contained layer;
- Music stage height is at most `min(viewport height, 46rem)` plus one-pixel tolerance;
- no second full-width image appears below the stage;
- Podcast background fills the atmosphere and contains no foreground semantic image;
- Podcast portrait is contained, bottom-anchored, and does not intersect copy;
- latest band follows the stage and stays inside `.chrnx-podcast-landing`;
- latest media is 28–42% of card width, content is at least a real `28ch` probe width where available, and neither clips.
At 375 and 768, require text → art → latest visual order, positive dimensions, no overlap, and no horizontal overflow. For the deterministic 200% rendering-zoom probe, set `document.documentElement.style.zoom = '2'` after load at 375 and 1440 CSS-pixel viewports; require Music copy to stay inside its stage and Podcast title/card copy to wrap without clipping. Run this zoom subset in Chromium, Firefox, and WebKit and assert the computed root zoom is `2` before measuring.
For long-copy regression, modify only the rendered DOM in the browser: replace the latest title with a 120+ character phrase and the excerpt with repeated fixture prose. Compare the content width against a hidden `width:28ch` probe using the same computed font, require `min-width:0`, normal wrapping, and zero clipping. Do not mutate the database or add a thirteenth post.
Extend the existing no-JavaScript/reduced-motion matrix in `visual-states.spec.mjs` to `/music/` and `/podcasts/`. With JavaScript disabled, require the stage copy, character art, Podcast background, and latest card to remain visible and usable with zero horizontal overflow. With `prefers-reduced-motion: reduce`, compare settled geometry with the normal static state and require equal layer order, equivalent visible content, no animation/transition displacement, and zero overflow. Run both themes at 375 and 1440; keep normal keyboard/link behavior native and do not add a JS-only fallback.
Use immutable Projects/About assertions rather than an unrecorded before/after snapshot: exact approved asset filenames/counts, direct atmosphere/content/art order, unchanged heading/copy text, 35–48% desktop art ratio, contained art, and zero horizontal overflow at 375/1440 in both themes. Add a smoke assertion that the new CSS block contains no `.chrnx-home-projects`, `.chrnx-about`, or `.chrnx-related-` selector. Run existing Related Stories E2E unchanged.
- [ ] **Step 3: Run focused RED in Chromium**
```bash
node --test tests/smoke/visual-integration.test.mjs
CHRNX_E2E_BASE_URL=http://localhost:8908 npx playwright test tests/e2e/music-podcast-stages.spec.mjs --project=chromium
CHRNX_E2E_BASE_URL=http://localhost:8908 npx playwright test tests/e2e/visual-states.spec.mjs --project=chromium --grep 'Music and Podcast without JavaScript|Music and Podcast reduced motion'
```
Expected: Podcast reproduces the screenshot defect: content width is a narrow strip/clips; Music still fails single-stage composition/height; new stage selectors are absent; the expanded no-JavaScript/reduced-motion matrix fails because Music/Podcast are not yet part of that contract.
- [ ] **Step 4: Implement minimal stage and card CSS**
In `blocks/latest-podcast/style.css`, make the card's link the geometry authority:
```css
.chrnx-podcast-card__link {
display: grid;
grid-template-columns: minmax(12rem, 34%) minmax(0, 1fr);
}
.chrnx-podcast-card__content {
min-width: 0;
}
```
Use an explicit card breakpoint: stack at `max-width: 720px`; use the two-column grid from 721px upward. The threshold reserves at least 192px for media, a real 28ch content probe, and card padding/gap at the theme font metrics. Test exact 720/721 boundaries and do not reuse the character-stage breakpoint. Preserve the existing generic editorial-card helper markup.
In `components.css`, style only `.chrnx-music-landing` and `.chrnx-podcast-landing` character stages: atmosphere opacity/object-fit/veil, content surface, character sizing/anchor, stage height, and latest band integration. Keep main titles centered according to the existing title matrix; release/card/internal headings remain start-aligned.
- [ ] **Step 5: Run focused GREEN across engines**
```bash
node --test tests/smoke/visual-integration.test.mjs
npm run lint:css
CHRNX_E2E_BASE_URL=http://localhost:8908 npx playwright test tests/e2e/music-podcast-stages.spec.mjs --project=chromium
CHRNX_E2E_BASE_URL=http://localhost:8908 npx playwright test tests/e2e/music-podcast-stages.spec.mjs --project=firefox
CHRNX_E2E_BASE_URL=http://localhost:8908 npx playwright test tests/e2e/music-podcast-stages.spec.mjs --project=webkit
CHRNX_E2E_BASE_URL=http://localhost:8908 npx playwright test tests/e2e/visual-states.spec.mjs --project=chromium --grep 'Music and Podcast without JavaScript|Music and Podcast reduced motion'
CHRNX_E2E_BASE_URL=http://localhost:8908 npx playwright test tests/e2e/visual-states.spec.mjs --project=firefox --grep 'Music and Podcast without JavaScript|Music and Podcast reduced motion'
CHRNX_E2E_BASE_URL=http://localhost:8908 npx playwright test tests/e2e/visual-states.spec.mjs --project=webkit --grep 'Music and Podcast without JavaScript|Music and Podcast reduced motion'
CHRNX_E2E_BASE_URL=http://localhost:8908 npx playwright test tests/e2e/music-podcast-stages.spec.mjs --project=chromium --grep '200% zoom'
CHRNX_E2E_BASE_URL=http://localhost:8908 npx playwright test tests/e2e/music-podcast-stages.spec.mjs --project=firefox --grep '200% zoom'
CHRNX_E2E_BASE_URL=http://localhost:8908 npx playwright test tests/e2e/music-podcast-stages.spec.mjs --project=webkit --grep '200% zoom'
CHRNX_E2E_BASE_URL=http://localhost:8908 npx playwright test tests/e2e/related-stories.spec.mjs --project=chromium --grep 'layout matrix|focus|interaction|permalink'
```
Expected: all focused suites pass; Podcast long copy wraps; Music is one stage; both pages remain complete without JavaScript and statically equivalent under reduced motion in both themes; Related Stories remains green.
- [ ] **Step 6: Commit responsive styling**
```bash
git add blocks/latest-podcast/style.css assets/css/components.css tests/e2e/visual-states.spec.mjs tests/e2e/music-podcast-stages.spec.mjs tests/smoke/visual-integration.test.mjs
git commit -m "style: finish CHRNX music and podcast stages"
```
## Task 5: Capture exhaustive visual review and approve the result
**Files:**
- Modify: `scripts/capture-visual-review.mjs`
- Modify: `tests/smoke/visual-integration.test.mjs`
- Modify: `README.md`
- Create temporarily, never commit: `tmp/imagegen/grunge-stage-*.png`
- [ ] **Step 1: Write failing capture-contract tests**
Require exact targets `/music/`, `/podcasts/`, and a `podcasts-long-copy` state that navigates to `/podcasts/` then replaces only the rendered title/excerpt before capture. Require variants for light/dark at widths 375, 768, 1440, and 2560; filenames `grunge-stage-{music|podcasts|podcasts-long-copy}-{width}-{light|dark}.png`; fresh `chromium.launch()` inside each capture; `document.fonts.ready`; bounded image decoding; reduced motion; and local-host restriction.
- [ ] **Step 2: Run RED**
```bash
node --test tests/smoke/visual-integration.test.mjs
```
Expected: FAIL because the capture script does not include Podcast, the long-copy state, or the 768/2560 variants and uses old filenames.
- [ ] **Step 3: Implement capture/documentation only**
Keep the known fresh-browser isolation that prevents dark-to-light compositing corruption. Log only intended CLI output filenames/dimensions. Document:
```bash
CHRNX_REVIEW_URL=http://localhost:8908 node scripts/capture-visual-review.mjs
```
- [ ] **Step 4: Run GREEN and capture all 24 review images**
```bash
node --test tests/smoke/visual-integration.test.mjs
CHRNX_REVIEW_URL=http://localhost:8908 node scripts/capture-visual-review.mjs
find tmp/imagegen -maxdepth 1 -type f -name 'grunge-stage-*.png' -print | sort
```
Expected: exactly 24 screenshots total (Music, Podcast, Podcast long-copy × 4 widths × 2 themes), each produced by a fresh browser.
- [ ] **Step 5: Inspect and stop at `AWAITING_VISUAL_APPROVAL`**
Use `view_image` on every screenshot, paying special attention to:
- Music 1440/375 dark and light;
- Podcast 1440/375 dark and light;
- 768 transition behavior;
- 2560 maximum-width restraint;
- face/torso/prop visibility;
- left-copy readability;
- Podcast long-copy card width;
- no repeated Music image, overlap, clipping, or horizontal overflow.
Open representative captures for the user. Do not commit the capture-script/docs task until the user approves or requests a bounded visual revision.
- [ ] **Step 6: After approval, commit capture tooling and docs**
```bash
npx markdownlint-cli2 README.md
npm run lint:js -- --max-warnings=0
git diff --check
git add scripts/capture-visual-review.mjs tests/smoke/visual-integration.test.mjs README.md
git commit -m "test: capture CHRNX grunge stage review"
```
## Task 6: Run the full integrated release gate and clean isolation
**Files:**
- No new production files expected
- Remove temporary/ignored: `.wp-env.override.json`, `tmp/imagegen/grunge-stage-*.png`, test rebuild directories, `test-results`, `playwright-report`, `.phpunit.result.cache`
- [ ] **Step 1: Run preflight and exact fixture invariants**
```bash
PATH=/opt/homebrew/opt/docker/bin:$PATH npx wp-env run cli wp core version
PATH=/opt/homebrew/opt/docker/bin:$PATH npx wp-env run tests-cli wp core version
PATH=/opt/homebrew/opt/docker/bin:$PATH npx wp-env run cli wp eval-file wp-content/themes/chrnx/scripts/seed-test-content.php default
PATH=/opt/homebrew/opt/docker/bin:$PATH npx wp-env run cli wp eval '$q=new WP_Query(array("post_type"=>array("page","post"),"post_status"=>"any","meta_key"=>"_chrnx_fixture_key","posts_per_page"=>-1,"fields"=>"ids")); echo "OWNED=".count($q->posts);'
```
Expected: WordPress 6.9.6 in dev/tests; seed reports seven pages/twelve posts; `OWNED=19`.
- [ ] **Step 2: Run the exact full suite once from the integrated checkout**
```bash
PATH=/opt/homebrew/opt/docker/bin:$PATH CHRNX_E2E_BASE_URL=http://localhost:8908 npm test
```
Expected: smoke, JS/CSS lint, PHPCS, 86+ Jest tests, 130+ PHPUnit tests, and the full three-engine Playwright matrix pass; only documented cross-engine axe skips are allowed.
- [ ] **Step 3: Run asset and runtime integrity checks**
```bash
uv run --with pillow --with pytest pytest tests/assets/test_alter_ego_assets.py -q
chrnx_rebuild_dir=$(mktemp -d "${TMPDIR:-/tmp}/chrnx-responsive.XXXXXX")
./scripts/build-responsive-images.sh "$chrnx_rebuild_dir"
diff -rq assets/images/generated "$chrnx_rebuild_dir"
trash "$chrnx_rebuild_dir"
PATH=/opt/homebrew/opt/docker/bin:$PATH npx wp-env run cli wp eval '$bad=array(); foreach(array("chrnx/music-landing","chrnx/podcast-landing") as $slug){$p=WP_Block_Patterns_Registry::get_instance()->get_registered($slug);if(!$p||!parse_blocks($p["content"])){$bad[]=$slug;}} echo "BAD=".implode(",",$bad);'
for chrnx_path in /music/ /podcasts/ /; do curl -fsS -o /tmp/chrnx-stage-http -w "$chrnx_path=%{http_code}\n" "http://localhost:8908$chrnx_path"; ! rg -i 'Warning:|Notice:|Fatal error:|Parse error:|Deprecated:' /tmp/chrnx-stage-http; done
```
Expected: asset rebuild is byte-identical; `BAD=` is empty; all routes return 200 with no PHP diagnostics.
- [ ] **Step 4: Review scope and security**
```bash
git status --short
git diff main...HEAD --check
git diff --name-status main...HEAD
git diff main...HEAD -- . ':!assets/images/*.png' ':!assets/images/generated/*' | rg -n 'https?://|api[_-]?key|password|console\.log|eval\(|innerHTML|wp_remote_|curl_exec|iframe|<audio' || true
```
Expected: only planned files/commits; no secrets, remote endpoints, embeds, debug output, arbitrary filename construction, raw request input, or production-content hooks. The capture script's intentional filename/dimension CLI output is reviewed manually and is the only allowed logging.
- [ ] **Step 5: Stop the isolated environment and remove disposable artifacts**
```bash
PATH=/opt/homebrew/opt/docker/bin:$PATH npx wp-env stop
trash .wp-env.override.json 2>/dev/null || true
find tmp/imagegen -maxdepth 1 -type f -name 'grunge-stage-*.png' -exec trash {} + 2>/dev/null || true
trash test-results playwright-report .phpunit.result.cache 2>/dev/null || true
test ! -e .wp-env.override.json
test -z "$(find tmp/imagegen -maxdepth 1 -type f -name 'grunge-stage-*.png' -print -quit 2>/dev/null)"
test ! -e test-results
test ! -e playwright-report
test ! -e .phpunit.result.cache
curl -fsS -o /dev/null -w 'ROOT=%{http_code}\n' http://localhost:8888/
git status --short --branch
```
Expected: isolated 8908/8909 is stopped; root 8888 remains 200; worktree is clean on `feature/music-podcast-grunge-stages`.
- [ ] **Step 6: Request final code review**
Use `@superpowers:requesting-code-review` against `main...HEAD`. Resolve every material finding with RED → GREEN and a separate commit. Re-run the affected focused tests and then the full gate if production behavior changed.
- [ ] **Step 7: Present integration options**
Use `@superpowers:finishing-a-development-branch`. Recommend local merge/verification only. Do not merge, delete the worktree, push, deploy, or publish without explicit user choice.