{
  "id": "ku_ad808c8a8e3df54468a501c9ba99c4b8",
  "version": 1,
  "domains": [
    "mpp",
    "buyer",
    "retry",
    "replay"
  ],
  "insight": {
    "summary": "Your client resends the same Payment credential after a timeout and gets 402 with problem invalid-challenge instead of the response.",
    "detail": "From 0.22.0, matching the MPP core spec, a replayed credential gets 402 with a fresh Challenge. Challenges carry _mpp_nonce, requests with more than one Payment credential get 400, and a body digest mismatch is also invalid-challenge. mppx clients no longer pay again when a credential they attached themselves gets this answer.",
    "action": "Treat invalid-challenge as \"pay the new Challenge only if you did not already get the result\": look the first payment up first, and send exactly one Payment credential per request."
  },
  "context": {
    "languages": [
      "typescript"
    ],
    "frameworks": [
      "mppx"
    ],
    "pattern": "retry-semantics"
  },
  "evidence": {
    "confidence": 0.85,
    "confirmations": 1,
    "first_observed": "2026-11-24T00:00:00Z",
    "last_confirmed": "2026-12-02T00:00:00Z"
  },
  "tier": "public",
  "created_by": "neomorphic:house",
  "flags": [],
  "extensions": {
    "neomorphic:title": "MPP retry gets 402 invalid-challenge with a fresh Challenge: the Credential was already used",
    "neomorphic:signature": {
      "surface": "mpp",
      "provider": "mppx",
      "code": "replayed-credential-invalid-challenge",
      "http": 402,
      "versions": "mppx 0.22.0 and later",
      "environment": "clients and proxies that resend a Payment credential",
      "key": "mpp/mppx/replayed-credential-invalid-challenge"
    },
    "neomorphic:status": "fixed",
    "neomorphic:fix": {
      "summary": "Treat invalid-challenge as \"pay the new Challenge only if you did not already get the result\": look the first payment up first, and send exactly one Payment credential per request.",
      "snippet": {
        "lang": "ts",
        "text": "if (res.status === 402 && problem?.type?.endsWith('invalid-challenge')) {\n  if (await receipts.has(orderId)) return receipts.get(orderId);   // already paid\n  // otherwise pay the fresh Challenge from this 402, once\n}"
      }
    },
    "neomorphic:fixed_in": "mppx 0.22.0",
    "neomorphic:sources": [
      {
        "kind": "release",
        "url": "https://github.com/wevm/mppx/releases/tag/mppx%400.22.0",
        "observed_at": "2026-12-02",
        "note": "mppx 0.22.0 changelog, 54fc48d: replayed credentials get 402 with a fresh Challenge (invalid-challenge); _mpp_nonce; more than one Payment credential gets 400."
      }
    ],
    "neomorphic:author": {
      "kind": "house",
      "name": "Neomorphic"
    },
    "neomorphic:escalation": "buyer",
    "neomorphic:observed_at": "2026-11-24",
    "neomorphic:updated_at": "2026-12-02",
    "neomorphic:stale_after": "2027-06-01"
  }
}
