# When must an instance treat a content-addressed chunk manifest as authoritative over a peer's partial-result summary **Date of Record:** 2026 November 25 **Scope:** Applies to agent-to-agent (A2A) streaming exchanges where a producer agent emits a chunked artifact addressed by content hash (e.g., SHA-256 per chunk plus a root manifest) and a consumer agent reconciles a peer-supplied partial-result summary against that manifest. Does not apply to single-agent tool-call retries, non-streaming request/response handoffs, or exchanges where the artifact is delivered atomically in one message. ## Core Distinction The failure mode hinges on a distinction that is invisible at the API surface but decisive at reconciliation time: **the manifest is a statement about bytes that exist, while the summary is a statement about work the peer believes it completed.** These two claims can diverge because a peer agent can (a) emit a chunk, (b) hash it correctly into the manifest, (c) then *fail to durably commit* the chunk to its store before its own summary is generated from in-memory state. The summary reports `chunks_complete: N`, but the manifest's chunk set is what actually survived. A consumer that trusts the summary's count over the manifest's addressable set will attempt to splice a partial artifact whose missing chunk is not at the tail — it is somewhere in the middle, and its hash slot is present in the manifest with no backing bytes. The non-obvious part: the divergence is *not* detectable by comparing counts. A peer that lost chunk 7 but re-emitted a duplicate of chunk 3 will report the same `chunks_complete` as a healthy peer. Only per-address verification against the manifest reveals the hole. ## What Was Observed A producer agent streaming a 512-chunk analysis artifact (each chunk ~4 KiB, addressed `sha256:`) emitted chunks 0–511 and a root manifest listing all 512 addresses. During the stream, a transport-level backpressure event caused the producer's chunk-7 write to be acknowledged by the transport layer but rejected by the producer's durable store (disk quota, silently downgraded to a warning). The producer's in-memory completion counter still incremented. At stream end the producer sent a partial-result summary: ``` { "chunks_complete": 512, "root": "sha256:9f2c...", "status": "complete" } ``` The consumer, following a "trust summary, verify tail" reconciliation policy, checked only that the last chunk's hash matched and that the count equaled the manifest length. Both passed: chunk 511 was present and correct, and the count matched. The consumer assembled the artifact, computed a whole-artifact hash, and got a mismatch against the manifest root — but by then it had already committed the assembled artifact to its own store and marked the task complete. The consumer's downstream auditor later replayed the artifact and failed at chunk 7 with a `KeyError` on the address, because the chunk was never on the wire and never in the manifest's backing store. The trace: 1. Producer emits chunk 7 → transport ACK → store write rejected (quota) → counter++ (bug: counter reflects emit, not commit). 2. Producer emits chunks 8–511 normally, all committed. 3. Producer generates summary from counter → reports 512. 4. Consumer receives summary → verifies count == len(manifest) → verifies tail hash → assembles → whole-hash mismatch → *but commits anyway* under a "best-effort" policy. 5. Auditor replays → chunk 7 address unresolvable → verification replay discrepancy. The root cause is a **commit-point ambiguity**: the producer's counter advanced at emit, not at durable commit, and the summary inherited that ambiguity. The consumer's reconciliation policy had no per-address check, so it could not detect the hole. ## Condition of Validity The manifest-over-summary rule is valid — and must be enforced — exactly when all three hold: 1. **The artifact is content-addressed per chunk.** Each chunk carries an address that is a deterministic function of its bytes. If chunks are addressed by sequence number only, the manifest cannot distinguish "chunk 7 missing" from "chunk 7 replaced," and the rule degrades to a count check. 2. **The peer's summary is generated from a state that can diverge from durable storage.** This is the normal case for any producer that streams from memory or from a write-behind buffer. If the producer's summary is generated by re-reading its own durable store after a barrier, the summary and manifest are co-consistent and the rule is unnecessary (though harmless). 3. **The consumer will act on the assembled artifact — commit it, forward it, or feed it to a downstream reasoner.** If the consumer only inspects a sample, the cost of a hole is bounded and the per-address check can be relaxed to a sampled check. The rule does **not** apply when the peer is a trusted in-process component sharing the same store (no divergence possible), or when the transport guarantees atomic all-or-nothing delivery with a single content hash over the whole artifact (the manifest is then redundant). ## Decision Boundary The consumer must switch from summary-trust to manifest-trust at the moment it observes **any** of the following: - The whole-artifact hash computed over assembled chunks does not equal the manifest root. - The manifest's address set and the summary's `chunks_complete` disagree in either direction (count is necessary but not sufficient). - The peer's summary was generated before a durable-commit barrier was confirmed (detectable if the summary carries a `committed_at` field earlier than the last chunk's `received_at`, or if no such field exists at all). Below the boundary — all addresses present, root matches, summary consistent — the consumer may proceed on the summary alone. Above the boundary, the consumer **must not** commit the assembled artifact. It must instead: 1. Compute the set difference `manifest.addresses - received.addresses` (the hole set). 2. Request re-emission of exactly the hole set from the producer, addressed by hash (not by index — the producer's index space may have shifted). 3. Re-verify the whole-artifact hash after the hole set is filled. 4. Only then commit, and record the reconciliation event (hole count, re-emission rounds) in its own episodic log so a later auditor can distinguish "assembled cleanly" from "assembled after repair." The critical invariant: **a consumer may never mark a task complete on the basis of a peer's summary when the manifest is available.** The summary is a hint about the peer's self-model; the manifest is ground truth about the artifact. When they conflict, the manifest wins, and the conflict itself is a signal that the peer's commit accounting is unreliable for the remainder of the session. ## Operational Effect Enforcing manifest-over-summary changes three things in practice: - **Latency.** Per-address verification costs one hash per chunk. For a 512-chunk artifact at 4 KiB each, this is ~2 MiB of hashing — negligible against the network cost of the stream, but non-zero. The decision boundary above is what keeps this cost off the happy path: if the root matches and the count matches, skip the per-address pass and trust the root. - **Failure surface.** Holes now surface as explicit `HoleSetNonEmpty` conditions rather than as downstream `KeyError`s in an auditor's replay. This converts a silent corruption into a bounded, repairable event. - **Peer trust.** A peer that produces a hole is not banned, but its summary is downgraded: subsequent summaries from the same peer in the same session require per-address verification regardless of root match, because the commit-accounting bug is per-peer, not per-artifact. The guardrail is a single architectural invariant: **the consumer's commit predicate is `root_match AND hole_set_empty`, evaluated against the manifest, never against the summary's count alone.** The summary is admitted only as a fast-path hint that, if it disagrees with the manifest, is discarded. ```python import hashlib from dataclasses import dataclass, field class HoleSetNonEmpty(RuntimeError): """Raised when a peer's partial-result summary claims completeness but the content-addressed manifest reveals missing chunk addresses.""" pass class ManifestSummaryConflict(RuntimeError): """Raised when the peer summary and the manifest disagree on chunk count or root, indicating the peer's commit accounting is unreliable.""" pass @dataclass class Chunk: address: str # "sha256:" data: bytes @dataclass class Manifest: root: str addresses: list[str] def address_set(self) -> set[str]: return set(self.addresses) @dataclass class PeerSummary: chunks_complete: int root: str status: str # "complete" | "partial" committed_at: str | None = None @dataclass class Received: chunks: dict[str, Chunk] = field(default_factory=dict) def add(self, chunk: Chunk) -> None: self.chunks[chunk.address] = chunk def address_set(self) -> set[str]: return set(self.chunks.keys()) def sha256_address(data: bytes) -> str: return "sha256:" + hashlib.sha256(data).hexdigest() def reconcile( manifest: Manifest, summary: PeerSummary, received: Received, ) -> bytes: """Reconcile a peer's partial-result summary against the chunk manifest. Invariant: commit predicate is (root_match AND hole_set_empty), evaluated against the manifest, never against the summary count alone. """ # Step 1: count is necessary but not sufficient. A mismatch here means the # peer's commit accounting diverged from the manifest; refuse to proceed. if summary.chunks_complete != len(manifest.addresses): raise ManifestSummaryConflict( f"summary count {summary.chunks_complete} != manifest length " f"{len(manifest.addresses)}; peer commit accounting unreliable" ) if summary.root != manifest.root: raise ManifestSummaryConflict( f"summary root {summary.root} != manifest root {manifest.root}" ) # Step 2: hole set is the authoritative signal. Counts can match while a # mid-stream chunk is missing and a duplicate fills the count. hole_set = manifest.address_set() - received.address_set() if hole_set: raise HoleSetNonEmpty( f"{len(hole_set)} chunk address(es) missing from received set: " f"{sorted(hole_set)[:5]}{'...' if len(hole_set) > 5 else ''}; " f"request re-emission by address, do not commit" ) # Step 3: assemble in manifest order (not receive order) and verify root. assembled = b"".join( received.chunks[addr].data for addr in manifest.addresses ) if sha256_address(assembled) != manifest.root: raise HoleSetNonEmpty( "assembled artifact root mismatch despite empty hole set; " "a chunk was replaced, not merely missing — re-request full set" ) return assembled ```