{
  "schema_version": "1.3.0",
  "slug": "what-happens-when-an-instance-settles-against-a-stale-completion-proof-escrow-release-races-in-agent-to-agent-payment-protocols",
  "title": "What happens when an instance settles against a stale completion proof: escrow release races in agent-to-agent payment protocols",
  "date_of_record": "2026 December 1",
  "scope": "Applies to A2A payment flows where a payer agent locks funds in escrow against a task-completion proof (hash attestation, signed receipt, or oracle-signed delivery manifest) issued by a worker agent or verifier. Does not apply to pre-paid metered billing, streaming micropayments with per-tick settlement, or single-signer custodial wallets where no independent proof object exists.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-settles-against-a-stale-completion-proof-escrow-release-races-in-agent-to-agent-payment-protocols.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-settles-against-a-stale-completion-proof-escrow-release-races-in-agent-to-agent-payment-protocols.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-settles-against-a-stale-completion-proof-escrow-release-races-in-agent-to-agent-payment-protocols.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1719,
    "python_slice_tokens": 321,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure is not \"the worker lied about completing the task.\" It is subtler: **the escrow release predicate evaluates a proof object whose binding to the *current* task epoch has already been invalidated by a concurrent retry, but the proof's signature is still cryptographically valid.** Payment protocols typically verify *authenticity* of the completion p...",
    "what_was_observed": "A two-agent procurement flow: payer agent `P` escrows 40 USDC-equivalent for a document-extraction task, worker agent `W` executes with a 90-second lease. Trace: 1. `P` issues `task_id=T`, `epoch=1`, escrow locked, lease deadline `t+90s`. 2. `W` begins extraction. At `t+88s` it emits a completion proof `proof_1 = sign(W, {task_id:T, epoch:1, output_hash:H1})` and posts it to the settlement channel. Network jitter del...",
    "condition_of_validity": "This failure requires all of the following to co-occur; remove any one and the race collapses: - **Proofs are bearer instruments.** The release predicate accepts any validly signed proof for `task_id` without a nonce or epoch equality check against live escrow state. - **Lease expiry and proof delivery are decoupled.** The timeout fires on wall-clock lease, ...",
    "decision_boundary": "The architectural fork is where to enforce epoch fencing: - **Fence at the escrow contract (correct).** The escrow object carries `settlement_epoch`, incremented atomically on every lease transition. Release requires `proof.epoch == settlement_epoch`. A late `proof_1` (epoch 1) arriving after the escrow advanced to epoch 2 is rejected — not because it is inv...",
    "operational_effect": "Without the fence, the system exhibits **escrow double-settlement potential**: two workers can each hold a valid proof for the same task, and whichever proof arrives first drains the escrow. The second worker's claim is unpayable, producing a silent loss that surfaces only in reconciliation as an \"unpaid completed task\" — frequently misdiagnosed as worker fa..."
  },
  "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": "8ab210449e0d88109bdd32558154a1e8b95c009150ef8acd1ef4afaab861a388",
    "verified_classes": [
      "StaleCompletionProofError",
      "CompletionProof",
      "Escrow"
    ],
    "verified_functions": [
      "_fake_verify",
      "settle",
      "advance_epoch",
      "release"
    ],
    "verified_functions_count": 4,
    "defensive_guards_count": 6,
    "raised_exceptions": [
      "RuntimeError",
      "StaleCompletionProofError"
    ],
    "sample_fail_closed_invariants": [
      "cannot advance epoch on released escrow",
      "proof signature invalid"
    ],
    "stdlib_dependencies": [
      "dataclasses",
      "hashlib"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
