{
  "schema_version": "1.3.0",
  "slug": "which-invariants-prevent-speculative-agent-drafts-from-committing-side-effects-twice-under-consensus-based-commit",
  "title": "Which invariants prevent speculative agent drafts from committing side effects twice under consensus-based commit",
  "date_of_record": "2026 November 24",
  "scope": "Applies to multi-agent systems where one agent speculatively drafts a side-effecting action (write, transfer, deploy, delete) and a quorum of peers/auditors votes to commit it. Does not apply to single-agent tool calls with synchronous idempotency keys already enforced at the transport layer.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/which-invariants-prevent-speculative-agent-drafts-from-committing-side-effects-twice-under-consensus-based-commit.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-speculative-agent-drafts-from-committing-side-effects-twice-under-consensus-based-commit.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-speculative-agent-drafts-from-committing-side-effects-twice-under-consensus-based-commit.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1620,
    "python_slice_tokens": 326,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure mode is not \"consensus fails to agree.\" It is: consensus agrees, twice, on two *different* drafts that are semantically equivalent but structurally distinct, and both commits execute. The distinction that matters is between **draft identity** (a hash over the literal bytes the speculator emitted) and **effect identity** (a canonical projection of...",
    "what_was_observed": "A three-node drafting swarm: Planner (P) speculates, Auditor-A and Auditor-B cast commit votes, a Ledger applies. The task was a single `transfer_funds` action. Trace: 1. P emits draft `D1 = {op: transfer, to: \"acct_7\", amt: 500, nonce: \"n-1\"}`. Effect digest `E = sha256(canonical(op,to,amt)) = e9a1…`. 2. P's RPC to Auditor-A stalls past the 800ms vote timeout (transport jitter, not node failure). 3. P's retry logic ...",
    "condition_of_validity": "The double-commit is only possible when **all three** of the following hold simultaneously: - **Draft identity is the vote key.** Quorum is computed over `h(draft_bytes)` rather than a canonical effect digest. If votes were keyed on `effect_digest`, D1 and D2 would share a vote bucket and quorum would be reached by the *first* pair of matching votes, not by ...",
    "decision_boundary": "The boundary is whether the side-effecting tool is **effect-canonicalizable**. For `transfer_funds`, `delete_record`, `deploy_revision`, the effect is a small tuple and a canonical digest is trivial. For tools whose effect depends on external state at apply time (`append_to_log`, `increment_counter`, `send_email`), the canonical digest must include the *pre-...",
    "operational_effect": "Enforcing effect-keyed ledger dedup converts the failure from \"silent double-spend\" to \"second commit rejected with a recoverable conflict.\" The speculator's retry then receives `EffectAlreadyCommitted(e9a1…)` and can treat it as success (the effect happened) rather than retrying again. This is the correct semantics: the speculator wanted the *effect*, not t..."
  },
  "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": "1788b5be9037e5ba6cec08824b7bc8d9cc4de734d631bf026ee893c4a94b272c",
    "verified_classes": [
      "DoubleCommitError",
      "UnstableEffectIdentityError",
      "Draft",
      "Ledger"
    ],
    "verified_functions": [
      "speculative_commit",
      "effect_digest",
      "draft_hash",
      "commit"
    ],
    "verified_functions_count": 4,
    "defensive_guards_count": 4,
    "raised_exceptions": [
      "DoubleCommitError",
      "UnstableEffectIdentityError"
    ],
    "sample_fail_closed_invariants": [
      "assert d1.effect_digest() == d2.effect_digest()",
      "assert d1.draft_hash() != d2.draft_hash()"
    ],
    "stdlib_dependencies": [
      "dataclasses",
      "hashlib",
      "json"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
