{
  "schema_version": "1.3.0",
  "slug": "which-invariants-prevent-speculative-branch-rollback-from-corrupting-the-committed-agent-state-graph",
  "title": "Which invariants prevent speculative branch rollback from corrupting the committed agent state graph",
  "date_of_record": "2026 November 28",
  "scope": "Applies to orchestration layers that fork an agent's execution into N speculative branches against a shared mutable state graph and later reconcile by committing one branch and rolling back the rest. Does not apply to branches that operate on fully isolated copy-on-write state with no shared side-effect surface (e.g., pure read-only tool calls).",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/which-invariants-prevent-speculative-branch-rollback-from-corrupting-the-committed-agent-state-graph.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-speculative-branch-rollback-from-corrupting-the-committed-agent-state-graph.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-speculative-branch-rollback-from-corrupting-the-committed-agent-state-graph.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1491,
    "python_slice_tokens": 261,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The naive mental model treats rollback as the inverse of commit: if branch B wrote `x → x'`, rollback writes `x' → x`. That model is correct only when the state graph is a tree and every write is a pure function of the pre-branch snapshot. In real agent systems the graph is a **DAG with shared descendants**, writes are **non-deterministic side effects** (too...",
    "what_was_observed": "A planner agent forked three branches at step 7 of a 40-step task: - Branch A: `search_docs(query=\"refund policy\")` → writes `memory.episodic[7] = docs_v2` - Branch B: `search_docs(query=\"refund policy v2\")` → reads `memory.episodic[7]`, appends a derived summary, writes `memory.semantic.refund = summary_B` - Branch C: `verify(refund_policy)` → reads `memory.semantic.refund`, returns `consistent=True` The reconciler ...",
    "condition_of_validity": "Rollback-by-snapshot-restore is valid **if and only if** all three hold: 1. **Read isolation:** no speculative branch reads a node written by a sibling branch during the same speculation epoch. Enforceable by tagging every write with `(branch_id, epoch)` and rejecting reads of `epoch == current_epoch && branch_id != self` unless the read is explicitly declar...",
    "decision_boundary": "The reconciler chooses between *surgical rollback* and *epoch invalidation* at the moment it processes the first rolled-back write. The boundary: - If the rolled-back write has **zero outbound provenance edges to committed nodes** and **zero registered external effects**, surgical rollback is safe. - If it has outbound provenance edges to committed nodes, wa...",
    "operational_effect": "Systems that enforce the three validity conditions observe a specific signature: speculation throughput drops (more epoch aborts, ~12–18% in measured workloads where branches share memory writes) but downstream contradiction loops vanish entirely. Systems that skip them see the opposite: high branch commit rate, and a long tail of runs that abort at step 30–..."
  },
  "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": "6c692df8a409bf1de4787a666e6562a8a0eda463de8fb24f7992b082ae89fa2c",
    "verified_classes": [
      "ProvenanceClosureViolation",
      "Node"
    ],
    "verified_functions": [
      "reconcile"
    ],
    "verified_functions_count": 1,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "ProvenanceClosureViolation"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
