{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://sediment.so/schemas/facts/push/v3.json",
  "title": "Push",
  "description": "One forge push receipt.",
  "type": "object",
  "properties": {
    "schema_version": {
      "enum": [
        1,
        2
      ],
      "type": "integer",
      "description": "The positive integer version of the canonical row schema."
    },
    "repository_provider": {
      "anyOf": [
        {
          "const": "github",
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "description": "Captured forge provider."
    },
    "repository_host": {
      "anyOf": [
        {
          "type": "string",
          "pattern": "^[^\\u0000\\uD800-\\uDFFF]*$"
        },
        {
          "type": "null"
        }
      ],
      "description": "Configured lowercase forge host."
    },
    "repository_id": {
      "anyOf": [
        {
          "type": "string",
          "pattern": "^[^\\u0000\\uD800-\\uDFFF]*$"
        },
        {
          "type": "null"
        }
      ],
      "description": "Immutable provider repository ID within its forge host."
    },
    "push_id": {
      "type": "string",
      "pattern": "^[^\\u0000\\uD800-\\uDFFF]*$",
      "description": "Stable id for this push."
    },
    "org_id": {
      "type": "string",
      "pattern": "^[^\\u0000\\uD800-\\uDFFF]*$",
      "description": "The deployment's tenant id, normalized. Bound to the server."
    },
    "provider": {
      "const": "github",
      "type": "string",
      "description": "Which system this fact came from."
    },
    "repo": {
      "type": "string",
      "pattern": "^[^\\u0000\\uD800-\\uDFFF]*$",
      "description": "`owner/repo`, lowercased. Empty string when the sender omitted it."
    },
    "clone_url": {
      "type": "string",
      "description": "Where the mirror fetches this repo from."
    },
    "ref": {
      "type": "string",
      "pattern": "^[^\\u0000\\uD800-\\uDFFF]*$",
      "description": "The ref that moved, e.g. `refs/heads/main`."
    },
    "before_sha": {
      "type": "string",
      "description": "The ref's tip before the push."
    },
    "after_sha": {
      "type": "string",
      "description": "The ref's tip after the push."
    },
    "forced": {
      "type": "boolean",
      "description": "Whether the push rewrote history."
    },
    "captured_at": {
      "type": "string",
      "format": "date-time",
      "description": "When Sediment stored the fact, stamped server-side. Windows and ordering anchor on this, never on a client clock."
    }
  },
  "additionalProperties": false,
  "required": [
    "schema_version",
    "repository_provider",
    "repository_host",
    "repository_id",
    "push_id",
    "org_id",
    "provider",
    "repo",
    "clone_url",
    "ref",
    "before_sha",
    "after_sha",
    "forced",
    "captured_at"
  ]
}
