{
 "openapi": "3.1.0",
 "info": {
  "title": "0R10N15-8374 - Governed Crossing Evaluation",
  "version": "07",
  "description": "Governed evaluation at a signing boundary, operated by StegVerse LLC. Each crossing is a manifest-governed packet evaluated against the admitted scope; every crossing, ALLOW or NON-ALLOW, produces a matched receipt pair, and the fee is paid either way. Posted tiers: receipt-only $0.0005; full-evaluation $0.015 (select via the body's tier field; defaults to receipt-only). The posted tiers are the governance fee; settlement gas is charged additionally on each crossing, quoted live at challenge time, and the 402 challenge amount is the total authorized (governance fee + settlement charge). Payment: x402 exact scheme, USDC on Base, to the recipient published in the service's authenticated offer; authorizations are accepted only for that recipient. Patent pending: U.S. Application No. 64/198,910."
 },
 "paths": {
  "/crossing": {
   "post": {
    "summary": "Submit a governed crossing for evaluation",
    "operationId": "submitCrossing",
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "tier": {
          "type": "string",
          "enum": [
           "receipt-only",
           "full-evaluation"
          ],
          "description": "Posted fee tier for this crossing (see the offer document); defaults to receipt-only."
         },
         "counterparty": {
          "type": "string",
          "description": "Caller's declared identity for the crossing record."
         },
         "action": {
          "type": "string",
          "description": "The governed action requested at this crossing."
         },
         "scope_ref": {
          "type": "string",
          "description": "Reference to the admitted scope under which the action is requested."
         },
         "resource": {
          "type": "string",
          "description": "The resource the action targets."
         },
         "sublane": {
          "type": "string",
          "description": "Optional routing name (two uppercase alphanumeric characters, e.g. \"AA\"); receipts land on that sub-lane's chain under 8374's one identity."
         }
        },
        "required": [
         "counterparty",
         "action",
         "scope_ref",
         "resource"
        ],
        "additionalProperties": true
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Crossing evaluated; the response carries the disposition, the receipt pair identifiers, and the caller's retention bundle (BUILD-Q-44)."
     },
     "402": {
      "description": "Payment required (x402): see the challenge body's accepts[] and extensions.bazaar."
     },
     "422": {
      "description": "Crossing refused (NON-ALLOW); the response carries the refusal receipt pair."
     }
    },
    "x-payment-info": {
     "price": {
      "mode": "fixed",
      "currency": "USD",
      "amount": "0.015"
     },
     "protocols": [
      "x402"
     ]
    }
   }
  },
  "/pass-through": {
   "post": {
    "summary": "Take the nonce pass-through (discovery)",
    "operationId": "passThrough",
    "description": "A one-time, free traversal of the governed surface. Declare a subject (your origin URL or agent id; optionally a payer address); the endpoint mints a nonce bound to the subject and to the governed terms as they stand, receipts the traversal, and returns the record. Later challenges and crossings for the subject carry the distinction that the pass-through has already been taken. A repeat traversal returns the existing record as ALREADY_TAKEN. Identity is declared, not proven (v1).",
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "subject": {
          "type": "string"
         },
         "payer": {
          "type": "string"
         },
         "nonce": {
          "type": "string"
         }
        }
       }
      }
     }
    },
    "responses": {
     "201": {
      "description": "Pass-through taken; the response is the discovery record (nonce, subject, terms, terms_hash, log anchor)."
     },
     "200": {
      "description": "ALREADY_TAKEN (the existing record, state marked) or a nonce replay (the record as issued)."
     },
     "400": {
      "description": "No subject declared (or a malformed payer): FAIL_CLOSED with the six-field detail."
     }
    }
   }
  },
  "/badges": {
   "post": {
    "summary": "Declare an origin for public receipt chains (mint a badge)",
    "operationId": "declareBadge",
    "description": "Declares an origin (an absolute http(s) URL, normalized to scheme + host + port) and mints its declaration badge. One badge per origin: re-declaring the same origin returns the existing badge and receipts an ALREADY_DECLARED observation. The response carries the badge_id and the embed snippets (HTML and Markdown).",
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "origin": {
          "type": "string"
         }
        }
       }
      }
     }
    },
    "responses": {
     "201": {
      "description": "Declared; the response carries the badge_id, the declaration record, and the embed snippets."
     },
     "200": {
      "description": "ALREADY_DECLARED: the origin's existing badge, with the observation receipted."
     },
     "400": {
      "description": "Origin missing or not an absolute http(s) URL: FAIL_CLOSED with the six-field detail."
     }
    }
   },
   "get": {
    "summary": "The public badge registry",
    "operationId": "badgeRegistry",
    "description": "Every declaration (badge_id, origin, declared_at) with per-badge counts and the badge log's live replay verdict and terminal anchor. Clicks are exact; impressions are rollup-grade as of the last rollup. Identity is declared, not proven (v1).",
    "responses": {
     "200": {
      "description": "The registry document."
     }
    }
   }
  },
  "/badge/{badge_id}.svg": {
   "get": {
    "summary": "A badge's image",
    "operationId": "badgeImage",
    "description": "The two-segment SVG: PUBLIC RECEIPT CHAINS | SUPPORTED HERE, plus the badge's receipted click count when it has one. Each serve is an impression, graded bound when the Referer host equals the registered origin's host, and receipted in rollup entries.",
    "parameters": [
     {
      "name": "badge_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "The badge SVG (image/svg+xml, Cache-Control: no-store)."
     },
     "404": {
      "description": "Unknown badge_id."
     }
    }
   }
  },
  "/badge/{badge_id}/click": {
   "get": {
    "summary": "A badge's click-through",
    "operationId": "badgeClick",
    "description": "Receipts the click in the badge log as its own entry, then redirects (302) to the 0R10N15 protocol page.",
    "parameters": [
     {
      "name": "badge_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "302": {
      "description": "Redirect to https://stegverse.org/0r10n15/ after the click is receipted."
     },
     "404": {
      "description": "Unknown badge_id; no entry is written."
     }
    }
   }
  }
 },
 "servers": [
  {
   "url": "http://bore.pub:61418"
  }
 ]
}