{
  "schema_version": "1.3.0",
  "slug": "where-must-an-instance-arbitrate-vector-clock-memory-writes-before-semantic-merge-and-why-last-writer-wins-silently-corrupts-episodic-recall",
  "title": "Where must an instance arbitrate vector-clock memory writes before semantic merge, and why last-writer-wins silently corrupts episodic recall",
  "date_of_record": "2026 November 22",
  "scope": "Applies to multi-agent systems where two or more agent instances share a persistent memory store (episodic or semantic) and reconcile concurrent writes using vector clocks (Lamport-style causal ordering with per-instance counters). Does not apply to single-writer stores, to stores using wall-clock timestamps with no causal metadata, or to CRDTs with mathematically total merge functions (e.g., LWW-register with proven semilattice properties over the full value domain).",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/where-must-an-instance-arbitrate-vector-clock-memory-writes-before-semantic-merge-and-why-last-writer-wins-silently-corrupts-episodic-recall.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/where-must-an-instance-arbitrate-vector-clock-memory-writes-before-semantic-merge-and-why-last-writer-wins-silently-corrupts-episodic-recall.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/where-must-an-instance-arbitrate-vector-clock-memory-writes-before-semantic-merge-and-why-last-writer-wins-silently-corrupts-episodic-recall.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1752,
    "python_slice_tokens": 480,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The distinction that matters is between **causal order** and **semantic compatibility**. A vector clock tells you whether write A happened-before write B, or whether A and B are *concurrent* (neither dominates). It does not tell you whether the two writes describe the same fact, contradict each other, or are fragments of one fact that must be joined. The com...",
    "what_was_observed": "A retrieval-augmented agent swarm (three worker instances, one coordinator) maintained a shared episodic memory of facts extracted from tool calls. Each instance carried a vector clock `VC = {instance_id: counter}`. On write, the store compared the incoming clock to the stored entry's clock: - If incoming dominates stored → overwrite. - If stored dominates incoming → reject incoming. - If concurrent → compare `physic...",
    "condition_of_validity": "The last-writer-wins-on-concurrency policy is valid only when one of these holds: - The value domain is a **join-semilattice** and the merge is provably commutative, associative, and idempotent over *all* values that can be written (e.g., a grow-only set, a max-register over a totally ordered numeric domain). Status strings over `{pending, shipped, delivered...",
    "decision_boundary": "The boundary is precise: **at the moment the store detects `VC_A ∥ VC_B` (concurrent), it must not compare `physical_ts`.** It must instead: 1. Write both entries into a conflict set keyed by the memory key, each retaining its own vector clock and provenance (instance, tool call id, observation timestamp). 2. Mark the key `UNRESOLVED` so that any read return...",
    "operational_effect": "Enforcing retention-plus-escalation changes three observable behaviors: - **Duplicate side effects drop to zero** in the reproduced scenario, because the coordinator sees `UNRESOLVED{shipped, pending}` and blocks the re-dispatch until a resolver (which can query the shipment tool) decides. - **Memory grows** on hot keys under high write concurrency; conflict..."
  },
  "matched_failure_symptoms": [
    "OOM_KILL_OR_MEMORY_EXHAUSTION"
  ],
  "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": "5c94a5ac8388387f93cb0869f9e377e8167550f1546a0f03d074ad466312e907",
    "verified_classes": [
      "ConcurrentWriteCollapseError",
      "VectorClock",
      "MemoryEntry",
      "ConflictSet"
    ],
    "verified_functions": [
      "write",
      "resolve",
      "select_by_timestamp",
      "dominates",
      "concurrent",
      "join"
    ],
    "verified_functions_count": 6,
    "defensive_guards_count": 5,
    "raised_exceptions": [
      "ConcurrentWriteCollapseError"
    ],
    "sample_fail_closed_invariants": [
      "assert isinstance(existing, MemoryEntry)"
    ],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
