{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/peopleprincipia-com/json-schema/peopleprincipia-com-vo-irequest-schema.json",
  "title": "VoIRequest",
  "description": "Provide prior_id OR prior_tuple, and at least one of sample_design.n or (cost_per_observation + max_n).",
  "x-generated": "2026-11-21",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/peopleprincipia-com-analytics-api-openapi.yml#/components/schemas/VoIRequest",
  "type": "object",
  "required": [
    "loss_function"
  ],
  "properties": {
    "prior_id": {
      "type": "string"
    },
    "prior_tuple": {
      "type": "object",
      "properties": {
        "from": {
          "type": "string"
        },
        "predicate": {
          "$ref": "#/$defs/Predicate"
        },
        "to": {
          "type": "string"
        }
      }
    },
    "loss_function": {
      "oneOf": [
        {
          "type": "object",
          "properties": {
            "type": {
              "const": "squared_error"
            }
          }
        },
        {
          "type": "object",
          "properties": {
            "type": {
              "const": "absolute_error"
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type",
            "threshold",
            "cost_above",
            "cost_below"
          ],
          "properties": {
            "type": {
              "const": "linear_decision"
            },
            "threshold": {
              "type": "number"
            },
            "cost_above": {
              "type": "number"
            },
            "cost_below": {
              "type": "number"
            }
          }
        }
      ]
    },
    "sample_design": {
      "type": "object",
      "properties": {
        "n": {
          "type": "integer"
        },
        "measurement_sigma": {
          "type": "number"
        }
      }
    },
    "cost_per_observation": {
      "type": "number"
    },
    "max_n": {
      "type": "integer"
    },
    "seed": {
      "type": "integer"
    }
  },
  "$defs": {
    "Predicate": {
      "type": "string",
      "enum": [
        "predicts",
        "moderates",
        "mediates",
        "correlates",
        "causes"
      ]
    }
  }
}