Skip to content

Accept native front-page rewrite cache refresh during apply - #191

Merged
noeltock merged 3 commits into
mainfrom
block-theme/front-page-routing
Oct 12, 2026
Merged

noeltock merged 3 commits into
mainfrom
block-theme/front-page-routing

Conversation

@noeltock

@noeltock noeltock commented Oct 12, 2026 •

Copy link
Copy Markdown
Member

Problem

A confirmed front-page assignment on WordPress 7.1 rebuilt the native rewrite cache. Apply treated its changed hash as an unrelated edit and returned an unknown outcome after creating the pages and setting the front page.

Solution

Allow that hash to advance only while a changed, explicitly planned front-page option reads back as requested. Every other snapshot and routing field stays compared. When an interrupted option is proved, refresh completed pages' derived routes so the existing journal can continue without recreating them.

Behaviour Read first Proof
Planned front-option rewrite-cache refresh is accepted src/site/apply.ts Distinct hashes for both native front options
Other routing changes still stop apply dev/test/site-apply.test.ts Ordinary page-write, permalink and unsupported-routing controls
Exact interrupted option is proved without repeating mutations src/site/apply.ts Recovery test retains three mutations and the final page route

Diff

+13 −5 · 2 files · no new command, dependency or recovery mechanism.

 assertTransition
+ changed front option + exact readback + nonempty rewrite hash
+ accept that observed rewrite hash
  compare all other routing and managed state

 interrupted option proof
  validate the complete transition
+ refresh only derived completed page routes
  continue the existing journal

Testing & verification

Reviewed revision: 3b8103c2f01447f98e3fb526b40a8e7c2dc0cfbd · Environment: local macOS, Node 22.23.1.

  • npm exec vitest -- run dev/test/site-apply.test.ts dev/test/site-plan.test.ts dev/test/site-apply-wpcli.test.ts: 71 passed, exit 0.
  • npm run typecheck and git diff --check: exit 0.
  • npm run verify: exit 0; 977 passed, 4 skipped; typecheck, build, source-hash, private-reference and package checks passed.
  • Exact-head CI 38284391018: Node22.13/24, packed consumers, WordPress and CI scope passed; documentation and skill jobs skipped by scope.
  • Actual native failure on main 97ba58a was retained. Exact expected/observed product snapshots differed only in the rewrite hash after page_on_front changed from 0 to 9.
  • Bounded advisor safety review approved the specific transition exception; lead source review checked the unchanged before-state/replay/refusal protections.

Not verified: corrected native continuation is pending. The original unknown-outcome evidence is preserved.

Risk / rollout

An opaque hash cannot prove why the cache changed. This accepts WordPress's observed rewrite result during the specific planned front-option mutation; it does not exclude simultaneous external rewrite changes. The existing concurrency limitation remains. Other routing fields, stale state, ownership and exact recovery proof stay checked.

Detection: targeted transition controls, full CI and the retained native journal continuation. Rollback: revert this PR; existing native effects remain explicit and require operator review.

@noeltock
noeltock marked this pull request as ready for review October 12, 2026 17:35
@noeltock
noeltock merged commit a7bae0d into main Oct 12, 2026
8 checks passed
@noeltock
noeltock deleted the block-theme/front-page-routing branch October 12, 2026 17:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant