[codex] Harden merge reliability gates and semantic coverage#46
Conversation
1df6d01 to
30c93f8
Compare
473d44f to
7776355
Compare
|
Follow-up tracker for the remaining merge reliability work: #48 |
|
Wrapping PR #46 here as the merge-reliability hardening milestone. Current state:
Follow-up work is documented in #48 and linked from the PR body. That issue is intentionally about what remains before claiming fully reliable real-world merging, especially real-plugin validators, broader product-level crash harnesses, APFS sparsebundle kill coverage, explicit-ID/import expansion, richer plugin/schema stale-audit evidence, deterministic schema dependency planning, and macOS release gates. |
9f72db4 to
a37f87d
Compare
|
Rebased PR #46 onto current New head: Conflict resolution notes:
Post-rebase validation:
CI restarted on the rebased head; no failed check was visible immediately after the push. |
|
Pushed |
Summary
This PR hardens ForkPress merge reliability across the nine problem areas we identified: WordPress semantic objects, plugin semantics, review-only schema cases, filesystem behavior, crash consistency, branch birth metadata, ID bands, stale audits, and release gates.
The main product stance is conservative: merge should apply exact source changes, preserve target state, or produce an auditable conflict. It should not silently rewrite WordPress IDs or plugin data graphs to make conflicts disappear.
What Changed
forkpress branch mergekill/recover/retry paths for DB, metadata, before-file, and filesystem checkpoints, public interrupted recovery cleanup retry coverage, and public branch reset crash/retry coverage with pending-reset guards that block merge/reuse after interrupted reset publication.revalidate-reviews,merge-audit --revalidate, guardedmerge-resolve --after-revalidate, plugin validator evidence revalidation, plugin replacement conflict links, and conservativerevalidation_classmetadata for stale reviewed conflicts, including target drift, source drift, missing target rows/files, incompatible no-primary-key rowid replacements, and supported WordPress same-key semantic replacements.set -u.docs/merge-reliability.mdso each original merge reliability requirement maps to concrete tests/docs and an explicit remaining gap.Merging Model
ForkPress treats merge as a three-surface operation:
Branch IDs are not repaired after the fact. Each branch gets a separate AUTOINCREMENT band before writes happen because WordPress and plugins store IDs in JSON, serialized PHP, block markup, options, and custom tables. If a source row tries to bring an explicit ID outside its reserved band, ForkPress holds that row and dependent references for review instead of rewriting embedded IDs.
Plugin data is not guessed by the generic SQLite layer. The generic merge can preserve rows and files, but plugin validators are the boundary for plugin-specific coherence. A validator can say the staged candidate is coherent, report review conflicts with plugin evidence, or fail the merge and trigger rollback.
Reviewed conflict resolution is guarded. If the target no longer matches the audited payload, resolution stops. Revalidation can carry prior reviewer intent back into
needs-action, but drift does not auto-apply. Generic DB row/cell and filesystem conflicts now recordcompatible-source-driftwhen the source side changes after review, so a stale source choice is reopened instead of applying old reviewer intent to new source data. Supported WordPress primary-key row conflicts also recordincompatiblewhen the same key now describes a different semantic object. Source- and target-side regression coverage now spans every currently implemented WordPress row fingerprint: posts, options, postmeta, terms, term taxonomy, termmeta, users, usermeta, comments, and commentmeta.Upsides
Trade-offs
Still Missing
Validation
umask 022; php tests/cow/merge.phppassed with 2912 assertions.php -l scripts/cow/merge.phpphp -l tests/cow/merge.phpbash -n scripts/build-dist.shmake test-releasemake test-release PHP_CONFIG= PHP_DEV_DIR= PKG_CONFIG=make test-branchfs PHP_CONFIG= PHP_DEV_DIR= PKG_CONFIG=fails with the expected PHP-header error.bash -n tests/release/build-dist-preflight.shumask 022; CARGO_TARGET_DIR=/tmp/forkpress-target-merge-reliability cargo test -p forkpress-storagebash -n tests/cow/e2e.shumask 022; php tests/cow/branch_ui.phppassed with 25 assertions.php -l scripts/cow/git_server.phpphp -l tests/cow/git_server.phpumask 022; php tests/cow/git_server.phppassed with 252 assertions.umask 022; CARGO_TARGET_DIR=/tmp/forkpress-cli-test.<tmp> FORKPRESS_RUNTIME_BUNDLE=/dev/null cargo test -p forkpress-cli --bin forkpresspassed with 61 tests.git diff --check