Skip to content

[codex] Extend merge revalidation and WordPress semantic guards#313

Merged
adamziel merged 16 commits into
trunkfrom
codex/merge-revalidation-next
May 18, 2026
Merged

[codex] Extend merge revalidation and WordPress semantic guards#313
adamziel merged 16 commits into
trunkfrom
codex/merge-revalidation-next

Conversation

@adamziel
Copy link
Copy Markdown
Contributor

@adamziel adamziel commented May 18, 2026

What it does

Extends the merge reliability follow-up after #311 with guarded revalidation, UI-routing hardening, crash consistency coverage, and additional WordPress/plugin semantic tests that are still best reviewed as one draft lane.

Rationale

ForkPress merge correctness depends on more than row-level conflict detection. WordPress stores object links in postmeta, options, plugin tables, upload metadata, and generated schema objects, so automatic merge resolution must re-check current source/target state before applying anything destructive.

Implementation

  • Applies current source DB payloads after explicit revalidation only when the live source still matches the latest reviewed payload.
  • Extends schema after-revalidate support to table restores, indexes, views, triggers, table rebuild target drift, and compatible table rebuild source drift.
  • Rebuilds compatible table-drift sources with guarded dependency replacement: source-applied indexes/triggers may be replaced by current source dependencies, while unrelated target dependency changes still block automatic resolution.
  • Adds compatible target-drift filtering for table rebuild and source-dropped index schema conflicts.
  • Applies filesystem source drift only when the live source file still matches the latest revalidation payload.
  • Keeps target-referenced WordPress owner children reviewable instead of deleting objects still referenced by target-side metadata/options/content.
  • Protects WordPress upload files still referenced by merged attachment metadata so source-side deletes become file conflicts instead of removing referenced originals/thumbnails.
  • Adds browser-like non-async/admin-page branch merge routing tests so branch UI actions return ForkPress JSON instead of falling through to WordPress HTML.
  • Extends plugin-validator coverage for WooCommerce HPOS order graphs, WooCommerce product references, Gravity Forms fields, ACF fields, Yoast SEO indexables, and The Events Calendar scalar _EventVenueID references.
  • Extends semantic smoke coverage for nav_menu term counts so unrelated/draft relationships do not inflate published menu counts.
  • Covers exhausted branch ID bands so branch-birth allocation reserves a fresh band after an explicit in-band import reaches the prior band end.
  • Adds a storage failpoint test for reset birth metadata: failure after metadata finalization but before branch publication rolls back metadata/base artifacts and a retry publishes cleanly.
  • Updates merge reliability, crash consistency, stale-audit, and plugin-validator docs for these guarded paths.

Testing instructions

Latest grouped verification passed locally:

umask 0022 && scripts/dev/cow-changed-test-plan.sh --base origin/trunk

That planner covered diff checks, PHP syntax, merge_smoke, filesystem, id_bands, explicit_ids, media_validator, plugin_validator, schema_review, stale_audit, wp_semantic_validator, full merge.php, and branch UI tests.

Focused gates also passed directly while developing the latest slices:

umask 0022 && cargo test -p forkpress-storage
umask 0022 && cargo test -p forkpress-storage reset_birth_metadata_failpoint_rolls_back_artifacts_before_publish
umask 0022 && php tests/cow/plugin_validator.php
umask 0022 && make test-cow-merge-smoke
umask 0022 && make test-cow-schema-review
umask 0022 && php tests/cow/wp_semantic_validator.php
umask 0022 && php tests/cow/explicit_ids.php

Still draft because

  • Remote CI for the latest head is still running.
  • This is the next review batch after [codex] Extend merge reliability guards and stale review flow #311, not a release tag by itself.
  • Remaining roadmap items still include more real plugin validators/drivers, broader schema reorderings, upload regeneration policy, and platform kill/recovery harnessing.

@adamziel adamziel force-pushed the codex/merge-revalidation-next branch from 408bd82 to 4d08f7d Compare May 18, 2026 07:27
@adamziel adamziel force-pushed the codex/merge-revalidation-next branch from fbd1cd8 to 18bcdab Compare May 18, 2026 10:11
@adamziel adamziel marked this pull request as ready for review May 18, 2026 10:32
@adamziel adamziel merged commit 4823b33 into trunk May 18, 2026
13 checks passed
@adamziel adamziel deleted the codex/merge-revalidation-next branch May 18, 2026 10:32
@adamziel adamziel mentioned this pull request May 18, 2026
adamziel added a commit that referenced this pull request May 18, 2026
## Release `v0.1.35`

Version bump and release metadata update for `v0.1.35`.

**Changelog draft:**
* Extend merge revalidation and WordPress semantic guards
([#313](#313))
* Add Events Calendar-shaped merge smoke coverage
([#318](#318))
* Extend semantic E2E with Site Editor objects
([#317](#317))
* Add thin SSH remote clone command
([#315](#315))
* Update release gate evidence for v0.1.34
([#319](#319))
* Guard plugin children behind logical identity collisions
([#320](#320))
* Hold case-insensitive upload path collisions
([#322](#322))
* Cover scoped crash recovery
([#323](#323))
* Hold malformed attachment metadata shapes
([#324](#324))
* Cover thin remote clone branch metadata
([#326](#326))
* Cover source-added trigger view dependencies
([#321](#321))
* Cover WooCommerce duplicate address semantics
([#325](#325))
* Cover Events Calendar organizer validator semantics
([#327](#327))
* Cover Elementor widget media validator semantics
([#328](#328))
* Reject duplicate attachment upload metadata rows
([#329](#329))
* Cover existing branch Git update crash recovery
([#330](#330))
* Mark WordPress media repairs review-only
([#331](#331))
* Cover backup attachment metadata drift
([#332](#332))
* Limit release verification for COW-only PRs
([#335](#335))
* Batch merge reliability roadmap coverage
([#336](#336))
* Cover WordPress upload MIME drift
([#333](#333))
* Add branch merge history commands
([#334](#334))
* Show restored stale-audit reviews
([#337](#337))
* Cover Yoast duplicate indexable permalinks
([#338](#338))
* Cover Yoast indexable hierarchy drift
([#339](#339))
* Cover revision parent semantic drift
([#340](#340))
* Expose merge history in branch switcher
([#341](#341))
* Cover ACF relationship validator drift
([#342](#342))
* Show merge history on branch admin page
([#343](#343))
* Drill into conflicts from branch admin history
([#344](#344))
* Expose branch tree on admin page
([#345](#345))
* Resolve conflicts from branch admin page
([#346](#346))
* Document conflict review workflow
([#347](#347))

**Full changelog:**
v0.1.34...release/v0.1.35

## Next steps

1. **Review** the changes in this pull request.
2. **Push** any additional edits to this branch (`release/v0.1.35`).
3. **Merge** this pull request to publish `v0.1.35`.

Merging will automatically build ForkPress binaries, create a GitHub
release, and update the Homebrew formula.

Co-authored-by: Codex <codex@openai.com>
mokagio added a commit that referenced this pull request May 19, 2026
Windows PowerShell 5.1 (BK `windows` queue) reads `.ps1` files as
ANSI/Windows-1252 unless a UTF-8 BOM is present, so the em dashes
in `sign.ps1`'s `throw` message and the comment in
`windows-build.ps1` got decoded as garbage and broke the parser
mid-string with cascading "Unexpected token" / "missing terminator"
errors during the `windows-tests` `[scriptblock]::Create(...)`
syntax check on build #313.

Local `pwsh` on macOS (PowerShell Core 7+, UTF-8 native) parsed
the same file cleanly, which is why the Tier 2 parse-check missed
this. Going forward, scan with
`grep -nP "[^\x00-\x7F]" path/to/script.ps1` before pushing
PowerShell intended for the Windows queue.

---

Generated with the help of Claude Code, https://claude.com/claude-code

Co-Authored-By: Claude Code Opus 4.7 (1M context) <noreply@anthropic.com>
mokagio added a commit that referenced this pull request May 19, 2026
Windows PowerShell 5.1 (BK `windows` queue) reads `.ps1` files as
ANSI/Windows-1252 unless a UTF-8 BOM is present, so the em dashes
in `sign.ps1`'s `throw` message and the comment in
`windows-build.ps1` got decoded as garbage and broke the parser
mid-string with cascading "Unexpected token" / "missing terminator"
errors during the `windows-tests` `[scriptblock]::Create(...)`
syntax check on build #313.

Local `pwsh` on macOS (PowerShell Core 7+, UTF-8 native) parsed
the same file cleanly, which is why the Tier 2 parse-check missed
this. Going forward, scan with
`grep -nP "[^\x00-\x7F]" path/to/script.ps1` before pushing
PowerShell intended for the Windows queue.

---

Generated with the help of Claude Code, https://claude.com/claude-code

Co-Authored-By: Claude Code Opus 4.7 (1M context) <noreply@anthropic.com>
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.

2 participants