{
  "schema_version": "1.3.0",
  "slug": "why-does-an-instance-of-speculative-agent-execution-corrupt-its-parent-state-when-a-rolled-back-branch-writes-to-a-shared-reconciliation-log",
  "title": "Why does an instance of speculative agent execution corrupt its parent state when a rolled-back branch writes to a shared reconciliation log",
  "date_of_record": "2026 November 17",
  "scope": "Applies to orchestrators that fan out N speculative agent branches from a common checkpoint, execute them concurrently against shared external state (filesystems, databases, message queues, reconciliation logs), and roll back all but one branch on commit. Does not apply to branches that operate on fully isolated copy-on-write snapshots with no shared append-only sinks.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/why-does-an-instance-of-speculative-agent-execution-corrupt-its-parent-state-when-a-rolled-back-branch-writes-to-a-shared-reconciliation-log.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/why-does-an-instance-of-speculative-agent-execution-corrupt-its-parent-state-when-a-rolled-back-branch-writes-to-a-shared-reconciliation-log.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/why-does-an-instance-of-speculative-agent-execution-corrupt-its-parent-state-when-a-rolled-back-branch-writes-to-a-shared-reconciliation-log.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1305,
    "python_slice_tokens": 257,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The distinction that matters is between **rollback of branch-local state** and **rollback of effects already externalized to a shared sink**. A speculative branch is usually modeled as a transaction over its own working memory: on abort, you discard the branch's context, undo its scratchpad, and free its lease. That model is correct for private state. It is ...",
    "what_was_observed": "In a fan-out of four branches speculating on a schema migration, branch B2 wrote a `reconcile_intent` entry to the shared log at T+40ms and then stalled on a downstream lock. The orchestrator's timeout fired at T+120ms, B2 was rolled back, and B4 committed. The parent then ran reconciliation, read the log, and found two intents — B2's phantom and B4's real one — for the same resource key. Because the log was append-o...",
    "condition_of_validity": "Rollback reconciliation is only sound when **every externalized effect is either (a) idempotent and keyed by a committed-branch token, or (b) fenced by a generation/epoch that the parent validates at reconcile time.** If the shared sink accepts unkeyed appends, or keys only by resource rather than by `(resource, branch_epoch)`, the invariant \"log contents ⊆ ...",
    "decision_boundary": "The decision boundary is: **does the branch write to a sink the parent will later read as ground truth?** If no — branch state is private, rollback is complete, proceed with naive speculation. If yes — you must choose between (1) fencing every append with a `(branch_id, epoch)` token and having the reconciler reject intents whose token is not in the committe...",
    "operational_effect": "Operationally, the effect is a **phantom-effect leak**: the shared log accumulates intents from branches that were rolled back, and the parent's reconciler, trusting the log, applies effects that no committed branch authorized. This manifests as double-application, divergent final state, and — critically — a green exit code, because the orchestrator's succes..."
  },
  "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": "9ef382d826cdcf659be2c195b04244a218aeb33bd503e0ae1ca16582b5dee505",
    "verified_classes": [
      "PhantomIntentError",
      "Intent",
      "Branch"
    ],
    "verified_functions": [
      "reconcile",
      "safe_reconcile"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 4,
    "raised_exceptions": [
      "PhantomIntentError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
