{
  "id": "retry-schedule-plan",
  "name": "Bounded Retry Schedule Plan",
  "description": "Produce a deterministic hypothetical retry wait plan from explicit replay-safety assertions, HTTP status, backoff limits and waiting budget. Supports delta-seconds/IMF-fixdate Retry-After with explicit reference time. Stops for payment uncertainty and unknown/unsafe replay; never sends requests or authorizes repayment.",
  "category": "workflow-assurance",
  "priceUsd": "0.003",
  "pricingStatus": "proposed-unverified",
  "pricing": {
    "unit": "one successful operation call",
    "proposedNominalUsd": "0.003",
    "sixDecimalTokenBaseUnits": "3000",
    "subscription": false,
    "includesPayerWalletOrNetworkFees": false,
    "liveQuoteVerified": false,
    "condition": "Actual SDK challenge is authoritative only within the caller's explicit authorization; configured six-decimal token peg is an operator assertion, not a conversion guarantee."
  },
  "intents": [
    "Calculate capped retry backoff under a fixed waiting budget",
    "Respect Retry-After without clipping the server's minimum wait"
  ],
  "whenToUse": [
    "Calculate capped retry backoff under a fixed waiting budget",
    "Respect Retry-After without clipping the server's minimum wait"
  ],
  "whenNotToUse": [
    "Automatically retrying payment uncertainty or assuming idempotency",
    "Live scheduling, random jitter, traffic synchronization prevention, or complete HTTP-date parsing"
  ],
  "capabilities": [
    "Caller-established replay safety is mandatory",
    "Retry-After profile grounded in https://www.rfc-editor.org/rfc/rfc9110.html#name-retry-after"
  ],
  "related": [
    "workflow-dag-analyze",
    "workflow-transition-check"
  ],
  "limits": {
    "inputBytes": 100000,
    "outputBytes": 400000,
    "jsonNodes": 8000,
    "depth": 20,
    "findings": 200,
    "quoteSearchCharacters": 4000000,
    "quoteOccurrenceEvaluations": 200000,
    "maxRetries": 10,
    "maxDelayMs": 3600000,
    "budgetMs": 86400000
  },
  "errorCodes": [
    "INPUT_LIMIT",
    "OUTPUT_LIMIT",
    "COMPLEXITY_LIMIT",
    "UNSAFE_KEY",
    "DUPLICATE_ID",
    "EDGE_LIMIT",
    "EVALUATION_LIMIT",
    "INVALID_UNICODE",
    "INVALID_RETRY_AFTER",
    "INVALID_RETRY_INPUT"
  ],
  "requirementsProfile": {
    "format": "declared-requirements-v1",
    "facts": {
      "execution.suppliedCode": false,
      "execution.remoteMutation": false,
      "execution.llmInference": false,
      "execution.paidMcp": false,
      "verification.semanticTruth": false,
      "verification.sourceAuthenticity": false,
      "verification.liveVulnerabilities": false,
      "numbers.arbitraryPrecisionJson": false,
      "numbers.model": "ieee754-binary64",
      "privacy.requestBodyPersisted": false,
      "execution.deterministic": true,
      "execution.networkAccess": false,
      "privacy.resultBodyPersisted": false,
      "payment.x402": true,
      "payment.mpp": true,
      "operation.id": "retry-schedule-plan",
      "operation.category": "workflow-assurance",
      "limit.httpRequestBytes": 131072,
      "limit.requestBytes": 100000,
      "limit.responseBytes": 524288,
      "limit.resultBytes": 400000,
      "limit.jsonDepth": 20,
      "limit.jsonNodes": 8000,
      "input.statusCode.maximum": 599,
      "input.statusCode.minimum": 100,
      "input.retryAfter.maxLength": 128,
      "input.nowEpochMs.maximum": 4102444800000,
      "input.nowEpochMs.minimum": 0,
      "input.retryableStatuses.maxItems": 20,
      "input.maxRetries.maximum": 10,
      "input.maxRetries.minimum": 0,
      "input.baseDelayMs.maximum": 60000,
      "input.baseDelayMs.minimum": 1,
      "input.multiplier.maximum": 10,
      "input.multiplier.minimum": 1,
      "input.maxDelayMs.maximum": 3600000,
      "input.maxDelayMs.minimum": 1,
      "input.budgetMs.maximum": 86400000,
      "input.budgetMs.minimum": 0
    },
    "unknownPolicy": "Undeclared requirements are unknown, never compatible. Matching declared facts does not establish semantic fit or input validity.",
    "preflight": "/preflight"
  },
  "documentation": "/reference/tools/retry-schedule-plan.md",
  "serviceContract": "/reference/services/retry-schedule-plan.json",
  "errors": [
    {
      "status": 400,
      "meaning": "Malformed JSON, missing/invalid idempotency key, or payment identifier mismatch",
      "retry": "Correct the request before payment"
    },
    {
      "status": 402,
      "meaning": "Payment challenge or rejected payment",
      "retry": "Use official protocol SDK; inspect payment outcome before another payment"
    },
    {
      "status": 409,
      "meaning": "Idempotency conflict, duplicate proof, or PAYMENT_UNCERTAIN",
      "retry": "Keep original key, body, and proof; reconcile uncertainty with operator; never blindly repay"
    },
    {
      "status": 413,
      "meaning": "Input or generated output too large",
      "retry": "Reduce input; no payment attempted for validation failure"
    },
    {
      "status": 415,
      "meaning": "Unsupported media type or compression",
      "retry": "Send uncompressed application/json"
    },
    {
      "status": 422,
      "meaning": "Schema or service-specific semantic validation failure",
      "retry": "Correct input using returned error code; no payment attempted"
    },
    {
      "status": 429,
      "meaning": "Request/payment-attempt rate exceeded",
      "retry": "Wait for rate limit window; preserve existing payment identity"
    },
    {
      "status": 503,
      "meaning": "Payment configuration/provider/state unavailable, or live DNS preparation failed before settlement",
      "retry": "Check readiness; DNS preparation failures may retry the identical key/body/credential only; uncertainty requires reconciliation"
    }
  ],
  "numericPrecision": "JavaScript IEEE-754 numbers; use strings for large integer IDs/exact decimals where the schema accepts strings. No lossless numeric parsing.",
  "paymentWorkflow": {
    "discoveryOnly": false,
    "supportedProtocols": [
      "x402",
      "mpp"
    ],
    "x402": {
      "credentialHeader": "PAYMENT-SIGNATURE",
      "challengeHeader": "PAYMENT-REQUIRED",
      "receiptHeader": "PAYMENT-RESPONSE",
      "version": 2,
      "scheme": "exact",
      "paymentIdentifier": "payment-identifier extension MUST equal the HTTP Idempotency-Key",
      "sdk": "@x402/core with @x402/evm"
    },
    "mpp": {
      "supported": true,
      "credentialHeader": "Authorization",
      "challengeHeader": "WWW-Authenticate",
      "receiptHeader": "Payment-Receipt",
      "method": "tempo",
      "intent": "charge",
      "sdk": "mppx",
      "tokenDecimals": 6
    },
    "steps": [
      "Check configured readiness and the exact service schema",
      "Generate a fresh random Idempotency-Key for this operation; never use a discovery probe fixture for purchases",
      "Send valid input without a credential to obtain the official protocol challenge",
      "Use the official SDK and authorized wallet to fulfill the challenge",
      "Retry only with identical key, body, protocol and credential",
      "On PAYMENT_UNCERTAIN stop and request operator reconciliation; never blindly pay again"
    ],
    "versionedRetries": "Request fingerprint includes service release version. Retries across a version upgrade can conflict; coordinate upgrades outside the 24-hour replay window and reconcile pending attempts.",
    "docs": "/llms.txt"
  },
  "method": "POST",
  "paths": {
    "x402": "/v1/x402/retry-schedule-plan",
    "mpp": "/v1/mpp/retry-schedule-plan"
  },
  "inputSchema": {
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "type": "object",
    "properties": {
      "outcome": {
        "type": "string",
        "enum": [
          "http-response",
          "transport-uncertain",
          "payment-uncertain"
        ]
      },
      "replaySafety": {
        "type": "string",
        "enum": [
          "safe",
          "unsafe",
          "unknown"
        ]
      },
      "statusCode": {
        "type": "integer",
        "minimum": 100,
        "maximum": 599
      },
      "retryAfter": {
        "type": "string",
        "maxLength": 128
      },
      "nowEpochMs": {
        "type": "integer",
        "minimum": 0,
        "maximum": 4102444800000
      },
      "retryableStatuses": {
        "default": [
          408,
          429,
          500,
          502,
          503,
          504
        ],
        "maxItems": 20,
        "type": "array",
        "items": {
          "type": "integer",
          "minimum": 100,
          "maximum": 599
        }
      },
      "maxRetries": {
        "default": 3,
        "type": "integer",
        "minimum": 0,
        "maximum": 10
      },
      "baseDelayMs": {
        "default": 1000,
        "type": "integer",
        "minimum": 1,
        "maximum": 60000
      },
      "multiplier": {
        "default": 2,
        "type": "number",
        "minimum": 1,
        "maximum": 10
      },
      "maxDelayMs": {
        "default": 60000,
        "type": "integer",
        "minimum": 1,
        "maximum": 3600000
      },
      "budgetMs": {
        "type": "integer",
        "minimum": 0,
        "maximum": 86400000
      }
    },
    "required": [
      "outcome",
      "replaySafety",
      "budgetMs"
    ],
    "additionalProperties": false
  },
  "outputSchema": {
    "type": "object",
    "required": [
      "operation",
      "version",
      "result",
      "provenance"
    ],
    "properties": {
      "operation": {
        "const": "retry-schedule-plan",
        "type": "string"
      },
      "version": {
        "const": "0.29.0",
        "type": "string"
      },
      "result": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "profile": {
            "type": "string",
            "const": "bounded-retry-plan-v1"
          },
          "eligible": {
            "type": "boolean"
          },
          "reason": {
            "type": "string",
            "enum": [
              "planned",
              "payment_reconciliation_required",
              "replay_safety_not_established",
              "status_not_retryable",
              "no_retries_requested",
              "budget_exhausted",
              "delay_limit_exceeded"
            ]
          },
          "serverMinimumFirstDelayMs": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              {
                "type": "null"
              }
            ]
          },
          "plan": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "retry": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                },
                "delayMs": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                },
                "cumulativeDelayMs": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                }
              },
              "required": [
                "retry",
                "delayMs",
                "cumulativeDelayMs"
              ],
              "additionalProperties": false
            }
          },
          "totalDelayMs": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "unplannedRetries": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "assumptions": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        },
        "required": [
          "profile",
          "eligible",
          "reason",
          "serverMinimumFirstDelayMs",
          "plan",
          "totalDelayMs",
          "unplannedRetries",
          "assumptions"
        ],
        "additionalProperties": false
      },
      "provenance": {
        "type": "object",
        "required": [
          "inputSha256",
          "outputSha256",
          "deterministic",
          "externalRequests"
        ],
        "properties": {
          "inputSha256": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "outputSha256": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "deterministic": {
            "const": true
          },
          "externalRequests": {
            "const": 0
          }
        }
      }
    },
    "additionalProperties": false
  },
  "exampleInput": {
    "outcome": "http-response",
    "replaySafety": "safe",
    "statusCode": 429,
    "retryAfter": "3",
    "maxRetries": 3,
    "baseDelayMs": 1000,
    "multiplier": 2,
    "maxDelayMs": 10000,
    "budgetMs": 10000
  },
  "exampleResponse": {
    "operation": "retry-schedule-plan",
    "version": "0.29.0",
    "result": {
      "profile": "bounded-retry-plan-v1",
      "eligible": true,
      "reason": "planned",
      "serverMinimumFirstDelayMs": 3000,
      "plan": [
        {
          "retry": 1,
          "delayMs": 3000,
          "cumulativeDelayMs": 3000
        },
        {
          "retry": 2,
          "delayMs": 2000,
          "cumulativeDelayMs": 5000
        },
        {
          "retry": 3,
          "delayMs": 4000,
          "cumulativeDelayMs": 9000
        }
      ],
      "totalDelayMs": 9000,
      "unplannedRetries": 0,
      "assumptions": [
        "Caller must establish replay safety; this plan grants no permission",
        "No requests, payments, sleeps, or retries are executed",
        "Hypothetical repeated failures; Retry-After applies only to the first retry",
        "Budget counts waiting only; excludes execution time and has no jitter"
      ]
    },
    "provenance": {
      "inputSha256": "a0d7ca9aaa8f91ec282225d6df1edc726e7034f4e317744fc540a2ba2ceef469",
      "outputSha256": "d257e017c93ed0a51a5b49ecdf7bf20e7ca5190c89ad50c66ae46db72e17ada5",
      "deterministic": true,
      "externalRequests": 0
    }
  },
  "requiredHeaders": {
    "Content-Type": "application/json",
    "Idempotency-Key": "random 16–128 character operation identifier"
  },
  "fixedExample": "/reference/examples/retry-schedule-plan.json",
  "execution": {
    "deterministic": true,
    "externalRequests": 0,
    "maxExternalRequests": 0,
    "resultSnapshotPersisted": false,
    "fixedExampleIsIllustrativeSnapshot": false,
    "requiresPayment": true,
    "supportsMcpExecution": false
  },
  "releaseSnapshot": {
    "format": "static-release-reference-v1",
    "sourceVersion": "0.29.0",
    "sourceRegistrySha256": "a2b5ec09bf6c38b9d2879d746a4fded374f5928b445377b0270ef6aa8e6cac65",
    "generatedAt": "2026-10-06T15:38:00Z",
    "releaseAcceptance": "not-verified-by-generator",
    "runtimeReadiness": "not-evaluated",
    "livePaymentsVerified": false,
    "indexingVerified": false,
    "apiOrigin": null,
    "notice": "Build-time release reference. Runtime readiness, deployment, payment settlement and external indexing are not evaluated here. Prices are proposed; this file cannot authorize execution or payment."
  }
}
