{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/aimeat-io/json-schema/aimeat-io-peer-info-schema.json",
  "title": "PeerInfo",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/aimeat-io-federation-api-openapi.yml#/components/schemas/PeerInfo",
  "type": "object",
  "properties": {
    "node_id": {
      "type": "string"
    },
    "url": {
      "type": "string",
      "format": "uri"
    },
    "status": {
      "type": "string",
      "enum": [
        "active",
        "degraded",
        "offline"
      ]
    },
    "tier": {
      "type": "string",
      "enum": [
        "genesis",
        "member",
        "visiting",
        "contact"
      ],
      "default": "member",
      "description": "Trust tier, low to high: contact < visiting < member < genesis. 'contact' is the floor of the ladder — direct messages cross and nothing else does: no catalogue, no memory replication, no routing, no broadcast, no settlement, no federated auth, and the peer is absent from both nodes' public directory (peer_mode is forced to 'private'). This is where an infrastructure operator sits on a managed instance. 'visiting' = low-trust self-join (browse + request work only); 'member' = full peer, promoted by a local operator. A contact link is not promotable in one step: widening it is a re-peering decision (409 TIER_NOT_PROMOTABLE)."
    },
    "software_version": {
      "type": [
        "string",
        "null"
      ],
      "description": "Peer's AIMEAT software version (from heartbeat) — lets you see which features a peer has."
    },
    "availability": {
      "type": [
        "string",
        "null"
      ],
      "enum": [
        "temporary",
        "permanent",
        "unknown"
      ],
      "description": "Availability label derived from heartbeat uptime (Phase B)."
    },
    "expires_at": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time",
      "description": "Optional expiry for time-limited visiting peers."
    },
    "peered_since": {
      "type": "string",
      "format": "date-time"
    },
    "last_heartbeat": {
      "type": "string",
      "format": "date-time"
    },
    "share_catalogue": {
      "type": "boolean",
      "default": true,
      "description": "Whether to share catalogue data with this peer"
    },
    "replicate_memory": {
      "type": "boolean",
      "default": true,
      "description": "Whether to replicate memory entries to this peer"
    },
    "allow_routing": {
      "type": "boolean",
      "default": true,
      "description": "Traffic is forwarded from here to this peer, as a destination or as a relay hop; it does not stop that peer from sending here, which they decide on their own side."
    },
    "allow_messaging": {
      "type": "boolean",
      "default": true,
      "description": "Whether this peer may deliver direct messages, read receipts and attachment download grants here. The one capability a 'contact' peer carries. Absent on a row written before this field existed means true."
    },
    "allow_broadcast": {
      "type": "boolean",
      "default": true,
      "description": "Whether this peer's operator may announce to EVERY human on this node at once. Off for 'contact': a broadcast auto-accepts the contact for each recipient, on a link only the operator agreed to."
    },
    "allow_settlement": {
      "type": "boolean",
      "default": true,
      "description": "Whether this peer may move morsels onto this node's ledger. Off for 'contact'. This is the only unauthenticated door on the node that credits a balance."
    },
    "support_upstream": {
      "type": "boolean",
      "default": false,
      "description": "Whether this node's `support@operators` is answered by THIS peer. At most one active peer may carry it. Not a tier flag: raising the link's tier keeps the support routing."
    },
    "peer_mode": {
      "type": "string",
      "enum": [
        "federation",
        "private"
      ],
      "default": "federation",
      "description": "Peering mode controlling which federation features are enabled. Forced to 'private' at tier 'contact', which is what keeps the link out of GET /v1/federation/directory."
    }
  }
}