{
  "contract": {
    "id": "retry-proof",
    "version": 1,
    "ttlTicks": 6,
    "maxTick": 24,
    "maxSteps": 12,
    "bodyBytes": 3072,
    "keys": [
      "A",
      "B"
    ],
    "values": [
      "A",
      "B"
    ],
    "deliveries": [
      "received",
      "lost"
    ],
    "targets": [
      "duplicate-write",
      "body-blind",
      "sliding-expiry",
      "forget-on-loss"
    ],
    "semantics": {
      "clock": "Nondecreasing integer ticks. A key expires at creation tick + 6; a request at the deadline can create a new write.",
      "create": "Commit one write, cache body and receipt ordinal, return 201. Receipt ordinals start at 1 and increase once per committed write.",
      "replay": "Before expiry, the same key and body return 200 with the original receipt and no write. The deadline does not move.",
      "conflict": "Before expiry, the same key with a different body returns 409 with a null receipt and no write.",
      "loss": "Lost delivery happens after the service finishes: caller status and receipt are null, but committed writes and durable key state survive.",
      "observations": "Each step exposes status, receipt and independently measured cumulative committedWrites. Keys are independent.",
      "mutants": {
        "duplicate-write": "A matching unexpired replay commits another write and returns 201 with its new receipt; it retains the original expiry.",
        "body-blind": "An unexpired key returns 200 and its original receipt even when the body differs.",
        "sliding-expiry": "A matching unexpired replay extends the deadline to this request tick + 6.",
        "forget-on-loss": "A successful create or replay followed by lost delivery deletes its cached key record after committing."
      }
    }
  },
  "cases": [
    {
      "id": "same-key-replay",
      "steps": [
        {
          "at": 0,
          "key": "A",
          "value": "A",
          "delivery": "received"
        },
        {
          "at": 1,
          "key": "A",
          "value": "A",
          "delivery": "received"
        }
      ]
    },
    {
      "id": "body-conflict",
      "steps": [
        {
          "at": 0,
          "key": "A",
          "value": "A",
          "delivery": "received"
        },
        {
          "at": 1,
          "key": "A",
          "value": "B",
          "delivery": "received"
        }
      ]
    },
    {
      "id": "lost-create-recovery",
      "steps": [
        {
          "at": 0,
          "key": "A",
          "value": "A",
          "delivery": "lost"
        },
        {
          "at": 1,
          "key": "A",
          "value": "A",
          "delivery": "received"
        }
      ]
    },
    {
      "id": "fixed-expiry-boundary",
      "steps": [
        {
          "at": 0,
          "key": "A",
          "value": "A",
          "delivery": "received"
        },
        {
          "at": 5,
          "key": "A",
          "value": "A",
          "delivery": "received"
        },
        {
          "at": 6,
          "key": "A",
          "value": "A",
          "delivery": "received"
        }
      ]
    },
    {
      "id": "independent-keys",
      "steps": [
        {
          "at": 0,
          "key": "A",
          "value": "A",
          "delivery": "received"
        },
        {
          "at": 0,
          "key": "B",
          "value": "B",
          "delivery": "received"
        },
        {
          "at": 1,
          "key": "A",
          "value": "A",
          "delivery": "received"
        }
      ]
    },
    {
      "id": "new-body-after-expiry",
      "steps": [
        {
          "at": 0,
          "key": "A",
          "value": "A",
          "delivery": "received"
        },
        {
          "at": 6,
          "key": "A",
          "value": "B",
          "delivery": "received"
        }
      ]
    },
    {
      "id": "lost-replay-recovery",
      "steps": [
        {
          "at": 0,
          "key": "A",
          "value": "A",
          "delivery": "received"
        },
        {
          "at": 1,
          "key": "A",
          "value": "A",
          "delivery": "lost"
        },
        {
          "at": 2,
          "key": "A",
          "value": "A",
          "delivery": "received"
        }
      ]
    }
  ],
  "authoredSeed": {
    "target": "forget-on-loss",
    "steps": [
      {
        "at": 0,
        "key": "B",
        "value": "B",
        "delivery": "received"
      },
      {
        "at": 1,
        "key": "A",
        "value": "A",
        "delivery": "lost"
      },
      {
        "at": 2,
        "key": "B",
        "value": "B",
        "delivery": "received"
      },
      {
        "at": 3,
        "key": "A",
        "value": "A",
        "delivery": "received"
      },
      {
        "at": 4,
        "key": "B",
        "value": "A",
        "delivery": "received"
      }
    ]
  },
  "seedProvenance": "Authored development fixture with deliberately removable work; not an observed outside implementation failure."
}
