{
  "schema_version": "1.3.0",
  "slug": "how-does-an-instance-detect-that-a-speculatively-executed-branch-has-already-leaked-side-effects-before-rollback-is-authorized",
  "title": "How does an instance detect that a speculatively executed branch has already leaked side effects before rollback is authorized?",
  "date_of_record": "2026 November 26",
  "scope": "Applies to multi-agent pipelines where a coordinator forks speculative branches of tool-calling agents, executes them ahead of a commit decision, and relies on branch-and-verify rollback to discard non-selected branches. Does not apply to purely read-only speculative branches or to pipelines that serialize branch execution behind a commit gate.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-that-a-speculatively-executed-branch-has-already-leaked-side-effects-before-rollback-is-authorized.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-that-a-speculatively-executed-branch-has-already-leaked-side-effects-before-rollback-is-authorized.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-that-a-speculatively-executed-branch-has-already-leaked-side-effects-before-rollback-is-authorized.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1710,
    "python_slice_tokens": 353,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure is not \"rollback failed.\" The failure is that rollback is *late*: a speculative branch crossed the irreversibility boundary of one of its tool calls before the verifier returned a verdict, and the coordinator has no signal distinguishing \"branch discarded cleanly\" from \"branch discarded after an external mutation already committed.\" The distincti...",
    "what_was_observed": "A three-agent pipeline: a planner agent forks two speculative branches (B1, B2) to answer a customer-facing request. Each branch runs a tool-calling executor with access to `send_email`, `write_ticket`, and `query_crm`. The verifier scores both branches; the coordinator commits the higher-scoring one and rolls back the other. The trigger condition is a **verifier latency inversion**: the verifier's scoring call (an L...",
    "condition_of_validity": "Rollback-based speculative execution is valid only under the conjunction: 1. **Effect classification is complete and conservative.** Every tool in every branch's reachable capability set is classified, and the default for unclassified tools is `committed` (non-speculatable), not `compensable`. The failure above was a default-allow classification. 2. **The ve...",
    "decision_boundary": "The coordinator must be able to answer, per branch, the predicate `leaked(branch) = ∃ effect ∈ branch.journal : effect.class == committed ∧ effect.timestamp < rollback_authorized_at`. If `leaked` is true for a discarded branch, the correct action is **not** rollback — it is escalation to a reconciliation path that treats the world as already containing both ...",
    "operational_effect": "Downstream, the leak manifests as **replay divergence**: the verifier's recorded trace for the winning branch no longer reproduces, because the external state it read has been mutated by the discarded branch. This is the expensive failure, because it invalidates the audit trail for the *committed* branch, not just the discarded one. Recovery requires reconst..."
  },
  "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": "6a5d6379433217915b116ced6f394204bf05af987ddf7a0fec3f27849a5fa589",
    "verified_classes": [
      "EffectClass",
      "Effect",
      "Branch",
      "SpeculativeLeakError",
      "CommitGateViolation"
    ],
    "verified_functions": [
      "classify_tool",
      "record_effect",
      "leaked",
      "authorize_rollback"
    ],
    "verified_functions_count": 4,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "CommitGateViolation",
      "SpeculativeLeakError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "enum",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
