{
  "type": "object",
  "properties": {
    "schema": {
      "const": "metacore.atlas.astro-state.v1"
    },
    "publisher": {
      "const": "MetaCore AstroCore"
    },
    "served_at": {
      "type": "string",
      "format": "date-time"
    },
    "server_clock": {
      "type": "object",
      "properties": {
        "epoch_seconds": {
          "type": "number"
        },
        "utc": {
          "type": "string",
          "format": "date-time"
        },
        "basis": {
          "const": "response_server_clock"
        },
        "precision_guarantee": {
          "const": false
        }
      },
      "required": [
        "epoch_seconds",
        "utc",
        "basis",
        "precision_guarantee"
      ],
      "additionalProperties": false
    },
    "status": {
      "enum": [
        "fresh",
        "stale",
        "partial",
        "unavailable"
      ]
    },
    "fresh_channels": {
      "type": "integer",
      "minimum": 0,
      "maximum": 4
    },
    "channel_count": {
      "type": "integer",
      "minimum": 1,
      "maximum": 4
    },
    "refresh_hint_seconds": {
      "const": 60
    },
    "freshness_window_seconds": {
      "const": 180
    },
    "retention_window_seconds": {
      "const": 900
    },
    "snapshot_id": {
      "type": "string",
      "pattern": "^[a-f0-9]{64}$"
    },
    "consistency": {
      "type": "object",
      "properties": {
        "source_time_spread_seconds": {
          "type": [
            "number",
            "null"
          ]
        },
        "same_generation_guaranteed": {
          "const": false
        },
        "mixed_snapshots": {
          "type": "boolean"
        }
      },
      "required": [
        "source_time_spread_seconds",
        "same_generation_guaranteed",
        "mixed_snapshots"
      ],
      "additionalProperties": false
    },
    "channels": {
      "type": "object",
      "properties": {
        "time": {
          "type": "object",
          "properties": {
            "classification": {
              "const": "CLOCK_CONTEXT"
            },
            "freshness": {
              "enum": [
                "fresh",
                "stale",
                "expired",
                "unavailable"
              ]
            },
            "source_id": {
              "const": "astrocore.time"
            },
            "source_at": {
              "type": [
                "string",
                "null"
              ],
              "format": "date-time"
            },
            "source_epoch": {
              "type": [
                "number",
                "null"
              ]
            },
            "age_seconds": {
              "type": [
                "number",
                "null"
              ]
            },
            "valid_until": {
              "type": [
                "string",
                "null"
              ],
              "format": "date-time"
            },
            "expires_at": {
              "type": [
                "string",
                "null"
              ],
              "format": "date-time"
            },
            "source_sha256": {
              "type": [
                "string",
                "null"
              ],
              "pattern": "^[a-f0-9]{64}$"
            },
            "value": {
              "anyOf": [
                {
                  "type": "null"
                },
                {
                  "type": "object",
                  "properties": {
                    "date": {
                      "type": "string",
                      "format": "date"
                    },
                    "datetime_as_reported": {
                      "type": "string"
                    },
                    "timezone": {
                      "type": "string"
                    },
                    "local_iso": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "reference_location": {
                      "type": "object",
                      "properties": {
                        "label": {
                          "const": "Vilnius"
                        },
                        "kind": {
                          "const": "product_reference_not_viewer_location"
                        }
                      },
                      "required": [
                        "label",
                        "kind"
                      ],
                      "additionalProperties": false
                    },
                    "notice": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "date",
                    "datetime_as_reported",
                    "timezone",
                    "local_iso",
                    "reference_location",
                    "notice"
                  ],
                  "additionalProperties": false
                }
              ]
            },
            "reason": {
              "type": [
                "string",
                "null"
              ]
            }
          },
          "required": [
            "classification",
            "freshness",
            "source_id",
            "source_at",
            "source_epoch",
            "age_seconds",
            "valid_until",
            "expires_at",
            "source_sha256",
            "value",
            "reason"
          ],
          "additionalProperties": false
        },
        "planets": {
          "type": "object",
          "properties": {
            "classification": {
              "const": "CALCULATED"
            },
            "freshness": {
              "enum": [
                "fresh",
                "stale",
                "expired",
                "unavailable"
              ]
            },
            "source_id": {
              "const": "astrocore.planets"
            },
            "source_at": {
              "type": [
                "string",
                "null"
              ],
              "format": "date-time"
            },
            "source_epoch": {
              "type": [
                "number",
                "null"
              ]
            },
            "age_seconds": {
              "type": [
                "number",
                "null"
              ]
            },
            "valid_until": {
              "type": [
                "string",
                "null"
              ],
              "format": "date-time"
            },
            "expires_at": {
              "type": [
                "string",
                "null"
              ],
              "format": "date-time"
            },
            "source_sha256": {
              "type": [
                "string",
                "null"
              ],
              "pattern": "^[a-f0-9]{64}$"
            },
            "value": {
              "anyOf": [
                {
                  "type": "null"
                },
                {
                  "type": "object",
                  "properties": {
                    "planetary_positions": {
                      "type": "object",
                      "properties": {
                        "Sun": {
                          "type": "number",
                          "minimum": 0,
                          "exclusiveMaximum": 360
                        },
                        "Moon": {
                          "type": "number",
                          "minimum": 0,
                          "exclusiveMaximum": 360
                        },
                        "Mercury": {
                          "type": "number",
                          "minimum": 0,
                          "exclusiveMaximum": 360
                        },
                        "Venus": {
                          "type": "number",
                          "minimum": 0,
                          "exclusiveMaximum": 360
                        },
                        "Mars": {
                          "type": "number",
                          "minimum": 0,
                          "exclusiveMaximum": 360
                        },
                        "Jupiter": {
                          "type": "number",
                          "minimum": 0,
                          "exclusiveMaximum": 360
                        },
                        "Saturn": {
                          "type": "number",
                          "minimum": 0,
                          "exclusiveMaximum": 360
                        },
                        "Uranus": {
                          "type": "number",
                          "minimum": 0,
                          "exclusiveMaximum": 360
                        },
                        "Neptune": {
                          "type": "number",
                          "minimum": 0,
                          "exclusiveMaximum": 360
                        },
                        "Pluto": {
                          "type": "number",
                          "minimum": 0,
                          "exclusiveMaximum": 360
                        }
                      },
                      "required": [
                        "Sun",
                        "Moon",
                        "Mercury",
                        "Venus",
                        "Mars",
                        "Jupiter",
                        "Saturn",
                        "Uranus",
                        "Neptune",
                        "Pluto"
                      ],
                      "additionalProperties": false
                    },
                    "unit": {
                      "const": "degree"
                    },
                    "coordinate_frame": {
                      "const": "ecliptic_longitude"
                    },
                    "notice": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "planetary_positions",
                    "unit",
                    "coordinate_frame",
                    "notice"
                  ],
                  "additionalProperties": false
                }
              ]
            },
            "reason": {
              "type": [
                "string",
                "null"
              ]
            }
          },
          "required": [
            "classification",
            "freshness",
            "source_id",
            "source_at",
            "source_epoch",
            "age_seconds",
            "valid_until",
            "expires_at",
            "source_sha256",
            "value",
            "reason"
          ],
          "additionalProperties": false
        },
        "lunar": {
          "type": "object",
          "properties": {
            "classification": {
              "const": "CALCULATED"
            },
            "freshness": {
              "enum": [
                "fresh",
                "stale",
                "expired",
                "unavailable"
              ]
            },
            "source_id": {
              "const": "astrocore.lunar"
            },
            "source_at": {
              "type": [
                "string",
                "null"
              ],
              "format": "date-time"
            },
            "source_epoch": {
              "type": [
                "number",
                "null"
              ]
            },
            "age_seconds": {
              "type": [
                "number",
                "null"
              ]
            },
            "valid_until": {
              "type": [
                "string",
                "null"
              ],
              "format": "date-time"
            },
            "expires_at": {
              "type": [
                "string",
                "null"
              ],
              "format": "date-time"
            },
            "source_sha256": {
              "type": [
                "string",
                "null"
              ],
              "pattern": "^[a-f0-9]{64}$"
            },
            "value": {
              "anyOf": [
                {
                  "type": "null"
                },
                {
                  "type": "object",
                  "properties": {
                    "phase_label_as_reported": {
                      "type": "string"
                    },
                    "illumination_as_reported": {
                      "type": "string"
                    },
                    "illumination_percent": {
                      "type": "number",
                      "minimum": 0,
                      "maximum": 100
                    },
                    "lunar_day_as_reported": {
                      "type": "integer",
                      "minimum": 1,
                      "maximum": 31
                    },
                    "notice": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "phase_label_as_reported",
                    "illumination_as_reported",
                    "illumination_percent",
                    "lunar_day_as_reported",
                    "notice"
                  ],
                  "additionalProperties": false
                }
              ]
            },
            "reason": {
              "type": [
                "string",
                "null"
              ]
            }
          },
          "required": [
            "classification",
            "freshness",
            "source_id",
            "source_at",
            "source_epoch",
            "age_seconds",
            "valid_until",
            "expires_at",
            "source_sha256",
            "value",
            "reason"
          ],
          "additionalProperties": false
        },
        "influence": {
          "type": "object",
          "properties": {
            "classification": {
              "const": "SYMBOLIC"
            },
            "freshness": {
              "enum": [
                "fresh",
                "stale",
                "expired",
                "unavailable"
              ]
            },
            "source_id": {
              "const": "astrocore.influence"
            },
            "source_at": {
              "type": [
                "string",
                "null"
              ],
              "format": "date-time"
            },
            "source_epoch": {
              "type": [
                "number",
                "null"
              ]
            },
            "age_seconds": {
              "type": [
                "number",
                "null"
              ]
            },
            "valid_until": {
              "type": [
                "string",
                "null"
              ],
              "format": "date-time"
            },
            "expires_at": {
              "type": [
                "string",
                "null"
              ],
              "format": "date-time"
            },
            "source_sha256": {
              "type": [
                "string",
                "null"
              ],
              "pattern": "^[a-f0-9]{64}$"
            },
            "value": {
              "anyOf": [
                {
                  "type": "null"
                },
                {
                  "type": "object",
                  "properties": {
                    "dominant_energy": {
                      "type": "string"
                    },
                    "planetary_alignment": {
                      "type": "string"
                    },
                    "lunar_influence": {
                      "type": "string"
                    },
                    "cosmic_weather": {
                      "type": "string"
                    },
                    "key_aspects": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "maxItems": 45
                    },
                    "source_recommendations": {
                      "type": "array",
                      "items": {
                        "type": "string",
                        "maxLength": 240
                      },
                      "maxItems": 8
                    },
                    "aspects_count": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 90
                    },
                    "harmonious_aspects": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 90
                    },
                    "challenging_aspects": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 90
                    },
                    "causal_effect_validated": {
                      "const": false
                    },
                    "notice": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "dominant_energy",
                    "planetary_alignment",
                    "lunar_influence",
                    "cosmic_weather",
                    "key_aspects",
                    "source_recommendations",
                    "aspects_count",
                    "harmonious_aspects",
                    "challenging_aspects",
                    "causal_effect_validated",
                    "notice"
                  ],
                  "additionalProperties": false
                }
              ]
            },
            "reason": {
              "type": [
                "string",
                "null"
              ]
            }
          },
          "required": [
            "classification",
            "freshness",
            "source_id",
            "source_at",
            "source_epoch",
            "age_seconds",
            "valid_until",
            "expires_at",
            "source_sha256",
            "value",
            "reason"
          ],
          "additionalProperties": false
        }
      },
      "required": [],
      "additionalProperties": false,
      "minProperties": 1,
      "maxProperties": 4
    },
    "links": {
      "type": "object",
      "properties": {
        "documentation": {
          "type": "string",
          "format": "uri"
        },
        "catalog": {
          "type": "string",
          "format": "uri"
        },
        "schema": {
          "type": "string",
          "format": "uri"
        },
        "map": {
          "type": "string",
          "format": "uri"
        }
      },
      "required": [
        "documentation",
        "catalog",
        "schema",
        "map"
      ],
      "additionalProperties": false
    },
    "consumer_notice": {
      "type": "string"
    }
  },
  "required": [
    "schema",
    "publisher",
    "served_at",
    "server_clock",
    "status",
    "fresh_channels",
    "channel_count",
    "refresh_hint_seconds",
    "freshness_window_seconds",
    "retention_window_seconds",
    "snapshot_id",
    "consistency",
    "channels",
    "links",
    "consumer_notice"
  ],
  "additionalProperties": false,
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://aipersona.space/vr/astro-state-schema-v1.json",
  "title": "MetaCore public AstroCore state v1"
}