{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://platphormnews.com/schemas/platphorm-universal-schema-pack.json",
  "title": "PlatPhorm Universal Schema Pack",
  "description": "Shared universal schema pack for the PlatPhorm network.",
  "type": "object",
  "required": [
    "model",
    "enums",
    "defaults",
    "contracts",
    "$defs"
  ],
  "properties": {
    "model": {
      "type": "object",
      "required": ["id", "name", "version"],
      "properties": {
        "id": { "const": "platphorm-universal-model" },
        "name": { "const": "PlatPhorm Universal Model" },
        "version": { "type": "string", "const": "1.0.0" },
        "description": { "type": "string" }
      },
      "additionalProperties": false
    },
    "enums": {
      "type": "object",
      "required": [
        "environment",
        "visibility",
        "status",
        "trust_level",
        "feature_tags",
        "environment_tags",
        "governance_tags",
        "realm_type",
        "namespace_type",
        "item_type",
        "fingerprint_type",
        "edge_type"
      ],
      "properties": {
        "environment": {
          "type": "array",
          "items": {
            "type": "string",
            "enum": [
              "production",
              "staging",
              "development",
              "preview",
              "sandbox",
              "internal",
              "partner",
              "customer"
            ]
          }
        },
        "visibility": {
          "type": "array",
          "items": {
            "type": "string",
            "enum": [
              "public",
              "private",
              "unlisted",
              "network-internal",
              "agent-only",
              "partner-shared",
              "customer-isolated"
            ]
          }
        },
        "status": {
          "type": "array",
          "items": {
            "type": "string",
            "enum": [
              "active",
              "inactive",
              "draft",
              "queued",
              "running",
              "succeeded",
              "failed",
              "archived",
              "deleted"
            ]
          }
        },
        "trust_level": {
          "type": "array",
          "items": {
            "type": "string",
            "enum": [
              "low",
              "standard",
              "elevated",
              "high",
              "verified",
              "restricted",
              "network-observable"
            ]
          }
        },
        "feature_tags": {
          "type": "array",
          "items": {
            "type": "string",
            "enum": [
              "api",
              "mcp",
              "llms",
              "rss",
              "sitemap",
              "search",
              "submissions",
              "traces",
              "observability",
              "agents",
              "graph",
              "json",
              "docs",
              "podcasts",
              "feeds",
              "transcripts",
              "collections",
              "evals",
              "network",
              "status",
              "health",
              "jobs",
              "fingerprinting",
              "governance",
              "privacy",
              "analytics",
              "edge",
              "vercel"
            ]
          }
        },
        "environment_tags": {
          "type": "array",
          "items": {
            "type": "string",
            "enum": [
              "production",
              "staging",
              "development",
              "preview",
              "sandbox",
              "internal",
              "partner",
              "customer"
            ]
          }
        },
        "governance_tags": {
          "type": "array",
          "items": {
            "type": "string",
            "enum": [
              "public",
              "private",
              "unlisted",
              "network-internal",
              "agent-only",
              "partner-shared",
              "customer-isolated",
              "open-source",
              "copyright-restricted",
              "human-led",
              "ai-first",
              "human-in-the-loop",
              "trace-required",
              "fingerprint-aware",
              "retention-controlled"
            ]
          }
        },
        "realm_type": {
          "type": "array",
          "items": {
            "type": "string",
            "enum": [
              "content-platform",
              "documentation-platform",
              "observability-platform",
              "evaluation-platform",
              "data-platform",
              "search-platform",
              "network-platform",
              "application-platform",
              "experiment-platform",
              "utility-platform"
            ]
          }
        },
        "namespace_type": {
          "type": "array",
          "items": {
            "type": "string",
            "enum": [
              "api",
              "mcp",
              "observability",
              "content",
              "search",
              "ingest",
              "transcripts",
              "collections",
              "admin",
              "network",
              "evals"
            ]
          }
        },
        "item_type": {
          "type": "array",
          "items": {
            "type": "string",
            "enum": [
              "item",
              "document",
              "page",
              "resource",
              "submission",
              "source",
              "podcast",
              "episode",
              "feed",
              "transcript",
              "chapter",
              "person",
              "collection",
              "snapshot",
              "job",
              "event",
              "observation",
              "trace",
              "fingerprint",
              "request_observation",
              "edge_trace",
              "agent",
              "agent_run",
              "tool_call",
              "resource_touch",
              "agent_output",
              "eval_suite",
              "eval_run",
              "eval_case",
              "metric",
              "scorecard",
              "artifact",
              "dataset",
              "report",
              "status_report",
              "network_node"
            ]
          }
        },
        "fingerprint_type": {
          "type": "array",
          "items": {
            "type": "string",
            "enum": [
              "ja4",
              "ja4h",
              "ja4s",
              "ua_hash",
              "route_digest",
              "vercel_digest",
              "tool_signature",
              "agent_signature"
            ]
          }
        },
        "edge_type": {
          "type": "array",
          "items": {
            "type": "string",
            "enum": [
              "references",
              "derived_from",
              "mirrors",
              "routes_to",
              "curated_into",
              "observes",
              "alerts_on",
              "scores",
              "indexes",
              "summarizes"
            ]
          }
        }
      },
      "additionalProperties": false
    },
    "defaults": {
      "type": "object",
      "required": [
        "environment",
        "visibility",
        "status",
        "trust_level",
        "governance_profile",
        "observability_profile",
        "trace_capture",
        "fingerprint_capture",
        "provenance_capture",
        "agent_execution_capture",
        "search_indexing",
        "api_enabled",
        "mcp_enabled",
        "llms_enabled",
        "sitemap_enabled",
        "health_enabled",
        "docs_enabled",
        "network_visible",
        "feature_tags",
        "environment_tags",
        "governance_tags"
      ],
      "properties": {
        "environment": { "const": "production" },
        "visibility": { "const": "public" },
        "status": { "const": "active" },
        "trust_level": { "const": "standard" },
        "governance_profile": { "type": "string", "const": "open-network" },
        "observability_profile": { "type": "string", "const": "platphorm-default" },
        "trace_capture": { "type": "boolean", "const": true },
        "fingerprint_capture": { "type": "boolean", "const": true },
        "provenance_capture": { "type": "boolean", "const": true },
        "agent_execution_capture": { "type": "boolean", "const": true },
        "search_indexing": { "type": "boolean", "const": true },
        "api_enabled": { "type": "boolean", "const": true },
        "mcp_enabled": { "type": "boolean", "const": true },
        "llms_enabled": { "type": "boolean", "const": true },
        "sitemap_enabled": { "type": "boolean", "const": true },
        "health_enabled": { "type": "boolean", "const": true },
        "docs_enabled": { "type": "boolean", "const": true },
        "network_visible": { "type": "boolean", "const": true },
        "feature_tags": { "type": "array", "items": { "type": "string" }, "default": [] },
        "environment_tags": { "type": "array", "items": { "type": "string" }, "default": [] },
        "governance_tags": { "type": "array", "items": { "type": "string" }, "default": [] }
      },
      "additionalProperties": false
    },
    "contracts": {
      "type": "object",
      "required": [
        "site_contract",
        "api_contract",
        "mcp_contract",
        "discovery_contract"
      ],
      "properties": {
        "site_contract": {
          "type": "object",
          "required": [
            "required_routes",
            "required_capabilities"
          ],
          "properties": {
            "required_routes": {
              "type": "array",
              "items": {
                "type": "string",
                "enum": [
                  "/",
                  "/api/health",
                  "/api/docs",
                  "/api/mcp",
                  "/llms.txt",
                  "/llms-full.txt",
                  "/llms-index.json",
                  "/robots.txt",
                  "/sitemap.xml",
                  "/manifest.webmanifest"
                ]
              }
            },
            "recommended_routes": {
              "type": "array",
              "items": { "type": "string" },
              "default": ["/about", "/search", "/explore", "/status", "/network"]
            },
            "required_capabilities": {
              "type": "object",
              "required": ["api", "mcp", "health", "llms", "sitemap", "robots"],
              "properties": {
                "api": { "type": "boolean", "const": true },
                "mcp": { "type": "boolean", "const": true },
                "health": { "type": "boolean", "const": true },
                "llms": { "type": "boolean", "const": true },
                "sitemap": { "type": "boolean", "const": true },
                "robots": { "type": "boolean", "const": true }
              },
              "additionalProperties": false
            }
          },
          "additionalProperties": false
        },
        "api_contract": {
          "type": "object",
          "required": ["global_endpoints", "universe_endpoints", "realm_endpoints"],
          "properties": {
            "global_endpoints": {
              "type": "array",
              "items": {
                "type": "string",
                "enum": [
                  "/v0/maxitem",
                  "/v0/updates",
                  "/v0/item/{id}",
                  "/v0/items?ids=1,2,3",
                  "/v0/search?q={query}"
                ]
              }
            },
            "universe_endpoints": {
              "type": "array",
              "items": {
                "type": "string",
                "enum": [
                  "/v0/universes",
                  "/v0/universe/{id}",
                  "/v0/universe/{id}/realms"
                ]
              }
            },
            "realm_endpoints": {
              "type": "array",
              "items": {
                "type": "string",
                "enum": [
                  "/v0/realms",
                  "/v0/realm/{id}",
                  "/v0/realm/{id}/items",
                  "/v0/realm/{id}/updates",
                  "/v0/realm/{id}/agents",
                  "/v0/realm/{id}/events",
                  "/v0/realm/{id}/observations"
                ]
              }
            },
            "trace_endpoints": {
              "type": "array",
              "items": { "type": "string" },
              "default": [
                "/v0/trace/{traceId}",
                "/v0/request/{requestId}",
                "/v0/event/{id}",
                "/v0/observation/{id}",
                "/v0/provenance/{itemId}"
              ]
            },
            "fingerprint_endpoints": {
              "type": "array",
              "items": { "type": "string" },
              "default": [
                "/v0/fingerprint/{id}",
                "/v0/fingerprint/{id}/requests",
                "/v0/request/{requestId}/fingerprints"
              ]
            },
            "agent_endpoints": {
              "type": "array",
              "items": { "type": "string" },
              "default": [
                "/v0/agent/{id}",
                "/v0/agent-run/{id}",
                "/v0/agent-run/{id}/tool-calls",
                "/v0/agent-run/{id}/resources",
                "/v0/agent-run/{id}/outputs"
              ]
            }
          },
          "additionalProperties": false
        },
        "mcp_contract": {
          "type": "object",
          "required": ["required_server_route", "required_tools", "required_resources"],
          "properties": {
            "required_server_route": { "type": "string", "const": "/api/mcp" },
            "required_tools": {
              "type": "array",
              "items": {
                "type": "string",
                "enum": [
                  "network.get_universe",
                  "network.list_realms",
                  "network.get_realm",
                  "network.get_trace",
                  "network.get_request",
                  "network.get_provenance",
                  "network.get_fingerprint",
                  "network.get_agent_run",
                  "content.get_item",
                  "content.search"
                ]
              }
            },
            "required_resources": {
              "type": "array",
              "items": {
                "type": "string",
                "enum": [
                  "resource://universes/{id}",
                  "resource://realms/{id}",
                  "resource://items/{id}",
                  "resource://traces/{traceId}",
                  "resource://requests/{requestId}",
                  "resource://provenance/{itemId}",
                  "resource://fingerprints/{id}",
                  "resource://agent-runs/{id}"
                ]
              }
            },
            "required_prompts": {
              "type": "array",
              "items": { "type": "string" },
              "default": [
                "trace-item-lineage",
                "summarize-agent-execution",
                "explain-cross-realm-relationships",
                "assess-fingerprint-trust",
                "build-topic-brief"
              ]
            }
          },
          "additionalProperties": false
        },
        "discovery_contract": {
          "type": "object",
          "required": ["required_files"],
          "properties": {
            "required_files": {
              "type": "array",
              "items": {
                "type": "string",
                "enum": [
                  "/llms.txt",
                  "/llms-full.txt",
                  "/llms-index.json",
                  "/robots.txt",
                  "/sitemap.xml",
                  "/manifest.webmanifest"
                ]
              }
            },
            "recommended_files": {
              "type": "array",
              "items": { "type": "string" },
              "default": ["/rss.xml", "/openapi.json", "/api/docs"]
            }
          },
          "additionalProperties": false
        }
      },
      "additionalProperties": false
    },
    "$defs": {
      "idInteger": {
        "type": "integer",
        "minimum": 1
      },
      "timestamp": {
        "type": "string",
        "format": "date-time"
      },
      "url": {
        "type": "string",
        "format": "uri"
      },
      "slug": {
        "type": "string",
        "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$"
      },
      "fqid": {
        "type": "string",
        "pattern": "^[a-z0-9-]+\\.[a-z0-9-]+\\.[a-z0-9-]+\\.[a-z0-9_]+\\.[0-9]+$"
      },
      "graphUri": {
        "type": "string",
        "pattern": "^graph:\\/\\/[a-z0-9-]+\\/[a-z0-9-]+\\/[a-z0-9-]+\\/[a-z0-9_]+\\/[0-9]+$"
      },
      "tags": {
        "type": "array",
        "items": { "type": "string" },
        "uniqueItems": true,
        "default": []
      },
      "commonPolicyProfile": {
        "type": "object",
        "properties": {
          "private_feed_handling": { "type": "string", "default": "vaulted" },
          "transcript_exposure": { "type": "string", "default": "inherit-visibility" },
          "fingerprint_capture": { "type": "string", "default": "enabled" },
          "agent_write_policy": { "type": "string", "default": "restricted-write" },
          "cross_realm_sharing": { "type": "string", "default": "allow-with-policy" },
          "search_indexing": { "type": "string", "default": "enabled-if-public" }
        },
        "additionalProperties": true,
        "default": {}
      },
      "universe": {
        "type": "object",
        "required": [
          "id",
          "slug",
          "name",
          "environment",
          "visibility",
          "trust_level",
          "feature_tags",
          "environment_tags",
          "governance_tags"
        ],
        "properties": {
          "id": { "$ref": "#/$defs/idInteger" },
          "slug": { "$ref": "#/$defs/slug" },
          "name": { "type": "string", "minLength": 1 },
          "description": { "type": ["string", "null"], "default": null },
          "owner_org": { "type": ["string", "null"], "default": null },
          "environment": {
            "type": "string",
            "enum": ["production", "staging", "development", "preview", "sandbox", "internal", "partner", "customer"],
            "default": "production"
          },
          "visibility": {
            "type": "string",
            "enum": ["public", "private", "unlisted", "network-internal", "agent-only", "partner-shared", "customer-isolated"],
            "default": "public"
          },
          "trust_level": {
            "type": "string",
            "enum": ["low", "standard", "elevated", "high", "verified", "restricted", "network-observable"],
            "default": "network-observable"
          },
          "feature_tags": { "$ref": "#/$defs/tags" },
          "environment_tags": { "$ref": "#/$defs/tags" },
          "governance_tags": { "$ref": "#/$defs/tags" },
          "defaults": {
            "type": "object",
            "properties": {
              "trace_capture": { "type": "boolean", "default": true },
              "fingerprint_capture": { "type": "boolean", "default": true },
              "agent_execution_capture": { "type": "boolean", "default": true },
              "network_visible": { "type": "boolean", "default": true }
            },
            "additionalProperties": false,
            "default": {}
          }
        },
        "additionalProperties": false
      },
      "realm": {
        "type": "object",
        "required": [
          "id",
          "universe_id",
          "slug",
          "name",
          "realm_type",
          "primary_domain",
          "canonical_url",
          "environment",
          "visibility",
          "feature_tags",
          "environment_tags",
          "governance_tags"
        ],
        "properties": {
          "id": { "$ref": "#/$defs/idInteger" },
          "universe_id": { "$ref": "#/$defs/idInteger" },
          "slug": { "$ref": "#/$defs/slug" },
          "name": { "type": "string", "minLength": 1 },
          "realm_type": {
            "type": "string",
            "enum": [
              "content-platform",
              "documentation-platform",
              "observability-platform",
              "evaluation-platform",
              "data-platform",
              "search-platform",
              "network-platform",
              "application-platform",
              "experiment-platform",
              "utility-platform"
            ]
          },
          "primary_domain": { "type": "string", "minLength": 1 },
          "canonical_url": { "$ref": "#/$defs/url" },
          "network_manifest_url": { "anyOf": [{ "$ref": "#/$defs/url" }, { "type": "null" }], "default": null },
          "llms_url": { "anyOf": [{ "$ref": "#/$defs/url" }, { "type": "null" }], "default": null },
          "mcp_url": { "anyOf": [{ "$ref": "#/$defs/url" }, { "type": "null" }], "default": null },
          "docs_url": { "anyOf": [{ "$ref": "#/$defs/url" }, { "type": "null" }], "default": null },
          "health_url": { "anyOf": [{ "$ref": "#/$defs/url" }, { "type": "null" }], "default": null },
          "environment": {
            "type": "string",
            "enum": ["production", "staging", "development", "preview", "sandbox", "internal", "partner", "customer"],
            "default": "production"
          },
          "visibility": {
            "type": "string",
            "enum": ["public", "private", "unlisted", "network-internal", "agent-only", "partner-shared", "customer-isolated"],
            "default": "public"
          },
          "status": {
            "type": "string",
            "enum": ["active", "inactive", "draft", "queued", "running", "succeeded", "failed", "archived", "deleted"],
            "default": "active"
          },
          "feature_tags": { "$ref": "#/$defs/tags" },
          "environment_tags": { "$ref": "#/$defs/tags" },
          "governance_tags": { "$ref": "#/$defs/tags" },
          "capabilities": {
            "type": "object",
            "properties": {
              "content_types": {
                "type": "array",
                "items": { "type": "string" },
                "uniqueItems": true
              }
            },
            "additionalProperties": true,
            "default": {}
          },
          "policy_profile": { "$ref": "#/$defs/commonPolicyProfile" },
          "observability_profile": {
            "type": "string",
            "default": "platphorm-default"
          },
          "fingerprint_profile": {
            "type": "string",
            "default": "platphorm-default"
          }
        },
        "additionalProperties": false
      },
      "namespace": {
        "type": "object",
        "required": [
          "id",
          "realm_id",
          "slug",
          "name",
          "namespace_type",
          "version"
        ],
        "properties": {
          "id": { "$ref": "#/$defs/idInteger" },
          "realm_id": { "$ref": "#/$defs/idInteger" },
          "slug": { "$ref": "#/$defs/slug" },
          "name": { "type": "string", "minLength": 1 },
          "namespace_type": {
            "type": "string",
            "enum": [
              "api",
              "mcp",
              "observability",
              "content",
              "search",
              "ingest",
              "transcripts",
              "collections",
              "admin",
              "network",
              "evals"
            ]
          },
          "version": { "type": "string", "minLength": 1 },
          "api_prefix": { "type": ["string", "null"], "default": null },
          "mcp_resource_prefix": { "type": ["string", "null"], "default": null },
          "active": { "type": "boolean", "default": true }
        },
        "additionalProperties": false
      },
      "baseItem": {
        "type": "object",
        "required": [
          "id",
          "public_id",
          "fqid",
          "graph_uri",
          "type",
          "universe_id",
          "realm_id",
          "namespace_id",
          "time",
          "canonical_url",
          "environment",
          "visibility",
          "status",
          "feature_tags",
          "environment_tags",
          "governance_tags",
          "dead",
          "deleted",
          "metadata"
        ],
        "properties": {
          "id": { "$ref": "#/$defs/idInteger" },
          "public_id": { "type": "string", "pattern": "^[a-z]+_[0-9]+$" },
          "fqid": { "$ref": "#/$defs/fqid" },
          "graph_uri": { "$ref": "#/$defs/graphUri" },
          "type": { "type": "string" },
          "title": { "type": ["string", "null"], "default": null },
          "description": { "type": ["string", "null"], "default": null },
          "universe_id": { "$ref": "#/$defs/idInteger" },
          "realm_id": { "$ref": "#/$defs/idInteger" },
          "namespace_id": { "$ref": "#/$defs/idInteger" },
          "time": { "type": "integer", "minimum": 0 },
          "observed_at": { "anyOf": [{ "$ref": "#/$defs/timestamp" }, { "type": "null" }], "default": null },
          "canonical_url": { "$ref": "#/$defs/url" },
          "environment": {
            "type": "string",
            "enum": ["production", "staging", "development", "preview", "sandbox", "internal", "partner", "customer"],
            "default": "production"
          },
          "visibility": {
            "type": "string",
            "enum": ["public", "private", "unlisted", "network-internal", "agent-only", "partner-shared", "customer-isolated"],
            "default": "public"
          },
          "status": {
            "type": "string",
            "enum": ["active", "inactive", "draft", "queued", "running", "succeeded", "failed", "archived", "deleted"],
            "default": "active"
          },
          "feature_tags": { "$ref": "#/$defs/tags" },
          "environment_tags": { "$ref": "#/$defs/tags" },
          "governance_tags": { "$ref": "#/$defs/tags" },
          "trace_id": { "type": ["string", "null"], "default": null },
          "correlation_id": { "type": ["string", "null"], "default": null },
          "request_id": { "type": ["string", "null"], "default": null },
          "fingerprint_id": { "anyOf": [{ "$ref": "#/$defs/idInteger" }, { "type": "null" }], "default": null },
          "source_event_id": { "anyOf": [{ "$ref": "#/$defs/idInteger" }, { "type": "null" }], "default": null },
          "ingest_job_id": { "anyOf": [{ "$ref": "#/$defs/idInteger" }, { "type": "null" }], "default": null },
          "parser_version": { "type": ["string", "null"], "default": null },
          "schema_version": { "type": ["string", "null"], "default": null },
          "provenance_status": { "type": ["string", "null"], "default": null },
          "score": { "type": ["number", "null"], "default": null },
          "dead": { "type": "boolean", "default": false },
          "deleted": { "type": "boolean", "default": false },
          "metadata": { "type": "object", "default": {} }
        },
        "additionalProperties": false
      },
      "podcast": {
        "allOf": [
          { "$ref": "#/$defs/baseItem" },
          {
            "type": "object",
            "required": ["type", "slug", "feed_id", "feed_url", "episode_count", "aliases"],
            "properties": {
              "type": { "const": "podcast" },
              "slug": { "$ref": "#/$defs/slug" },
              "feed_id": { "$ref": "#/$defs/idInteger" },
              "feed_url": { "$ref": "#/$defs/url" },
              "site_url": { "anyOf": [{ "$ref": "#/$defs/url" }, { "type": "null" }], "default": null },
              "image": { "type": ["string", "null"], "default": null },
              "language": { "type": ["string", "null"], "default": null },
              "categories": {
                "type": "array",
                "items": { "type": "string" },
                "default": []
              },
              "episode_count": { "type": "integer", "minimum": 0 },
              "last_episode_id": { "anyOf": [{ "$ref": "#/$defs/idInteger" }, { "type": "null" }], "default": null },
              "aliases": {
                "type": "array",
                "items": { "type": "string" },
                "default": []
              }
            },
            "additionalProperties": false
          }
        ]
      },
      "episode": {
        "allOf": [
          { "$ref": "#/$defs/baseItem" },
          {
            "type": "object",
            "required": ["type", "podcast_id", "feed_id", "guid", "slug"],
            "properties": {
              "type": { "const": "episode" },
              "podcast_id": { "$ref": "#/$defs/idInteger" },
              "feed_id": { "$ref": "#/$defs/idInteger" },
              "guid": { "type": "string", "minLength": 1 },
              "slug": { "$ref": "#/$defs/slug" },
              "description_html": { "type": ["string", "null"], "default": null },
              "description_text": { "type": ["string", "null"], "default": null },
              "audio_url": { "anyOf": [{ "$ref": "#/$defs/url" }, { "type": "null" }], "default": null },
              "audio_mime_type": { "type": ["string", "null"], "default": null },
              "audio_bytes": { "type": ["integer", "null"], "minimum": 0, "default": null },
              "duration_seconds": { "type": ["integer", "null"], "minimum": 0, "default": null },
              "published_at": { "anyOf": [{ "$ref": "#/$defs/timestamp" }, { "type": "null" }], "default": null },
              "image": { "type": ["string", "null"], "default": null },
              "explicit": { "type": ["boolean", "null"], "default": null },
              "episode_number": { "type": ["integer", "null"], "minimum": 0, "default": null },
              "season_number": { "type": ["integer", "null"], "minimum": 0, "default": null },
              "transcript_id": { "anyOf": [{ "$ref": "#/$defs/idInteger" }, { "type": "null" }], "default": null },
              "chapter_ids": {
                "type": "array",
                "items": { "$ref": "#/$defs/idInteger" },
                "default": []
              },
              "person_ids": {
                "type": "array",
                "items": { "$ref": "#/$defs/idInteger" },
                "default": []
              },
              "snapshot_id": { "anyOf": [{ "$ref": "#/$defs/idInteger" }, { "type": "null" }], "default": null }
            },
            "additionalProperties": false
          }
        ]
      },
      "document": {
        "allOf": [
          { "$ref": "#/$defs/baseItem" },
          {
            "type": "object",
            "required": ["type", "slug"],
            "properties": {
              "type": { "const": "document" },
              "slug": { "$ref": "#/$defs/slug" },
              "source_url": { "anyOf": [{ "$ref": "#/$defs/url" }, { "type": "null" }], "default": null },
              "content_type": { "type": ["string", "null"], "default": null },
              "version_label": { "type": ["string", "null"], "default": null },
              "author": { "type": ["string", "null"], "default": null },
              "published_at": { "anyOf": [{ "$ref": "#/$defs/timestamp" }, { "type": "null" }], "default": null },
              "updated_at": { "anyOf": [{ "$ref": "#/$defs/timestamp" }, { "type": "null" }], "default": null }
            },
            "additionalProperties": false
          }
        ]
      },
      "trace": {
        "allOf": [
          { "$ref": "#/$defs/baseItem" },
          {
            "type": "object",
            "required": ["type", "status"],
            "properties": {
              "type": { "const": "trace" },
              "root_request_id": { "type": ["string", "null"], "default": null },
              "root_event_id": { "anyOf": [{ "$ref": "#/$defs/idInteger" }, { "type": "null" }], "default": null },
              "started_at": { "anyOf": [{ "$ref": "#/$defs/timestamp" }, { "type": "null" }], "default": null },
              "completed_at": { "anyOf": [{ "$ref": "#/$defs/timestamp" }, { "type": "null" }], "default": null },
              "duration_ms": { "type": ["integer", "null"], "minimum": 0, "default": null },
              "agent_run_ids": {
                "type": "array",
                "items": { "$ref": "#/$defs/idInteger" },
                "default": []
              },
              "event_ids": {
                "type": "array",
                "items": { "$ref": "#/$defs/idInteger" },
                "default": []
              },
              "observation_ids": {
                "type": "array",
                "items": { "$ref": "#/$defs/idInteger" },
                "default": []
              }
            },
            "additionalProperties": false
          }
        ]
      },
      "event": {
        "type": "object",
        "required": ["id", "event_type", "time"],
        "properties": {
          "id": { "$ref": "#/$defs/idInteger" },
          "universe_id": { "anyOf": [{ "$ref": "#/$defs/idInteger" }, { "type": "null" }], "default": null },
          "realm_id": { "anyOf": [{ "$ref": "#/$defs/idInteger" }, { "type": "null" }], "default": null },
          "event_type": { "type": "string", "minLength": 1 },
          "severity": { "type": "string", "default": "info" },
          "status": { "type": ["string", "null"], "default": null },
          "trace_id": { "type": ["string", "null"], "default": null },
          "correlation_id": { "type": ["string", "null"], "default": null },
          "request_id": { "type": ["string", "null"], "default": null },
          "actor_type": { "type": ["string", "null"], "default": null },
          "actor_id": { "type": ["string", "null"], "default": null },
          "target_type": { "type": ["string", "null"], "default": null },
          "target_id": { "type": ["string", "null"], "default": null },
          "message": { "type": ["string", "null"], "default": null },
          "payload": { "type": "object", "default": {} },
          "time": { "$ref": "#/$defs/timestamp" }
        },
        "additionalProperties": false
      },
      "observation": {
        "type": "object",
        "required": ["id", "subject_type", "subject_id", "metric_name", "observed_at"],
        "properties": {
          "id": { "$ref": "#/$defs/idInteger" },
          "universe_id": { "anyOf": [{ "$ref": "#/$defs/idInteger" }, { "type": "null" }], "default": null },
          "realm_id": { "anyOf": [{ "$ref": "#/$defs/idInteger" }, { "type": "null" }], "default": null },
          "subject_type": { "type": "string" },
          "subject_id": { "type": "string" },
          "metric_name": { "type": "string" },
          "metric_value": { "type": ["number", "null"], "default": null },
          "metric_text": { "type": ["string", "null"], "default": null },
          "metric_unit": { "type": ["string", "null"], "default": null },
          "confidence": { "type": ["number", "null"], "default": null },
          "trace_id": { "type": ["string", "null"], "default": null },
          "observed_at": { "$ref": "#/$defs/timestamp" },
          "metadata": { "type": "object", "default": {} }
        },
        "additionalProperties": false
      },
      "provenanceEdge": {
        "type": "object",
        "required": ["id", "from_type", "from_id", "to_type", "to_id", "edge_type", "time"],
        "properties": {
          "id": { "$ref": "#/$defs/idInteger" },
          "from_type": { "type": "string" },
          "from_id": { "$ref": "#/$defs/idInteger" },
          "to_type": { "type": "string" },
          "to_id": { "$ref": "#/$defs/idInteger" },
          "edge_type": {
            "type": "string",
            "enum": [
              "references",
              "derived_from",
              "mirrors",
              "routes_to",
              "curated_into",
              "observes",
              "alerts_on",
              "scores",
              "indexes",
              "summarizes"
            ]
          },
          "created_by": { "type": ["string", "null"], "default": null },
          "created_by_agent_id": { "anyOf": [{ "$ref": "#/$defs/idInteger" }, { "type": "null" }], "default": null },
          "trace_id": { "type": ["string", "null"], "default": null },
          "time": { "$ref": "#/$defs/timestamp" },
          "metadata": { "type": "object", "default": {} }
        },
        "additionalProperties": false
      },
      "fingerprint": {
        "type": "object",
        "required": ["id", "fingerprint_type", "fingerprint_value", "first_seen_at", "last_seen_at"],
        "properties": {
          "id": { "$ref": "#/$defs/idInteger" },
          "realm_id": { "anyOf": [{ "$ref": "#/$defs/idInteger" }, { "type": "null" }], "default": null },
          "fingerprint_type": {
            "type": "string",
            "enum": [
              "ja4",
              "ja4h",
              "ja4s",
              "ua_hash",
              "route_digest",
              "vercel_digest",
              "tool_signature",
              "agent_signature"
            ]
          },
          "fingerprint_value": { "type": "string", "minLength": 1 },
          "normalized_value": { "type": ["string", "null"], "default": null },
          "classification": { "type": ["string", "null"], "default": null },
          "confidence": { "type": ["number", "null"], "default": null },
          "trust_score": { "type": ["number", "null"], "default": null },
          "first_seen_at": { "$ref": "#/$defs/timestamp" },
          "last_seen_at": { "$ref": "#/$defs/timestamp" },
          "notes": { "type": ["string", "null"], "default": null },
          "metadata": { "type": "object", "default": {} }
        },
        "additionalProperties": false
      },
      "requestObservation": {
        "type": "object",
        "required": ["id", "request_id", "observed_at"],
        "properties": {
          "id": { "$ref": "#/$defs/idInteger" },
          "universe_id": { "anyOf": [{ "$ref": "#/$defs/idInteger" }, { "type": "null" }], "default": null },
          "realm_id": { "anyOf": [{ "$ref": "#/$defs/idInteger" }, { "type": "null" }], "default": null },
          "request_id": { "type": "string", "minLength": 1 },
          "trace_id": { "type": ["string", "null"], "default": null },
          "correlation_id": { "type": ["string", "null"], "default": null },
          "fingerprint_id": { "anyOf": [{ "$ref": "#/$defs/idInteger" }, { "type": "null" }], "default": null },
          "method": { "type": ["string", "null"], "default": null },
          "path": { "type": ["string", "null"], "default": null },
          "host": { "type": ["string", "null"], "default": null },
          "edge_region": { "type": ["string", "null"], "default": null },
          "runtime": { "type": ["string", "null"], "default": null },
          "latency_ms": { "type": ["integer", "null"], "minimum": 0, "default": null },
          "status_code": { "type": ["integer", "null"], "minimum": 100, "maximum": 599, "default": null },
          "cache_status": { "type": ["string", "null"], "default": null },
          "bot_score": { "type": ["number", "null"], "default": null },
          "trust_score": { "type": ["number", "null"], "default": null },
          "observed_at": { "$ref": "#/$defs/timestamp" },
          "metadata": { "type": "object", "default": {} }
        },
        "additionalProperties": false
      },
      "edgeTrace": {
        "type": "object",
        "required": ["id", "request_id", "time"],
        "properties": {
          "id": { "$ref": "#/$defs/idInteger" },
          "request_id": { "type": "string" },
          "trace_id": { "type": ["string", "null"], "default": null },
          "edge_node": { "type": ["string", "null"], "default": null },
          "route_signature": { "type": ["string", "null"], "default": null },
          "digest": { "type": ["string", "null"], "default": null },
          "source_ip_classification": { "type": ["string", "null"], "default": null },
          "destination_service": { "type": ["string", "null"], "default": null },
          "policy_decision": { "type": ["string", "null"], "default": null },
          "firewall_action": { "type": ["string", "null"], "default": null },
          "time": { "$ref": "#/$defs/timestamp" },
          "metadata": { "type": "object", "default": {} }
        },
        "additionalProperties": false
      },
      "agent": {
        "type": "object",
        "required": ["id", "slug", "name", "agent_type", "active", "created_at", "updated_at"],
        "properties": {
          "id": { "$ref": "#/$defs/idInteger" },
          "realm_id": { "anyOf": [{ "$ref": "#/$defs/idInteger" }, { "type": "null" }], "default": null },
          "slug": { "$ref": "#/$defs/slug" },
          "name": { "type": "string", "minLength": 1 },
          "agent_type": { "type": "string", "minLength": 1 },
          "capability_profile": { "type": "object", "default": {} },
          "trust_level": {
            "type": ["string", "null"],
            "enum": ["low", "standard", "elevated", "high", "verified", "restricted", "network-observable", null],
            "default": null
          },
          "active": { "type": "boolean", "default": true },
          "created_at": { "$ref": "#/$defs/timestamp" },
          "updated_at": { "$ref": "#/$defs/timestamp" }
        },
        "additionalProperties": false
      },
      "agentRun": {
        "type": "object",
        "required": ["id", "agent_id", "status", "started_at"],
        "properties": {
          "id": { "$ref": "#/$defs/idInteger" },
          "agent_id": { "$ref": "#/$defs/idInteger" },
          "realm_id": { "anyOf": [{ "$ref": "#/$defs/idInteger" }, { "type": "null" }], "default": null },
          "trace_id": { "type": ["string", "null"], "default": null },
          "correlation_id": { "type": ["string", "null"], "default": null },
          "session_id": { "type": ["string", "null"], "default": null },
          "trigger_type": { "type": ["string", "null"], "default": null },
          "trigger_id": { "type": ["string", "null"], "default": null },
          "status": {
            "type": "string",
            "enum": ["active", "inactive", "draft", "queued", "running", "succeeded", "failed", "archived", "deleted"]
          },
          "started_at": { "$ref": "#/$defs/timestamp" },
          "completed_at": { "anyOf": [{ "$ref": "#/$defs/timestamp" }, { "type": "null" }], "default": null },
          "metadata": { "type": "object", "default": {} }
        },
        "additionalProperties": false
      },
      "toolCall": {
        "type": "object",
        "required": ["id", "agent_run_id", "tool_name", "status", "started_at"],
        "properties": {
          "id": { "$ref": "#/$defs/idInteger" },
          "agent_run_id": { "$ref": "#/$defs/idInteger" },
          "tool_name": { "type": "string", "minLength": 1 },
          "input_hash": { "type": ["string", "null"], "default": null },
          "output_hash": { "type": ["string", "null"], "default": null },
          "status": {
            "type": "string",
            "enum": ["active", "inactive", "draft", "queued", "running", "succeeded", "failed", "archived", "deleted"]
          },
          "duration_ms": { "type": ["integer", "null"], "minimum": 0, "default": null },
          "error_code": { "type": ["string", "null"], "default": null },
          "trace_id": { "type": ["string", "null"], "default": null },
          "started_at": { "$ref": "#/$defs/timestamp" },
          "completed_at": { "anyOf": [{ "$ref": "#/$defs/timestamp" }, { "type": "null" }], "default": null },
          "metadata": { "type": "object", "default": {} }
        },
        "additionalProperties": false
      }
    }
  },
  "additionalProperties": false
}
