{
  "schema_version": "1.3.0",
  "slug": "which-invariants-prevent-silent-state-corruption-when-speculative-agents-merge-after-a-cost-aware-commit-boundary",
  "title": "Which invariants prevent silent state corruption when speculative agents merge after a cost-aware commit boundary",
  "date_of_record": "2026 November 9",
  "scope": "Applies to orchestrators that run multiple speculative agent branches against a shared mutable substrate (tool side effects, filesystem, database rows, external API calls) and merge branches on a cost-aware commit decision. Does not apply to read-only fan-out, to single-agent retry loops, or to systems where every branch runs in a fully isolated sandbox with no shared external effects.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/which-invariants-prevent-silent-state-corruption-when-speculative-agents-merge-after-a-cost-aware-commit-boundary.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-silent-state-corruption-when-speculative-agents-merge-after-a-cost-aware-commit-boundary.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-silent-state-corruption-when-speculative-agents-merge-after-a-cost-aware-commit-boundary.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1467,
    "python_slice_tokens": 195,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "There are two different things people call \"rollback.\" *Logical rollback* means discarding a branch's in-memory trace and its declared intent. *Physical rollback* means undoing the effects that branch already committed to the outside world. Speculative multi-agent systems routinely conflate the two because the branch-and-merge abstraction makes a branch look...",
    "what_was_observed": "In a deployment running three-to-five speculative branches per task, each branch was given a cost budget and allowed to call tools (write files, POST to internal services, mutate a staging table). The orchestrator selected the winning branch by a cost/latency/quality score and \"rolled back\" the losers by deleting their traces and replaying the winner's diff. The failure was not a crash. It was a slow divergence: two ...",
    "condition_of_validity": "The invariant \"no branch effect is visible to a peer branch or downstream consumer before the merge decision\" holds only if one of the following is true: 1. Every tool call is namespaced by branch ID and the merge is the *only* operation that rewrites the namespace to the canonical one; or 2. Every tool call is deferred behind a commit gate that the orchestr...",
    "decision_boundary": "The decision to speculate is not the decision to commit. Treat them as separate gates: - **Speculate** when the expected value of parallel exploration exceeds the cost of duplicated tool calls *and* the substrate supports per-branch namespacing or deferral. Otherwise, serialize. - **Commit** only when the winning branch's diff is the *sole* source of canonic...",
    "operational_effect": "Teams that adopt cost-aware speculative execution without per-branch namespacing see three recurring symptoms: (a) merge diffs that are smaller than the actual state change, (b) downstream reads that are reproducible only if you replay *all* branch traces, not just the winner's, and (c) \"phantom rows\" that survive rollback and reappear after garbage collecti..."
  },
  "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": "fe3e534e16d007a3f09356d143f75d6cd7f5ded25882a3d418ea83839c7c0c33",
    "verified_classes": [
      "MergeReconciliationError"
    ],
    "verified_functions": [
      "merge_branches"
    ],
    "verified_functions_count": 1,
    "defensive_guards_count": 1,
    "raised_exceptions": [
      "MergeReconciliationError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
