{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/agentic-atlas-dev/json-schema/agentic-atlas-dev-links-read-schema.json",
  "title": "Bounded relationship read",
  "description": "Every argued relationship touching one subject, inbound and outbound in one bounded response.",
  "x-generated": "2026-10-31",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/agentic-atlas-dev-openapi.json#/components/schemas/LinksRead",
  "type": "object",
  "properties": {
    "catalog_revision": {
      "type": "object",
      "description": "The active Release's Catalog revision, the same identity the X-Catalog-Revision header carries, with the provenance counts beside it.",
      "properties": {
        "revision": {
          "type": "string",
          "description": "The revision two responses must share to be comparable."
        }
      },
      "required": [
        "revision"
      ]
    },
    "subject": {
      "type": "object",
      "description": "The Node the relationships were read around."
    },
    "direction": {
      "type": "string",
      "enum": [
        "both",
        "in",
        "out"
      ],
      "description": "The direction filter this read applied."
    },
    "limit": {
      "type": "integer",
      "description": "The bound this response was read under — echoed so a caller can tell a defaulted read from one it asked for."
    },
    "inbound": {
      "$ref": "#/$defs/ReferenceView"
    },
    "outbound": {
      "$ref": "#/$defs/ReferenceView"
    }
  },
  "required": [
    "catalog_revision",
    "subject",
    "direction",
    "limit",
    "inbound",
    "outbound"
  ],
  "$defs": {
    "ReferenceView": {
      "type": "object",
      "title": "Bounded reference view",
      "description": "One side of a bounded read. There is no cursor or offset to fetch the remainder: raise `limit` toward its maximum, or narrow the subject.",
      "properties": {
        "total": {
          "type": "integer",
          "description": "How many occurrences exist on this side."
        },
        "returned": {
          "type": "integer",
          "description": "How many this response carries."
        },
        "truncated": {
          "type": "boolean",
          "description": "True when `total` exceeds `returned` — the bound cut, and what is here is a prefix."
        },
        "references": {
          "type": "array",
          "description": "The occurrences themselves, each stating its own direction and class.",
          "items": {
            "type": "object"
          }
        }
      },
      "required": [
        "total",
        "returned",
        "truncated",
        "references"
      ]
    }
  }
}