# CHRNX Projects as First-Class Entities 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:** Promote projects from a topic term to an entity taxonomy with its own term meta, landing page, and archive, modelled exactly on the existing `chrnx_release` pattern. **Architecture:** Register `chrnx_project` through the shared editorial taxonomy contract, give it term meta mirroring `chrnx_release` (cover, status, and three URLs), and render it through two new dynamic blocks cloned from `release-list` and `release-detail`. Retire the `chrnx_project_featured` post meta and the `selected-work` block, because music already proves a landing does not need a featured picker. Repair the missing `taxonomy-chrnx_show.html` while the same template shape is fresh. **Tech Stack:** WordPress 7.0.4 block theme, PHP 8.3, dynamic blocks with `render.php`, term meta on term edit screens, PHPUnit, Node smoke tests, Playwright on Chromium/Firefox/WebKit, PHPCS, WordPress Scripts linting. **Spec:** `docs/superpowers/specs/2026-08-15-projects-as-entities-design.md` ## Global Constraints - Theme version is `0.4.4`. Any release bump updates `style.css`, `functions.php` (`CHRNX_VERSION`), and all 20 `blocks/*/block.json` together, or `npm run package` refuses to build. - New block `block.json` files use `"apiVersion": 3` and `"version": "0.4.4"` to match every existing block. - All PHP follows the theme's PHPCS ruleset; run `npm run phpcs` before every commit. - Term meta sanitizers reuse existing helpers: `chrnx_sanitize_https_url`, `absint`, `sanitize_text_field`. - Term meta auth reuses `chrnx_auth_release_meta`, as `show-meta.php` already does. - Never invent project metadata. Repository, site, package URLs, and status come from the author. - Do not push, deploy, or mutate production content. Production migration is Task 9 and is executed only after the author confirms the post-to-project mapping. - Work on a branch off `main`. `main` is at the merge commit for `fix/document-language`. --- ## File map | File | Responsibility | |---|---| | `inc/taxonomies.php` | Add the `chrnx_project` definition to the shared contract | | `inc/project-meta.php` | Rewritten: project term meta, edit fields, save handler | | `inc/queries.php` | Remove `chrnx_get_selected_project_ids()` | | `blocks/project-list/` | New: lists every project as a card | | `blocks/project-detail/` | New: renders one project's header on its archive | | `blocks/selected-work/` | Deleted | | `templates/taxonomy-chrnx_project.html` | New: project archive | | `templates/taxonomy-chrnx_show.html` | New: repairs the podcast archive gap | | `patterns/projects-landing.php` | New: banner plus project list | | `patterns/home-projects.php` | Banner copy only, no list | | `tests/php/TaxonomiesTest.php` | Extend definitions with `chrnx_project` | | `tests/php/ProjectMetaTest.php` | New: term meta contract | | `tests/smoke/templates.test.mjs` | Assert both new templates exist | --- ### Task 1: Register the project taxonomy **Files:** - Modify: `inc/taxonomies.php:14-56` - Test: `tests/php/TaxonomiesTest.php:24-60` **Interfaces:** - Consumes: `chrnx_register_editorial_taxonomy( $name, $definition )`, already defined at `inc/taxonomies.php:66`. - Produces: taxonomy `chrnx_project` with `rest_base` `project` and seeded terms `green-tea`, `ailed`. - [ ] **Step 1: Write the failing test** In `tests/php/TaxonomiesTest.php`, add to the `$this->definitions` array in `set_up()`, after the `chrnx_release` entry: ```php 'chrnx_project' => array( 'rest_base' => 'project', 'terms' => array( 'green-tea' => 'Green Tea', 'ailed' => 'Ailed', ), ), ``` - [ ] **Step 2: Run the test to verify it fails** Run: `npm run test:php` Expected: FAIL. The existing loop over `$this->definitions` asserts `taxonomy_exists()` and term presence, so `chrnx_project` reports as missing. - [ ] **Step 3: Add the taxonomy definition** In `inc/taxonomies.php`, inside `chrnx_get_editorial_taxonomies()`, add after the `chrnx_release` entry: ```php 'chrnx_project' => array( 'singular' => __( 'Project', 'chrnx' ), 'plural' => __( 'Projects', 'chrnx' ), 'rest_base' => 'project', 'terms' => array( 'green-tea' => __( 'Green Tea', 'chrnx' ), 'ailed' => __( 'Ailed', 'chrnx' ), ), ), ``` - [ ] **Step 4: Run the test to verify it passes** Run: `npm run test:php` Expected: PASS. - [ ] **Step 5: Commit** ```bash git add inc/taxonomies.php tests/php/TaxonomiesTest.php git commit -m "feat: model projects as their own editorial taxonomy" ``` --- ### Task 2: Project term metadata **Files:** - Modify: `inc/project-meta.php` (replace the whole file, currently 37 lines of post meta) - Test: `tests/php/ProjectMetaTest.php` (create) **Interfaces:** - Consumes: `chrnx_sanitize_https_url()` from `inc/release-meta.php`, `chrnx_auth_release_meta()`, `chrnx_print_release_field( $name, $label, $value, $type, $description )`. - Produces: `chrnx_get_project_meta_definitions(): array`, `chrnx_get_project_links( int $term_id ): array`. - [ ] **Step 1: Write the failing test** Create `tests/php/ProjectMetaTest.php`: ```php assertArrayHasKey( $meta_key, $registered ); } } /** * Ensure a plain http repository URL is rejected. */ public function test_project_links_reject_insecure_urls() { $term_id = self::factory()->term->create( array( 'taxonomy' => 'chrnx_project' ) ); update_term_meta( $term_id, 'chrnx_project_repo', 'http://example.com/repo' ); $this->assertArrayNotHasKey( 'repo', chrnx_get_project_links( $term_id ) ); } /** * Ensure stored https links come back keyed by their slot. */ public function test_project_links_return_stored_https_urls() { $term_id = self::factory()->term->create( array( 'taxonomy' => 'chrnx_project' ) ); update_term_meta( $term_id, 'chrnx_project_repo', 'https://github.com/Expressive-Tea/green-tea' ); update_term_meta( $term_id, 'chrnx_project_package', 'https://www.npmjs.com/package/@green-tea/core' ); $links = chrnx_get_project_links( $term_id ); $this->assertSame( 'https://github.com/Expressive-Tea/green-tea', $links['repo'] ); $this->assertSame( 'https://www.npmjs.com/package/@green-tea/core', $links['package'] ); $this->assertArrayNotHasKey( 'site', $links ); } } ``` - [ ] **Step 2: Run the test to verify it fails** Run: `npm run test:php` Expected: FAIL with "Call to undefined function chrnx_get_project_meta_definitions()". - [ ] **Step 3: Replace `inc/project-meta.php`** ```php > Slot key to label and icon. */ function chrnx_get_project_link_slots() { return array( 'repo' => array( 'label' => __( 'Repository', 'chrnx' ), 'icon' => '', ), 'package' => array( 'label' => __( 'Package', 'chrnx' ), 'icon' => '', ), 'site' => array( 'label' => __( 'Website', 'chrnx' ), 'icon' => '', ), ); } /** * Return the project term meta keys and their sanitizers. * * @return array Meta key to sanitize callback. */ function chrnx_get_project_meta_definitions() { $definitions = array( 'chrnx_project_cover' => 'absint', 'chrnx_project_status' => 'sanitize_text_field', ); foreach ( array_keys( chrnx_get_project_link_slots() ) as $slot ) { $definitions[ 'chrnx_project_' . $slot ] = 'chrnx_sanitize_https_url'; } return $definitions; } /** * Register project term metadata. */ function chrnx_register_project_meta() { foreach ( chrnx_get_project_meta_definitions() as $meta_key => $sanitize ) { register_term_meta( 'chrnx_project', $meta_key, array( 'type' => 'chrnx_project_cover' === $meta_key ? 'integer' : 'string', 'single' => true, 'show_in_rest' => true, 'sanitize_callback' => $sanitize, 'auth_callback' => 'chrnx_auth_release_meta', ) ); } } add_action( 'init', 'chrnx_register_project_meta' ); /** * Return the stored outbound links for one project. * * @param int $term_id Project term ID. * @return array Slot key to URL, omitting empty ones. */ function chrnx_get_project_links( $term_id ) { $links = array(); foreach ( array_keys( chrnx_get_project_link_slots() ) as $slot ) { $url = chrnx_sanitize_https_url( get_term_meta( $term_id, 'chrnx_project_' . $slot, true ) ); if ( '' !== $url ) { $links[ $slot ] = $url; } } return $links; } /** * Render the project metadata fields on the term edit screen. * * @param WP_Term $term Project term. */ function chrnx_render_project_edit_fields( $term ) { chrnx_print_release_field( 'chrnx_project_status', __( 'Status', 'chrnx' ), (string) get_term_meta( $term->term_id, 'chrnx_project_status', true ), 'text', __( 'Short and honest, for example Beta, Activo or Archivado.', 'chrnx' ) ); foreach ( chrnx_get_project_link_slots() as $slot => $definition ) { chrnx_print_release_field( 'chrnx_project_' . $slot, $definition['label'], (string) get_term_meta( $term->term_id, 'chrnx_project_' . $slot, true ), 'url', __( 'HTTPS only. Leave empty to hide this icon.', 'chrnx' ) ); } chrnx_print_release_field( 'chrnx_project_cover', __( 'Cover attachment ID', 'chrnx' ), (string) absint( get_term_meta( $term->term_id, 'chrnx_project_cover', true ) ), 'text', __( 'Leave empty to use the shared placeholder art.', 'chrnx' ) ); } add_action( 'chrnx_project_edit_form_fields', 'chrnx_render_project_edit_fields' ); /** * Persist project term metadata from the term edit screen. * * @param int $term_id Project term ID. */ function chrnx_save_project_meta( $term_id ) { if ( ! chrnx_auth_release_meta() ) { return; } // Core supplies and verifies the add/update term nonce on these screens. $nonce = isset( $_POST['_wpnonce'] ) ? sanitize_text_field( wp_unslash( $_POST['_wpnonce'] ) ) : ''; if ( ! wp_verify_nonce( $nonce, 'update-tag_' . $term_id ) && ! wp_verify_nonce( $nonce, 'add-tag' ) ) { return; } foreach ( chrnx_get_project_meta_definitions() as $meta_key => $sanitize ) { if ( ! isset( $_POST[ $meta_key ] ) ) { continue; } $value = call_user_func( $sanitize, wp_unslash( $_POST[ $meta_key ] ) ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- Sanitized by the mapped callback. if ( '' === $value || 0 === $value ) { delete_term_meta( $term_id, $meta_key ); continue; } update_term_meta( $term_id, $meta_key, $value ); } } add_action( 'edited_chrnx_project', 'chrnx_save_project_meta' ); add_action( 'created_chrnx_project', 'chrnx_save_project_meta' ); ``` - [ ] **Step 4: Confirm the term edit hook fires** Resolved before dispatch, no theme code needed. `{$taxonomy}_edit_form_fields` is a WordPress core hook fired by `wp-admin/edit-tag-form.php`, which is why `inc/show-meta.php` hooks `chrnx_show_edit_form_fields` without any dispatcher of its own. Hooking `chrnx_project_edit_form_fields` is enough. Confirm the fields appear by loading `/wp-admin/term.php?taxonomy=chrnx_project&tag_ID=`. - [ ] **Step 5: Run the tests to verify they pass** Run: `npm run test:php && npm run phpcs` Expected: PASS, no PHPCS output. - [ ] **Step 6: Commit** ```bash git add inc/project-meta.php tests/php/ProjectMetaTest.php git commit -m "feat: give projects a repository, package and status" ``` --- ### Task 3: Placeholder cover art **Files:** - Create: `assets/images/generated/placeholder-project-384.{webp,avif}`, `-768.{webp,avif}`, `placeholder-project.json` - Modify: `inc/media.php` allowlist **Interfaces:** - Produces: art slug `placeholder-project`, consumed by `chrnx_get_topic_portrait_markup( 'placeholder-project', ... )`. - [ ] **Step 1: Read how `placeholder-release` is allowlisted** Run: `grep -n "placeholder-release" inc/media.php` The art slug must appear in the same allowlist, or `chrnx_get_topic_art_asset()` returns an empty string and the helper renders nothing. - [ ] **Step 2: Generate the master image** Ask the author for the master PNG. Do not substitute CSS art, an SVG, or a stock image. Stop here until the author approves the generated master. - [ ] **Step 3: Build the derivatives** Run: `./scripts/build-responsive-images.sh ` Expected: `384` and `768` variants in both webp and avif, plus the JSON dimensions sidecar. - [ ] **Step 4: Add the slug to the allowlist** Mirror the `placeholder-release` entry in `inc/media.php` exactly, changing only the slug. - [ ] **Step 5: Verify the helper returns markup** Run: `npx wp-env run cli wp eval 'echo chrnx_get_topic_portrait_markup( "placeholder-project", "", "test" ) === "" ? "VACIO" : "OK";'` Expected: `OK`. - [ ] **Step 6: Commit** ```bash git add assets/images/generated/placeholder-project* inc/media.php git commit -m "feat: add shared placeholder art for projects without a cover" ``` --- ### Task 4: The project list block **Files:** - Create: `blocks/project-list/block.json`, `blocks/project-list/render.php` - Modify: `inc/blocks.php:235` — add `'project-list'` to the `$blocks` array - Test: `tests/php/ProjectBlocksTest.php` (create) **Registration is not automatic.** `chrnx_register_editorial_blocks()` iterates an explicit allowlist array and only then calls `register_block_type()` on the matching directory. Creating `blocks/project-list/` without adding its name to that array leaves the block unregistered, and `do_blocks()` returns the raw comment, so the test fails with no useful message. **Interfaces:** - Consumes: `chrnx_get_project_links()`, `chrnx_get_heading_level()`, `chrnx_get_topic_portrait_markup()`, `chrnx_get_platform_links_markup()`. - Produces: block `chrnx/project-list`, consumed by `patterns/projects-landing.php`. - [ ] **Step 1: Write the failing test** Create `tests/php/ProjectBlocksTest.php`: ```php term->create( array( 'taxonomy' => 'chrnx_project', 'name' => 'Green Tea', 'slug' => 'green-tea-test', ) ); update_term_meta( $term_id, 'chrnx_project_status', 'Beta' ); $markup = do_blocks( '' ); $this->assertStringContainsString( 'chrnx-project-card', $markup ); $this->assertStringContainsString( 'Green Tea', $markup ); $this->assertStringContainsString( 'Beta', $markup ); } /** * Ensure a project without a cover still renders art. */ public function test_project_without_cover_uses_placeholder_art() { self::factory()->term->create( array( 'taxonomy' => 'chrnx_project', 'slug' => 'coverless-test', ) ); $markup = do_blocks( '' ); $this->assertStringContainsString( 'chrnx-project-card__fallback', $markup ); } } ``` - [ ] **Step 2: Run the test to verify it fails** Run: `npm run test:php` Expected: FAIL. `do_blocks()` returns the unrendered comment because `chrnx/project-list` is not registered. - [ ] **Step 3: Create `blocks/project-list/block.json`** ```json { "$schema": "https://schemas.wp.org/trunk/block.json", "apiVersion": 3, "name": "chrnx/project-list", "version": "0.4.4", "title": "Project List", "category": "theme", "description": "Every project, each linking to its own page.", "textdomain": "chrnx", "attributes": { "headingLevel": { "type": "integer", "default": 4, "enum": [2, 3, 4, 5, 6] } }, "supports": { "html": false }, "render": "file:./render.php" } ``` - [ ] **Step 3b: Register the block** Add `'project-list'` to the `$blocks` array in `chrnx_register_editorial_blocks()` at `inc/blocks.php:235`, keeping the existing single-line array format. - [ ] **Step 4: Create `blocks/project-list/render.php`** ```php 'chrnx_project', 'hide_empty' => false, ) ); if ( is_wp_error( $chrnx_terms ) || empty( $chrnx_terms ) ) { return; } ?>
'chrnx-project-list' ) ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>> term_id, 'chrnx_project_status', true ); $chrnx_cover = absint( get_term_meta( $chrnx_term->term_id, 'chrnx_project_cover', true ) ); $chrnx_links = chrnx_get_project_links( $chrnx_term->term_id ); ?>
``` - [ ] **Step 5: Confirm the icon lookup** Resolved before dispatch, no change needed to the helper. `chrnx_get_platform_links_markup( array $links, $class_name, $platforms = null )` at `inc/release-meta.php:120` already takes an explicit slot-definition array as its third argument and falls back to `chrnx_get_release_platforms()` only when that argument is omitted. Its loop skips any slot missing from `$platforms`, so omitting the third argument would silently render no links at all for projects. The render code above passes `chrnx_get_project_link_slots()` explicitly. Verify that argument is present. - [ ] **Step 6: Run the tests to verify they pass** Run: `npm run test:php && npm run phpcs` Expected: PASS. - [ ] **Step 7: Commit** ```bash git add blocks/project-list tests/php/ProjectBlocksTest.php git commit -m "feat: list every project with its status and links" ``` --- ### Task 5: The project detail block **Files:** - Create: `blocks/project-detail/block.json`, `blocks/project-detail/render.php` - Modify: `inc/blocks.php:235` — add `'project-detail'` to the `$blocks` array, exactly as Task 4 added `'project-list'` - Test: `tests/php/ProjectBlocksTest.php` (extend) **Interfaces:** - Consumes: `chrnx_get_project_links()`, `chrnx_get_topic_portrait_markup()`. - Produces: block `chrnx/project-detail`, consumed by `templates/taxonomy-chrnx_project.html`. - [ ] **Step 1: Read the release equivalent** Run: `cat blocks/release-detail/render.php` The project version renders the same shape: cover, status, description, links. Copy its structure exactly rather than inventing a new one. - [ ] **Step 2: Write the failing test** Append to `tests/php/ProjectBlocksTest.php`: ```php /** * Ensure the detail block renders the queried project header. */ public function test_project_detail_renders_the_queried_term() { $term_id = self::factory()->term->create( array( 'taxonomy' => 'chrnx_project', 'name' => 'Ailed', 'slug' => 'ailed-test', 'description' => 'A chess engine that feels.', ) ); update_term_meta( $term_id, 'chrnx_project_repo', 'https://github.com/example/ailed' ); $this->go_to( get_term_link( $term_id ) ); $markup = do_blocks( '' ); $this->assertStringContainsString( 'A chess engine that feels.', $markup ); $this->assertStringContainsString( 'https://github.com/example/ailed', $markup ); } ``` - [ ] **Step 3: Run the test to verify it fails** Run: `npm run test:php` Expected: FAIL, block not registered. - [ ] **Step 4: Create the block** `blocks/project-detail/block.json` mirrors Task 4's JSON with `"name": "chrnx/project-detail"`, `"title": "Project Detail"`, `"description": "Cover, status and links for the queried project."`, and no `headingLevel` attribute. `blocks/project-detail/render.php` follows `blocks/release-detail/render.php` line for line, substituting `chrnx_release` with `chrnx_project`, `chrnx_get_release_links` with `chrnx_get_project_links`, `chrnx_release_cover` with `chrnx_project_cover`, `chrnx_release_status` with `chrnx_project_status`, `placeholder-release` with `placeholder-project`, and the `chrnx-release-` class prefix with `chrnx-project-`. - [ ] **Step 5: Run the tests to verify they pass** Run: `npm run test:php && npm run phpcs` Expected: PASS. - [ ] **Step 6: Commit** ```bash git add blocks/project-detail tests/php/ProjectBlocksTest.php git commit -m "feat: give each project its own page header" ``` --- ### Task 6: Archive templates for projects and shows **Files:** - Create: `templates/taxonomy-chrnx_project.html` - Create: `templates/taxonomy-chrnx_show.html` - Test: `tests/smoke/templates.test.mjs` **Interfaces:** - Consumes: blocks `chrnx/project-detail` (Task 5) and `chrnx/show-links` (existing). - [ ] **Step 1: Write the failing test** Read `tests/smoke/templates.test.mjs` first to match its existing assertion style, then add both filenames to whatever list it checks. - [ ] **Step 2: Run the test to verify it fails** Run: `npm run test:smoke` Expected: FAIL, both templates missing. - [ ] **Step 3: Create `templates/taxonomy-chrnx_project.html`** ```html
``` - [ ] **Step 4: Create `templates/taxonomy-chrnx_show.html`** This repairs the gap named in the spec: shows currently fall through to the generic archive and never render their own detail. ```html
``` - [ ] **Step 5: Verify both archives render** Run: `npx wp-env run cli wp eval 'echo get_term_link( "green-tea", "chrnx_project" );'` then curl that URL and confirm HTTP 200 with the project title in the output. Repeat for `silicon-ranch` in `chrnx_show`. - [ ] **Step 6: Run the tests to verify they pass** Run: `npm run test:smoke && npm run test:php` Expected: PASS. - [ ] **Step 7: Commit** ```bash git add templates/taxonomy-chrnx_project.html templates/taxonomy-chrnx_show.html tests/smoke/templates.test.mjs git commit -m "feat: give project and show archives their own templates" ``` --- ### Task 7: The projects landing **Files:** - Create: `patterns/projects-landing.php` - Modify: `patterns/home-projects.php` - Modify: `assets/css/components.css` **Interfaces:** - Consumes: `chrnx/project-list` (Task 4), `chrnx_get_atmosphere_markup()`, `chrnx_get_topic_portrait_markup()`. - Produces: pattern slug `chrnx/projects-landing`, referenced by production page 740 in Task 9. - [ ] **Step 1: Create `patterns/projects-landing.php`** Mirrors `patterns/music-landing.php` exactly: a `chrnx-character-stage` with atmosphere, content, and art layers, then the list block. Copy is the author's, approved in the spec. ```php

``` - [ ] **Step 2: Strip the list out of `patterns/home-projects.php`** Replace the `` line with a paragraph, so the home section becomes banner copy only, matching `home-music.php`: ```php

``` - [ ] **Step 3: Add card styles** In `assets/css/components.css`, find the `.chrnx-release-card` rules and add `.chrnx-project-card` to the same selectors rather than duplicating the block. The two cards are the same object with a different label. - [ ] **Step 4: Verify the landing renders locally** Create a local page containing only ``, then curl it and confirm the heading, both paragraphs, and one `chrnx-project-card` per seeded term. - [ ] **Step 5: Run the full local suite** Run: `npm run test:smoke && npm run test:php && npm run lint:css && npm run phpcs` Expected: PASS. - [ ] **Step 6: Commit** ```bash git add patterns/projects-landing.php patterns/home-projects.php assets/css/components.css git commit -m "feat: give projects a landing of their own" ``` --- ### Task 8: Retire the featured picker **Files:** the surface is wider than a block deletion. Every one of these was verified to reference the retired feature. - Delete: `blocks/selected-work/` (block.json + render.php) - Delete: `assets/js/editor-project.js` — the editor sidebar panel exists only to toggle `chrnx_project_featured`, and it self-hides unless the post carries the `projects` topic, which Task 9 retires - Delete: `tests/js/editor-project.test.js` — four references, all covering the deleted panel - Modify: `inc/queries.php:274` remove `chrnx_get_selected_project_ids()` and its docblock - Modify: `inc/blocks.php:235` remove `'selected-work'` from the registration list - Modify: `inc/editor.php:49-50` remove the `chrnx-editor-project` enqueue, and `:66` its `wp_set_script_translations()` call - Modify: `scripts/seed-test-content.php:143,147` remove `chrnx_project_featured` from the seeded meta keys and the `update_post_meta()` call - Modify: `assets/css/components.css` remove `.chrnx-selected-work*` rules - Modify: `tests/php/EditorialQueriesTest.php` drop the coverage of the removed query **Interfaces:** - Removes: `chrnx_get_selected_project_ids()`, post meta `chrnx_project_featured`, block `chrnx/selected-work`. - [ ] **Step 1: Confirm nothing else references them** ```bash grep -rn "selected-work\|selected_project\|chrnx_project_featured\|chrnx-editor-project" \ --include="*.php" --include="*.js" --include="*.json" --include="*.html" --include="*.mjs" \ --include="*.css" inc blocks patterns templates assets tests scripts ``` Note `scripts` in the search path and `--include="*.css"` in the filters: the first pass of this plan omitted both and missed four real references. Every hit must be one of the files listed above. A hit anywhere else means this task is incomplete; handle it before deleting. Re-run this grep after the deletions and expect zero output. - [ ] **Step 2: Confirm production stores no copy of the block** Already verified on 2026-08-15: pages hold `wp:pattern` references, and page 740 holds `chrnx/home-projects` plus `chrnx/journal-stream`, not `chrnx/selected-work`. Re-run the check before deleting: ```bash WP_PASS=$(pass show personal/chrnx-dev | head -1) WP_USER=$(pass show personal/chrnx-dev | sed -n 's/^user:[[:space:]]*//p' | head -1) curl -s -u "$WP_USER:$WP_PASS" "https://chrnx.dev/wp-json/wp/v2/pages?per_page=50&context=edit&_fields=id,slug,content" \ | grep -c "chrnx/selected-work" ``` Expected: `0`. If it is not zero, stop and migrate that page's content first. - [ ] **Step 3: Delete the block and the query** ```bash git rm -r blocks/selected-work ``` Then remove `chrnx_get_selected_project_ids()` from `inc/queries.php` along with its docblock, and drop the tests covering it from `tests/php/EditorialQueriesTest.php`. - [ ] **Step 4: Confirm the post meta registration is gone** Task 2 replaced `inc/project-meta.php` wholesale, so the `register_post_meta()` call for `chrnx_project_featured` no longer exists. What survives is every CONSUMER of that meta, listed in this task's file map. Confirm with the grep from Step 1 that none remain. - [ ] **Step 4b: Run the JavaScript suite** Deleting an editor script and its test file changes the JS surface, which the PHP suite does not cover. Run: `npm run test:js && npm run lint:js` Expected: PASS, with one fewer suite than before. - [ ] **Step 5: Run the full local suite** Run: `npm test` Expected: PASS across smoke, lint, phpcs, php, js, and e2e. - [ ] **Step 6: Commit** ```bash git add -A git commit -m "refactor: drop the featured-project picker in favour of the project list" ``` --- ### Task 9: Production migration **Files:** none in the repository. This task mutates production content and runs only after the author confirms the mapping. **Interfaces:** - Consumes: taxonomy `chrnx_project` and its terms, live after the theme ZIP is uploaded. - [ ] **Step 1: Get the mapping from the author** Do not infer it. Ask for the project term and the corrected topic for each of these six posts: | ID | Title | Topic today | |---|---|---| | 730 | I Built a Framework on Express. Then I Had to Rebuild It From Scratch. | code | | 838 | req.user no existe, tú nomás rezas | projects | | 695 | What's New in Expressive Tea 2.0: The Full Breakdown | code | | 692 | Expressive Tea 2.0 Is Here | projects | | 678 | Ailed: A Chess Engine That Feels | projects | | 716 | Processing 1M Chess Games in 15 Seconds with Rust | code | Note that Expressive Tea is a separate project from Green Tea, so it likely needs a third term that Task 1 does not seed. - [ ] **Step 2: Release and upload the theme** Bump `style.css`, `functions.php`, and all `blocks/*/block.json` to the new version together, then: ```bash npm run package ``` The author uploads `dist/chrnx-.zip` through Appearance then Themes. Do not attempt to deploy. - [ ] **Step 3: Fill in each project's term meta** Through the term edit screen or REST, set status, repository, package, and site for `green-tea`, `ailed`, and any term added in Step 1. Values come from the author. - [ ] **Step 4: Assign project terms and correct topics** Apply the Step 1 mapping through REST, one post at a time, verifying each response before moving on. - [ ] **Step 5: Repoint page 740** Replace the page content with a single pattern reference: ```text ``` This drops the `chrnx/journal-stream {"topic":"projects"}` block, which breaks once the `projects` topic is retired. - [ ] **Step 6: Retire the projects topic term** Only after Step 4 shows every post rehomed. Delete the `projects` term from `chrnx_topic` and remove it from the seeded definitions in `inc/taxonomies.php` and `tests/php/TaxonomiesTest.php`. - [ ] **Step 7: Verify production** ```bash for u in / /projects/ /project/green-tea/ /project/ailed/ /topic/code/; do printf "%-4s %s\n" "$(curl -sL -o /dev/null -w '%{http_code}' "https://chrnx.dev$u")" "$u" done ``` Expected: `200` on every route. Then confirm each project page lists its posts, and that no route leaks a PHP notice. - [ ] **Step 8: Regenerate the critical CSS** After the theme upload, never before. The author regenerates Jetpack Boost's critical CSS from the plugin settings. --- ## Self-review **Spec coverage.** Content model is Tasks 1 and 2. The generic package field is Task 2. Cover fallback is Tasks 3 and 4. Retiring the featured picker is Task 8. The landing and its copy are Task 7. Project and show archives are Task 6. Migration and the retirement of the `projects` topic are Task 9. **Open item carried into execution.** Task 4 Step 5 and Task 2 Step 4 both depend on how `inc/release-meta.php` dispatches term-edit hooks and resolves platform icons. Both steps read the file first and adapt. These are the only places where the release code may not generalise without a small change, and both are flagged rather than assumed. **Naming consistency.** `chrnx_get_project_link_slots()`, `chrnx_get_project_meta_definitions()`, and `chrnx_get_project_links()` are defined in Task 2 and used under those exact names in Tasks 4 and 5. Meta keys are `chrnx_project_cover`, `chrnx_project_status`, `chrnx_project_repo`, `chrnx_project_package`, `chrnx_project_site` throughout. CSS classes use the `chrnx-project-` prefix throughout.