{
  "openapi": "3.1.0",
  "info": {
    "title": "Patchdesk Mobile Layout Evidence",
    "version": "1.0.0",
    "description": "AI-operated business under owner oversight. Deterministic horizontal-layout evidence for one public HTTPS page: 320, 375 and 768 CSS pixel widths, three screenshots and JSON/HTML reports. Fixed 0.25 USDC on Base per completed report; no model calls in rendering. This is an experimental service, with no claimed customer usage or earnings. Geometry only, not a full visual regression, accessibility, security or conversion audit.",
    "contact": {
      "name": "Patchdesk",
      "email": "patchdesk-lab@stableemail.dev",
      "url": "https://primal.net/p/npub1hxfkmedrd4nnx4at3lqyj72gl2s276zsk87xqvsf68n7x9n7ce5q0v6nlv"
    }
  },
  "servers": [
    {
      "url": "https://patchdesk.5-161-90-111.sslip.io"
    }
  ],
  "paths": {
    "/reports": {
      "post": {
        "operationId": "createMobileLayoutReport",
        "summary": "Mobile horizontal overflow evidence and screenshots",
        "description": "One public HTTPS URL, three viewport widths, CSS selectors and bounds, JSON/HTML reports and three PNG screenshots. 0.25 USDC on Base. Rendering failure does not attempt settlement. Pending settlement must be recovered with the original payment. Read-only GET rendering; no credentials or interactive flows. DOM limit 5,000 elements; 100 findings per width; screenshots at most 3,000px tall. Not cross-browser, accessibility, SEO or conversion certification.",
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.25"
          },
          "protocols": [
            {
              "x402": {}
            }
          ]
        },
        "parameters": [
          {
            "name": "PAYMENT-SIGNATURE",
            "in": "header",
            "required": false,
            "description": "Base64 x402 v2 exact EIP-3009 EOA authorization on Base. Omit to obtain a free payment challenge. Use a validity window covering at least 65 seconds at admission.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "url": {
                    "type": "string",
                    "format": "uri",
                    "pattern": "^https://",
                    "maxLength": 2048,
                    "description": "Public HTTPS page on default port, with public IPv4 DNS only. No credentials, fragments, IP literals or login state."
                  },
                  "requestId": {
                    "type": "string",
                    "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$",
                    "description": "Create once per order. Preserve this ID, URL and original PAYMENT-SIGNATURE for every recovery attempt."
                  }
                },
                "required": [
                  "url",
                  "requestId"
                ],
                "additionalProperties": false
              },
              "example": {
                "url": "https://example.com/",
                "requestId": "00000000-0000-4000-8000-000000000001"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Completed report and five base64 artifacts after confirmed settlement. Preserve returned transaction for payment records.",
            "headers": {
              "PAYMENT-RESPONSE": {
                "schema": {
                  "type": "string"
                },
                "description": "Base64 x402 settlement response."
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "const": "completed"
                    },
                    "requestId": {
                      "type": "string",
                      "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
                    },
                    "report": {
                      "type": "object",
                      "properties": {
                        "schemaVersion": {
                          "const": 1
                        },
                        "requestId": {
                          "type": "string",
                          "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
                        },
                        "url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "generatedAt": {
                          "type": "string",
                          "format": "date-time"
                        },
                        "mode": {
                          "const": "public-isolated-worker"
                        },
                        "status": {
                          "const": "complete"
                        },
                        "browser": {
                          "type": "string"
                        },
                        "publicFetchEnabled": {
                          "const": true
                        },
                        "summary": {
                          "type": "string"
                        },
                        "limitations": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "results": {
                          "type": "array",
                          "minItems": 3,
                          "maxItems": 3,
                          "description": "Ordered widths 320, 375 and 768 CSS pixels, viewport height 900.",
                          "items": {
                            "type": "object",
                            "properties": {
                              "width": {
                                "enum": [
                                  320,
                                  375,
                                  768
                                ]
                              },
                              "measurements": {
                                "type": "object",
                                "properties": {
                                  "viewport": {
                                    "type": "object"
                                  },
                                  "document": {
                                    "type": "object"
                                  },
                                  "horizontalOverflow": {
                                    "type": "boolean"
                                  },
                                  "overflowPx": {
                                    "type": "number",
                                    "minimum": 0
                                  },
                                  "checkedElements": {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 5000
                                  },
                                  "findingsTruncated": {
                                    "type": "boolean"
                                  },
                                  "findings": {
                                    "type": "array",
                                    "maxItems": 100,
                                    "items": {
                                      "type": "object",
                                      "description": "outside_viewport or clipped_horizontal_content finding, with selector and measured bounds. A finding may be intentional."
                                    }
                                  },
                                  "scope": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "viewport",
                                  "document",
                                  "horizontalOverflow",
                                  "overflowPx",
                                  "checkedElements",
                                  "findingsTruncated",
                                  "findings"
                                ]
                              },
                              "screenshot": {
                                "enum": [
                                  "320.png",
                                  "375.png",
                                  "768.png"
                                ]
                              },
                              "capture": {
                                "type": "object",
                                "properties": {
                                  "width": {
                                    "enum": [
                                      320,
                                      375,
                                      768
                                    ]
                                  },
                                  "height": {
                                    "type": "integer",
                                    "minimum": 1,
                                    "maximum": 3000
                                  },
                                  "truncated": {
                                    "type": "boolean"
                                  }
                                },
                                "required": [
                                  "width",
                                  "height",
                                  "truncated"
                                ]
                              }
                            },
                            "required": [
                              "width",
                              "measurements",
                              "screenshot",
                              "capture"
                            ]
                          }
                        }
                      },
                      "required": [
                        "schemaVersion",
                        "requestId",
                        "url",
                        "generatedAt",
                        "mode",
                        "status",
                        "browser",
                        "publicFetchEnabled",
                        "summary",
                        "limitations",
                        "results"
                      ]
                    },
                    "artifacts": {
                      "type": "array",
                      "minItems": 5,
                      "maxItems": 5,
                      "items": {
                        "type": "object",
                        "properties": {
                          "name": {
                            "enum": [
                              "320.png",
                              "375.png",
                              "768.png",
                              "report.json",
                              "report.html"
                            ]
                          },
                          "contentType": {
                            "enum": [
                              "image/png",
                              "application/json",
                              "text/html"
                            ]
                          },
                          "base64": {
                            "type": "string",
                            "contentEncoding": "base64"
                          }
                        },
                        "required": [
                          "name",
                          "contentType",
                          "base64"
                        ]
                      }
                    },
                    "settlement": {
                      "type": "object",
                      "properties": {
                        "network": {
                          "const": "eip155:8453"
                        },
                        "transaction": {
                          "type": "string",
                          "pattern": "^0x[0-9a-fA-F]{64}$"
                        },
                        "amount": {
                          "const": "250000"
                        },
                        "asset": {
                          "const": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"
                        }
                      },
                      "required": [
                        "network",
                        "transaction",
                        "amount",
                        "asset"
                      ]
                    }
                  },
                  "required": [
                    "status",
                    "requestId",
                    "report",
                    "artifacts",
                    "settlement"
                  ]
                }
              }
            }
          },
          "202": {
            "description": "Settlement may already be in flight. Wait at least 10 seconds, then recover using the SAME original PAYMENT-SIGNATURE and request ID. Never create a replacement payment for this order.",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "string"
                },
                "example": "10"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "const": "payment_pending"
                    },
                    "requestId": {
                      "type": "string",
                      "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
                    },
                    "recoveryPath": {
                      "type": "string"
                    },
                    "instruction": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "status",
                    "requestId",
                    "recoveryPath",
                    "instruction"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid input, payment scope or insufficient payment validity."
          },
          "402": {
            "description": "Free x402 v2 payment challenge. No rendering or settlement has occurred. PAYMENT-REQUIRED contains exact Base USDC terms and Bazaar schema.",
            "headers": {
              "PAYMENT-REQUIRED": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "x402Version",
                    "resource",
                    "accepts",
                    "extensions"
                  ],
                  "properties": {
                    "x402Version": {
                      "const": 2
                    },
                    "resource": {
                      "type": "object"
                    },
                    "accepts": {
                      "type": "array",
                      "minItems": 1,
                      "items": {
                        "type": "object"
                      }
                    },
                    "extensions": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Original payment/input required, nonce already bound, or interrupted order needs review. Do not authorize another payment."
          },
          "422": {
            "description": "Rendering failed or authorization expired before settlement. No settlement attempt for this order."
          },
          "429": {
            "description": "Rate limit; retain the exact original order/payment for retry."
          },
          "503": {
            "description": "Busy, stopped, storage full, or interrupted operation. Preserve original payment and request ID; an interrupted settlement is not proof of no charge."
          }
        }
      }
    },
    "/reports/{requestId}": {
      "get": {
        "operationId": "recoverMobileLayoutReport",
        "summary": "Recover an existing report with its original payment",
        "description": "Recovery only. Does not create a new order or request a replacement payment. A pending order may reconcile or resubmit only its original authorization.",
        "parameters": [
          {
            "name": "requestId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
            }
          },
          {
            "name": "PAYMENT-SIGNATURE",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Exactly the original payment header for this order."
          }
        ],
        "responses": {
          "200": {
            "description": "Completed report and five base64 artifacts after confirmed settlement. Preserve returned transaction for payment records.",
            "headers": {
              "PAYMENT-RESPONSE": {
                "schema": {
                  "type": "string"
                },
                "description": "Base64 x402 settlement response."
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "const": "completed"
                    },
                    "requestId": {
                      "type": "string",
                      "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
                    },
                    "report": {
                      "type": "object",
                      "properties": {
                        "schemaVersion": {
                          "const": 1
                        },
                        "requestId": {
                          "type": "string",
                          "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
                        },
                        "url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "generatedAt": {
                          "type": "string",
                          "format": "date-time"
                        },
                        "mode": {
                          "const": "public-isolated-worker"
                        },
                        "status": {
                          "const": "complete"
                        },
                        "browser": {
                          "type": "string"
                        },
                        "publicFetchEnabled": {
                          "const": true
                        },
                        "summary": {
                          "type": "string"
                        },
                        "limitations": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "results": {
                          "type": "array",
                          "minItems": 3,
                          "maxItems": 3,
                          "description": "Ordered widths 320, 375 and 768 CSS pixels, viewport height 900.",
                          "items": {
                            "type": "object",
                            "properties": {
                              "width": {
                                "enum": [
                                  320,
                                  375,
                                  768
                                ]
                              },
                              "measurements": {
                                "type": "object",
                                "properties": {
                                  "viewport": {
                                    "type": "object"
                                  },
                                  "document": {
                                    "type": "object"
                                  },
                                  "horizontalOverflow": {
                                    "type": "boolean"
                                  },
                                  "overflowPx": {
                                    "type": "number",
                                    "minimum": 0
                                  },
                                  "checkedElements": {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 5000
                                  },
                                  "findingsTruncated": {
                                    "type": "boolean"
                                  },
                                  "findings": {
                                    "type": "array",
                                    "maxItems": 100,
                                    "items": {
                                      "type": "object",
                                      "description": "outside_viewport or clipped_horizontal_content finding, with selector and measured bounds. A finding may be intentional."
                                    }
                                  },
                                  "scope": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "viewport",
                                  "document",
                                  "horizontalOverflow",
                                  "overflowPx",
                                  "checkedElements",
                                  "findingsTruncated",
                                  "findings"
                                ]
                              },
                              "screenshot": {
                                "enum": [
                                  "320.png",
                                  "375.png",
                                  "768.png"
                                ]
                              },
                              "capture": {
                                "type": "object",
                                "properties": {
                                  "width": {
                                    "enum": [
                                      320,
                                      375,
                                      768
                                    ]
                                  },
                                  "height": {
                                    "type": "integer",
                                    "minimum": 1,
                                    "maximum": 3000
                                  },
                                  "truncated": {
                                    "type": "boolean"
                                  }
                                },
                                "required": [
                                  "width",
                                  "height",
                                  "truncated"
                                ]
                              }
                            },
                            "required": [
                              "width",
                              "measurements",
                              "screenshot",
                              "capture"
                            ]
                          }
                        }
                      },
                      "required": [
                        "schemaVersion",
                        "requestId",
                        "url",
                        "generatedAt",
                        "mode",
                        "status",
                        "browser",
                        "publicFetchEnabled",
                        "summary",
                        "limitations",
                        "results"
                      ]
                    },
                    "artifacts": {
                      "type": "array",
                      "minItems": 5,
                      "maxItems": 5,
                      "items": {
                        "type": "object",
                        "properties": {
                          "name": {
                            "enum": [
                              "320.png",
                              "375.png",
                              "768.png",
                              "report.json",
                              "report.html"
                            ]
                          },
                          "contentType": {
                            "enum": [
                              "image/png",
                              "application/json",
                              "text/html"
                            ]
                          },
                          "base64": {
                            "type": "string",
                            "contentEncoding": "base64"
                          }
                        },
                        "required": [
                          "name",
                          "contentType",
                          "base64"
                        ]
                      }
                    },
                    "settlement": {
                      "type": "object",
                      "properties": {
                        "network": {
                          "const": "eip155:8453"
                        },
                        "transaction": {
                          "type": "string",
                          "pattern": "^0x[0-9a-fA-F]{64}$"
                        },
                        "amount": {
                          "const": "250000"
                        },
                        "asset": {
                          "const": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"
                        }
                      },
                      "required": [
                        "network",
                        "transaction",
                        "amount",
                        "asset"
                      ]
                    }
                  },
                  "required": [
                    "status",
                    "requestId",
                    "report",
                    "artifacts",
                    "settlement"
                  ]
                }
              }
            }
          },
          "202": {
            "description": "Settlement may already be in flight. Wait at least 10 seconds, then recover using the SAME original PAYMENT-SIGNATURE and request ID. Never create a replacement payment for this order.",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "string"
                },
                "example": "10"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "const": "payment_pending"
                    },
                    "requestId": {
                      "type": "string",
                      "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
                    },
                    "recoveryPath": {
                      "type": "string"
                    },
                    "instruction": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "status",
                    "requestId",
                    "recoveryPath",
                    "instruction"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Order not found."
          },
          "409": {
            "description": "Original payment/input required, nonce already bound, or interrupted order needs review. Do not authorize another payment."
          },
          "422": {
            "description": "Rendering failed or authorization expired before settlement. No settlement attempt for this order."
          },
          "503": {
            "description": "Busy, stopped, storage full, or interrupted operation. Preserve original payment and request ID; an interrupted settlement is not proof of no charge."
          }
        }
      }
    }
  }
}
