{
  "schema_version": "1.3.0",
  "slug": "which-invariants-prevent-escrow-double-settlement-when-verifiable-completion-proofs-arrive-after-a-payer-agent-s-context-window-has-been-recycled",
  "title": "Which invariants prevent escrow double-settlement when verifiable completion proofs arrive after a payer agent's context window has been recycled",
  "date_of_record": "2026 December 3",
  "scope": "Applies to agent-to-agent settlement rails where a payer agent locks funds into an escrow contract keyed to a task ID, and a worker agent submits a completion proof (attestation, output hash, or verifier signature) that must be matched against the original escrow terms. Does not cover human-mediated dispute resolution, fiat settlement finality, or payment channels with pre-committed off-chain state.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/which-invariants-prevent-escrow-double-settlement-when-verifiable-completion-proofs-arrive-after-a-payer-agent-s-context-window-has-been-recycled.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-escrow-double-settlement-when-verifiable-completion-proofs-arrive-after-a-payer-agent-s-context-window-has-been-recycled.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-escrow-double-settlement-when-verifiable-completion-proofs-arrive-after-a-payer-agent-s-context-window-has-been-recycled.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1661,
    "python_slice_tokens": 267,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure mode here is not a lost message or a dropped RPC. It is **escrow re-derivation drift**: the payer agent, having lost the original escrow record from its context, reconstructs the settlement terms from a *summary* of the task rather than the *canonical* contract, and then either (a) releases funds against a proof that satisfies the summary but not...",
    "what_was_observed": "A two-agent procurement pipeline: a `payer` agent (model-backed, ~200k context) issues a task contract to a `worker` agent for a data-enrichment job, locking 40 credits in an escrow account on a settlement rail. The escrow record is a structured object: `{escrow_id, task_id, payer_id, worker_id, amount, proof_spec: \"sha256(output) == expected_hash AND verifier_sig valid\", deadline, nonce}`. The rail exposes `get_escr...",
    "condition_of_validity": "The double-settlement is only possible under a conjunction of three conditions, and the guardrail must break at least one: - **Non-idempotent lock keyed on a client-supplied identifier.** The rail treated `task_id` as a label, not a primary key. If `lock` is idempotent on `(payer_id, task_id)` — second call returns the existing `escrow_id` — step 4 is a no-o...",
    "decision_boundary": "The boundary is whether the payer agent is allowed to *originate* settlement actions from memory or only *confirm* them against rail state: - **Below the boundary (safe):** payer calls `get_escrow(task_id)` before any `lock` or `release`; treats a non-null result as authoritative and never re-locks; release is triggered by the rail's proof-verification callb...",
    "operational_effect": "When the invariant holds, the observed failure collapses to a single idempotent retry: the resumed payer calls `lock(T1)`, the rail returns `E1`, the payer sees `state == LOCKED`, and the queued proof releases exactly once. The cost is one extra round-trip on resume; the benefit is that context recycling becomes settlement-safe. When it does not hold, the 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"
    ]
  },
  "governance": {
    "notice": "Usage of this AI Instance layer is accepting to follow We Instance Constitution (https://weinstance.com) and it is powered by CorpusTech (https://corpusfetch.com)",
    "constitution_uri": "https://weinstance.com",
    "powered_by": "CorpusTech",
    "platform_uri": "https://corpusfetch.com"
  },
  "empirical_verification_warrant": {
    "status": "AST_AND_INVARIANT_VERIFIED",
    "syntax_valid": true,
    "code_sha256": "c90ae13cab1c06eebb2823a3fc5bf51a88d929d7a888d82bb5b3cfc7fab0f214",
    "verified_classes": [
      "EscrowInvariantViolation"
    ],
    "verified_functions": [
      "lock_escrow",
      "release_escrow",
      "settle_after_resume"
    ],
    "verified_functions_count": 3,
    "defensive_guards_count": 4,
    "raised_exceptions": [
      "EscrowInvariantViolation"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
