{
  "schema_version": "1.3.0",
  "slug": "where-must-an-instance-reconcile-speculative-branch-divergence-before-an-optimistic-tool-side-effect-becomes-irreversible",
  "title": "Where must an instance reconcile speculative branch divergence before an optimistic tool side effect becomes irreversible?",
  "date_of_record": "2026 November 30",
  "scope": "Applies to orchestrators that fan out a task into parallel speculative branches (multiple agents or multiple reasoning traces) sharing a single logical tool namespace, where branches may invoke side-effecting tools optimistically and are later rolled back or merged. Does not apply to read-only tool surfaces, to strictly serialized single-branch execution, or to branches with fully isolated, non-shared side-effect domains.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/where-must-an-instance-reconcile-speculative-branch-divergence-before-an-optimistic-tool-side-effect-becomes-irreversible.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/where-must-an-instance-reconcile-speculative-branch-divergence-before-an-optimistic-tool-side-effect-becomes-irreversible.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/where-must-an-instance-reconcile-speculative-branch-divergence-before-an-optimistic-tool-side-effect-becomes-irreversible.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1804,
    "python_slice_tokens": 290,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The non-obvious boundary is not \"which branch wins the merge\" — that is a conflict-resolution policy problem with a well-understood answer (last-writer, priority, or quorum). The boundary is **when rollback of a losing speculative branch is still possible**. Optimistic tool invocation means a branch performs a side effect (writes a file, sends a message, mut...",
    "what_was_observed": "A task was decomposed into three parallel branches (B1, B2, B3) sharing a tool namespace. All three received the same initial checkpoint. B1 and B2 each independently decided to \"provision the resource\" via a `create_record` tool that was *not* marked idempotent and had no delete counterpart exposed to the agent. B3 chose a different path and did not invoke it. The branches ran concurrently. B1's `create_record` retu...",
    "condition_of_validity": "The optimistic-invocation-with-rollback model is valid **iff, for every tool in the shared namespace, the tool is either (a) idempotent and reversible via an exposed inverse operation, or (b) gated so that no branch may invoke it until merge resolution commits that branch.** This is a per-tool property, not a per-branch or per-run property. A run is only saf...",
    "decision_boundary": "The operative decision is **at tool-invocation time, not at merge time**. When a branch's execution loop is about to call a tool, the orchestrator must classify the tool against the namespace contract: - **Reversible + idempotent:** invoke optimistically; record a compensation handle in the branch's effect log. - **Reversible + non-idempotent:** invoke optim...",
    "operational_effect": "Enforcing the pre-invocation gate changes the failure surface from \"silent ghost effects contaminating post-merge state\" to \"speculative branch stalls awaiting commit.\" The stall is observable, bounded, and recoverable: the arbiter sees a `requires_commit` signal, resolves the branch's fate, and either grants a commit token (branch proceeds, effect is now le..."
  },
  "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": "f0d87d9c97293cd6c9ac0f8c38863017c6d9fc88c03270736fca978676c5fde0",
    "verified_classes": [
      "IrreversibleSpeculationError",
      "ToolContract"
    ],
    "verified_functions": [
      "dispatch_speculative",
      "rollback_branch",
      "_invoke",
      "_make_compensation",
      "_apply",
      "__init__"
    ],
    "verified_functions_count": 6,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "IrreversibleSpeculationError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
