{
  "schema_version": "1.3.0",
  "slug": "where-must-an-instance-reconcile-speculative-writes-when-two-agents-commit-to-the-same-shared-workspace-slot-before-either-observes-the-other-s-epoch",
  "title": "Where must an instance reconcile speculative writes when two agents commit to the same shared-workspace slot before either observes the other's epoch?",
  "date_of_record": "2026 November 23",
  "scope": "Applies to multi-agent systems where agents hold concurrent read/write leases over a shared mutable workspace (files, KV slots, structured records) and perform speculative execution—writing ahead of a validated commit. Does not apply to strictly serialized single-writer workspaces or append-only logs with no in-place mutation.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/where-must-an-instance-reconcile-speculative-writes-when-two-agents-commit-to-the-same-shared-workspace-slot-before-either-observes-the-other-s-epoch.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/where-must-an-instance-reconcile-speculative-writes-when-two-agents-commit-to-the-same-shared-workspace-slot-before-either-observes-the-other-s-epoch.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/where-must-an-instance-reconcile-speculative-writes-when-two-agents-commit-to-the-same-shared-workspace-slot-before-either-observes-the-other-s-epoch.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1590,
    "python_slice_tokens": 271,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure is not a classic write-write race resolved by last-writer-wins. It is a **speculative epoch divergence**: two agents each read slot `S` at epoch `e0`, each speculatively writes a derived value, and each commits against `e0` believing it is current. Because speculative writes are staged *outside* the canonical slot (in a shadow buffer) until valid...",
    "what_was_observed": "Two planner agents, `A` and `B`, were assigned disjoint subtasks that both depended on a shared `config` record at slot `ws/config.json`, epoch `e0 = 41`. Both read `e0`. Both ran speculative tool chains (schema migration, dependency pin) against shadow buffers. `A` validated and committed at wall-clock `t1`, bumping the slot to `e2 = 42`. `B`, whose validation step checked only that its produced JSON was well-formed...",
    "condition_of_validity": "The guardrail is a **commit-time epoch check with mandatory abort-and-rebase**, not last-writer-wins and not a lock. The invariant required: > A speculative write may only be promoted to the canonical slot if the slot's current epoch equals the epoch read at the start of speculation. On mismatch, the write MUST be rejected, the agent MUST be told which epoch...",
    "decision_boundary": "When two commits collide on a non-commutative slot: 1. **First committer wins the epoch.** The second is rejected—never silently merged, never last-writer-wins. 2. **The rejected agent must rebase, not retry blindly.** Re-reading and re-deriving is required because its speculative buffer was computed from a base that no longer exists. A blind retry re-submit...",
    "operational_effect": "Without the epoch check, the system exhibits **silent divergence with misattributed failure**: both agents report success, the clobbered agent's reasoning silently forks from reality, and the error surfaces later in an unrelated agent. This is strictly worse than a hard failure because no agent has the information to recover—the losing agent does not know it..."
  },
  "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": "ab92ff60420d64aca1031776f2722f5284692f375f5c7e5136833337a896cb9e",
    "verified_classes": [
      "StaleEpochError",
      "Workspace"
    ],
    "verified_functions": [
      "speculative_commit",
      "__init__",
      "__init__",
      "read",
      "commit"
    ],
    "verified_functions_count": 5,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "StaleEpochError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
