{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "@context": [
    "https://schemas.meta-aiml.org/v3.0.0/context.jsonld"
  ],
  "@id": "https://schemas.meta-aiml.org/v3.0.0/components/structural_metadata.json",
  "@type": [
    "Thing",
    "ComponentSchema"
  ],
  "schemaVersion": "3.0.0",
  "aimlVersion": "3.0.0",
  "title": "Structural Metadata Component",
  "description": "Structural metadata for entity topology, roles, and value flows",
  "type": "object",
  "$defs": {
    "StructuralMetadata": {
      "type": "object",
      "title": "Structural Metadata",
      "description": "Information about entity structure and interactions",
      "properties": {
        "topology": {
          "type": "string",
          "description": "Network topology of interactions",
          "enum": [
            "binary",
            "triadic",
            "many_to_many",
            "hub_and_spoke",
            "peer_to_peer",
            "distributed"
          ]
        },
        "roles": {
          "type": "array",
          "description": "Roles participants play",
          "items": {
            "type": "string"
          },
          "uniqueItems": true
        },
        "valueSource": {
          "type": "string",
          "description": "Where value originates",
          "enum": [
            "platform_provided",
            "transaction_mediation",
            "user_generated",
            "content_creation",
            "protocol_execution",
            "mixed"
          ]
        },
        "transactionFlow": {
          "type": "string",
          "description": "How transactions flow",
          "enum": [
            "direct",
            "escrow",
            "direct_settlement",
            "peer_to_peer",
            "one_to_many",
            "protocol_based",
            "programmatic"
          ]
        },
        "networkEffects": {
          "type": "string",
          "description": "Type of network effects present",
          "enum": [
            "none",
            "same_side",
            "cross_side",
            "scale_dependent",
            "two_sided"
          ]
        },
        "contentOwnership": {
          "type": "string",
          "description": "Who owns content",
          "enum": [
            "platform",
            "users",
            "creators",
            "mixed"
          ]
        },
        "moderationModel": {
          "type": "string",
          "description": "How content is moderated",
          "enum": [
            "community",
            "ai_assisted",
            "human",
            "ai_assisted_human",
            "none"
          ]
        }
      }
    }
  },
  "validationMetadata": {
    "schemaVersion": "3.0.0",
    "phase": "phase_1",
    "status": "draft",
    "lastValidated": "2026-02-19",
    "validator": "META-AIML QA"
  },
  "semanticAnnotations": {
    "type": "object",
    "description": "Critical semantic notes on structural metadata ownership and immutability.",
    "properties": {
      "ownershipModel": {
        "type": "string",
        "const": "Core fields (topology, roles, valueSource, transactionFlow) are ARCHETYPE-OWNED and IMMUTABLE. Entity schemas may add EXTENSION fields only. SDK v3 validates immutability."
      },
      "entityExtensions": {
        "type": "string",
        "const": "Allowed entity-level extensions: networkEffects (qualifier), contentOwnership, liquidity, moderationModel, governanceModel, physicalConstraints, serviceMode."
      }
    }
  },
  "governanceMetadata": {
    "type": "object",
    "properties": {
      "componentVersion": {
        "type": "string",
        "const": "3.0.0"
      },
      "stabilityLevel": {
        "type": "string",
        "const": "stable"
      },
      "sdkValidationRules": {
        "type": "array",
        "const": [
          "RULE-SM-001: topology value must match archetype's declared const value.",
          "RULE-SM-002: roles array must match archetype's declared const value.",
          "RULE-SM-003: valueSource must match archetype's declared const value.",
          "RULE-SM-004: transactionFlow must match archetype's declared const value.",
          "RULE-SM-005: Entity may add extension fields not defined by archetype."
        ]
      }
    }
  },
  "examples": {
    "type": "array",
    "examples": [
      {
        "archetype": "DirectService",
        "structuralMetadata": {
          "topology": "binary",
          "roles": [
            "user",
            "platform"
          ],
          "valueSource": "platform_provided",
          "transactionFlow": "direct",
          "networkEffects": "none",
          "serviceMode": "on_premises"
        }
      },
      {
        "archetype": "MediatedExchange",
        "structuralMetadata": {
          "topology": "triadic",
          "roles": [
            "buyer",
            "seller",
            "platform"
          ],
          "valueSource": "transaction_mediation",
          "transactionFlow": "escrow",
          "networkEffects": "cross_side",
          "trustModel": "dual_rating",
          "liquidity": {
            "buyerSide": "high",
            "sellerSide": "medium"
          }
        }
      }
    ]
  },
  "$id": "https://schemas.meta-aiml.org/v3.0.0/components/structural_metadata.json"
}
