Skip to content

[codex] Extend merge reliability guards and stale review flow#311

Merged
adamziel merged 6 commits into
trunkfrom
codex/stale-revalidation-drivers
May 18, 2026
Merged

[codex] Extend merge reliability guards and stale review flow#311
adamziel merged 6 commits into
trunkfrom
codex/stale-revalidation-drivers

Conversation

@adamziel
Copy link
Copy Markdown
Contributor

@adamziel adamziel commented May 18, 2026

What it does

Groups the next merge-reliability slice without opening another PR:

  • Adds fast smoke coverage for clean wp_global_styles create/create merges and source-edit/target-delete review conflicts.
  • Makes apply-reviewed-resolutions preflight live staleness, revalidate stale validated choices, skip unsafe batch application, and leave target state unchanged.
  • Accepts compatible-schema-table-target-drift in the audit CLI revalidation-class filter, matching the schema planner/resolver contract.
  • Documents the known Codex .git sandbox permission failure mode and repair commands in AGENTS.md.
  • Holds dependent source child rows behind non-AUTOINCREMENT INTEGER PRIMARY KEY parent collisions, so plugin child rows cannot silently attach to a different target parent with the same key.

Rationale

The merge model has to be conservative when object identity is ambiguous. wp_global_styles needs the same WordPress-specific coverage as other Site Editor object types, stale reviewed choices need to become actionable review state instead of raw resolver failures, and plain integer-key plugin tables cannot be made reliable by ID rewrites. When a parent row collision is review-held, dependent child rows must wait too.

The .git notes are included because prior Codex sessions have repeatedly misdiagnosed sandbox-created permission damage as product Git/merge failures.

Testing instructions

Run locally:

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

Latest local run passed with diff checks, PHP syntax checks, tests/cow/merge_smoke.php, tests/cow/id_bands.php, tests/cow/schema_review.php, and tests/cow/stale_audit.php.

@adamziel adamziel force-pushed the codex/stale-revalidation-drivers branch from 1fb17ca to 517d38e Compare May 18, 2026 05:33
@adamziel adamziel changed the title [codex] Extend stale audit and global styles coverage [codex] Extend merge reliability guards and stale review flow May 18, 2026
@adamziel adamziel force-pushed the codex/stale-revalidation-drivers branch from 862e1a3 to c03ff8b Compare May 18, 2026 06:41
@adamziel adamziel marked this pull request as ready for review May 18, 2026 06:42
@adamziel adamziel merged commit c23e23e into trunk May 18, 2026
13 checks passed
@adamziel adamziel deleted the codex/stale-revalidation-drivers branch May 18, 2026 07:22
adamziel added a commit that referenced this pull request May 18, 2026
## Release `v0.1.34`

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

**Changelog draft:**
* Expose conflict resolution contract
([#237](#237))
* Expose conflict lifecycle actions
([#238](#238))
* Store conflict lifecycle events
([#239](#239))
* Expose conflict event audit records
([#240](#240))
* Persist validated conflict resolutions
([#241](#241))
* Apply latest validated conflict choice
([#242](#242))
* Cover stale revalidation conflict events
([#243](#243))
* Document v0.1.33 release gate evidence
([#244](#244))
* Cover plugin revalidation conflict events
([#245](#245))
* Cover schema revalidation conflict events
([#246](#246))
* Cover backup-size media validator drift
([#247](#247))
* Run-scope merge conflict records
([#248](#248))
* Record repeated merge conflicts per run
([#249](#249))
* Add merge conflict lineage keys
([#250](#250))
* Clean created-branch birth decisions on rollback
([#252](#252))
* Expand merge smoke and conflict audit coverage
([#251](#251))
* Guard branch writes without birth metadata
* Warn when WordPress branch merges have conflicts
* Expose merge conflict audits in branch UI
* Guard table rebuild revalidation
* Add plugin driver conflict execution contract
([#257](#257))
* Avoid static PHP auto-fix in release builds
([#259](#259))
* Expose crash recovery in merge audit
([#258](#258))
* Route branch recovery actions before WordPress
([#261](#261))
* Expose merge conflict audit summaries
([#262](#262))
* Cover term meta in semantic merge e2e
([#264](#264))
* Add WordPress conflict review actions
([#263](#263))
* Add reviewed conflict batch apply command
([#265](#265))
* Add WordPress reviewed-resolution apply action
([#269](#269))
* Keep stale reviewed choices out of batch apply
([#271](#271))
* Intercept conflict review actions in COW router
([#272](#272))
* Require plugin driver postflight validation
([#273](#273))
* Add Git-created post-metadata crash E2E
* Auto-merge safe source trigger rewrites
* Add changed-file COW preflight
* Report unchecked active plugin validators
* Harden media upload entry validation
* Guard source-changed schema drift resolution
* Cover explicit attachment content refs
* Auto-merge safe source view rewrites
* Batch merge reliability hardening
([#282](#282))
* Cover schema rewrites using source tables
([#283](#283))
* Hold duplicate WordPress page routes during merge
([#284](#284))
* Cover missing media metadata file fields
([#285](#285))
* Expose WordPress semantic audit scope
([#287](#287))
* Guard Git branch updates with ID-band metadata
([#288](#288))
* Hold child rows behind colliding explicit parents
([#291](#291))
* Filter plugin audit by reported file
([#286](#286))
* Cover synced patterns in runtime semantic E2E
([#292](#292))
* Cover block-theme merge smoke cases
([#289](#289))
* Advertise schema after-revalidate audit support
([#290](#290))
* Auto-apply compatible source index rewrites
([#293](#293))
* Use static PHP default fallback mirrors
([#295](#295))
* Expose carried review notes in revalidation summaries
([#294](#294))
* Guard merge repair semantics
([#296](#296))
* Cover WooCommerce-style plugin graph validation
([#298](#298))
* Reject symlinked media upload entries
([#300](#300))
* Document worktree-safe Git sandbox repair
([#302](#302))
* Cover Git-created storage crash in E2E
([#297](#297))
* Auto-apply unchanged schema drops
([#299](#299))
* Require plain IPK birth metadata
([#301](#301))
* Add WordPress semantic merge validators
([#304](#304))
* Harden media upload validator coverage
([#303](#303))
* Record unchecked plugin validator coverage
([#305](#305))
* Tighten merge semantic and schema coverage
([#307](#307))
* Publish merge-base snapshots atomically
([#308](#308))
* Allocate reset ID bands before publish
([#310](#310))
* Keep WordPress owner deletes coherent
([#309](#309))
* Extend merge reliability guards and stale review flow
([#311](#311))

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

## Next steps

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

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

---------

Co-authored-by: Codex <codex@openai.com>
adamziel added a commit that referenced this pull request 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:

```bash
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:

```bash
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 #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.

---------

Co-authored-by: Codex <codex@openai.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