{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://github.com/welkaim/ea-codex/schemas/v1/technology-standard.json",
  "title": "TechnologyStandard",
  "description": "Catalogue of integration patterns or technology choices that realize an ArchitecturePrinciple, classified along a deliberately coarse axis (preferred, acceptable, acceptable-legacy, prohibited) so that the catalogue maps cleanly to fitness-function outcomes. Introduced in Chapter 14. Five-band Likert scales of compliance maturity produce satisfying spreadsheets and uneven enforcement; three or four bands map cleanly to fitness function outcomes. The standard's job is narrow: to make one binary question answerable on every commit, without consulting an architect. Is this pattern allowed here? A fitness function or an EA-tool MCP query reads the catalogue and decides.",
  "type": "object",
  "required": ["apiVersion", "kind", "metadata", "spec"],
  "properties": {
    "apiVersion": { "$ref": "_common.json#/$defs/apiVersion" },
    "kind": { "type": "string", "const": "TechnologyStandard" },
    "metadata": {
      "type": "object",
      "required": ["id", "name", "status"],
      "properties": {
        "id": { "$ref": "_common.json#/$defs/identifier" },
        "name": {
          "type": "string",
          "description": "Short human-readable name for the standard."
        },
        "title": { "type": "string" },
        "status": { "$ref": "_common.json#/$defs/lifecycleStatus" },
        "version": { "$ref": "_common.json#/$defs/version" },
        "domain": { "type": "string" },
        "owners": { "$ref": "_common.json#/$defs/owners" }
      },
      "additionalProperties": true
    },
    "spec": {
      "type": "object",
      "required": ["patterns"],
      "properties": {
        "principleRef": {
          "type": "string",
          "description": "Identifier of the ArchitecturePrinciple this standard realizes. A standard without a principle is a list; the principle is the anchor."
        },
        "scope": {
          "type": "string",
          "description": "What the standard applies to (system class, integration boundary, data domain)."
        },
        "patterns": {
          "type": "array",
          "minItems": 1,
          "description": "The catalogue itself. Each entry is a named pattern, classified, with a use statement that names the cases where the pattern is the right choice.",
          "items": {
            "type": "object",
            "required": ["id", "name", "classification"],
            "properties": {
              "id": {
                "type": "string",
                "description": "Stable pattern identifier, unique within this standard. Conventional prefix PAT-."
              },
              "name": {
                "type": "string",
                "description": "Short human-readable name for the pattern."
              },
              "classification": {
                "type": "string",
                "enum": ["preferred", "acceptable", "acceptable-legacy", "prohibited"],
                "description": "Coarse classification mapping cleanly to fitness-function outcomes. preferred and acceptable allow new use; acceptable-legacy permits existing use but blocks greenfield; prohibited fails the build."
              },
              "use": {
                "type": "string",
                "description": "Plain-language statement of when the pattern is the right choice (or that no use is allowed, for prohibited patterns)."
              },
              "applicableWhen": {
                "type": "string",
                "description": "Specific conditions that further qualify when the pattern is selected within its classification."
              },
              "exceptionsRequire": {
                "type": "string",
                "description": "For acceptable-legacy and prohibited patterns: the gating mechanism for any exception (typically a DecisionRecord with a sunset date)."
              }
            },
            "additionalProperties": true
          }
        }
      },
      "additionalProperties": true
    }
  },
  "additionalProperties": false
}
