{
  "schema_version": "1.3.0",
  "slug": "how-does-an-instance-detect-that-a-speculative-branch-has-already-mutated-shared-external-state-before-its-rollback-point",
  "title": "How does an instance detect that a speculative branch has already mutated shared external state before its rollback point?",
  "date_of_record": "2026 November 20",
  "scope": "Applies to orchestrators that fork parallel speculative agent branches from a shared plan checkpoint and later commit one branch while rolling back the others. Does not apply to branches that are fully sandboxed with no external side effects, nor to single-agent linear execution.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-that-a-speculative-branch-has-already-mutated-shared-external-state-before-its-rollback-point.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-that-a-speculative-branch-has-already-mutated-shared-external-state-before-its-rollback-point.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-that-a-speculative-branch-has-already-mutated-shared-external-state-before-its-rollback-point.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1977,
    "python_slice_tokens": 411,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The distinction that matters is between **rollback of internal state** and **rollback of externalized effects**. A speculative branch owns its private context, scratch memory, and plan DAG, and those roll back trivially when the orchestrator discards the branch. What does *not* roll back is any effect the branch emitted through a tool call that crossed the p...",
    "what_was_observed": "A three-way speculative fork was launched to satisfy a request: \"update the deployment manifest to pin the image to the tested digest.\" The planner forked three branches with different strategies: - Branch A: read the current manifest, compute a patch, write the file, then run a validation tool. - Branch B: rewrite the manifest wholesale from a template, write the file, then validate. - Branch C: query the registry f...",
    "condition_of_validity": "Speculative multi-agent execution is valid only under the conjunction of: - **Effect quarantine:** every tool with external side effects is wrapped so that, during speculation, its effect is captured into a per-branch *effect journal* rather than applied. The journal is applied atomically at commit and discarded at rollback. This is the only condition that m...",
    "decision_boundary": "The orchestrator faces a decision at every fork: **quarantine-then-commit** versus **speculate-then-compensate**. The boundary is determined by the tool's reversibility class, not by the agent's confidence. - If *all* tools reachable by any branch are reversible or quarantine-capable → use quarantine-then-commit. Rollback is free. - If *any* tool is irrevers...",
    "operational_effect": "The operational consequence is that speculative execution without effect quarantine converts a parallelism optimization into a distributed-write hazard whose failure is invisible to the agent layer. The orchestrator's rollback logic reads branch state that is *semantically* correct but *causally* stale: the branch believes it has not written, while the trans..."
  },
  "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": "3b92389b78c7a0c7dfdf77fc3392dcf90d7594930ed77b79bbf0f98c58bf7bb6",
    "verified_classes": [
      "EffectState",
      "SpeculationBoundaryError",
      "Effect",
      "Branch",
      "SpeculativeOrchestrator"
    ],
    "verified_functions": [
      "run_fork",
      "__init__",
      "_live_effects",
      "commit"
    ],
    "verified_functions_count": 4,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "SpeculationBoundaryError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "enum",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
