{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://groups.qft.org/schema/physical-setup-v1.json",
  "title": "Groups for Physics — bounded physical setup v1",
  "description": "Four-dimensional Lorentzian scalar and Weyl fields with SU(3) × SU(2) × U(1) gauge representations and a standard diagonal quotient. Counts complex derivative-free local polynomials, before Hermiticity or flavor-basis identification. This is a bounded part of the physical-setup blueprint, not a complete EFT specification.",
  "$comment": "The runtime additionally enforces distinct field ids, powers referring only to declared ids, total degree ≤ 6, and canonical dimension ≤ 6 (scalar dimension 1; Weyl dimension 3/2). Missing powers normalize to zero. Every declared field must descend to the chosen quotient before a calculation is allowed; structural validity and global admissibility are separate checks.",
  "type": "object",
  "additionalProperties": false,
  "required": ["schema", "name", "spacetime", "gauge", "fields", "operator"],
  "properties": {
    "schema": {"const": "groups.qft.org/physical-setup/1"},
    "name": {"$ref": "#/$defs/setupName"},
    "spacetime": {
      "type": "object",
      "additionalProperties": false,
      "required": ["dimension", "signature"],
      "properties": {
        "dimension": {"const": 4},
        "signature": {"const": "Lorentzian"}
      }
    },
    "gauge": {
      "type": "object",
      "additionalProperties": false,
      "required": ["kind", "quotientOrder", "u1Normalization"],
      "properties": {
        "kind": {"const": "su3-su2-u1"},
        "quotientOrder": {
          "enum": [1, 2, 3, 6],
          "description": "The group is (SU(3) × SU(2) × U(1))/Γ_d, where Γ_d = ⟨γ^(6/d)⟩ and γ = (exp(2πi/3) I_3, −I_2, exp(2πi/6)). Order 1 is the unquotiented product."
        },
        "u1Normalization": {
          "const": "integer-charge-period-2pi",
          "description": "The U(1) parameter has period 2π and acts with integer charge Q. For Standard Model presets Q = 6Y."
        }
      }
    },
    "fields": {
      "type": "array",
      "maxItems": 16,
      "items": {"$ref": "#/$defs/field"},
      "description": "All declared fields, including fields with exponent zero, enter the global-form consistency check. Flavor copies have the same gauge and Lorentz representation."
    },
    "operator": {
      "type": "object",
      "additionalProperties": false,
      "required": ["powers", "derivatives", "equivalence", "coefficientField"],
      "properties": {
        "powers": {
          "type": "object",
          "propertyNames": {"$ref": "#/$defs/fieldId"},
          "additionalProperties": {"type": "integer", "minimum": 0, "maximum": 6},
          "maxProperties": 16,
          "description": "Exponents keyed by declared field id; omitted declared ids have exponent zero. Total degree is at most six and total canonical dimension is at most six."
        },
        "derivatives": {"const": 0},
        "equivalence": {
          "const": "algebraic",
          "description": "Invariant polynomials modulo algebraic identities and graded commutation. Equations of motion and integration by parts are not imposed."
        },
        "coefficientField": {
          "const": "C",
          "description": "Independent complex polynomial coefficients, without identifying a polynomial with its Hermitian conjugate or quotienting by flavor rotations."
        }
      }
    }
  },
  "$defs": {
    "fieldId": {
      "type": "string",
      "pattern": "^[A-Za-z][A-Za-z0-9_]{0,23}$",
      "not": {"enum": ["constructor", "prototype"]}
    },
    "setupName": {
      "type": "string",
      "minLength": 1,
      "maxLength": 100,
      "allOf": [
        {"pattern": "\\S"},
        {"pattern": "^[^\\u0000-\\u001f\\u007f-\\u009f\\u2028\\u2029]+$"}
      ]
    },
    "fieldName": {
      "type": "string",
      "minLength": 1,
      "maxLength": 48,
      "allOf": [
        {"pattern": "\\S"},
        {"pattern": "^[^\\u0000-\\u001f\\u007f-\\u009f\\u2028\\u2029]+$"}
      ]
    },
    "field": {
      "type": "object",
      "additionalProperties": false,
      "required": ["id", "name", "kind", "su3", "su2", "charge", "flavors"],
      "properties": {
        "id": {"$ref": "#/$defs/fieldId"},
        "name": {"$ref": "#/$defs/fieldName"},
        "kind": {"enum": ["scalar", "left-weyl", "right-weyl"]},
        "su3": {
          "enum": [[0, 0], [1, 0], [0, 1], [2, 0], [1, 1], [0, 2]],
          "description": "SU(3) Dynkin labels [p,q], in the convention [1,0] = 3, [0,1] = conjugate 3. The implemented bound is p + q ≤ 2."
        },
        "su2": {
          "type": "integer",
          "minimum": 0,
          "maximum": 2,
          "description": "Weak SU(2) Dynkin label n; representation dimension n+1. This factor is distinct from both Lorentz spin factors."
        },
        "charge": {"type": "integer", "minimum": -24, "maximum": 24},
        "flavors": {
          "type": "integer",
          "minimum": 1,
          "maximum": 3,
          "description": "Ungauged flavor multiplicity. The symmetry projection acts on the full Lorentz × gauge × flavor space; flavor is not projected to a singlet."
        }
      }
    }
  }
}
