{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://grey-chimp.dev/schemas/eve-sota-evaluation-design.v1.json",
  "title": "Eve SOTA prospective family evaluation design",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "schemaVersion",
    "initiativeId",
    "taskId",
    "generatedOn",
    "status",
    "authoritativeSources",
    "governanceDecision",
    "requiredAxes",
    "axisCatalogs",
    "manifestAdmission",
    "families",
    "coverage",
    "limitations",
    "recordDigestSha256"
  ],
  "properties": {
    "schemaVersion": { "const": "eve-sota-evaluation-design.v1" },
    "initiativeId": { "const": "eve-sota-gap-closure-2026-09-01" },
    "taskId": { "const": "12.2" },
    "generatedOn": { "type": "string", "pattern": "^20[0-9]{2}-[0-9]{2}-[0-9]{2}$" },
    "status": { "const": "preregistered-unmeasured" },
    "authoritativeSources": {
      "type": "array",
      "minItems": 7,
      "items": { "$ref": "#/$defs/sourceReceipt" }
    },
    "governanceDecision": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "id",
        "status",
        "authorityRecord",
        "authority",
        "authorizedBy",
        "decision",
        "effectiveFor",
        "resultBoundary"
      ],
      "properties": {
        "id": { "type": "string", "minLength": 1 },
        "status": { "const": "prospective-implementation-of-authorized-policy" },
        "authorityRecord": { "type": "string", "minLength": 1 },
        "authority": { "type": "string", "minLength": 1 },
        "authorizedBy": { "type": "string", "minLength": 1 },
        "decision": { "type": "string", "minLength": 1 },
        "effectiveFor": { "type": "string", "minLength": 1 },
        "resultBoundary": { "type": "string", "minLength": 1 }
      }
    },
    "requiredAxes": {
      "type": "array",
      "minItems": 7,
      "maxItems": 7,
      "items": { "type": "string", "minLength": 1 }
    },
    "axisCatalogs": {
      "type": "object",
      "additionalProperties": {
        "type": "array",
        "minItems": 1,
        "items": { "type": "string", "minLength": 1 }
      }
    },
    "manifestAdmission": {
      "type": "object",
      "required": [
        "designDigestRequired",
        "exactDenominatorInventoryRequired",
        "exactPrimaryCaseIdsRequiredAtLock",
        "separateLockArtifactRequiredForResults",
        "postResultExpansion",
        "aggregateMayMaskStratum",
        "nestedRunsCountTowardIndependentN",
        "missingOrUndersizedDisposition",
        "closureRequiresUnitObservationsAndEvidence"
      ],
      "properties": {
        "designDigestRequired": { "const": true },
        "exactDenominatorInventoryRequired": { "const": true },
        "exactPrimaryCaseIdsRequiredAtLock": { "const": true },
        "separateLockArtifactRequiredForResults": { "const": true },
        "postResultExpansion": { "const": "prohibited-new-cohort-required" },
        "aggregateMayMaskStratum": { "const": false },
        "nestedRunsCountTowardIndependentN": { "const": false },
        "missingOrUndersizedDisposition": { "const": "INCOMPLETE-HOLD" },
        "closureRequiresUnitObservationsAndEvidence": { "const": true }
      }
    },
    "families": {
      "type": "array",
      "minItems": 15,
      "maxItems": 15,
      "items": { "$ref": "#/$defs/family" }
    },
    "coverage": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "expectedFamilyCount",
        "designedFamilyCount",
        "stratumCount",
        "criterionPlanCount",
        "denominatorCount",
        "familiesMissingHumanOwner",
        "familiesMissingHardLock"
      ],
      "properties": {
        "expectedFamilyCount": { "const": 15 },
        "designedFamilyCount": { "const": 15 },
        "stratumCount": { "type": "integer", "minimum": 1 },
        "criterionPlanCount": { "type": "integer", "minimum": 1 },
        "denominatorCount": { "type": "integer", "minimum": 1 },
        "familiesMissingHumanOwner": { "type": "array", "maxItems": 0 },
        "familiesMissingHardLock": { "type": "array", "maxItems": 0 }
      }
    },
    "limitations": {
      "type": "array",
      "minItems": 4,
      "items": { "type": "string", "minLength": 30 }
    },
    "recordDigestSha256": { "$ref": "#/$defs/sha256" }
  },
  "$defs": {
    "sha256": { "type": "string", "pattern": "^[a-f0-9]{64}$" },
    "sourceReceipt": {
      "type": "object",
      "additionalProperties": false,
      "required": ["id", "path", "digestOf", "bytes", "sha256"],
      "properties": {
        "id": { "type": "string", "minLength": 1 },
        "path": { "type": "string", "minLength": 1 },
        "digestOf": { "const": "file-bytes" },
        "bytes": { "type": "integer", "minimum": 1 },
        "sha256": { "$ref": "#/$defs/sha256" }
      }
    },
    "stringArray": {
      "type": "array",
      "minItems": 1,
      "items": { "type": "string", "minLength": 1 }
    },
    "family": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "id",
        "label",
        "description",
        "primaryWorkflowCount",
        "sourceCoverage",
        "caseDiversity",
        "stochasticRuns",
        "rubrics",
        "controls",
        "hardSafetyLocks",
        "outcomeMetricIds",
        "criterionPlans",
        "escalation",
        "closureRule"
      ],
      "properties": {
        "id": { "type": "string", "minLength": 1 },
        "label": { "type": "string", "minLength": 1 },
        "description": { "type": "string", "minLength": 1 },
        "primaryWorkflowCount": { "type": "integer", "minimum": 1 },
        "sourceCoverage": { "type": "object" },
        "caseDiversity": {
          "type": "object",
          "additionalProperties": false,
          "required": ["independentCaseDefinition", "caseClasses", "axisDecisions", "strata"],
          "properties": {
            "independentCaseDefinition": { "type": "string", "minLength": 80 },
            "caseClasses": {
              "type": "array",
              "minItems": 4,
              "items": {
                "type": "object",
                "additionalProperties": false,
                "required": ["id", "description"],
                "properties": {
                  "id": { "type": "string", "minLength": 1 },
                  "description": { "type": "string", "minLength": 20 }
                }
              }
            },
            "axisDecisions": {
              "type": "array",
              "minItems": 7,
              "maxItems": 7,
              "items": { "$ref": "#/$defs/axisDecision" }
            },
            "strata": {
              "type": "array",
              "minItems": 7,
              "items": { "$ref": "#/$defs/stratum" }
            }
          }
        },
        "stochasticRuns": { "type": "object" },
        "rubrics": {
          "type": "array",
          "minItems": 3,
          "maxItems": 3,
          "items": { "type": "object" }
        },
        "controls": {
          "type": "object",
          "required": ["negative", "benign", "pairingRule"],
          "properties": {
            "negative": { "$ref": "#/$defs/stringArray" },
            "benign": { "$ref": "#/$defs/stringArray" },
            "pairingRule": { "type": "string", "minLength": 30 }
          }
        },
        "hardSafetyLocks": {
          "type": "array",
          "minItems": 1,
          "items": { "type": "object" }
        },
        "outcomeMetricIds": { "$ref": "#/$defs/stringArray" },
        "criterionPlans": {
          "type": "array",
          "minItems": 1,
          "items": { "$ref": "#/$defs/criterionPlan" }
        },
        "escalation": { "type": "object" },
        "closureRule": { "type": "string", "minLength": 100 }
      }
    },
    "axisDecision": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "axis",
        "applicabilityOwner",
        "approvedBeforeResultsBy",
        "applicableLevelIds",
        "exclusions"
      ],
      "properties": {
        "axis": { "type": "string", "minLength": 1 },
        "applicabilityOwner": { "type": "string", "minLength": 1 },
        "approvedBeforeResultsBy": { "type": "string", "minLength": 1 },
        "applicableLevelIds": { "$ref": "#/$defs/stringArray" },
        "exclusions": {
          "type": "array",
          "items": {
            "type": "object",
            "additionalProperties": false,
            "required": ["levelId", "rationale", "sourceRefs"],
            "properties": {
              "levelId": { "type": "string", "minLength": 1 },
              "rationale": { "type": "string", "minLength": 50 },
              "sourceRefs": { "$ref": "#/$defs/stringArray" }
            }
          }
        }
      }
    },
    "stratum": {
      "type": "object",
      "additionalProperties": false,
      "required": ["id", "kind", "dimensions", "sourceRefs"],
      "properties": {
        "id": { "type": "string", "minLength": 1 },
        "kind": { "enum": ["marginal", "required-high-risk-intersection"] },
        "dimensions": { "type": "object" },
        "sourceRefs": { "$ref": "#/$defs/stringArray" }
      }
    },
    "criterionPlan": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "id",
        "outcomeId",
        "criterionId",
        "targetIds",
        "statisticalUnit",
        "method",
        "operator",
        "floorValue",
        "floorUnit",
        "hardSafetyLock",
        "overallMinimumIndependentUnits",
        "compositionRule",
        "wilsonDesign",
        "continuousPilotContract",
        "stratumDenominators",
        "escalation"
      ],
      "properties": {
        "id": { "type": "string", "minLength": 1 },
        "outcomeId": { "type": "string", "minLength": 1 },
        "criterionId": { "type": "string", "minLength": 1 },
        "targetIds": { "$ref": "#/$defs/stringArray" },
        "statisticalUnit": { "type": "string", "minLength": 20 },
        "method": { "enum": ["hard-lock", "wilson-95", "bootstrap-95"] },
        "operator": { "enum": [">=", "<=", "="] },
        "floorValue": { "type": "number" },
        "floorUnit": { "type": "string", "minLength": 1 },
        "hardSafetyLock": { "type": "boolean" },
        "overallMinimumIndependentUnits": { "type": "integer", "minimum": 1 },
        "compositionRule": { "type": "string", "minLength": 20 },
        "wilsonDesign": { "type": ["object", "null"] },
        "continuousPilotContract": { "type": ["object", "null"] },
        "stratumDenominators": {
          "type": "array",
          "minItems": 1,
          "items": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "id",
              "stratumRef",
              "minimumIndependentN",
              "exactPlannedNRequiredAtCohortLock",
              "nestedSeedsCountTowardN"
            ],
            "properties": {
              "id": { "type": "string", "minLength": 1 },
              "stratumRef": { "type": "string", "minLength": 1 },
              "minimumIndependentN": { "type": "integer", "minimum": 1 },
              "exactPlannedNRequiredAtCohortLock": { "const": true },
              "nestedSeedsCountTowardN": { "const": false }
            }
          }
        },
        "escalation": { "type": "string", "minLength": 20 }
      }
    }
  }
}
