{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/run402-com/json-schema/run402-com-app-repo-schema.json",
  "title": "AppRepo",
  "description": "An app repo. The never-written `default` repo reads as empty: `head: null`, `seq: 0`, `created_at`/`updated_at: null`.",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/run402-com-app-repos-api-openapi.yml#/components/schemas/AppRepo",
  "type": "object",
  "required": [
    "repo_name",
    "head",
    "seq",
    "commit_count",
    "size_bytes",
    "size",
    "clone_url",
    "created_at",
    "updated_at"
  ],
  "properties": {
    "repo_name": {
      "$ref": "#/$defs/AppRepoName"
    },
    "head": {
      "type": [
        "string",
        "null"
      ],
      "description": "The commit `refs/heads/main` points at; null for an empty repo."
    },
    "seq": {
      "type": "integer",
      "description": "Sequence number of the head commit (first-parent count)."
    },
    "commit_count": {
      "type": "integer"
    },
    "size_bytes": {
      "type": "integer",
      "description": "Bytes of the repo's git objects; they count toward the organization's pooled storageBytes (never the vault's sourceBytes)."
    },
    "size": {
      "type": "string",
      "description": "size_bytes as a decimal label, e.g. \"1.2 MB\"."
    },
    "clone_url": {
      "type": "string",
      "format": "uri"
    },
    "created_at": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "updated_at": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    }
  },
  "additionalProperties": false,
  "$defs": {
    "AppRepoName": {
      "type": "string",
      "pattern": "^[a-z0-9][a-z0-9._-]{0,63}$",
      "description": "App repo name; must not end in `.git`. `default` always exists."
    }
  }
}