{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "title": "Intercultural Micro-Story Spec",
  "description": "Culture-agnostic template for generating ultra-short stories using archetypal structures and endings.",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "archetype",
    "conflict_dyads",
    "structure",
    "setting",
    "object_motifs",
    "ending_mode",
    "word_cap",
    "register",
    "name_policy"
  ],
  "properties": {
    "version": {
      "type": "string",
      "default": "1.0.0"
    },
    "random_seed": {
      "type": "integer",
      "minimum": 0,
      "description": "Optional seed for deterministic generation."
    },
    "language": {
      "type": "string",
      "default": "en",
      "description": "BCP-47 language tag for surface realization."
    },
    "archetype": {
      "type": "string",
      "enum": [
        "trickster",
        "sage",
        "outsider",
        "naif",
        "judge",
        "caretaker",
        "partner",
        "rival",
        "fate"
      ]
    },
    "conflict_dyads": {
      "type": "array",
      "minItems": 1,
      "uniqueItems": true,
      "items": {
        "type": "string",
        "enum": [
          "haste_vs_steadiness",
          "pride_vs_humility",
          "appearance_vs_reality",
          "rule_vs_spirit",
          "fortune_vs_judgment",
          "part_vs_whole",
          "appetite_vs_prudence",
          "trust_vs_deception",
          "cooperation_vs_self_interest",
          "nature_vs_choice"
        ]
      }
    },
    "structure": {
      "type": "string",
      "enum": [
        "fable",
        "parable",
        "koan",
        "irony",
        "allegory"
      ]
    },
    "setting": {
      "type": "string",
      "enum": [
        "path",
        "threshold",
        "gathering_place",
        "workplace",
        "water_edge",
        "field",
        "marketplace",
        "court",
        "home",
        "crossroads"
      ],
      "description": "Use abstract, portable places (no geography, no era)."
    },
    "object_motifs": {
      "type": "array",
      "minItems": 1,
      "maxItems": 3,
      "uniqueItems": true,
      "items": {
        "type": "string",
        "enum": [
          "vessel",
          "rope",
          "coin",
          "map",
          "bowl",
          "cloak",
          "stick",
          "lamp",
          "scale",
          "grain",
          "salt",
          "mirror",
          "ring"
        ]
      }
    },
    "ending_mode": {
      "type": "string",
      "enum": [
        "explicit_moral",
        "implicit_beat",
        "paradox",
        "twist",
        "ellipsis"
      ]
    },
    "word_cap": {
      "type": "integer",
      "minimum": 6,
      "maximum": 200
    },
    "register": {
      "type": "string",
      "enum": [
        "oral",
        "laconic",
        "lyrical_sparse"
      ]
    },
    "name_policy": {
      "type": "string",
      "enum": [
        "none",
        "generic",
        "role_titles"
      ]
    },
    "proper_noun_cap": {
      "type": "integer",
      "minimum": 0,
      "maximum": 2,
      "default": 0,
      "description": "Hard cap on proper nouns; default 0 to avoid cultural specificity."
    },
    "moral_line_if_needed": {
      "type": "string",
      "maxLength": 120,
      "description": "Only used when ending_mode is explicit_moral. ≤12 words recommended."
    },
    "beat_template": {
      "type": "array",
      "minItems": 3,
      "maxItems": 6,
      "items": {
        "type": "object",
        "required": [
          "label",
          "goal"
        ],
        "additionalProperties": false,
        "properties": {
          "label": {
            "type": "string"
          },
          "goal": {
            "type": "string",
            "maxLength": 140
          },
          "max_sentences": {
            "type": "integer",
            "minimum": 1,
            "maximum": 3
          }
        }
      },
      "description": "Abstract beat instructions; no culture-bound content."
    },
    "constraints": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "max_sentences_total": {
          "type": "integer",
          "minimum": 1,
          "maximum": 8,
          "default": 6
        },
        "ban_list": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Words or concepts to avoid (e.g., culture-specific markers, slang)."
        },
        "imagery_domain": {
          "type": "array",
          "items": {
            "type": "string",
            "enum": [
              "body",
              "weather",
              "food",
              "tools",
              "path",
              "light_dark",
              "time"
            ]
          },
          "default": [
            "body",
            "weather",
            "food",
            "tools",
            "path"
          ]
        }
      }
    }
  }
}