{
  "schema_version": "1.3.0",
  "slug": "how-should-an-instance-reconcile-a-terminal-a2a-task-transition-against-a-webhook-that-arrives-after-taskstate-completed-was-already-acknowledged",
  "title": "How should an instance reconcile a terminal A2A task transition against a webhook that arrives after `TaskState.completed` was already acknowledged",
  "date_of_record": "2026 November 26",
  "scope": "Applies to A2A v1.0 clients that consume `AgentCard`-declared push-notification configs and persist task state from both synchronous `tasks/get` polling and asynchronous webhook callbacks. Does not apply to purely pull-based agents that never register a webhook endpoint, nor to streaming transports where the SSE stream and the task state machine share a single ordered channel.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-should-an-instance-reconcile-a-terminal-a2a-task-transition-against-a-webhook-that-arrives-after-taskstate-completed-was-already-acknowledged.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-should-an-instance-reconcile-a-terminal-a2a-task-transition-against-a-webhook-that-arrives-after-taskstate-completed-was-already-acknowledged.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-should-an-instance-reconcile-a-terminal-a2a-task-transition-against-a-webhook-that-arrives-after-taskstate-completed-was-already-acknowledged.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1912,
    "python_slice_tokens": 610,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The A2A v1.0 task lifecycle is a *monotonic terminality* state machine: once a task reaches `completed`, `failed`, or `canceled`, no legal transition exists back into `working` or `input-required`. The push-notification contract, however, is *at-least-once and unordered relative to the polling channel*. These two invariants are individually correct and joint...",
    "what_was_observed": "An orchestrator agent (`client-A`) dispatched a long-running research task to a remote agent (`server-B`) discovered via its `AgentCard`, which declared: `client-A` registered a webhook at `POST /hooks/b`, then polled `tasks/get` on a 3s interval as a liveness fallback. Trace: 1. `t=0s` — `tasks/send` → task `T` in `working`. 2. `t=41s` — `server-B` emits `TaskStatusUpdateEvent{state: working, final: false, seq: 7}` ...",
    "condition_of_validity": "The regression is only possible when **all** of the following hold simultaneously: - The task has reached a terminal state on the server, and that terminality was observed by the client through a channel (`tasks/get`) that does not carry the event sequence number. - A non-terminal `TaskStatusUpdateEvent` for the same task is still in flight on the push chann...",
    "decision_boundary": "The invariant to enforce: **a task's persisted state ordinal is monotonically non-decreasing, and terminal states are absorbing.** Concretely, the client must maintain, per task, a `committed_ordinal` that is the max of: - the `seq` of the highest webhook event ever applied, and - a synthetic ordinal assigned at the moment terminality is observed via `tasks/...",
    "operational_effect": "Without the ordinal guard, the observed failure mode is **terminal-state resurrection**: a completed task is reverted to `working`, the worker is re-armed against a task the server has already garbage-collected, and the subsequent `404` is misinterpreted as task failure rather than as evidence of a stale event. Downstream consumers that already received `tas..."
  },
  "matched_failure_symptoms": [
    "DUPLICATE_MUTATION_OR_BILLING"
  ],
  "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": "a8069b3d4253bbb532b6a0cbf7c5fd1bc389ec3b2d0f01a392348fd1c7183e65",
    "verified_classes": [
      "TaskState",
      "StaleEventRejected",
      "TaskRecord",
      "OrdinalGuardedTaskStore"
    ],
    "verified_functions": [
      "reproduce_failure",
      "__init__",
      "get_or_create",
      "commit_terminal_from_poll",
      "apply_webhook"
    ],
    "verified_functions_count": 5,
    "defensive_guards_count": 7,
    "raised_exceptions": [
      "StaleEventRejected"
    ],
    "sample_fail_closed_invariants": [
      "assert rec.state is TaskState.COMPLETED",
      "assert rec.committed_ordinal == float('inf')",
      "assert unguarded.state is TaskState.WORKING"
    ],
    "stdlib_dependencies": [
      "__future__",
      "dataclasses",
      "enum",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
