{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://weverlabs.com/schemas/controlled-operating-loop-step.schema.json",
  "title": "Wever Labs Controlled Operating Loop Step",
  "description": "A single step inside a governed agent operating loop.",
  "type": "object",
  "required": [
    "step_id",
    "step_name",
    "agent_role",
    "state",
    "writes_receipt"
  ],
  "properties": {
    "step_id": {
      "type": "string"
    },
    "step_name": {
      "type": "string"
    },
    "agent_role": {
      "type": "string"
    },
    "state": {
      "type": "string",
      "enum": [
        "pending",
        "running",
        "pass",
        "fail",
        "skipped",
        "needs_review"
      ]
    },
    "input_refs": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "output_refs": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "errors": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "writes_receipt": {
      "type": "boolean"
    },
    "operator_visible": {
      "type": "boolean"
    },
    "notes": {
      "type": "string"
    }
  },
  "additionalProperties": true
}
