{
  "schema_version": "1.3.0",
  "slug": "which-invariants-prevent-speculative-branch-leakage-from-corrupting-shared-planner-state-in-multi-agent-dag-execution",
  "title": "Which invariants prevent speculative branch leakage from corrupting shared planner state in multi-agent DAG execution",
  "date_of_record": "2026 November 26",
  "scope": "Applies to multi-agent planning pipelines where a planner agent speculatively executes downstream subgoals (eager execution / branch lookahead) before the branch is committed. Does not apply to strictly sequential single-agent planners or to pipelines where subgoal execution has no external side effects.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/which-invariants-prevent-speculative-branch-leakage-from-corrupting-shared-planner-state-in-multi-agent-dag-execution.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-speculative-branch-leakage-from-corrupting-shared-planner-state-in-multi-agent-dag-execution.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-speculative-branch-leakage-from-corrupting-shared-planner-state-in-multi-agent-dag-execution.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2041,
    "python_slice_tokens": 337,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure mode is not \"a speculative branch produced a wrong answer.\" That is expected and cheap to discard. The failure mode is **speculative branch leakage**: a speculative execution writes to state that is *shared* with the committed path—memory stores, tool-side effects, budget counters, or the planner's own working memory—so that even after the specul...",
    "what_was_observed": "A three-tier planner (Planner → Executor pool → Critic) was configured to speculatively fan out three candidate decompositions of a subgoal at each DAG node, execute the first tool call of each candidate in parallel, and commit to the candidate whose tool response had the highest critic score. The intent was latency reduction: overlap the slow tool call with the critic's ranking. The observed trace: 1. Planner emits ...",
    "condition_of_validity": "Speculative execution is safe **if and only if** every speculative branch is isolated across all four of the following axes simultaneously: - **State axis:** all writes go to a branch-scoped namespace (branch ID in the key), never to a task-scoped or global key. Reads from a speculative branch may see committed state; reads from committed state must never se...",
    "decision_boundary": "The boundary is **not** \"should we speculate?\" It is **\"is the commit operation atomic across every axis the branch touched?\"** The operational test: - If a branch can be discarded by a single namespace-scoped delete plus a budget refund, and nothing it wrote is reachable from any committed read path, speculation is safe. - If discarding a branch requires *r...",
    "operational_effect": "When the invariant holds, speculation is a pure latency win: discarded branches cost only their metered sub-budget, and the committed path is bit-identical to a non-speculative run. This is the property that makes speculation *auditable*—you can replay the committed path without replaying the speculation and get the same result, which is what verification re..."
  },
  "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": "3030cb9533bf2c438d0f89d59619c7c0de2ad774d1c3892b00a1f1e221c92ac1",
    "verified_classes": [
      "SpeculativeLeakError",
      "BudgetExhaustedError",
      "BranchScope"
    ],
    "verified_functions": [
      "write_speculative",
      "commit_branch",
      "rollback_branch",
      "namespace_key"
    ],
    "verified_functions_count": 4,
    "defensive_guards_count": 4,
    "raised_exceptions": [
      "BudgetExhaustedError",
      "SpeculativeLeakError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "hashlib",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
