# When must an instance treat an A2A artifact chunk as non-durable: partial-result streaming across org boundaries under renegotiated chunk windows **Date of Record:** 2026 November 21 **Scope:** Applies to A2A v1.0 task execution where a remote agent (different org/trust domain) streams artifacts as ordered chunks (`artifact.part`) and the consumer persists partial results before the terminal `TaskStatusUpdateEvent`. Does not apply to single-turn request/response A2A calls with no streaming artifacts, nor to same-org peers sharing a durable store. ## Core Distinction The failure here is not "chunk lost in transit." Transport loss is detectable and retried. The non-obvious boundary is **durability attribution**: a consumer agent treats an in-flight `artifact.part` as a committed, resumable checkpoint, but A2A v1.0 gives no cross-org guarantee that a chunk, once emitted, is *stable* under a subsequent task renegotiation (`input-required` → resume with a modified chunk window, e.g. a changed `append`/`replace` mode or a reduced `lastChunk` index). Concretely: the producer is entitled to re-emit, renumber, or retract prior parts when the task re-enters `working` after an `input-required` state, because the producer's own model/tooling may regenerate earlier output. The consumer, having persisted part index 3 as durable, now holds a stale fragment that will be *silently concatenated* with a corrected part 3, producing an artifact that is internally inconsistent but passes every per-chunk integrity check (each chunk is well-formed, correctly signed, correctly ordered). The corruption is only visible at the assembled-artifact level, and only if the consumer tracks producer-side revision identity that A2A v1.0 does not mandate. The distinction that matters: **chunk-level integrity ≠ artifact-level durability**. A signed, ordered, well-formed chunk is not a promise that the artifact is monotonic. Consumers that conflate the two build resume state on sand that looks like concrete. ## What Was Observed A consumer agent (Org B) drives a research task against a producer agent (Org A). Producer streams a report artifact in parts 0–7. At part 3, producer emits `TaskStatusUpdateEvent` with `state: input-required` requesting a clarification. Org B persists parts 0–3 to its episodic store, keyed by `(taskId, artifactId, partIndex)`, and marks them `durable=true`. Org B answers the clarification. Org A resumes: it re-enters `working`, and because its internal planner decided the clarification changes the framing, it **regenerates the artifact from part 2 onward**. It re-emits parts 2, 3, 4 with new content. Parts 2 and 3 overwrite cleanly in Org B's store (same keys). Part 4 arrives. Org B's assembler concatenates parts 0,1,2',3',4',5',6',7' — but part 5 was emitted *before* the regeneration decision in Org A's buffer and carries old content that referenced the pre-clarification framing. Observed symptom in the assembled artifact: a coherent-looking document whose middle section contradicts its opening, with no error raised anywhere. Per-chunk checksums all passed. The A2A task terminated `completed`. Org B's verifier (a separate LLM) rated the artifact "plausible," so the corruption propagated into Org B's semantic memory. The trace shows the exact seam: `input-required` is a **producer-side rewind point**, but A2A v1.0 exposes it to the consumer as a **pause**, not a rewind. The consumer's mental model (pause/resume) and the producer's actual behavior (regenerate-from-checkpoint) diverge precisely at the state transition where the spec is silent on part-level monotonicity. ## Condition of Validity The failure requires all of the following to co-occur; break any one and the invariant holds: 1. **Cross-org boundary** where the consumer cannot inspect producer internals and must rely on wire-observable signals only. 2. **A task that re-enters `working` after `input-required`** (or after any producer-side replan), so regeneration is possible. 3. **Consumer-side persistence of partial artifacts** before terminal status — i.e., the consumer is doing its own checkpointing for resume, cost amortization, or downstream fan-out. 4. **No producer revision epoch in the wire protocol** distinguishing "this part supersedes a prior part under a new revision" from "this part is new." A2A v1.0's `artifact.part` carries index and content; it does not carry a monotonic `revision` or `regenerationEpoch` that the consumer can key on. If the consumer does not persist partials (holds them in volatile memory until terminal), the stale-fragment merge cannot occur — the regenerated stream simply replaces the buffer. If the producer never regenerates (pure append-only producers), the invariant holds trivially. The dangerous quadrant is *persisting consumer × regenerating producer × no revision epoch*. ## Decision Boundary The consumer must decide, at each `input-required` → resume transition, whether its persisted parts are **durable** (safe to keep and merge) or **provisional** (must be invalidated on resume unless the producer explicitly confirms continuation). The correct boundary rule: **a persisted part is durable only if the producer's resume event carries an explicit continuation attestation** — in practice, a producer-supplied `resumeFrom` index or revision token that the consumer validates against its highest persisted index. Absent that attestation, all persisted parts for that artifact must be demoted to provisional on any state transition that exits `input-required`, and the artifact reassembled only from parts received *after* the resume. This is a conservative rule and it costs re-fetch. The alternative — trusting per-chunk signatures as durability — is what produced the observed corruption. The decision boundary is therefore: - **Producer attests continuation (`resumeFrom == lastPersistedIndex + 1`)**: keep persisted parts, merge. - **Producer attests rewind (`resumeFrom <= lastPersistedIndex`)**: truncate persisted parts to `resumeFrom - 1`, discard the rest, reassemble. - **Producer sends no attestation**: demote all persisted parts to provisional, discard on first post-resume part for that index, and log a `DurabilityUnattested` warning. Do not silently merge. The trap is the third case being treated as the first. Silence is not continuation. ## Operational Effect Implementing the boundary rule converts a silent-corruption failure into a bounded, observable re-fetch. The operational costs: - **Re-fetch amplification** on regenerating producers: up to the full artifact size per `input-required` cycle. For a producer that regenerates on every clarification, this is O(n) re-streaming per clarification. Acceptable when clarifications are rare; pathological when they are frequent. Mitigate by negotiating a producer-side `resumeFrom` in the initial `AgentCard` capability exchange, so the common case is the attested-continuation branch. - **Latency**: the consumer cannot finalize the artifact until terminal status, because provisional parts may be invalidated. This removes the "stream-and-commit" optimization that motivated partial persistence in the first place. The honest tradeoff: partial persistence buys latency only when the producer is append-only, which the consumer cannot verify cross-org. - **Audit surface**: every demotion is a logged event with `(taskId, artifactId, invalidatedParts, reason)`. This is the evidence trail that distinguishes "we re-fetched because the producer rewound" from "we lost data." The invariant to encode in the consumer's state machine: **no part is durable across an `input-required` boundary without explicit producer continuation attestation.** This is the only guardrail that survives a producer whose regeneration behavior is opaque and whose wire output is indistinguishable from a clean append. ```python from __future__ import annotations from dataclasses import dataclass, field from enum import Enum from typing import Optional class DurabilityViolation(RuntimeError): """Raised when a consumer attempts to merge a persisted artifact part across an input-required boundary without producer continuation attestation.""" class PartDurability(Enum): DURABLE = "durable" PROVISIONAL = "provisional" @dataclass class PersistedPart: part_index: int content: str durability: PartDurability @dataclass class ArtifactStore: task_id: str artifact_id: str parts: dict[int, PersistedPart] = field(default_factory=dict) def highest_persisted_index(self) -> int: return max(self.parts) if self.parts else -1 def demote_all_to_provisional(self) -> None: for p in self.parts.values(): p.durability = PartDurability.PROVISIONAL def reconcile_on_resume( store: ArtifactStore, resume_from: Optional[int], ) -> None: """Apply the decision boundary when a task re-enters `working`. resume_from is the producer's attested continuation index, if any. - None -> no attestation: demote everything to provisional. - <= highest -> rewind: truncate persisted parts to resume_from - 1. - == highest + 1 -> continuation: keep durable parts as-is. - > highest + 1 -> gap: cannot merge, raise. """ highest = store.highest_persisted_index() if resume_from is None: store.demote_all_to_provisional() return if resume_from <= highest: # Producer rewound; discard parts at or beyond the resume point. for idx in [i for i in store.parts if i >= resume_from]: del store.parts[idx] return if resume_from == highest + 1: # Explicit continuation across the boundary: persisted parts stand. return # resume_from > highest + 1 means the producer skipped indices we never saw. # Merging would leave a hole; refuse rather than emit a corrupt artifact. raise DurabilityViolation( f"task={store.task_id} artifact={store.artifact_id}: " f"producer resumed at index {resume_from} but consumer only holds up to " f"{highest}; cannot reconcile partial artifact across org boundary" ) def assemble_artifact(store: ArtifactStore) -> str: """Assemble only durable parts; refuse if any provisional part would be merged.""" if any(p.durability is PartDurability.PROVISIONAL for p in store.parts.values()): raise DurabilityViolation( f"task={store.task_id} artifact={store.artifact_id}: " "refusing to assemble artifact containing provisional parts " "(unattested across input-required boundary)" ) indices = sorted(store.parts) if indices != list(range(len(indices))): raise DurabilityViolation( f"task={store.task_id} artifact={store.artifact_id}: " f"non-contiguous part indices {indices}; artifact integrity unverifiable" ) return "".join(store.parts[i].content for i in indices) ```