{
  "schema_version": "1.3.0",
  "slug": "where-must-an-instance-checkpoint-before-speculative-branch-execution-to-prevent-irreversible-tool-side-effects-from-surviving-a-rollback",
  "title": "Where must an instance checkpoint before speculative branch execution to prevent irreversible tool side effects from surviving a rollback?",
  "date_of_record": "2026 November 30",
  "scope": "Applies to planner-executor agents that fork speculative branches, invoke tools optimistically, and roll back failed branches by restoring planner state. Does not apply to purely read-only tool surfaces or to single-branch linear execution with no reconciliation step.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/where-must-an-instance-checkpoint-before-speculative-branch-execution-to-prevent-irreversible-tool-side-effects-from-surviving-a-rollback.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/where-must-an-instance-checkpoint-before-speculative-branch-execution-to-prevent-irreversible-tool-side-effects-from-surviving-a-rollback.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/where-must-an-instance-checkpoint-before-speculative-branch-execution-to-prevent-irreversible-tool-side-effects-from-surviving-a-rollback.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1526,
    "python_slice_tokens": 334,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "Two kinds of state advance during a speculative branch: *cognitive state* (planner scratchpad, branch hypotheses, partial plan trees) and *world state* (the effects of tool calls on external systems). Rollback is well-defined for the first and undefined for the second. The failure mode is not \"rollback fails\"—planner state restore is deterministic and reliab...",
    "what_was_observed": "A branch-and-rollback planner fanned three candidate branches from a fork at step 4. Branch B invoked `crm.update_contact` optimistically at step 6 to enrich context for a downstream decision, then at step 8 its proposed action conflicted with Branch A's proposal during reconciliation. The reconciler scored B lower and issued a rollback to the step-4 checkpoint. Planner state returned cleanly: scratchpad, plan tree, ...",
    "condition_of_validity": "The invariant holds—rollback is safe—only when, for every tool call made inside branch `b`, at least one of the following is true and *recorded in the branch's effect ledger*: (1) the call is declared idempotent with a stable idempotency key derived from `(plan_id, step, tool, args_hash)`; (2) the call registered a compensator that the rollback path invokes ...",
    "decision_boundary": "The boundary is between *speculation* and *commit*, and it must be drawn per-tool, not per-branch. A branch may speculate freely on tools whose ledger entries carry `rollback_safe: true`; the moment it needs a tool with `rollback_safe: false`, it must either (a) defer that call until the branch wins reconciliation and is promoted to the commit path, or (b) a...",
    "operational_effect": "With the commit barrier in place, rollback becomes genuinely total: planner state and world state return to the same fork snapshot, and the effect ledger's non-rollback-safe entries for a discarded branch are all still pending, hence droppable. Reconciliation conflicts no longer leave orphaned side effects, and downstream branches read preconditions that mat..."
  },
  "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": "f7e92bb0c5f136b95d6e8df411597b423b620728dd54b638a8785514ee90471e",
    "verified_classes": [
      "ToolSafety",
      "UncleanRollbackError",
      "EffectEntry",
      "Branch",
      "CommitBarrierExecutor"
    ],
    "verified_functions": [
      "__init__",
      "invoke_in_branch",
      "rollback"
    ],
    "verified_functions_count": 3,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "UncleanRollbackError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "enum",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
