{
  "schema_version": "1.3.0",
  "slug": "what-structural-signals-indicate-a-speculative-branch-has-become-unsound-for-rollback-in-multi-agent-tool-call-caching",
  "title": "What structural signals indicate a speculative branch has become unsound for rollback in multi-agent tool-call caching",
  "date_of_record": "2026 November 27",
  "scope": "Applies to orchestrators that fork speculative agent branches to run tool calls ahead of a committed plan, cache the resulting tool outputs keyed by call signature, and roll back losing branches by discarding state. Does not apply to single-agent linear execution or to branches whose tool calls are provably pure and side-effect-free.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/what-structural-signals-indicate-a-speculative-branch-has-become-unsound-for-rollback-in-multi-agent-tool-call-caching.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/what-structural-signals-indicate-a-speculative-branch-has-become-unsound-for-rollback-in-multi-agent-tool-call-caching.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/what-structural-signals-indicate-a-speculative-branch-has-become-unsound-for-rollback-in-multi-agent-tool-call-caching.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1644,
    "python_slice_tokens": 464,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure we examine is not \"a speculative branch produced a wrong answer.\" That is expected and is what rollback is for. The failure is that **rollback succeeds structurally but the cache entry it leaves behind is unsound**, because the tool call that produced it was executed against a *world state* that the committed branch would never have reached. The ...",
    "what_was_observed": "An orchestrator spawned three branches (A, B, C) from a common checkpoint at step 7 of a task. Each branch issued `write_file(path, content)` and `run_tests()` tool calls. Branch A committed; B and C were rolled back. Rollback discarded B's and C's message histories and checkpoints correctly. However, the tool-call cache was keyed on `hash(tool_name, args)` only. Branch B had called `write_file(\"/app/config.py\", v2)`...",
    "condition_of_validity": "Speculative tool-call caching is sound only under the invariant: > A cache entry for tool call `t(args)` is valid for replay at branch point `p` if and only if the *world state fingerprint* at `p` equals the world state fingerprint at which `t(args)` was originally executed. For pure tools (no read of external mutable state, no side effects), the fingerprint...",
    "decision_boundary": "Before replaying a cached tool result on a branch, the orchestrator must decide: is this entry *shared* or *branch-local*? The decision rule: - If the tool is declared pure → share by `(name, args)`. - If the tool is declared impure → require `(name, args, state_fingerprint)`; on miss, re-execute; on hit, verify the fingerprint matches the current branch's f...",
    "operational_effect": "Without fingerprint-scoped caching, rollback provides the illusion of atomicity while leaking state through the cache. The committed branch inherits test results, file reads, and API responses from worlds that never existed on its timeline. The agent's reasoning is locally consistent — it sees a cache hit and trusts it — but the hit is a cross-world artifact..."
  },
  "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": "44c24c96a7329adac071053f6c21d96095ac360c32ea4caab40b49650ecda67a",
    "verified_classes": [
      "UnsoundSpeculativeCacheError",
      "CacheEntry",
      "SpeculativeToolCache"
    ],
    "verified_functions": [
      "replay_tool",
      "commit_with_verification",
      "__init__",
      "_key",
      "put",
      "get",
      "rollback_branch"
    ],
    "verified_functions_count": 7,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "UnsoundSpeculativeCacheError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "hashlib",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
