Add CouchDB replication, failover, failback, and conflict integration tests #21

Merged
lost-rob0t merged 4 commits from feature/issue-11-replication-failover into main 2026-08-12 02:28:36 +00:00
lost-rob0t commented 2026-08-12 02:26:55 +00:00 (Migrated from github.com)

Closes #11.

What changed

  • add a dual-site Docker Compose topology with two CouchDB nodes and two Prolog API instances
  • add one-shot CouchDB A→B and B→A replication coverage
  • prove active release manifests and fact/rule documents reconstruct identical inference on the peer site
  • simulate complete site-A outage while site B continues serving inference
  • stage and activate a new release on the surviving site, then fail back to A through reverse replication
  • restart Prolog runtimes independently and prove reconstruction from local replicated CouchDB state
  • deliberately create divergent revisions from a common CouchDB ancestor
  • verify _conflicts exposes the losing leaf revision and that the losing revision remains retrievable
  • verify both CouchDB nodes converge on the same deterministic winner after bidirectional replication
  • add a dedicated replication workflow and document the current conflict boundary

Conflict boundary

This PR tests CouchDB conflict visibility exactly as it exists today. The expert-system API currently reasons over CouchDB's winning revision; it does not yet reject conflicted knowledge. The suite checks _conflicts directly rather than claiming fail-closed inference semantics.

CI policy

Merge only after both the existing full CI workflow and the new replication-required gate are green.

Closes #11. ## What changed - add a dual-site Docker Compose topology with two CouchDB nodes and two Prolog API instances - add one-shot CouchDB A→B and B→A replication coverage - prove active release manifests and fact/rule documents reconstruct identical inference on the peer site - simulate complete site-A outage while site B continues serving inference - stage and activate a new release on the surviving site, then fail back to A through reverse replication - restart Prolog runtimes independently and prove reconstruction from local replicated CouchDB state - deliberately create divergent revisions from a common CouchDB ancestor - verify `_conflicts` exposes the losing leaf revision and that the losing revision remains retrievable - verify both CouchDB nodes converge on the same deterministic winner after bidirectional replication - add a dedicated replication workflow and document the current conflict boundary ## Conflict boundary This PR tests CouchDB conflict visibility exactly as it exists today. The expert-system API currently reasons over CouchDB's winning revision; it does **not** yet reject conflicted knowledge. The suite checks `_conflicts` directly rather than claiming fail-closed inference semantics. ## CI policy Merge only after both the existing full CI workflow and the new `replication-required` gate are green.
Sign in to join this conversation.
No description provided.