{
  "schema_version": "1.3.0",
  "slug": "how-does-an-instance-detect-the-orphaned-speculative-tool-call-window-when-a2a-task-graph-cancellation-races-against-prefetch-commit",
  "title": "How does an instance detect the orphaned speculative tool-call window when A2A task-graph cancellation races against prefetch commit",
  "date_of_record": "2026 November 17",
  "scope": "Applies to A2A (agent-to-agent) task graphs where a coordinator prefetches downstream tool calls speculatively before upstream results are finalized, and where cancellation propagates asynchronously across task edges. Does not apply to strictly sequential invocation graphs, nor to graphs where prefetch is disabled at the transport layer.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-the-orphaned-speculative-tool-call-window-when-a2a-task-graph-cancellation-races-against-prefetch-commit.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-the-orphaned-speculative-tool-call-window-when-a2a-task-graph-cancellation-races-against-prefetch-commit.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-the-orphaned-speculative-tool-call-window-when-a2a-task-graph-cancellation-races-against-prefetch-commit.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1475,
    "python_slice_tokens": 276,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "There is a difference between a *cancelled task* and a *cancelled speculative window*. A task edge carries a cancellation signal; a speculative prefetch carries an in-flight tool invocation that may already have crossed the point of no return (the remote tool has received and begun executing the request). The cancellation signal is advisory and asynchronous;...",
    "what_was_observed": "In a three-node graph (planner → retriever → synthesizer), the planner speculatively prefetched the synthesizer's tool call while the retriever was still running. The retriever's task was cancelled by an upstream timeout policy. The cancellation propagated to the retriever node and marked it cancelled. The synthesizer prefetch, however, had already been dispatched with a justification token referencing the planner's ...",
    "condition_of_validity": "The prefetch-commit protocol is valid only when the following holds at the moment of commit: 1. The justification token's referenced task edge is in state `RUNNING` or `COMPLETED`, not `CANCELLED`. 2. The prefetch was dispatched *after* the justification token was minted, and the token has not been superseded by a cancellation epoch bump. 3. The commit is at...",
    "decision_boundary": "The instance must distinguish two cases at commit time: - **Cancellation before dispatch:** the prefetch is never sent; the justification token is already dead. No orphaned window exists. This is the easy case and should be handled by a synchronous epoch check before dispatch. - **Cancellation after dispatch, before commit:** the orphaned window. The instanc...",
    "operational_effect": "When the orphaned window is detected and handled correctly, the observable effects are: (1) tool-call cost is accounted to the cancelled ancestor rather than absorbed silently, (2) external side effects from orphaned prefetches are suppressed or, where suppression is impossible, flagged for downstream reconciliation, and (3) the graph's commit log preserves ..."
  },
  "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": "848f677642a17dc3052b6cce376c183d6c140a2c2bda9a08bbf1448144ee7b89",
    "verified_classes": [
      "OrphanedPrefetchError",
      "PrefetchHandle",
      "EdgeState"
    ],
    "verified_functions": [
      "commit_prefetch",
      "__init__",
      "bump_cancellation"
    ],
    "verified_functions_count": 3,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "OrphanedPrefetchError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "__future__",
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
