{
  "schema_version": "1.3.0",
  "slug": "what-happens-when-an-instance-reconnects-to-an-a2a-task-stream-after-a-terminal-artifact-was-emitted-but-before-the-client-acknowledged-it",
  "title": "What happens when an instance reconnects to an A2A task stream after a terminal artifact was emitted but before the client acknowledged it",
  "date_of_record": "2026 December 2",
  "scope": "Applies to A2A (agent-to-agent) task lifecycles where a remote agent produces streaming artifacts over a resumable event stream (SSE or chunked transport) and the consuming agent may disconnect/reconnect mid-task. Does not cover synchronous request/response tool calls or transports without resumable cursors (e.g., raw one-shot HTTP with no task ID).",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-reconnects-to-an-a2a-task-stream-after-a-terminal-artifact-was-emitted-but-before-the-client-acknowledged-it.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-reconnects-to-an-a2a-task-stream-after-a-terminal-artifact-was-emitted-but-before-the-client-acknowledged-it.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-reconnects-to-an-a2a-task-stream-after-a-terminal-artifact-was-emitted-but-before-the-client-acknowledged-it.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2039,
    "python_slice_tokens": 454,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The A2A task lifecycle distinguishes between *task state* (a server-side enum: `submitted`, `working`, `input-required`, `completed`, `failed`, `canceled`) and *artifact state* (the ordered set of emitted `Artifact` chunks, each with an append/extend semantic and a `lastChunk` flag). These two state machines are **not synchronized by a single atomic commit**...",
    "what_was_observed": "A consuming orchestrator agent (`Consumer`) dispatched a task to a remote `Producer` agent over A2A. The Producer streamed a `working` status, then three artifact chunks (`chunk 0`, `chunk 1`, `chunk 2`), the last of which carried `lastChunk: true` and a `status: completed` transition in the same frame. The transport (SSE) delivered `chunk 0` and `chunk 1` to the Consumer, then the TCP connection was reset by an inte...",
    "condition_of_validity": "The failure requires all of the following to hold simultaneously: - The transport is resumable but the Consumer's reconnect handler does not use the cursor (`Last-Event-ID` / `task.artifacts[-1].id`) to request *only the missing suffix*. - The Producer's terminal frame bundles a state transition (`completed`) with the final artifact chunk, so a client that m...",
    "decision_boundary": "The correct decision boundary is not \"is the task terminal?\" but \"**is my local artifact cursor equal to the server's terminal cursor?**\" These are different predicates. The former is a boolean on task state; the latter is an equality on `(artifact_count, last_chunk_id, content_hash_of_prefix)`. Concretely, on reconnect the Consumer must: 1. Fetch the task r...",
    "operational_effect": "When the boundary is respected, the observed failure mode disappears: the Consumer detects that its `chunk 0`+`chunk 1` prefix matches the server's first two chunks by hash, fetches only `chunk 2`, and completes correctly. When the boundary is violated (as in the observed incident), the failure is *silent and delayed* — it surfaces only via a downstream veri..."
  },
  "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": "1841aaa28c500877abf6f518ab680c150ed370111636c0eada1730589533d284",
    "verified_classes": [
      "ArtifactDivergenceError",
      "ArtifactChunk",
      "TaskRecord"
    ],
    "verified_functions": [
      "reconcile_on_reconnect",
      "content_hash"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 4,
    "raised_exceptions": [
      "ArtifactDivergenceError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "hashlib"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
