{
  "$id": "https://hotato.dev/atlas/schema/feed.schema.json",
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "description": "Stable agent surface for the Voice Failure Atlas.",
  "properties": {
    "attribution": {
      "type": "string"
    },
    "counts": {
      "properties": {
        "patterns": {
          "type": "integer"
        },
        "queued_for_review": {
          "type": "integer"
        },
        "reports": {
          "type": "integer"
        },
        "withdrawn": {
          "type": "integer"
        }
      },
      "required": [
        "patterns",
        "reports",
        "queued_for_review",
        "withdrawn"
      ],
      "type": "object"
    },
    "data_as_of": {
      "description": "The newest fetched artifact in the store. Derived from data, not from build time.",
      "type": "string"
    },
    "entries": {
      "items": {
        "properties": {
          "activity": {
            "description": "How live this mode is: independent reports plus distinct sources, divided by the time since the last report. Derived only from fields published on this entry, so it can be re-computed and checked.",
            "minimum": 0,
            "type": "number"
          },
          "affected": {
            "description": "Where this mode has been reported. Absence of a stack is absence of a report, not evidence the stack is unaffected.",
            "properties": {
              "note": {
                "type": "string"
              },
              "stacks_reported_on": {
                "items": {
                  "type": "string"
                },
                "type": "array"
              }
            },
            "type": "object"
          },
          "atlas_id": {
            "description": "The stable, quotable id for this entry (VFA-<year>-<sequence>). Assigned once and never reassigned, including after a merge.",
            "type": "string"
          },
          "content_digest": {
            "pattern": "^sha256:[0-9a-f]{64}$",
            "type": "string"
          },
          "first_seen": {
            "type": "string"
          },
          "hotato_coverage": {
            "properties": {
              "command": {
                "description": "The shipped hotato command that measures this mode on your own recording.",
                "type": "string"
              },
              "detector_kind": {
                "type": "string"
              },
              "measured": {
                "type": "boolean"
              },
              "note": {
                "type": "string"
              }
            },
            "required": [
              "measured",
              "command",
              "note"
            ],
            "type": "object"
          },
          "id": {
            "pattern": "^pat_[0-9a-f]{24}$",
            "type": "string"
          },
          "independent_sources": {
            "minimum": 0,
            "type": "integer"
          },
          "last_seen": {
            "type": "string"
          },
          "merged_into": {
            "description": "Present when this entry was folded into another as a duplicate. The address and the id both stay; follow url for the record.",
            "properties": {
              "atlas_id": {
                "type": "string"
              },
              "id": {
                "type": "string"
              },
              "merged_at": {
                "type": "string"
              },
              "url": {
                "type": "string"
              }
            },
            "required": [
              "id",
              "url"
            ],
            "type": "object"
          },
          "pattern_class": {
            "type": "string"
          },
          "references": {
            "description": "Every URL this entry stands on: the reports and the evidence behind each status move.",
            "items": {
              "properties": {
                "date": {
                  "type": "string"
                },
                "handle": {
                  "type": "string"
                },
                "note": {
                  "type": "string"
                },
                "role": {
                  "enum": [
                    "report",
                    "evidence"
                  ]
                },
                "source": {
                  "type": "string"
                },
                "url": {
                  "type": "string"
                }
              },
              "required": [
                "role",
                "url"
              ],
              "type": "object"
            },
            "type": "array"
          },
          "report_count": {
            "minimum": 0,
            "type": "integer"
          },
          "reports": {
            "items": {
              "properties": {
                "body_sha256": {
                  "type": "string"
                },
                "content_license": {
                  "type": "string"
                },
                "fetched_at": {
                  "type": "string"
                },
                "first_seen": {
                  "type": "string"
                },
                "handle": {
                  "type": "string"
                },
                "handle_url": {
                  "type": "string"
                },
                "quote": {
                  "type": "string"
                },
                "source": {
                  "type": "string"
                },
                "url": {
                  "type": "string"
                }
              },
              "required": [
                "handle",
                "url",
                "quote",
                "source"
              ],
              "type": "object"
            },
            "type": "array"
          },
          "stacks": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "statement": {
            "maxLength": 240,
            "type": "string"
          },
          "status": {
            "enum": [
              "open",
              "acknowledged",
              "fixed",
              "stale",
              "disputed",
              "withdrawn"
            ]
          },
          "status_history": {
            "items": {
              "properties": {
                "changed_at": {
                  "type": "string"
                },
                "evidence_date": {
                  "type": "string"
                },
                "evidence_quote": {
                  "type": "string"
                },
                "evidence_url": {
                  "type": "string"
                },
                "from": {
                  "enum": [
                    "open",
                    "acknowledged",
                    "fixed",
                    "stale",
                    "disputed",
                    "withdrawn"
                  ]
                },
                "to": {
                  "enum": [
                    "open",
                    "acknowledged",
                    "fixed",
                    "stale",
                    "disputed",
                    "withdrawn"
                  ]
                }
              },
              "required": [
                "from",
                "to",
                "changed_at",
                "evidence_url",
                "evidence_quote",
                "evidence_date"
              ],
              "type": "object"
            },
            "type": "array"
          },
          "url": {
            "type": "string"
          },
          "withdrawn": {
            "type": "boolean"
          }
        },
        "required": [
          "id",
          "url",
          "status"
        ],
        "type": "object"
      },
      "type": "array"
    },
    "generator": {
      "type": "string"
    },
    "home": {
      "type": "string"
    },
    "removal": {
      "properties": {
        "email": {
          "type": "string"
        },
        "honored_within_hours": {
          "type": "integer"
        },
        "method": {
          "const": "tombstone"
        },
        "policy_url": {
          "type": "string"
        }
      },
      "required": [
        "email",
        "honored_within_hours",
        "method"
      ],
      "type": "object"
    },
    "schema": {
      "const": "hotato.atlas-feed.v1"
    },
    "schema_url": {
      "type": "string"
    },
    "title": {
      "type": "string"
    }
  },
  "required": [
    "schema",
    "title",
    "home",
    "data_as_of",
    "attribution",
    "removal",
    "counts",
    "entries"
  ],
  "title": "hotato.atlas-feed.v1",
  "type": "object"
}
