{
  "name": "DN Agent Retry Boundary Lab",
  "version": "0.1",
  "publishedAt": "2026-11-03",
  "evidenceType": "local-deterministic-event-order-simulation",
  "license": "https://creativecommons.org/licenses/by/4.0/",
  "designs": {
    "cache": "Completed-response cache only",
    "ledger": "Reserved logical-operation ledger"
  },
  "assumptions": [
    "All identities and authority are synthetic and assumed valid; this model does not authenticate requests.",
    "Each admitted arrival commits one abstract effect before its completion record; no real payment is executed.",
    "Both models scope payment keys by principal and compare fingerprints containing operation, destination, amount and asset.",
    "The cache model writes only on completion and has no in-flight reservation.",
    "The ledger model assumes atomic admission, durable operation records and stable principal plus logical-operation identifiers.",
    "The expiry event removes response-cache entries only; ledger records and key bindings remain intact.",
    "A lost-completion event leaves an uncertain ledger record that blocks further execution pending outside reconciliation.",
    "This is a single-process ordered simulation, not a concurrent server, database, crash-recovery, provider or end-to-end benchmark."
  ],
  "scenarios": {
    "serial": {
      "label": "Serial retry after completion",
      "events": [
        {
          "type": "arrive",
          "requestId": "r1",
          "principal": "buyer-a",
          "operationId": "operation-1",
          "key": "payment-key-1",
          "destination": "merchant-a",
          "amountMinor": 100,
          "asset": "USD"
        },
        {
          "type": "complete",
          "requestId": "r1"
        },
        {
          "type": "arrive",
          "requestId": "r2",
          "principal": "buyer-a",
          "operationId": "operation-1",
          "key": "payment-key-1",
          "destination": "merchant-a",
          "amountMinor": 100,
          "asset": "USD"
        },
        {
          "type": "complete",
          "requestId": "r2"
        }
      ]
    },
    "overlap": {
      "label": "Two arrivals before completion",
      "events": [
        {
          "type": "arrive",
          "requestId": "r1",
          "principal": "buyer-a",
          "operationId": "operation-1",
          "key": "payment-key-1",
          "destination": "merchant-a",
          "amountMinor": 100,
          "asset": "USD"
        },
        {
          "type": "arrive",
          "requestId": "r2",
          "principal": "buyer-a",
          "operationId": "operation-1",
          "key": "payment-key-1",
          "destination": "merchant-a",
          "amountMinor": 100,
          "asset": "USD"
        },
        {
          "type": "complete",
          "requestId": "r1"
        },
        {
          "type": "complete",
          "requestId": "r2"
        }
      ]
    },
    "lost-response": {
      "label": "Effect occurs; completion record is lost",
      "events": [
        {
          "type": "arrive",
          "requestId": "r1",
          "principal": "buyer-a",
          "operationId": "operation-1",
          "key": "payment-key-1",
          "destination": "merchant-a",
          "amountMinor": 100,
          "asset": "USD"
        },
        {
          "type": "lose",
          "requestId": "r1"
        },
        {
          "type": "arrive",
          "requestId": "r2",
          "principal": "buyer-a",
          "operationId": "operation-1",
          "key": "payment-key-1",
          "destination": "merchant-a",
          "amountMinor": 100,
          "asset": "USD"
        },
        {
          "type": "complete",
          "requestId": "r2"
        }
      ]
    },
    "expired-cache": {
      "label": "Response cache expires before retry",
      "events": [
        {
          "type": "arrive",
          "requestId": "r1",
          "principal": "buyer-a",
          "operationId": "operation-1",
          "key": "payment-key-1",
          "destination": "merchant-a",
          "amountMinor": 100,
          "asset": "USD"
        },
        {
          "type": "complete",
          "requestId": "r1"
        },
        {
          "type": "expire"
        },
        {
          "type": "arrive",
          "requestId": "r2",
          "principal": "buyer-a",
          "operationId": "operation-1",
          "key": "payment-key-1",
          "destination": "merchant-a",
          "amountMinor": 100,
          "asset": "USD"
        },
        {
          "type": "complete",
          "requestId": "r2"
        }
      ]
    },
    "changed-payload": {
      "label": "Same key; changed destination",
      "events": [
        {
          "type": "arrive",
          "requestId": "r1",
          "principal": "buyer-a",
          "operationId": "operation-1",
          "key": "payment-key-1",
          "destination": "merchant-a",
          "amountMinor": 100,
          "asset": "USD"
        },
        {
          "type": "complete",
          "requestId": "r1"
        },
        {
          "type": "arrive",
          "requestId": "r2",
          "principal": "buyer-a",
          "operationId": "operation-1",
          "key": "payment-key-1",
          "destination": "merchant-b",
          "amountMinor": 100,
          "asset": "USD"
        },
        {
          "type": "complete",
          "requestId": "r2"
        }
      ]
    },
    "regenerated-key": {
      "label": "Same logical operation; newly generated key",
      "events": [
        {
          "type": "arrive",
          "requestId": "r1",
          "principal": "buyer-a",
          "operationId": "operation-1",
          "key": "payment-key-1",
          "destination": "merchant-a",
          "amountMinor": 100,
          "asset": "USD"
        },
        {
          "type": "complete",
          "requestId": "r1"
        },
        {
          "type": "arrive",
          "requestId": "r2",
          "principal": "buyer-a",
          "operationId": "operation-1",
          "key": "payment-key-2",
          "destination": "merchant-a",
          "amountMinor": 100,
          "asset": "USD"
        },
        {
          "type": "complete",
          "requestId": "r2"
        }
      ]
    },
    "different-principal": {
      "label": "Same key label; two different principals",
      "events": [
        {
          "type": "arrive",
          "requestId": "r1",
          "principal": "buyer-a",
          "operationId": "operation-1",
          "key": "payment-key-1",
          "destination": "merchant-a",
          "amountMinor": 100,
          "asset": "USD"
        },
        {
          "type": "complete",
          "requestId": "r1"
        },
        {
          "type": "arrive",
          "requestId": "r2",
          "principal": "buyer-b",
          "operationId": "operation-1",
          "key": "payment-key-1",
          "destination": "merchant-a",
          "amountMinor": 100,
          "asset": "USD"
        },
        {
          "type": "complete",
          "requestId": "r2"
        }
      ]
    },
    "different-operation": {
      "label": "Same key reused for a different logical operation",
      "events": [
        {
          "type": "arrive",
          "requestId": "r1",
          "principal": "buyer-a",
          "operationId": "operation-1",
          "key": "payment-key-1",
          "destination": "merchant-a",
          "amountMinor": 100,
          "asset": "USD"
        },
        {
          "type": "complete",
          "requestId": "r1"
        },
        {
          "type": "arrive",
          "requestId": "r2",
          "principal": "buyer-a",
          "operationId": "operation-2",
          "key": "payment-key-1",
          "destination": "merchant-a",
          "amountMinor": 100,
          "asset": "USD"
        },
        {
          "type": "complete",
          "requestId": "r2"
        }
      ]
    }
  }
}
