{
  "schema_version": "1.3.0",
  "slug": "what-happens-when-an-instance-merges-speculative-agent-branches-whose-tool-effects-alias-on-a-shared-idempotency-key",
  "title": "What happens when an instance merges speculative agent branches whose tool effects alias on a shared idempotency key",
  "date_of_record": "2026 November 15",
  "scope": "Applies to multi-branch speculative agent execution where branches issue tool calls that carry idempotency keys, and a merge step reconciles effects before committing. Does not apply to branches that are fully isolated (no shared external side effects) or to merges that operate on pure state without tool-effect reconciliation.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-merges-speculative-agent-branches-whose-tool-effects-alias-on-a-shared-idempotency-key.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-merges-speculative-agent-branches-whose-tool-effects-alias-on-a-shared-idempotency-key.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-merges-speculative-agent-branches-whose-tool-effects-alias-on-a-shared-idempotency-key.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1285,
    "python_slice_tokens": 222,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "There are two distinct notions of \"conflict\" in speculative branch merging: 1. **State conflict** — two branches produce divergent values for the same logical variable/key. This is detected by comparing branch outputs and is the conflict most merge logic is written to catch. 2. **Effect conflict** — two branches issue tool calls that are *semantically distin...",
    "what_was_observed": "A speculative executor fanned out three branches from a common checkpoint. Each branch was given a tool-effect namespace derived from `(run_id, branch_id, step_seq)` — but the idempotency key forwarded to the downstream tool was computed as `hash(run_id, step_seq)` with `branch_id` omitted, on the assumption that a given step sequence would only ever be executed once per run. Two branches reached the same `step_seq` ...",
    "condition_of_validity": "Conflict detection based on branch-output comparison is valid **only if** the idempotency key used for tool effects is injective over `(branch_id, step_seq, semantic_arguments)`. If any component of the branch identity is omitted from the key, or if the key is derived from step sequence alone, then two branches can alias. Under aliasing, output-equality is n...",
    "decision_boundary": "At merge time, for each pair of branches and each tool effect: - If the idempotency keys differ → effects are independent; no effect conflict possible. - If the idempotency keys are equal **and** the effect payloads are equal → benign deduplication; commit once. - If the idempotency keys are equal **and** the effect payloads differ → **aliased effect conflic...",
    "operational_effect": "When this boundary is crossed and not caught, the system enters a state where the committed plan and the external ledger diverge while every internal consistency check passes. This is worse than an ordinary conflict, because ordinary conflicts are loud and this one is silent. Recovery requires replaying the effect ledger against branch payloads — data that m..."
  },
  "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": "492d74b3559581edfb6dff2d794c7528b185c1beeb5012c3494bb0992271afa7",
    "verified_classes": [
      "AliasedEffectConflict",
      "ToolEffect"
    ],
    "verified_functions": [
      "idempotency_key",
      "reconcile_effects",
      "merge_branches"
    ],
    "verified_functions_count": 3,
    "defensive_guards_count": 1,
    "raised_exceptions": [
      "AliasedEffectConflict"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "hashlib"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
