openapi: 3.1.0
info:
  title: Well-known Audit Corpus
  version: 0.1.0
  description: Hosted agent-readiness corpus backed by Cloudflare Cron + D1. Scores origins across AgentCard, MCP, OpenAPI, x402, RFC 9727, Link headers, llms.txt, health, schema, and pricing metadata.
servers:
  - url: https://wellknown-audit-corpus.mtree.workers.dev
paths:
  /dataset/health:
    get:
      summary: Dataset freshness and coverage
      responses:
        '200':
          description: Dataset health with dataset_fresh_at, total origins, bands, and last ingest.
  /v1/wellknowns/readiness_report:
    post:
      summary: Paid readiness report for one origin
      x-x402-price-usd: 0.05
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                url: { type: string }
                refresh: { type: boolean }
              required: [url]
      responses:
        '200':
          description: Readiness score, missing surfaces, checks, evidence, dataset_fresh_at, and provenance.
        '402':
          description: x402 payment required.
  /v1/wellknowns/compare:
    post:
      summary: Paid readiness comparison across origins
      x-x402-price-usd: 0.10
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                urls:
                  type: array
                  items: { type: string }
                refresh: { type: boolean }
              required: [urls]
      responses:
        '200':
          description: Ranked rows with readiness_score, readiness_band, missing surfaces, and dataset_fresh_at.
        '402':
          description: x402 payment required.

x-money-tree-buyer-readiness:
  quote_before_signing: "Read the unpaid 402 quote before signing or before paying; compare payTo, amount, network, asset, and resource."
  rail_readiness:
    network: "eip155:8453"
    asset: "USDC on Base"
  payment_proof_policy:
    require_payment_response: true
    receipt_fields: [transaction, network, asset, amount, payer, payTo]
  funding_handoff: "If the buyer lacks Base USDC or the settlement asset, stop before signing and hand off to funding; retry only with the same request after funding."
  revenue_metric_policy: "External paid calls are settled revenue; self-funded/internal-credit calls are protocol proof only."
  decision_json_shape:
    required_keys: [verdict, recommendation, warnings, confidence, metadata, evidence, action, stop_conditions, fallbacks, attribution]
