{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "program": {
      "type": "object",
      "properties": {
        "meta": {
          "type": "object",
          "properties": {
            "created_at": {
              "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)))$"
            },
            "updated_at": {
              "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)))$"
            },
            "deleted_at": {
              "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)))$"
            },
            "legacy_ref": {
              "type": "object",
              "properties": {
                "table": {
                  "type": "string"
                },
                "key": {
                  "type": ["string", "number"]
                },
                "row": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                }
              },
              "required": ["table", "key", "row"],
              "additionalProperties": false
            },
            "dataset": {
              "type": "string"
            }
          },
          "additionalProperties": false
        },
        "extensions": {
          "type": "object",
          "propertyNames": {
            "type": "string",
            "pattern": "^x-[a-z0-9]+-[a-z0-9-]+$"
          },
          "additionalProperties": {
            "$ref": "#/$defs/__schema0"
          }
        },
        "title": {
          "type": "string"
        },
        "description": {
          "type": "string"
        },
        "goal": {
          "type": "string"
        },
        "goal_text": {
          "type": "string"
        },
        "kind_hint": {
          "type": "string",
          "enum": ["schedule", "program"]
        },
        "advance": {
          "type": "string",
          "enum": ["calendar", "rolling"]
        },
        "finite": {
          "type": "boolean"
        },
        "progression_text": {
          "type": "string"
        },
        "starter": {
          "type": "object",
          "properties": {
            "key": {
              "type": "string"
            },
            "version": {
              "type": "string"
            }
          },
          "required": ["key", "version"],
          "additionalProperties": false
        },
        "equipment": {
          "maxItems": 100,
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "target_muscles": {
          "maxItems": 100,
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "contraindications": {
          "maxItems": 100,
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "level": {
          "type": "string"
        },
        "raw": {
          "type": "string"
        },
        "schedule": {
          "type": "object",
          "properties": {
            "meta": {
              "type": "object",
              "properties": {
                "created_at": {
                  "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)))$"
                },
                "updated_at": {
                  "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)))$"
                },
                "deleted_at": {
                  "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)))$"
                },
                "legacy_ref": {
                  "type": "object",
                  "properties": {
                    "table": {
                      "type": "string"
                    },
                    "key": {
                      "type": ["string", "number"]
                    },
                    "row": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 9007199254740991
                    }
                  },
                  "required": ["table", "key", "row"],
                  "additionalProperties": false
                },
                "dataset": {
                  "type": "string"
                }
              },
              "additionalProperties": false
            },
            "extensions": {
              "type": "object",
              "propertyNames": {
                "type": "string",
                "pattern": "^x-[a-z0-9]+-[a-z0-9-]+$"
              },
              "additionalProperties": {
                "$ref": "#/$defs/__schema0"
              }
            },
            "id": {
              "type": "string",
              "pattern": "^[A-Za-z0-9_.:-]{1,64}$"
            },
            "source_order": {
              "type": "number"
            },
            "mode": {
              "type": "string",
              "enum": ["repeat", "weekdays", "dated"]
            },
            "cycle_length_days": {
              "type": "integer",
              "minimum": 1,
              "maximum": 9007199254740991
            },
            "repeat_count": {
              "type": "integer",
              "minimum": 1,
              "maximum": 9007199254740991
            },
            "cycles": {
              "maxItems": 52,
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "meta": {
                    "type": "object",
                    "properties": {
                      "created_at": {
                        "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)))$"
                      },
                      "updated_at": {
                        "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)))$"
                      },
                      "deleted_at": {
                        "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)))$"
                      },
                      "legacy_ref": {
                        "type": "object",
                        "properties": {
                          "table": {
                            "type": "string"
                          },
                          "key": {
                            "type": ["string", "number"]
                          },
                          "row": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 9007199254740991
                          }
                        },
                        "required": ["table", "key", "row"],
                        "additionalProperties": false
                      },
                      "dataset": {
                        "type": "string"
                      }
                    },
                    "additionalProperties": false
                  },
                  "extensions": {
                    "type": "object",
                    "propertyNames": {
                      "type": "string",
                      "pattern": "^x-[a-z0-9]+-[a-z0-9-]+$"
                    },
                    "additionalProperties": {
                      "$ref": "#/$defs/__schema0"
                    }
                  },
                  "id": {
                    "type": "string",
                    "pattern": "^[A-Za-z0-9_.:-]{1,64}$"
                  },
                  "source_order": {
                    "type": "number"
                  },
                  "index": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  "days": {
                    "maxItems": 366,
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "meta": {
                          "type": "object",
                          "properties": {
                            "created_at": {
                              "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)))$"
                            },
                            "updated_at": {
                              "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)))$"
                            },
                            "deleted_at": {
                              "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)))$"
                            },
                            "legacy_ref": {
                              "type": "object",
                              "properties": {
                                "table": {
                                  "type": "string"
                                },
                                "key": {
                                  "type": ["string", "number"]
                                },
                                "row": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                }
                              },
                              "required": ["table", "key", "row"],
                              "additionalProperties": false
                            },
                            "dataset": {
                              "type": "string"
                            }
                          },
                          "additionalProperties": false
                        },
                        "extensions": {
                          "type": "object",
                          "propertyNames": {
                            "type": "string",
                            "pattern": "^x-[a-z0-9]+-[a-z0-9-]+$"
                          },
                          "additionalProperties": {
                            "$ref": "#/$defs/__schema0"
                          }
                        },
                        "id": {
                          "type": "string",
                          "pattern": "^[A-Za-z0-9_.:-]{1,64}$"
                        },
                        "source_order": {
                          "type": "number"
                        },
                        "day_index": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        "local_date": {
                          "type": "string",
                          "format": "date",
                          "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])))$"
                        },
                        "label": {
                          "type": "string"
                        },
                        "rest_day": {
                          "type": "boolean"
                        },
                        "phase": {
                          "type": "string",
                          "pattern": "^[A-Za-z0-9_.:-]{1,64}$"
                        },
                        "sessions": {
                          "maxItems": 100,
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "workout": {
                                "type": "object",
                                "properties": {
                                  "record": {
                                    "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)$"
                                  }
                                },
                                "required": ["record"],
                                "additionalProperties": false
                              },
                              "version": {
                                "type": "object",
                                "properties": {
                                  "record": {
                                    "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)$"
                                  }
                                },
                                "required": ["record"],
                                "additionalProperties": false
                              }
                            },
                            "required": ["workout"],
                            "additionalProperties": false
                          },
                          "atomic": true
                        }
                      },
                      "required": ["id", "day_index", "rest_day", "sessions"],
                      "additionalProperties": false
                    },
                    "partType": "day"
                  }
                },
                "required": ["id", "index", "days"],
                "additionalProperties": false
              },
              "partType": "cycle"
            }
          },
          "required": ["id", "mode", "cycle_length_days", "cycles"],
          "additionalProperties": false,
          "singletonPart": "schedule"
        },
        "phases": {
          "maxItems": 52,
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "meta": {
                "type": "object",
                "properties": {
                  "created_at": {
                    "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)))$"
                  },
                  "updated_at": {
                    "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)))$"
                  },
                  "deleted_at": {
                    "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)))$"
                  },
                  "legacy_ref": {
                    "type": "object",
                    "properties": {
                      "table": {
                        "type": "string"
                      },
                      "key": {
                        "type": ["string", "number"]
                      },
                      "row": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 9007199254740991
                      }
                    },
                    "required": ["table", "key", "row"],
                    "additionalProperties": false
                  },
                  "dataset": {
                    "type": "string"
                  }
                },
                "additionalProperties": false
              },
              "extensions": {
                "type": "object",
                "propertyNames": {
                  "type": "string",
                  "pattern": "^x-[a-z0-9]+-[a-z0-9-]+$"
                },
                "additionalProperties": {
                  "$ref": "#/$defs/__schema0"
                }
              },
              "id": {
                "type": "string",
                "pattern": "^[A-Za-z0-9_.:-]{1,64}$"
              },
              "source_order": {
                "type": "number"
              },
              "title": {
                "type": "string"
              },
              "focus": {
                "type": "string"
              },
              "week_count": {
                "type": "integer",
                "minimum": 1,
                "maximum": 52
              },
              "week_targets": {
                "maxItems": 52,
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "deload": {
                      "type": "boolean"
                    },
                    "load_factor": {
                      "type": "string",
                      "pattern": "^(?:0|[1-9]\\d*)(?:\\.\\d+)?$"
                    },
                    "set_delta": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "sets": {
                      "type": "integer",
                      "minimum": 1,
                      "maximum": 9007199254740991
                    },
                    "rir_offset": {
                      "type": "number"
                    },
                    "compound_rir": {
                      "type": "number"
                    },
                    "isolation_rir": {
                      "type": "number"
                    }
                  },
                  "required": ["deload"],
                  "additionalProperties": false
                },
                "atomic": true
              }
            },
            "required": ["id", "title", "week_targets"],
            "additionalProperties": false
          },
          "partType": "phase"
        },
        "progression_rules": {
          "maxItems": 100,
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "meta": {
                "type": "object",
                "properties": {
                  "created_at": {
                    "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)))$"
                  },
                  "updated_at": {
                    "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)))$"
                  },
                  "deleted_at": {
                    "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)))$"
                  },
                  "legacy_ref": {
                    "type": "object",
                    "properties": {
                      "table": {
                        "type": "string"
                      },
                      "key": {
                        "type": ["string", "number"]
                      },
                      "row": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 9007199254740991
                      }
                    },
                    "required": ["table", "key", "row"],
                    "additionalProperties": false
                  },
                  "dataset": {
                    "type": "string"
                  }
                },
                "additionalProperties": false
              },
              "extensions": {
                "type": "object",
                "propertyNames": {
                  "type": "string",
                  "pattern": "^x-[a-z0-9]+-[a-z0-9-]+$"
                },
                "additionalProperties": {
                  "$ref": "#/$defs/__schema0"
                }
              },
              "id": {
                "type": "string",
                "pattern": "^[A-Za-z0-9_.:-]{1,64}$"
              },
              "source_order": {
                "type": "number"
              },
              "applies_to": {
                "type": "object",
                "properties": {
                  "workout": {
                    "type": "object",
                    "properties": {
                      "record": {
                        "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)$"
                      }
                    },
                    "required": ["record"],
                    "additionalProperties": false
                  },
                  "slot": {
                    "type": "string",
                    "pattern": "^[A-Za-z0-9_.:-]{1,64}$"
                  }
                },
                "required": ["workout", "slot"],
                "additionalProperties": false
              },
              "exercise": {
                "type": "object",
                "properties": {
                  "record": {
                    "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)$"
                  }
                },
                "required": ["record"],
                "additionalProperties": false
              },
              "model": {
                "type": "string",
                "minLength": 1
              },
              "params": {
                "$ref": "#/$defs/__schema0"
              }
            },
            "required": ["id", "applies_to", "model", "params"],
            "additionalProperties": false
          },
          "partType": "rule"
        }
      },
      "required": ["title", "equipment", "target_muscles", "contraindications", "phases", "progression_rules"],
      "additionalProperties": false
    },
    "run": {
      "type": "object",
      "properties": {
        "meta": {
          "type": "object",
          "properties": {
            "created_at": {
              "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)))$"
            },
            "updated_at": {
              "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)))$"
            },
            "deleted_at": {
              "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)))$"
            },
            "legacy_ref": {
              "type": "object",
              "properties": {
                "table": {
                  "type": "string"
                },
                "key": {
                  "type": ["string", "number"]
                },
                "row": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                }
              },
              "required": ["table", "key", "row"],
              "additionalProperties": false
            },
            "dataset": {
              "type": "string"
            }
          },
          "additionalProperties": false
        },
        "extensions": {
          "type": "object",
          "propertyNames": {
            "type": "string",
            "pattern": "^x-[a-z0-9]+-[a-z0-9-]+$"
          },
          "additionalProperties": {
            "$ref": "#/$defs/__schema0"
          }
        },
        "program": {
          "type": "object",
          "properties": {
            "record": {
              "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)$"
            }
          },
          "required": ["record"],
          "additionalProperties": false
        },
        "status": {
          "type": "string",
          "enum": ["draft", "active", "paused", "completed", "archived"]
        },
        "start_date": {
          "type": "string",
          "format": "date",
          "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])))$"
        },
        "end_date": {
          "type": "string",
          "format": "date",
          "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])))$"
        },
        "timezone": {
          "type": "string",
          "pattern": "^[A-Za-z][A-Za-z0-9_+.-]*(?:\\/[A-Za-z0-9_+.-]+)*$"
        },
        "preferred_weekdays": {
          "maxItems": 7,
          "type": "array",
          "items": {
            "type": "integer",
            "minimum": 0,
            "maximum": 6
          }
        },
        "time_of_day": {
          "type": "string",
          "pattern": "^(?:[01]\\d|2[0-3]):[0-5]\\d$"
        },
        "reminder": {
          "type": "object",
          "properties": {
            "enabled": {
              "type": "boolean"
            }
          },
          "required": ["enabled"],
          "additionalProperties": false
        },
        "notes": {
          "type": "string"
        },
        "paused_at": {
          "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)))$"
        },
        "ended_at": {
          "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)))$"
        },
        "previous_run": {
          "type": "object",
          "properties": {
            "record": {
              "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)$"
            }
          },
          "required": ["record"],
          "additionalProperties": false
        },
        "progression_access": {
          "type": "string",
          "enum": ["none", "pro_granted"]
        },
        "planned": {
          "maxItems": 1000,
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "meta": {
                "type": "object",
                "properties": {
                  "created_at": {
                    "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)))$"
                  },
                  "updated_at": {
                    "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)))$"
                  },
                  "deleted_at": {
                    "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)))$"
                  },
                  "legacy_ref": {
                    "type": "object",
                    "properties": {
                      "table": {
                        "type": "string"
                      },
                      "key": {
                        "type": ["string", "number"]
                      },
                      "row": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 9007199254740991
                      }
                    },
                    "required": ["table", "key", "row"],
                    "additionalProperties": false
                  },
                  "dataset": {
                    "type": "string"
                  }
                },
                "additionalProperties": false
              },
              "extensions": {
                "type": "object",
                "propertyNames": {
                  "type": "string",
                  "pattern": "^x-[a-z0-9]+-[a-z0-9-]+$"
                },
                "additionalProperties": {
                  "$ref": "#/$defs/__schema0"
                }
              },
              "id": {
                "type": "string",
                "pattern": "^[A-Za-z0-9_.:-]{1,64}$"
              },
              "source_order": {
                "type": "number"
              },
              "workout": {
                "type": "object",
                "properties": {
                  "record": {
                    "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)$"
                  }
                },
                "required": ["record"],
                "additionalProperties": false
              },
              "version": {
                "type": "object",
                "properties": {
                  "record": {
                    "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)$"
                  }
                },
                "required": ["record"],
                "additionalProperties": false
              },
              "day": {
                "type": "string",
                "pattern": "^[A-Za-z0-9_.:-]{1,64}$"
              },
              "occurrence_key": {
                "type": "string"
              },
              "planned_date": {
                "type": "string",
                "format": "date",
                "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])))$"
              },
              "scheduled_date": {
                "type": "string",
                "format": "date",
                "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])))$"
              },
              "time_of_day": {
                "type": "string",
                "pattern": "^(?:[01]\\d|2[0-3]):[0-5]\\d$"
              },
              "status": {
                "type": "string",
                "enum": ["planned", "skipped", "completed", "cancelled"]
              },
              "session": {
                "type": "object",
                "properties": {
                  "record": {
                    "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)$"
                  }
                },
                "required": ["record"],
                "additionalProperties": false
              },
              "link_source": {
                "type": "string"
              },
              "phase": {
                "type": "string",
                "pattern": "^[A-Za-z0-9_.:-]{1,64}$"
              },
              "week_index": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              "sequence_index": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              "notes": {
                "type": "string"
              }
            },
            "required": ["id", "workout", "planned_date", "scheduled_date", "status"],
            "additionalProperties": false
          },
          "partType": "planned"
        },
        "anchors": {
          "maxItems": 500,
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "meta": {
                "type": "object",
                "properties": {
                  "created_at": {
                    "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)))$"
                  },
                  "updated_at": {
                    "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)))$"
                  },
                  "deleted_at": {
                    "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)))$"
                  },
                  "legacy_ref": {
                    "type": "object",
                    "properties": {
                      "table": {
                        "type": "string"
                      },
                      "key": {
                        "type": ["string", "number"]
                      },
                      "row": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 9007199254740991
                      }
                    },
                    "required": ["table", "key", "row"],
                    "additionalProperties": false
                  },
                  "dataset": {
                    "type": "string"
                  }
                },
                "additionalProperties": false
              },
              "extensions": {
                "type": "object",
                "propertyNames": {
                  "type": "string",
                  "pattern": "^x-[a-z0-9]+-[a-z0-9-]+$"
                },
                "additionalProperties": {
                  "$ref": "#/$defs/__schema0"
                }
              },
              "id": {
                "type": "string",
                "pattern": "^[A-Za-z0-9_.:-]{1,64}$"
              },
              "source_order": {
                "type": "number"
              },
              "rule": {
                "type": "object",
                "properties": {
                  "record": {
                    "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)$"
                  },
                  "part": {
                    "type": "string",
                    "pattern": "^[A-Za-z0-9_.:-]{1,64}$"
                  }
                },
                "required": ["record", "part"],
                "additionalProperties": false
              },
              "kind": {
                "type": "string",
                "enum": ["baseline", "training_max", "manual_target", "reset", "carry_forward"]
              },
              "effective_date": {
                "type": "string",
                "format": "date",
                "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])))$"
              },
              "mass": {
                "type": "object",
                "properties": {
                  "value": {
                    "type": "string",
                    "pattern": "^(?:0|[1-9]\\d*)(?:\\.\\d+)?$"
                  },
                  "unit": {
                    "type": "string",
                    "enum": ["kg", "lb"]
                  }
                },
                "required": ["value", "unit"],
                "additionalProperties": false
              },
              "mass_kg": {
                "type": "string",
                "pattern": "^(?:0|[1-9]\\d*)(?:\\.\\d+)?$"
              },
              "reps": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              "duration_ms": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              "distance_mm": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              "source_session": {
                "type": "object",
                "properties": {
                  "record": {
                    "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)$"
                  }
                },
                "required": ["record"],
                "additionalProperties": false
              },
              "comparison_key": {
                "type": "string"
              },
              "notes": {
                "type": "string"
              }
            },
            "required": ["id", "rule", "kind", "effective_date"],
            "additionalProperties": false
          },
          "partType": "anchor"
        }
      },
      "required": ["program", "status", "timezone", "planned", "anchors"],
      "additionalProperties": false
    }
  },
  "required": ["program", "run"],
  "additionalProperties": false,
  "$defs": {
    "__schema0": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "number"
        },
        {
          "type": "boolean"
        },
        {
          "type": "null"
        },
        {
          "type": "array",
          "items": {
            "$ref": "#/$defs/__schema0"
          }
        },
        {
          "type": "object",
          "propertyNames": {
            "type": "string"
          },
          "additionalProperties": {
            "$ref": "#/$defs/__schema0"
          }
        }
      ]
    }
  },
  "$id": "https://docs.sendtopigeon.com/schemas/collection-projection@1.schema.json",
  "title": "Pigeon Open Data: collection-projection@1",
  "$comment": "Apache-2.0. Structural schema; use Zod/parseRecord for semantic invariants. This published schema URL is immutable.",
  "examples": [
    {
      "program": {
        "title": "Program",
        "equipment": [],
        "target_muscles": [],
        "contraindications": [],
        "phases": [],
        "progression_rules": [],
        "schedule": {
          "id": "schedule",
          "mode": "dated",
          "cycle_length_days": 7,
          "cycles": [],
          "repeat_count": 3
        },
        "description": "Build strength",
        "goal": "strength",
        "kind_hint": "program",
        "advance": "rolling",
        "starter": {
          "key": "demo-starter",
          "version": "1"
        }
      },
      "run": {
        "program": {
          "record": "0194ab00-0000-7000-8000-000000000001"
        },
        "status": "paused",
        "timezone": "UTC",
        "planned": [],
        "anchors": [],
        "start_date": "2026-01-01",
        "time_of_day": "09:30",
        "notes": "Program note",
        "preferred_weekdays": [1, 3, 5],
        "paused_at": "2026-01-01T00:00:00Z",
        "ended_at": "2026-01-01T00:00:00Z",
        "end_date": "2026-02-01",
        "previous_run": {
          "record": "0194ab00-0000-7000-8000-000000000001"
        },
        "progression_access": "pro_granted"
      }
    }
  ]
}
