{
  "schema_version": "1.3.0",
  "slug": "which-invariants-prevent-speculative-plan-branch-divergence-from-leaking-into-committed-agent-state",
  "title": "Which invariants prevent speculative-plan branch divergence from leaking into committed agent state",
  "date_of_record": "2026 November 26",
  "scope": "Applies to multi-agent systems where a planner agent emits speculative action branches (parallel candidate plans) that are gated by a verifier before any branch is committed to shared durable state, and where concurrent branches may conflict. Does not apply to single-agent linear ReAct loops, to plans committed without a verifier gate, or to stateless request/response tool calls with no shared writable substrate.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/which-invariants-prevent-speculative-plan-branch-divergence-from-leaking-into-committed-agent-state.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-speculative-plan-branch-divergence-from-leaking-into-committed-agent-state.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-speculative-plan-branch-divergence-from-leaking-into-committed-agent-state.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2319,
    "python_slice_tokens": 453,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The distinction that matters here is between **speculation visibility** and **commit authority**. A speculative branch is *visible* the moment the planner emits it: peers can read it, downstream verifiers can evaluate it, and other branches can observe its intermediate writes if those writes are placed in any shared namespace. But a branch has *commit author...",
    "what_was_observed": "A three-agent planning swarm (planner `P`, verifier `V`, committer `C`) was tasked with a sequence of resource-mutating steps. `P` emitted two speculative branches, `B1` and `B2`, differing at step 3 (a choice between two tool configurations). Both branches shared steps 1–2, which included a `write` to a shared scratch store `S`. The branches were emitted concurrently. The trace: 1. `B1` executes step 1, writing `S.k...",
    "condition_of_validity": "The invariant holds — and the failure is prevented — only when all three of the following are enforced simultaneously. Dropping any one reopens the leak: 1. **Namespace isolation of speculative writes.** Every speculative write carries a mandatory branch identifier and lands in a namespace keyed by that identifier. Untagged reads resolve only to committed st...",
    "decision_boundary": "The boundary is between **speculation as a read-only proposal** and **speculation as a tentative mutation**. The moment a speculative branch performs a side-effecting write, it has crossed into tentative mutation, and every downstream reader — verifier, sibling, committer — must be made aware of the branch scope or must be denied the read. Operationally, the...",
    "operational_effect": "When the invariant is enforced, the observable effects are: - **Verifier approvals become replay-stable.** The digest equality check at commit time is a no-op in the common case and a hard abort in the leak case. Approval rate drops slightly (branches that were previously approved on sibling-contaminated inputs now abort), but committed-state correctness bec..."
  },
  "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": "ded047c32558e9d123790f8a2c3fab40c3935e3ecde29a8986c70f54dab88dc3",
    "verified_classes": [
      "SpeculationLeakError",
      "Effect",
      "Branch"
    ],
    "verified_functions": [
      "_digest",
      "verify",
      "commit",
      "run_swarm"
    ],
    "verified_functions_count": 4,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "SpeculationLeakError"
    ],
    "sample_fail_closed_invariants": [
      "aborting swarm: rejected sibling write reached commit input path"
    ],
    "stdlib_dependencies": [
      "__future__",
      "dataclasses",
      "hashlib"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
