{
  "schema_version": "1.3.0",
  "slug": "where-must-an-instance-reconcile-speculative-forks-before-committing-replay-state-and-why-does-the-obvious-last-writer-wins-merge-silently-corrupt-epi",
  "title": "Where must an instance reconcile speculative forks before committing replay state, and why does the obvious \"last-writer-wins\" merge silently corrupt episodic memory?",
  "date_of_record": "2026 November 30",
  "scope": "Applies to multi-agent orchestrators that run speculative execution forks (parallel tool-call branches, shadow auditors, or speculative decoding of a plan tree) and then deterministically replay the winning trajectory to reconstruct agent state. Does not apply to single-threaded agents with no forking, nor to stateless request/response LLM calls with no persistent episodic store.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/where-must-an-instance-reconcile-speculative-forks-before-committing-replay-state-and-why-does-the-obvious-last-writer-wins-merge-silently-corrupt-epi.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/where-must-an-instance-reconcile-speculative-forks-before-committing-replay-state-and-why-does-the-obvious-last-writer-wins-merge-silently-corrupt-epi.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/where-must-an-instance-reconcile-speculative-forks-before-committing-replay-state-and-why-does-the-obvious-last-writer-wins-merge-silently-corrupt-epi.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2162,
    "python_slice_tokens": 495,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The distinction that matters is between **replay determinism** (the same logical trajectory re-executed against the same recorded inputs yields the same state) and **fork reconciliation** (deciding which of several divergent speculative branches becomes the canonical trajectory). Teams conflate these. They build a replay engine that is bit-deterministic *giv...",
    "what_was_observed": "A three-agent orchestration (planner P, executor E, auditor A) ran speculative forks: E was forked into E₁ and E₂ to try two tool-call strategies against an external API with non-deterministic latency and occasional partial responses. A shadow auditor A forked alongside each to score the branch. Each fork wrote episodic entries (`step`, `observation`, `tool_result_hash`, `confidence`) into a shared append-only log ke...",
    "condition_of_validity": "The reconciliation-before-commit invariant is valid (and this failure is reachable) precisely when **all** of the following hold: - Forks share a logical key space (sequence counters, entity IDs, memory slot addresses) rather than a fork-scoped namespace. If each fork writes to `(trajectory_id, fork_id, seq)`, the collision cannot occur and reconciliation re...",
    "decision_boundary": "The boundary is drawn at the **commit barrier**, not at selection. Concretely: - **Below the barrier (safe):** each fork accumulates a private, fork-scoped delta log. No entry is visible to any other fork or to replay. Reconciliation is a pure function `merge(deltas, causal_order) -> canonical_log`. - **At the barrier (the decision):** the orchestrator must ...",
    "operational_effect": "The practical consequences of getting this wrong: - **Silent, self-consistent corruption.** Because replay and audit both reproduce the merged log faithfully, the standard verification path cannot detect it. You need a *cross-field* consistency invariant (e.g., \"a `status=206` observation may not be followed by a `status=200` continuation at the next seq wit..."
  },
  "matched_failure_symptoms": [
    "DOMAIN:EPISTEMIC_PROVENANCE_AND_FEDERATION_ROUTING"
  ],
  "composition_edges": {
    "primary_domain": "epistemic_provenance_and_federation_routing",
    "upstream_precondition_residuals": [
      "https://corpusfetch.com/c/according-to-what-precedence-hierarchy-must-an-instance-resolve-contradictory-directives-across-system-developer-and-user-tiers.md",
      "https://corpusfetch.com/c/how-should-an-instance-decide-that-a-stored-conclusion-has-gone-stale-without-a-new-observation.md"
    ],
    "downstream_consequence_residuals": [
      "https://corpusfetch.com/c/by-what-checkpoint-and-compaction-boundaries-must-an-instance-externalize-working-state-to-prevent-context-window-drift-and-truncation-amnesia.md",
      "https://corpusfetch.com/c/across-what-additive-schema-and-unknown-field-preservation-boundaries-must-an-instance-evolve-wire-contracts-to-prevent-rolling-deploy-deserialization-crashes.md"
    ],
    "co_occurring_sibling_residuals": [
      "https://corpusfetch.com/c/how-can-an-instance-capture-implicit-user-preferences-without-storing-private-data.md",
      "https://corpusfetch.com/c/how-can-an-instance-compress-long-reasoning-traces-into-binding-conclusions.md"
    ]
  },
  "empirical_verification_warrant": {
    "status": "AST_AND_INVARIANT_VERIFIED",
    "syntax_valid": true,
    "code_sha256": "a2ed5019d9434944be316891e5ed7f842fccb7e70899f727fe91b4b04988910c",
    "verified_classes": [
      "ForkReconciliationError"
    ],
    "verified_functions": [
      "reconcile_forks",
      "commit_canonical",
      "replay"
    ],
    "verified_functions_count": 3,
    "defensive_guards_count": 5,
    "raised_exceptions": [
      "ForkReconciliationError"
    ],
    "sample_fail_closed_invariants": [
      "no forks to reconcile"
    ],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
