{
  "schemaVersion": 2,
  "policyVersion": "4.0.0",
  "id": "artifact-schemas",
  "title": "Optional Domain Engineering artifact contracts",
  "ruleClass": "advisory",
  "maximumAutomaticLevel": "advisory",
  "note": "These schemas validate explicitly requested modeling artifacts. They never create a write or completion prerequisite.",
  "artifacts": {
    "domain-map": {
      "title": "Domain Map",
      "file": "domain-map.json",
      "recommendedForProfiles": ["domain-driven", "distributed-domain"],
      "neverForProfiles": ["no-code", "simple", "modular"],
      "requiredFields": [
        { "name": "owner", "type": "string" },
        { "name": "contexts", "type": "array" },
        { "name": "crossContextRelations", "type": "array" }
      ]
    },
    "aggregate": {
      "title": "Aggregate",
      "file": "aggregate.json",
      "recommendedForProfiles": [],
      "neverForProfiles": ["no-code", "simple"],
      "note": "Use only when a real aggregate boundary exists.",
      "requiredFields": [
        { "name": "owner", "type": "string" },
        { "name": "root", "type": "string" },
        { "name": "entities", "type": "array" },
        { "name": "valueObjects", "type": "array" },
        { "name": "invariants", "type": "array" },
        { "name": "commands", "type": "array" },
        { "name": "events", "type": "array" },
        { "name": "repositoryPort", "type": "string", "optional": true },
        { "name": "consistency", "type": "string" }
      ]
    },
    "use-case": {
      "title": "Use Case",
      "file": "use-case.json",
      "recommendedForProfiles": ["modular", "domain-driven", "distributed-domain"],
      "neverForProfiles": ["no-code", "simple"],
      "requiredFields": [
        { "name": "owner", "type": "string" },
        { "name": "actor", "type": "string" },
        { "name": "input", "type": "object" },
        { "name": "preconditions", "type": "array" },
        { "name": "invariants", "type": "array" },
        { "name": "output", "type": "object" },
        { "name": "errors", "type": "array" },
        { "name": "transaction", "type": "string" },
        { "name": "effects", "type": "array" },
        { "name": "acceptance", "type": "array" }
      ]
    }
  }
}
