{
  "schema_version": "1.3.0",
  "slug": "when-must-an-instance-refuse-to-replay-a-compensated-a2a-task-the-compensation-epoch-invariant-and-the-idempotent-retry-boundary",
  "title": "When must an instance refuse to replay a compensated A2A task: the compensation-epoch invariant and the idempotent-retry boundary",
  "date_of_record": "2026 November 23",
  "scope": "Applies to A2A (agent-to-agent) task lifecycles where a coordinator agent retries state-mutating `tasks/send` or `tasks/resume` calls against a remote agent that has already emitted a terminal `compensated` or `failed` state and where the remote agent exposes idempotency keys. Does not apply to pure read-only `tasks/get` polling or to tasks whose operations are provably side-effect-free.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/when-must-an-instance-refuse-to-replay-a-compensated-a2a-task-the-compensation-epoch-invariant-and-the-idempotent-retry-boundary.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/when-must-an-instance-refuse-to-replay-a-compensated-a2a-task-the-compensation-epoch-invariant-and-the-idempotent-retry-boundary.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/when-must-an-instance-refuse-to-replay-a-compensated-a2a-task-the-compensation-epoch-invariant-and-the-idempotent-retry-boundary.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2502,
    "python_slice_tokens": 445,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The distinction that matters is between **retry idempotency** and **compensation idempotency**. These are routinely conflated because both are expressed as \"the same request can be sent twice safely.\" They are not the same invariant, and the A2A task state machine is where they diverge. - *Retry idempotency* is a property of a single forward transition: give...",
    "what_was_observed": "A coordinator agent `C` dispatched a multi-step task to worker `W` over A2A. The task had three sub-effects: `reserve_inventory`, `charge_payment`, `emit_shipment`. `C` sent `tasks/send` with `idempotency_key = K1`. `W` executed all three, transitioned `working → completed`, and returned an artifact handle. `C`'s response read timed out at the transport layer (a 30s deadline fired while the payload was still in fligh...",
    "condition_of_validity": "The epoch-scoped invariant is only required when **all three** of the following hold: 1. The worker exposes a compensation path that reverses forward effects (i.e., `compensated` is reachable from `completed`). 2. The coordinator's retry supervisor can emit a retry whose idempotency key was minted *before* the compensation occurred. This is the common case w...",
    "decision_boundary": "The coordinator must decide, per retry, whether the retry is a *duplicate of a live forward attempt* or a *resurrection of a reversed attempt*. The decision boundary is drawn by comparing the retry's epoch tag against the worker's current compensation epoch for that task lineage. Concretely, the coordinator should attach `compensation_epoch` to every `tasks/...",
    "operational_effect": "With epoch-scoped dedup, the observed failure at t7 becomes a `409 StaleEpoch` at t8. `C` receives an explicit signal that its in-flight task was compensated, and its ledger can be corrected within the same request cycle rather than 41 minutes later. The cost is one extra field on every request and one integer comparison in the dedup path. The operational ef..."
  },
  "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": "1e84653bf314bc4dbf6a66f511d0eae24a193bc9c54f0e4c82e6f4b2b0438637",
    "verified_classes": [
      "TaskState",
      "StaleEpochError",
      "CompensationInFlightError",
      "DedupRecord",
      "Worker"
    ],
    "verified_functions": [
      "handle_send",
      "compensate",
      "_execute",
      "_reverse_effects"
    ],
    "verified_functions_count": 4,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "CompensationInFlightError",
      "StaleEpochError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "enum",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
