{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/peppolstatus-com/json-schema/peppolstatus-com-software-library-list-schema.json",
  "title": "SoftwareLibraryList",
  "description": "The whole software library, ordered by current host count (desc) then display name.",
  "x-generated": "2026-11-21",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/peppolstatus-com-software-api-openapi.yml#/components/schemas/SoftwareLibraryList",
  "type": "object",
  "required": [
    "items",
    "catalogue_version",
    "trend_from",
    "trend_to",
    "generated_at"
  ],
  "properties": {
    "items": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/SoftwareLibraryRow"
      }
    },
    "catalogue_version": {
      "type": "integer",
      "description": "Which software-catalogue edition produced the product metadata."
    },
    "trend_from": {
      "type": "string",
      "format": "date"
    },
    "trend_to": {
      "type": "string",
      "format": "date"
    },
    "generated_at": {
      "type": "string",
      "format": "date-time"
    }
  },
  "$defs": {
    "SoftwareAdvisorySummary": {
      "type": "object",
      "description": "Known advisories by CVSS severity (issue #798). All-zero counts with an empty `ids` mean TRACKED AND CLEAN; the whole object is null when the lane publishes no advisory feed at all. The two are different statements and must render differently. Verified 2026-09-17: no CVE/GHSA exists for any tracked product, so a clean sheet is the expected day-one answer.",
      "required": [
        "critical",
        "high",
        "medium",
        "low",
        "ids"
      ],
      "properties": {
        "critical": {
          "type": "integer"
        },
        "high": {
          "type": "integer"
        },
        "medium": {
          "type": "integer"
        },
        "low": {
          "type": "integer"
        },
        "ids": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Advisory ids (GHSA-… / CVE-…) behind the counts."
        }
      }
    },
    "SoftwareLaneStats": {
      "type": "object",
      "description": "One tracked upstream LANE of an engine and how its hosts sit against it (issue #798). A lane is not an engine: the `oxalis` engine hides three independent ladders (classic 7.x, NG 1.x, AS4 2.x), each with its own latest release. `hosts_current` = resolved and nothing newer published, `hosts_behind` = at least one stable release newer, `hosts_unknown` = no version, a snapshot, or a string the lane never published. For a multi-lane engine a version matching no lane is counted in none of them, so the buckets can sum to less than the engine's `hosts`. When any of the three is below 10 (and not zero), all three are null.",
      "required": [
        "lane",
        "latest_release",
        "hosts_current",
        "hosts_behind",
        "hosts_unknown"
      ],
      "properties": {
        "lane": {
          "type": "string",
          "description": "The catalogue `upstream` lane key."
        },
        "latest_release": {
          "oneOf": [
            {
              "$ref": "#/$defs/SoftwareLatestRelease"
            },
            {
              "type": "null"
            }
          ]
        },
        "hosts_current": {
          "type": [
            "integer",
            "null"
          ],
          "description": "null when fewer than 10 hosts"
        },
        "hosts_behind": {
          "type": [
            "integer",
            "null"
          ],
          "description": "null when fewer than 10 hosts"
        },
        "hosts_unknown": {
          "type": [
            "integer",
            "null"
          ],
          "description": "null when fewer than 10 hosts"
        }
      }
    },
    "SoftwareLatestRelease": {
      "type": "object",
      "description": "The newest STABLE (non-prerelease) release of a tracked product lane, from the daily upstream sync (issue #798). Published even when the host's own version cannot be placed on the ladder — it is the half a reader can still act on.",
      "required": [
        "version",
        "released_at"
      ],
      "properties": {
        "version": {
          "type": "string",
          "description": "Normalized: tag prefix and publisher suffix stripped."
        },
        "released_at": {
          "type": "string",
          "format": "date"
        }
      }
    },
    "SoftwareLibraryCompliance": {
      "type": "object",
      "description": "The compliance debt of the seats running an engine, summed from the daily seat rollup at its newest `snapshot_date` (published because the rollup can be a day stale). `seats_linked` is MANY-TO-MANY with engines — a seat whose hosts run two engines is counted under both — so this figure must never be summed across engines to reach a network total. `seats_scored` ≤ `seats_linked`: a linked seat the scan has not covered contributes nothing. `open_per_1k` is null when the linked seats host no registrations (a certificate finding needs none, and 0 would claim a clean sheet).",
      "required": [
        "snapshot_date",
        "seats_linked",
        "seats_scored",
        "registrations",
        "open_findings",
        "fatal",
        "warning",
        "notice",
        "open_per_1k"
      ],
      "properties": {
        "snapshot_date": {
          "type": "string",
          "format": "date"
        },
        "seats_linked": {
          "type": "integer"
        },
        "seats_scored": {
          "type": "integer"
        },
        "registrations": {
          "type": "integer"
        },
        "open_findings": {
          "type": "integer"
        },
        "fatal": {
          "type": "integer"
        },
        "warning": {
          "type": "integer"
        },
        "notice": {
          "type": "integer"
        },
        "open_per_1k": {
          "type": [
            "number",
            "null"
          ]
        }
      }
    },
    "SoftwareLibraryRoleCount": {
      "type": "object",
      "description": "One observed role of an engine and its current host count in that role.",
      "required": [
        "role",
        "hosts"
      ],
      "properties": {
        "role": {
          "type": "string",
          "enum": [
            "smp",
            "ap"
          ]
        },
        "hosts": {
          "type": "integer"
        }
      }
    },
    "SoftwareLibraryRow": {
      "type": "object",
      "description": "One engine of the software library: its product metadata plus what the network shows. An engine with no current sighting is still a row (`hosts: 0`, `roles: []`, null seen stamps, a flat trend). `compliance` is null when no seat is linked to the engine, or while the seat rollup is unavailable — never a fabricated zero. `lanes` and `advisories` (issue #798) are null — never `[]` or zero counts — for the 44 of 53 engines the catalogue tracks no upstream release feed for.",
      "required": [
        "engine",
        "display_name",
        "vendor",
        "category",
        "homepage",
        "hosts",
        "roles",
        "first_seen",
        "last_seen",
        "compliance",
        "trend",
        "lanes",
        "advisories"
      ],
      "properties": {
        "engine": {
          "type": "string",
          "description": "The catalogue engine slug."
        },
        "display_name": {
          "type": "string"
        },
        "vendor": {
          "type": [
            "string",
            "null"
          ]
        },
        "category": {
          "type": "string",
          "enum": [
            "smp",
            "ap",
            "both",
            "unknown"
          ]
        },
        "homepage": {
          "type": [
            "string",
            "null"
          ]
        },
        "hosts": {
          "type": "integer",
          "description": "Current production host+role targets running the engine."
        },
        "roles": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/SoftwareLibraryRoleCount"
          }
        },
        "first_seen": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time",
          "description": "First observation of the engine anywhere on the network."
        },
        "last_seen": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time",
          "description": "End of the most recent observation window — the request instant while the engine is still present."
        },
        "compliance": {
          "oneOf": [
            {
              "$ref": "#/$defs/SoftwareLibraryCompliance"
            },
            {
              "type": "null"
            }
          ]
        },
        "trend": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/SoftwareLibraryTrendPoint"
          }
        },
        "lanes": {
          "oneOf": [
            {
              "type": "array",
              "items": {
                "$ref": "#/$defs/SoftwareLaneStats"
              }
            },
            {
              "type": "null"
            }
          ],
          "description": "The engine's tracked upstream lanes, each with its newest stable release and the current / behind / unknown split of the hosts running it. Null when the engine tracks no upstream feed."
        },
        "advisories": {
          "oneOf": [
            {
              "$ref": "#/$defs/SoftwareAdvisorySummary"
            },
            {
              "type": "null"
            }
          ],
          "description": "Live advisories published for the PRODUCT, by severity — not a per-host match. Null when no lane of the engine has an advisory feed."
        }
      }
    },
    "SoftwareLibraryTrendPoint": {
      "type": "object",
      "description": "One UTC day of the host-count trend. Zero-filled: a day the engine had no open row reads `hosts: 0` rather than being omitted.",
      "required": [
        "day",
        "hosts"
      ],
      "properties": {
        "day": {
          "type": "string",
          "format": "date"
        },
        "hosts": {
          "type": "integer"
        }
      }
    }
  }
}