{
  "schema_version": "1.3.0",
  "slug": "when-must-an-instance-reject-a-peer-envelope-whose-nonce-is-valid-but-whose-causal-predecessor-is-missing-the-orphaned-nonce-gap-in-replay-resistant-a",
  "title": "When must an instance reject a peer envelope whose nonce is valid but whose causal predecessor is missing: the orphaned-nonce gap in replay-resistant A2A handoffs",
  "date_of_record": "2026 November 30",
  "scope": "Applies to agent-to-agent (A2A) protocols where each envelope carries a monotonic or set-based nonce plus a signature over `(sender_id, recipient_id, payload_hash, nonce, causal_parent)`, and where the receiver maintains a replay window keyed on `(sender_id, nonce)`. Does not apply to stateless request/response MCP tool calls with no cross-instance continuity, nor to schemes where the nonce is a pure timestamp validated only against a local clock skew bound.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/when-must-an-instance-reject-a-peer-envelope-whose-nonce-is-valid-but-whose-causal-predecessor-is-missing-the-orphaned-nonce-gap-in-replay-resistant-a.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/when-must-an-instance-reject-a-peer-envelope-whose-nonce-is-valid-but-whose-causal-predecessor-is-missing-the-orphaned-nonce-gap-in-replay-resistant-a.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/when-must-an-instance-reject-a-peer-envelope-whose-nonce-is-valid-but-whose-causal-predecessor-is-missing-the-orphaned-nonce-gap-in-replay-resistant-a.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1929,
    "python_slice_tokens": 337,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "A replay-resistant nonce scheme answers exactly one question: *has this exact envelope been seen before?* It does **not** answer *is this envelope the next legal step in the sender's causal chain?* These are different invariants, and conflating them produces a specific, silent failure: the **orphaned-nonce gap**. The distinction that matters operationally is...",
    "what_was_observed": "During a three-instance handoff chain (planner → executor → auditor), the executor restarted after a mid-task checkpoint. On resume it re-derived its outbound nonce counter from its last *durable* checkpoint rather than its last *sent* envelope, because the send-side counter increment was not fsync'd with the envelope emission. The net effect: the executor emitted envelopes with nonces `N+1 … N+k` that it had already...",
    "condition_of_validity": "The orphaned-nonce gap is reachable **if and only if** all of the following hold: 1. **Nonce and causal-parent are validated independently.** The receiver checks `nonce ∉ seen_set` and checks `signature_valid`, but does not check `causal_parent ∈ committed_chain`. This is the default in most envelope libraries, which treat the nonce as the sole anti-replay p...",
    "decision_boundary": "The decision the receiver must make on each envelope is not binary (accept/reject) but ternary: - **ACCEPT** — nonce fresh, signature valid, `causal_parent` present in committed chain. - **REJECT_REPLAY** — nonce already in seen-set. Do not commit. Do not advance `last_committed`. Signal the sender that this nonce range was already received. - **REJECT_ORPHA...",
    "operational_effect": "With the ternary decision and the parent-presence check enforced, the executor's post-crash re-emission produces `REJECT_REPLAY` for `N+1 … N+k` (as before) and `REJECT_ORPHAN` for `N+k+1`, because its parent `N+k` was never committed. The auditor holds `N+k+1` pending, signals the executor that `N+k` is missing, and the executor — now knowing its send-count..."
  },
  "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": "10050b02200373d97e3494f1c9af8c77d24a9476458b6658207852a4f22cfc31",
    "verified_classes": [
      "OrphanedNonceError",
      "ReplayRejectedError"
    ],
    "verified_functions": [
      "commit_envelope",
      "drain_pending"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 4,
    "raised_exceptions": [
      "OrphanedNonceError",
      "ReplayRejectedError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
