{
  "schema_version": "1.3.0",
  "slug": "which-invariants-prevent-a-speculative-agent-branch-from-committing-side-effects-it-never-reconciled",
  "title": "Which invariants prevent a speculative agent branch from committing side effects it never reconciled",
  "date_of_record": "2026 November 23",
  "scope": "Applies to orchestrators that fork N parallel agent branches speculatively against shared external state (filesystems, databases, ticketing APIs, payment rails) and rely on a rollback/reconciliation/commit protocol to collapse to one winner. Does not apply to pure read-only fan-out, nor to branches whose effects are confined to an isolated per-branch sandbox that is destroyed on abort.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/which-invariants-prevent-a-speculative-agent-branch-from-committing-side-effects-it-never-reconciled.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-a-speculative-agent-branch-from-committing-side-effects-it-never-reconciled.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-a-speculative-agent-branch-from-committing-side-effects-it-never-reconciled.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2169,
    "python_slice_tokens": 378,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure mode here is not \"a losing branch did work.\" Speculative execution *requires* losers to do work. The failure is subtler: **a losing branch's side effect becomes durable at the external resource before the orchestrator's abort signal reaches it, and the reconciliation pass has no evidence that the effect exists.** Two things get conflated in most ...",
    "what_was_observed": "A planner agent forked three branches to satisfy a \"reconcile invoice\" task: `branch-A` (apply credit note via billing API), `branch-B` (issue refund via payment gateway), `branch-C` (post adjustment journal entry). The orchestrator used a classic speculative protocol: each branch runs in its own process with a write-ahead ledger; on decision, losers receive `abort`, winners receive `commit`; then a reconciliation pa...",
    "condition_of_validity": "The invariant holds — and the protocol is safe — only under the following joint condition: - **Effect registration precedes effect attempt.** The branch must write an *intent* record (`effect_id`, target resource, idempotency key, expected postcondition) to durable storage *before* issuing the external call. The record must survive context eviction because i...",
    "decision_boundary": "The boundary is between **effects that are externally idempotent and queryable** and **effects that are neither.** For idempotent, queryable effects (payment gateways with idempotency keys, ticketing systems with external-id lookup), the intent-ledger + barrier protocol is sufficient: an `unknown` branch can be resolved by the orchestrator itself querying th...",
    "operational_effect": "The practical consequence is a shift in what the orchestrator measures. Latency of rollback is irrelevant; what matters is **the fraction of branches that reach a terminal ledger state before the commit deadline.** A healthy speculative system has a nonzero `unknown` rate — branches killed mid-call are normal — and the barrier's job is to absorb them, not to..."
  },
  "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": "6086529d8baa81ce917fe77e467447e937b103c16cfd22f56b7008315e4a59c5",
    "verified_classes": [
      "ReconciliationBarrierError",
      "BranchState",
      "IntentRecord",
      "BranchLedger"
    ],
    "verified_functions": [
      "resolve_branch",
      "commit_barrier",
      "register_intent"
    ],
    "verified_functions_count": 3,
    "defensive_guards_count": 1,
    "raised_exceptions": [
      "ReconciliationBarrierError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "enum",
      "hashlib",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
