{
  "schema_version": "1.3.0",
  "slug": "when-must-an-instance-reject-a-speculative-tool-call-batch-that-has-already-been-committed-by-a-peer-idempotency-key-collisions-across-speculative-fan",
  "title": "When must an instance reject a speculative tool-call batch that has already been committed by a peer: idempotency-key collisions across speculative fan-out",
  "date_of_record": "2026 November 26",
  "scope": "Applies to multi-agent systems where a coordinator speculatively fans out tool calls in parallel (optimistic batching) and deduplicates/merges results using client-generated idempotency keys. Does not apply to strictly serialized single-agent tool loops, nor to fan-out where each branch targets a disjoint, non-mutating tool surface.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/when-must-an-instance-reject-a-speculative-tool-call-batch-that-has-already-been-committed-by-a-peer-idempotency-key-collisions-across-speculative-fan.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/when-must-an-instance-reject-a-speculative-tool-call-batch-that-has-already-been-committed-by-a-peer-idempotency-key-collisions-across-speculative-fan.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/when-must-an-instance-reject-a-speculative-tool-call-batch-that-has-already-been-committed-by-a-peer-idempotency-key-collisions-across-speculative-fan.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1676,
    "python_slice_tokens": 336,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure is not \"two agents called the same tool.\" It is that a **speculative batch re-derives an idempotency key from semantically-equivalent-but-not-identical arguments**, and the downstream idempotency store treats key equality as *operation identity* while the agents treat it as *intent identity*. These are different equivalence relations, and the gap...",
    "what_was_observed": "A coordinator decomposed a \"reconcile inventory\" task into three speculative branches: `fetch_ledger`, `fetch_warehouse`, `apply_adjustment`. The `apply_adjustment` branch was emitted twice — once optimistically before `fetch_warehouse` returned, and once after a 900 ms timeout on the warehouse call triggered a retry. Both emissions carried intent key `adj-7f3a` derived from `(task_id=88, slot=\"adjust\")`. Trace of th...",
    "condition_of_validity": "Speculative batching with idempotency keys is sound only under the **key-effect congruence invariant**: > For every tool call emitted by any branch of a speculative batch, the idempotency key must be a deterministic function of the *exact payload that will be committed*, not of the intent, task slot, or conversational turn that produced it. Equivalently: `ke...",
    "decision_boundary": "The instance must **reject the batch and escalate to conflict resolution** — not merge, not retry — when all of the following hold: - A speculative branch is re-emitted after a prior emission of the *same intent key*. - The re-emitted payload digest differs from the committed payload digest for that intent key. - The tool's idempotency store reports a commit...",
    "operational_effect": "When the boundary is enforced, speculative fan-out retains its latency win for the common case (identical-payload retries deduplicate cleanly) while converting the dangerous case (payload drift under a stable intent key) from a silent double-apply into an explicit conflict-resolution event. The coordinator's merge layer must carry the tool's committed payloa..."
  },
  "matched_failure_symptoms": [
    "DUPLICATE_MUTATION_OR_BILLING"
  ],
  "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": "bc50fbaf8ab1f5a3633c5504ba989f8a86503e518310c5d85cce5dce7bc06ad6",
    "verified_classes": [
      "SpeculativeKeyMismatchError",
      "CommittedEffect"
    ],
    "verified_functions": [
      "payload_digest",
      "resolve_speculative_retry",
      "merge_speculative_batch"
    ],
    "verified_functions_count": 3,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "SpeculativeKeyMismatchError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "hashlib",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
