{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/peopleprincipia-com/json-schema/peopleprincipia-com-construct-score-prior-envelope-schema.json",
  "title": "ConstructScorePriorEnvelope",
  "description": "PRN-411 marginal score prior. Distinct from CanonicalPrior relationship-effect distributions. Numeric output requires all contributing findings to pass PRN-649; evidence carries tier, held_by and per-input check labels.",
  "x-generated": "2026-11-20",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/peopleprincipia-com-openapi.yaml#/components/schemas/ConstructScorePriorEnvelope",
  "type": "object",
  "required": [
    "found",
    "construct_id",
    "prior",
    "scale",
    "edition",
    "pooled_over",
    "source"
  ],
  "properties": {
    "found": {
      "type": "boolean"
    },
    "construct_id": {
      "type": "string"
    },
    "measure_id": {
      "type": "string"
    },
    "prior": {
      "oneOf": [
        {
          "$ref": "#/$defs/ConstructScorePrior"
        },
        {
          "type": "null"
        }
      ],
      "description": "null when no explicit score-distribution evidence exists; never synthesized from another numeric entity."
    },
    "scale": {
      "oneOf": [
        {
          "$ref": "#/$defs/ConstructScoreScale"
        },
        {
          "type": "null"
        }
      ]
    },
    "edition": {
      "type": [
        "string",
        "null"
      ]
    },
    "pooled_over": {
      "type": "object",
      "required": [
        "moderators"
      ],
      "properties": {
        "moderators": {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      }
    },
    "source": {
      "type": [
        "string",
        "null"
      ],
      "enum": [
        "deployment",
        "literature",
        "bootstrap",
        null
      ]
    },
    "refusal": {
      "type": "object",
      "required": [
        "code",
        "reason"
      ],
      "properties": {
        "code": {
          "type": "string",
          "enum": [
            "no_construct_score_prior",
            "measure_not_found",
            "measure_construct_mismatch",
            "invalid_score_prior_source",
            "unchecked_score_prior_source"
          ]
        },
        "reason": {
          "type": "string"
        }
      }
    }
  },
  "$defs": {
    "ConstructScorePrior": {
      "type": "object",
      "required": [
        "mean",
        "sd",
        "n"
      ],
      "properties": {
        "mean": {
          "type": "number"
        },
        "sd": {
          "type": "number",
          "exclusiveMinimum": 0
        },
        "n": {
          "type": "integer",
          "minimum": 1
        }
      }
    },
    "ConstructScoreScale": {
      "type": "object",
      "required": [
        "min",
        "max",
        "anchors"
      ],
      "properties": {
        "min": {
          "type": "number"
        },
        "max": {
          "type": "number"
        },
        "anchors": {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      }
    }
  }
}