{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/x402git-com/json-schema/x402git-com-listing-schema.json",
  "title": "Listing",
  "x-generated": "2026-11-29",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/x402git-com-openapi.json#/components/schemas/Listing",
  "type": "object",
  "properties": {
    "listing_id": {
      "type": "string",
      "format": "uuid",
      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
    },
    "owner": {
      "$ref": "#/$defs/Handle"
    },
    "slug": {
      "$ref": "#/$defs/Slug"
    },
    "status": {
      "$ref": "#/$defs/ListingStatus"
    },
    "source": {
      "$ref": "#/$defs/ListingSource"
    },
    "description": {
      "type": [
        "string",
        "null"
      ]
    },
    "trigger_hint": {
      "type": [
        "string",
        "null"
      ]
    },
    "licence": {
      "type": "object",
      "properties": {
        "verdict": {
          "anyOf": [
            {
              "$ref": "#/$defs/LicenceVerdict"
            },
            {
              "type": "null"
            }
          ]
        },
        "spdx": {
          "type": [
            "string",
            "null"
          ]
        }
      },
      "required": [
        "verdict",
        "spdx"
      ],
      "additionalProperties": false
    },
    "latest_release": {
      "anyOf": [
        {
          "$ref": "#/$defs/LatestRelease"
        },
        {
          "type": "null"
        }
      ]
    },
    "newest_release": {
      "anyOf": [
        {
          "$ref": "#/$defs/LatestRelease"
        },
        {
          "type": "null"
        }
      ]
    },
    "pricing": {
      "$ref": "#/$defs/Pricing"
    },
    "endpoints": {
      "$ref": "#/$defs/ListingEndpoints"
    },
    "remote": {
      "type": [
        "string",
        "null"
      ]
    },
    "ssh_host_key_fingerprints": {
      "anyOf": [
        {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        {
          "type": "null"
        }
      ]
    },
    "default_branch": {
      "type": [
        "string",
        "null"
      ]
    },
    "created_at": {
      "$ref": "#/$defs/IsoDateTime"
    },
    "published_at": {
      "anyOf": [
        {
          "$ref": "#/$defs/IsoDateTime"
        },
        {
          "type": "null"
        }
      ]
    },
    "retired_at": {
      "anyOf": [
        {
          "$ref": "#/$defs/IsoDateTime"
        },
        {
          "type": "null"
        }
      ]
    }
  },
  "required": [
    "listing_id",
    "owner",
    "slug",
    "status",
    "source",
    "description",
    "trigger_hint",
    "licence",
    "latest_release",
    "pricing",
    "endpoints",
    "remote",
    "ssh_host_key_fingerprints",
    "default_branch",
    "created_at",
    "published_at",
    "retired_at"
  ],
  "additionalProperties": false,
  "$defs": {
    "Capabilities": {
      "type": "object",
      "properties": {
        "tools": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string"
              },
              "from": {
                "type": "string"
              }
            },
            "required": [
              "name",
              "from"
            ],
            "additionalProperties": false
          }
        },
        "runs": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/CapabilityRun"
          }
        },
        "hosts": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/CapabilityHost"
          }
        },
        "env": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string"
              },
              "paths": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            },
            "required": [
              "name",
              "paths"
            ],
            "additionalProperties": false
          }
        },
        "install_runs": {
          "type": "boolean"
        },
        "summary": {
          "type": "string"
        }
      },
      "required": [
        "tools",
        "runs",
        "hosts",
        "env",
        "install_runs",
        "summary"
      ],
      "additionalProperties": false,
      "description": "§4.3. What the artifact's own files can do: tools, what runs, hosts, environment, and whether anything runs at install."
    },
    "CapabilityHost": {
      "type": "object",
      "properties": {
        "host": {
          "type": "string"
        },
        "local": {
          "type": "boolean"
        },
        "from": {
          "type": "string",
          "enum": [
            "code",
            "docs"
          ]
        },
        "paths": {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      },
      "required": [
        "host",
        "local",
        "from",
        "paths"
      ],
      "additionalProperties": false
    },
    "CapabilityRun": {
      "type": "object",
      "properties": {
        "path": {
          "type": "string"
        },
        "kind": {
          "type": "string",
          "enum": [
            "script",
            "hook",
            "mcp_server",
            "install_script",
            "workflow",
            "make",
            "build_hook"
          ]
        },
        "detail": {
          "type": "string"
        }
      },
      "required": [
        "path",
        "kind"
      ],
      "additionalProperties": false
    },
    "CreatorScanFinding": {
      "type": "object",
      "properties": {
        "kind": {
          "$ref": "#/$defs/ScanFindingKind"
        },
        "check": {
          "$ref": "#/$defs/ScanCheckId"
        },
        "tier": {
          "$ref": "#/$defs/ScanTier"
        },
        "rule_id": {
          "type": "string"
        },
        "severity": {
          "$ref": "#/$defs/ScanSeverity"
        },
        "description": {
          "type": "string"
        },
        "path": {
          "type": "string"
        },
        "line": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        },
        "package": {
          "$ref": "#/$defs/ScanPackageRef"
        },
        "advisory_ids": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "source": {
          "type": "string"
        },
        "public": {
          "type": "boolean"
        },
        "blocking": {
          "type": "boolean"
        },
        "match_length": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        }
      },
      "required": [
        "kind",
        "check",
        "tier",
        "rule_id",
        "severity",
        "description"
      ],
      "additionalProperties": false,
      "description": "§4.4. A finding as the creator sees it: path, line, and a secret's length — never its value."
    },
    "CreatorScanReport": {
      "type": "object",
      "properties": {
        "version": {
          "type": "number",
          "const": 2
        },
        "scanner_version": {
          "type": "string"
        },
        "scanned_at": {
          "type": "string"
        },
        "checks": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/ScanCheck"
          }
        },
        "findings": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/CreatorScanFinding"
          }
        },
        "capabilities": {
          "$ref": "#/$defs/Capabilities"
        },
        "counts": {
          "$ref": "#/$defs/ScanCounts"
        },
        "packages_scanned": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        },
        "osv_error": {
          "type": "string"
        },
        "advisories_refreshed_at": {
          "type": "string"
        }
      },
      "required": [
        "version",
        "scanner_version",
        "scanned_at",
        "checks",
        "findings",
        "counts"
      ],
      "additionalProperties": false,
      "description": "§4.4. The full trust report for the release's own creator: every check, every finding, and the path and line of a secret that failed the release. Never served to anyone else."
    },
    "Handle": {
      "type": "string",
      "pattern": "^[a-z0-9-]{2,40}$",
      "description": "A creator handle. The `owner` segment of every URL."
    },
    "IsoDateTime": {
      "type": "string",
      "format": "date-time",
      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$",
      "description": "RFC 3339 timestamp."
    },
    "LatestRelease": {
      "type": "object",
      "properties": {
        "release_id": {
          "type": "string",
          "format": "uuid",
          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
        },
        "version": {
          "$ref": "#/$defs/SemVer"
        },
        "scan": {
          "$ref": "#/$defs/ScanStatus"
        },
        "artifact_sha256": {
          "anyOf": [
            {
              "$ref": "#/$defs/Sha256"
            },
            {
              "type": "null"
            }
          ]
        },
        "published_at": {
          "anyOf": [
            {
              "$ref": "#/$defs/IsoDateTime"
            },
            {
              "type": "null"
            }
          ]
        },
        "manifest_url": {
          "type": "string"
        },
        "scan_report": {
          "anyOf": [
            {
              "$ref": "#/$defs/CreatorScanReport"
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "required": [
        "release_id",
        "version",
        "scan",
        "artifact_sha256",
        "published_at",
        "manifest_url"
      ],
      "additionalProperties": false
    },
    "LicenceVerdict": {
      "type": "string",
      "enum": [
        "pass",
        "manual",
        "block"
      ]
    },
    "ListingEndpoints": {
      "type": "object",
      "properties": {
        "url": {
          "type": "string"
        },
        "label_endpoint": {
          "type": "string"
        },
        "version_endpoint": {
          "type": "string"
        },
        "releases_endpoint": {
          "type": "string"
        },
        "resource_endpoint": {
          "type": "string"
        }
      },
      "required": [
        "url",
        "label_endpoint",
        "version_endpoint",
        "releases_endpoint",
        "resource_endpoint"
      ],
      "additionalProperties": false,
      "description": "Every public URL for a listing, absolute."
    },
    "ListingSource": {
      "type": "string",
      "enum": [
        "github",
        "hosted"
      ],
      "description": "D10. `github` is Rail A (the creator's own repo via the GitHub App); `hosted` is Rail B (a private repo we create)."
    },
    "ListingStatus": {
      "type": "string",
      "enum": [
        "draft",
        "live",
        "retired"
      ],
      "description": "FR-42. `live` requires licence pass, a passing release and a description. Retire is terminal."
    },
    "MicroUsdc": {
      "type": "string",
      "pattern": "^\\d+$",
      "title": "Micro-USDC",
      "description": "An amount in micro-USDC (6 decimals) encoded as a decimal integer string. 9000000 = $9.00."
    },
    "Pricing": {
      "type": "object",
      "properties": {
        "price_micro": {
          "$ref": "#/$defs/MicroUsdc"
        },
        "update_price_micro": {
          "$ref": "#/$defs/MicroUsdc"
        },
        "presets": {
          "type": "object",
          "properties": {
            "price": {
              "type": "array",
              "items": {
                "$ref": "#/$defs/MicroUsdc"
              }
            },
            "update": {
              "type": "array",
              "items": {
                "$ref": "#/$defs/MicroUsdc"
              }
            }
          },
          "required": [
            "price",
            "update"
          ],
          "additionalProperties": false
        },
        "defaults": {
          "type": "object",
          "properties": {
            "price_micro": {
              "$ref": "#/$defs/MicroUsdc"
            },
            "update_price_micro": {
              "$ref": "#/$defs/MicroUsdc"
            }
          },
          "required": [
            "price_micro",
            "update_price_micro"
          ],
          "additionalProperties": false
        },
        "platform_fee_bps": {
          "type": "integer",
          "minimum": -9007199254740991,
          "maximum": 9007199254740991
        }
      },
      "required": [
        "price_micro",
        "update_price_micro",
        "presets",
        "defaults",
        "platform_fee_bps"
      ],
      "additionalProperties": false,
      "description": "FR-13. An update price of 0 is lifetime access (D1). Explicit API values are never rounded."
    },
    "ScanCheck": {
      "type": "object",
      "properties": {
        "id": {
          "$ref": "#/$defs/ScanCheckId"
        },
        "tool": {
          "type": "string"
        },
        "tool_version": {
          "type": "string"
        },
        "status": {
          "$ref": "#/$defs/ScanCheckStatus"
        },
        "at": {
          "type": "string"
        },
        "findings": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        },
        "packages": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        },
        "reason": {
          "type": "string"
        }
      },
      "required": [
        "id",
        "tool",
        "tool_version",
        "status",
        "at",
        "findings"
      ],
      "additionalProperties": false,
      "description": "§4.2. One check, what ran it, at what version, and what it found. The vendor scan id is never published."
    },
    "ScanCheckId": {
      "type": "string",
      "enum": [
        "secrets",
        "limits",
        "known_vulns",
        "known_malware",
        "dep_behaviour",
        "capabilities",
        "injection"
      ],
      "description": "Which check a finding belongs to. The report carries one row per id whether or not it ran."
    },
    "ScanCheckStatus": {
      "type": "string",
      "enum": [
        "pass",
        "findings",
        "fail",
        "unavailable",
        "partial"
      ],
      "description": "pass · findings · fail · unavailable (could not run, retrying) · partial (ran, some packages still pending)."
    },
    "ScanCounts": {
      "type": "object",
      "properties": {
        "blocking": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        },
        "disclosed": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        },
        "review": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        }
      },
      "required": [
        "blocking",
        "disclosed",
        "review"
      ],
      "additionalProperties": false,
      "description": "§4.1. How many findings sit in each tier."
    },
    "ScanFindingKind": {
      "type": "string",
      "enum": [
        "secret",
        "vulnerability",
        "limit",
        "malware",
        "behaviour",
        "capability",
        "injection"
      ]
    },
    "ScanPackageRef": {
      "type": "object",
      "properties": {
        "ecosystem": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "version": {
          "type": "string"
        },
        "direct": {
          "type": "boolean"
        },
        "dev": {
          "type": "boolean"
        }
      },
      "required": [
        "ecosystem",
        "name"
      ],
      "additionalProperties": false,
      "description": "The package a dependency finding is about."
    },
    "ScanSeverity": {
      "type": "string",
      "enum": [
        "CRITICAL",
        "HIGH",
        "MODERATE",
        "LOW",
        "UNKNOWN"
      ]
    },
    "ScanStatus": {
      "type": "string",
      "enum": [
        "pending",
        "pass",
        "fail"
      ]
    },
    "ScanTier": {
      "type": "string",
      "enum": [
        "blocking",
        "disclosed",
        "review"
      ],
      "description": "§4.1. `blocking` fails the release. `disclosed` sells and is shown. `review` is a model-derived flag from a vendor — shown as flagged for review, never a verdict."
    },
    "SemVer": {
      "type": "string",
      "pattern": "^\\d+\\.\\d+\\.\\d+$",
      "description": "A release version: the git tag with any leading `v` stripped."
    },
    "Sha256": {
      "type": "string",
      "pattern": "^[0-9a-f]{64}$"
    },
    "Slug": {
      "type": "string",
      "pattern": "^[a-z0-9-]{2,40}$",
      "description": "A listing slug, unique per owner. `api`, `v`, `r` and `label` are reserved. Never reused after retirement."
    }
  }
}