{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "urn:foreverlearning:developer-runtime:2026-12-01",
  "title": "Developer runtime request and response schemas",
  "description": "Source-observed Developer Platform wire at cb392073; distinct from shared chat. Extra fields are refused in requests. Response schemas describe the known producer; clients must tolerate future response fields and event types. Runtime-only byte, UTF-16, scope, ordering and identity constraints remain authoritative.",
  "$defs": {
    "Id": {
      "type": "string",
      "pattern": "^[A-Za-z0-9_-]{1,128}$"
    },
    "Uuid": {
      "type": "string",
      "pattern": "^[a-fA-F0-9]{8}(?:-[a-fA-F0-9]{4}){3}-[a-fA-F0-9]{12}$"
    },
    "ConsoleOperationId": {
      "type": "string",
      "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$"
    },
    "ExternalUserId": {
      "type": "string",
      "minLength": 1,
      "maxLength": 200,
      "pattern": "^[^\\u0000-\\u001f\\u007f]+$",
      "x-max-utf16-code-units": 200
    },
    "Cursor": {
      "anyOf": [
        {
          "type": "string",
          "minLength": 1,
          "maxLength": 1024
        },
        {
          "type": "null"
        }
      ]
    },
    "Timestamp": {
      "type": "string",
      "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(?:\\.\\d{1,6})?Z$"
    },
    "ChatRequest": {
      "type": "object",
      "properties": {
        "prompt": {
          "type": "string",
          "maxLength": 10000,
          "x-max-utf16-code-units": 10000,
          "description": "The runtime measures UTF-16 code units. The released workload may impose tighter pre-call bounds."
        },
        "session_id": {
          "anyOf": [
            {
              "type": "string",
              "minLength": 1,
              "maxLength": 128,
              "pattern": "^[^\\u0000-\\u001f\\u007f]+$",
              "x-max-utf16-code-units": 128
            },
            {
              "enum": [
                null,
                ""
              ]
            }
          ]
        },
        "context": {
          "type": "object",
          "additionalProperties": true,
          "x-max-serialized-utf8-bytes": 24576,
          "description": "JSON.stringify UTF-8 byte bound, recursive depth limit and delimiter refusal are enforced at runtime. Client metadata cannot supply server memory or internal configuration."
        },
        "system_message": {
          "type": "boolean"
        },
        "reengage": {
          "type": "boolean"
        }
      },
      "required": [],
      "additionalProperties": false,
      "allOf": [
        {
          "anyOf": [
            {
              "required": [
                "prompt"
              ],
              "properties": {
                "prompt": {
                  "type": "string"
                }
              }
            },
            {
              "required": [
                "reengage",
                "session_id"
              ],
              "properties": {
                "reengage": {
                  "const": true
                },
                "session_id": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 128,
                  "pattern": "^[^\\u0000-\\u001f\\u007f]+$",
                  "x-max-utf16-code-units": 128
                }
              }
            }
          ]
        },
        {
          "if": {
            "required": [
              "reengage"
            ],
            "properties": {
              "reengage": {
                "const": true
              }
            }
          },
          "then": {
            "required": [
              "session_id"
            ],
            "properties": {
              "session_id": {
                "type": "string",
                "minLength": 1,
                "maxLength": 128,
                "pattern": "^[^\\u0000-\\u001f\\u007f]+$",
                "x-max-utf16-code-units": 128
              }
            }
          }
        }
      ]
    },
    "LifecycleRequest": {
      "type": "object",
      "properties": {
        "operation_id": {
          "$ref": "#/$defs/Uuid"
        }
      },
      "required": [
        "operation_id"
      ],
      "additionalProperties": false
    },
    "EmptyExportRequest": {
      "type": "object",
      "properties": {},
      "required": [],
      "additionalProperties": false
    },
    "ConsoleSubject": {
      "type": "object",
      "properties": {
        "assignment_id": {
          "$ref": "#/$defs/Uuid"
        },
        "external_user_id": {
          "$ref": "#/$defs/ExternalUserId"
        },
        "operation_id": {
          "$ref": "#/$defs/ConsoleOperationId"
        }
      },
      "required": [
        "assignment_id",
        "external_user_id",
        "operation_id"
      ],
      "additionalProperties": false
    },
    "ConsoleTurnRequest": {
      "type": "object",
      "properties": {
        "operation_id": {
          "$ref": "#/$defs/ConsoleOperationId"
        },
        "assignment_id": {
          "$ref": "#/$defs/Uuid"
        },
        "external_user_id": {
          "$ref": "#/$defs/ExternalUserId"
        },
        "message": {
          "type": "string",
          "maxLength": 10000,
          "x-max-utf16-code-units": 10000,
          "description": "The runtime measures UTF-16 code units. The released workload may impose tighter pre-call bounds."
        },
        "session_id": {
          "anyOf": [
            {
              "type": "string",
              "minLength": 1,
              "maxLength": 128,
              "pattern": "^[^\\u0000-\\u001f\\u007f]+$",
              "x-max-utf16-code-units": 128
            },
            {
              "enum": [
                null,
                ""
              ]
            }
          ]
        },
        "context": {
          "type": "object",
          "additionalProperties": true,
          "x-max-serialized-utf8-bytes": 24576,
          "description": "JSON.stringify UTF-8 byte bound, recursive depth limit and delimiter refusal are enforced at runtime. Client metadata cannot supply server memory or internal configuration."
        },
        "reengage": {
          "type": "boolean"
        },
        "conversation": {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "operation"
          ],
          "properties": {
            "operation": {
              "type": "string",
              "enum": [
                "opening",
                "turn"
              ]
            },
            "controls": {
              "type": "object",
              "additionalProperties": false,
              "properties": {
                "cast_language": {
                  "type": "string",
                  "enum": [
                    "en-US",
                    "es-US",
                    "fr-FR",
                    "fr-CA",
                    "de-DE",
                    "it-IT",
                    "pt-BR",
                    "ja-JP",
                    "ko-KR",
                    "cmn-CN"
                  ]
                },
                "cast_speech": {
                  "type": "string",
                  "enum": [
                    "simple",
                    "everyday",
                    "natural"
                  ]
                },
                "challenge": {
                  "type": "string",
                  "enum": [
                    "supportive",
                    "realistic",
                    "resistant"
                  ]
                },
                "emotional_heat": {
                  "type": "string",
                  "enum": [
                    "calm",
                    "tense",
                    "heated"
                  ]
                },
                "coach_lens_id": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 41
                }
              },
              "required": []
            }
          }
        }
      },
      "required": [
        "operation_id",
        "assignment_id",
        "external_user_id"
      ],
      "additionalProperties": false,
      "allOf": [
        {
          "anyOf": [
            {
              "required": [
                "message"
              ],
              "properties": {
                "message": {
                  "type": "string"
                }
              }
            },
            {
              "required": [
                "reengage",
                "session_id"
              ],
              "properties": {
                "reengage": {
                  "const": true
                },
                "session_id": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 128,
                  "pattern": "^[^\\u0000-\\u001f\\u007f]+$",
                  "x-max-utf16-code-units": 128
                }
              }
            },
            {
              "required": [
                "conversation",
                "session_id"
              ],
              "properties": {
                "conversation": {
                  "type": "object",
                  "required": [
                    "operation"
                  ],
                  "properties": {
                    "operation": {
                      "const": "opening"
                    }
                  }
                }
              }
            }
          ]
        },
        {
          "if": {
            "required": [
              "reengage"
            ],
            "properties": {
              "reengage": {
                "const": true
              }
            }
          },
          "then": {
            "required": [
              "session_id"
            ],
            "properties": {
              "session_id": {
                "type": "string",
                "minLength": 1,
                "maxLength": 128,
                "pattern": "^[^\\u0000-\\u001f\\u007f]+$",
                "x-max-utf16-code-units": 128
              }
            }
          }
        },
        {
          "if": {
            "required": [
              "conversation"
            ]
          },
          "then": {
            "required": [
              "session_id"
            ],
            "not": {
              "anyOf": [
                {
                  "required": [
                    "context"
                  ],
                  "properties": {
                    "context": {}
                  }
                },
                {
                  "required": [
                    "reengage"
                  ],
                  "properties": {
                    "reengage": {}
                  }
                }
              ]
            }
          }
        },
        {
          "if": {
            "required": [
              "conversation"
            ],
            "properties": {
              "conversation": {
                "type": "object",
                "required": [
                  "operation"
                ],
                "properties": {
                  "operation": {
                    "const": "opening"
                  }
                }
              }
            }
          },
          "then": {
            "not": {
              "required": [
                "message"
              ],
              "properties": {
                "message": {}
              }
            }
          }
        }
      ]
    },
    "ConsoleExportRequest": {
      "type": "object",
      "properties": {
        "operation_id": {
          "$ref": "#/$defs/ConsoleOperationId"
        },
        "assignment_id": {
          "$ref": "#/$defs/Uuid"
        },
        "external_user_id": {
          "$ref": "#/$defs/ExternalUserId"
        },
        "limit": {
          "type": "integer",
          "minimum": 1,
          "maximum": 100
        },
        "cursor": {
          "type": "string",
          "minLength": 1,
          "maxLength": 1024
        }
      },
      "required": [
        "operation_id",
        "assignment_id",
        "external_user_id"
      ],
      "additionalProperties": false
    },
    "Error": {
      "type": "object",
      "properties": {
        "error": {
          "const": true
        },
        "code": {
          "type": "string",
          "minLength": 1
        },
        "message": {
          "type": "string"
        },
        "request_id": {
          "$ref": "#/$defs/Id"
        }
      },
      "required": [
        "error",
        "code",
        "message",
        "request_id"
      ],
      "additionalProperties": false
    },
    "Money": {
      "type": "object",
      "properties": {
        "amount_micro_usd": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        },
        "currency": {
          "const": "USD"
        }
      },
      "required": [
        "amount_micro_usd",
        "currency"
      ],
      "additionalProperties": false
    },
    "Commercial": {
      "type": "object",
      "properties": {
        "listing": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128,
          "pattern": "^[^\\u0000-\\u001f\\u007f]+$",
          "x-max-utf16-code-units": 128
        },
        "band": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128,
          "pattern": "^[^\\u0000-\\u001f\\u007f]+$",
          "x-max-utf16-code-units": 128
        },
        "rate_version": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128,
          "pattern": "^[^\\u0000-\\u001f\\u007f]+$",
          "x-max-utf16-code-units": 128
        },
        "billable_units": {
          "enum": [
            0,
            1
          ]
        },
        "charge": {
          "$ref": "#/$defs/Money"
        },
        "settlement": {
          "enum": [
            "reserved",
            "settled",
            "released"
          ]
        }
      },
      "required": [
        "listing",
        "band",
        "rate_version",
        "billable_units",
        "charge",
        "settlement"
      ],
      "additionalProperties": false,
      "allOf": [
        {
          "if": {
            "properties": {
              "billable_units": {
                "const": 0
              }
            },
            "required": [
              "billable_units"
            ]
          },
          "then": {
            "properties": {
              "charge": {
                "type": "object",
                "properties": {
                  "amount_micro_usd": {
                    "const": 0
                  }
                }
              }
            }
          }
        },
        {
          "if": {
            "properties": {
              "settlement": {
                "const": "released"
              }
            },
            "required": [
              "settlement"
            ]
          },
          "then": {
            "properties": {
              "billable_units": {
                "const": 0
              },
              "charge": {
                "type": "object",
                "properties": {
                  "amount_micro_usd": {
                    "const": 0
                  }
                }
              }
            }
          }
        }
      ]
    },
    "SafetyStatus": {
      "type": "object",
      "properties": {
        "type": {
          "const": "safety_status"
        },
        "schema_version": {
          "const": 1
        },
        "evaluated": {
          "type": "boolean"
        },
        "level": {
          "enum": [
            "unknown",
            "clear",
            "watch",
            "warning",
            "critical"
          ]
        },
        "response_action": {
          "enum": [
            "none",
            "support",
            "escalate"
          ]
        },
        "source": {
          "enum": [
            "governed_turn",
            "backstop"
          ]
        }
      },
      "required": [
        "type",
        "schema_version",
        "evaluated",
        "level",
        "response_action",
        "source"
      ],
      "additionalProperties": false,
      "allOf": [
        {
          "if": {
            "properties": {
              "level": {
                "const": "unknown"
              }
            },
            "required": [
              "level"
            ]
          },
          "then": {
            "properties": {
              "evaluated": {
                "const": false
              }
            }
          },
          "else": {
            "properties": {
              "evaluated": {
                "const": true
              }
            }
          }
        }
      ]
    },
    "Part": {
      "type": "object",
      "properties": {
        "part": {
          "enum": [
            "conversation",
            "display"
          ]
        },
        "text": {
          "type": "string"
        }
      },
      "required": [
        "part",
        "text"
      ],
      "additionalProperties": false
    },
    "ReplayResult": {
      "type": "object",
      "properties": {
        "parts": {
          "type": "array",
          "minItems": 1,
          "maxItems": 4096,
          "items": {
            "$ref": "#/$defs/Part"
          }
        },
        "safety_status": {
          "$ref": "#/$defs/SafetyStatus"
        },
        "stop_reason": {
          "const": "end_turn"
        },
        "session_ended": {
          "type": "boolean"
        },
        "commercial": {
          "$ref": "#/$defs/Commercial"
        }
      },
      "required": [
        "parts",
        "safety_status",
        "stop_reason",
        "session_ended",
        "commercial"
      ],
      "additionalProperties": false
    },
    "CommittedReplay": {
      "type": "object",
      "properties": {
        "status": {
          "const": "committed"
        },
        "request_id": {
          "$ref": "#/$defs/Id"
        },
        "session_id": {
          "$ref": "#/$defs/Id"
        },
        "result": {
          "$ref": "#/$defs/ReplayResult"
        }
      },
      "required": [
        "status",
        "request_id",
        "session_id",
        "result"
      ],
      "additionalProperties": false
    },
    "PendingReplay": {
      "type": "object",
      "properties": {
        "status": {
          "enum": [
            "in_progress",
            "unavailable"
          ]
        },
        "request_id": {
          "$ref": "#/$defs/Id"
        },
        "session_id": {
          "$ref": "#/$defs/Id"
        }
      },
      "required": [
        "status",
        "request_id",
        "session_id"
      ],
      "additionalProperties": false
    },
    "Replay": {
      "oneOf": [
        {
          "$ref": "#/$defs/CommittedReplay"
        },
        {
          "$ref": "#/$defs/PendingReplay"
        }
      ]
    },
    "MetadataEvent": {
      "type": "object",
      "properties": {
        "type": {
          "const": "metadata"
        },
        "sessionId": {
          "$ref": "#/$defs/Id"
        },
        "request_id": {
          "$ref": "#/$defs/Id"
        }
      },
      "required": [
        "type",
        "sessionId",
        "request_id"
      ],
      "additionalProperties": false
    },
    "ContentEvent": {
      "type": "object",
      "properties": {
        "type": {
          "const": "content"
        },
        "part": {
          "enum": [
            "conversation",
            "display"
          ]
        },
        "text": {
          "type": "string"
        }
      },
      "required": [
        "type",
        "part",
        "text"
      ],
      "additionalProperties": false
    },
    "DisplayCompleteEvent": {
      "type": "object",
      "properties": {
        "type": {
          "const": "display_complete"
        }
      },
      "required": [
        "type"
      ],
      "additionalProperties": false
    },
    "SessionEndedEvent": {
      "type": "object",
      "properties": {
        "type": {
          "const": "session_ended"
        },
        "sessionId": {
          "$ref": "#/$defs/Id"
        }
      },
      "required": [
        "type",
        "sessionId"
      ],
      "additionalProperties": false
    },
    "ErrorEvent": {
      "type": "object",
      "properties": {
        "type": {
          "const": "error"
        },
        "error": {
          "const": true
        },
        "code": {
          "type": "string",
          "minLength": 1
        },
        "message": {
          "type": "string"
        },
        "request_id": {
          "$ref": "#/$defs/Id"
        }
      },
      "required": [
        "type",
        "error",
        "code",
        "message",
        "request_id"
      ],
      "additionalProperties": false
    },
    "HistoryItem": {
      "type": "object",
      "properties": {
        "message_id": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128,
          "pattern": "^[^\\u0000-\\u001f\\u007f]+$",
          "x-max-utf16-code-units": 128
        },
        "role": {
          "enum": [
            "user",
            "assistant"
          ]
        },
        "content": {
          "type": "string"
        },
        "created_at": {
          "$ref": "#/$defs/Timestamp"
        }
      },
      "required": [
        "message_id",
        "role",
        "content",
        "created_at"
      ],
      "additionalProperties": false
    },
    "Session": {
      "type": "object",
      "properties": {
        "session_id": {
          "$ref": "#/$defs/Id"
        },
        "status": {
          "enum": [
            "active",
            "closed",
            "discarded",
            "deleted",
            "erased"
          ]
        },
        "created_at": {
          "$ref": "#/$defs/Timestamp"
        },
        "updated_at": {
          "$ref": "#/$defs/Timestamp"
        },
        "ended_at": {
          "anyOf": [
            {
              "$ref": "#/$defs/Timestamp"
            },
            {
              "type": "null"
            }
          ]
        },
        "attention": {
          "type": "boolean"
        }
      },
      "required": [
        "session_id",
        "status",
        "created_at",
        "updated_at",
        "ended_at",
        "attention"
      ],
      "additionalProperties": false
    },
    "HistoryPage": {
      "type": "object",
      "properties": {
        "items": {
          "type": "array",
          "maxItems": 100,
          "items": {
            "$ref": "#/$defs/HistoryItem"
          }
        },
        "next_cursor": {
          "$ref": "#/$defs/Cursor"
        },
        "request_id": {
          "$ref": "#/$defs/Id"
        }
      },
      "required": [
        "items",
        "next_cursor",
        "request_id"
      ],
      "additionalProperties": false
    },
    "SessionPage": {
      "type": "object",
      "properties": {
        "items": {
          "type": "array",
          "maxItems": 100,
          "items": {
            "$ref": "#/$defs/Session"
          }
        },
        "next_cursor": {
          "$ref": "#/$defs/Cursor"
        },
        "request_id": {
          "$ref": "#/$defs/Id"
        }
      },
      "required": [
        "items",
        "next_cursor",
        "request_id"
      ],
      "additionalProperties": false
    },
    "SessionStatus": {
      "type": "object",
      "properties": {
        "session": {
          "$ref": "#/$defs/Session"
        },
        "request_id": {
          "$ref": "#/$defs/Id"
        }
      },
      "required": [
        "session",
        "request_id"
      ],
      "additionalProperties": false
    },
    "LifecycleReceipt": {
      "type": "object",
      "properties": {
        "operation_id": {
          "$ref": "#/$defs/Uuid"
        },
        "status": {
          "const": "completed"
        },
        "request_id": {
          "$ref": "#/$defs/Id"
        }
      },
      "required": [
        "operation_id",
        "status",
        "request_id"
      ],
      "additionalProperties": false
    },
    "DoneCommercial": {
      "type": "object",
      "properties": {
        "listing": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128,
          "pattern": "^[^\\u0000-\\u001f\\u007f]+$",
          "x-max-utf16-code-units": 128
        },
        "band": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128,
          "pattern": "^[^\\u0000-\\u001f\\u007f]+$",
          "x-max-utf16-code-units": 128
        },
        "rate_version": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128,
          "pattern": "^[^\\u0000-\\u001f\\u007f]+$",
          "x-max-utf16-code-units": 128
        },
        "billable_units": {
          "enum": [
            0,
            1
          ]
        },
        "charge": {
          "$ref": "#/$defs/Money"
        },
        "settlement": {
          "enum": [
            "reserved",
            "settled",
            "released"
          ]
        },
        "request_id": {
          "$ref": "#/$defs/Id"
        }
      },
      "required": [
        "listing",
        "band",
        "rate_version",
        "billable_units",
        "charge",
        "settlement",
        "request_id"
      ],
      "additionalProperties": false,
      "allOf": [
        {
          "if": {
            "properties": {
              "billable_units": {
                "const": 0
              }
            },
            "required": [
              "billable_units"
            ]
          },
          "then": {
            "properties": {
              "charge": {
                "type": "object",
                "properties": {
                  "amount_micro_usd": {
                    "const": 0
                  }
                }
              }
            }
          }
        },
        {
          "if": {
            "properties": {
              "settlement": {
                "const": "released"
              }
            },
            "required": [
              "settlement"
            ]
          },
          "then": {
            "properties": {
              "billable_units": {
                "const": 0
              },
              "charge": {
                "type": "object",
                "properties": {
                  "amount_micro_usd": {
                    "const": 0
                  }
                }
              }
            }
          }
        }
      ]
    },
    "DoneEvent": {
      "type": "object",
      "properties": {
        "type": {
          "const": "done"
        },
        "sessionId": {
          "$ref": "#/$defs/Id"
        },
        "stopReason": {
          "const": "end_turn"
        },
        "commercial": {
          "$ref": "#/$defs/DoneCommercial"
        }
      },
      "required": [
        "type",
        "sessionId",
        "stopReason",
        "commercial"
      ],
      "additionalProperties": false
    },
    "StreamEvent": {
      "oneOf": [
        {
          "$ref": "#/$defs/MetadataEvent"
        },
        {
          "$ref": "#/$defs/ContentEvent"
        },
        {
          "$ref": "#/$defs/DisplayCompleteEvent"
        },
        {
          "$ref": "#/$defs/SafetyStatus"
        },
        {
          "$ref": "#/$defs/SessionEndedEvent"
        },
        {
          "$ref": "#/$defs/DoneEvent"
        },
        {
          "$ref": "#/$defs/ErrorEvent"
        }
      ],
      "description": "Known emitted JSON data frames. SSE ordering and cross-event identity are runtime invariants. Consumers must ignore unknown future event types/fields without treating them as success."
    },
    "ExportSession": {
      "type": "object",
      "properties": {
        "session_id": {
          "$ref": "#/$defs/Id"
        },
        "status": {
          "enum": [
            "active",
            "closed",
            "discarded",
            "deleted",
            "erased"
          ]
        },
        "created_at": {
          "$ref": "#/$defs/Timestamp"
        },
        "updated_at": {
          "$ref": "#/$defs/Timestamp"
        },
        "ended_at": {
          "anyOf": [
            {
              "$ref": "#/$defs/Timestamp"
            },
            {
              "type": "null"
            }
          ]
        },
        "attention": {
          "type": "boolean"
        },
        "history": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/HistoryItem"
          }
        }
      },
      "required": [
        "session_id",
        "status",
        "created_at",
        "updated_at",
        "ended_at",
        "attention",
        "history"
      ],
      "additionalProperties": false
    },
    "ExportPage": {
      "type": "object",
      "properties": {
        "sessions": {
          "type": "array",
          "maxItems": 100,
          "items": {
            "$ref": "#/$defs/ExportSession"
          }
        },
        "profile_data": {
          "type": "object",
          "additionalProperties": true
        },
        "memory_data": {
          "type": "object",
          "properties": {
            "sessions": {
              "type": "array"
            }
          },
          "required": [
            "sessions"
          ],
          "additionalProperties": true,
          "description": "Stored user memory object. No server model, provider, diagnostic or financial configuration is exported."
        },
        "next_cursor": {
          "$ref": "#/$defs/Cursor"
        },
        "request_id": {
          "$ref": "#/$defs/Id"
        },
        "attention": {
          "type": "object",
          "properties": {
            "items": {
              "type": "array",
              "maxItems": 100,
              "items": {
                "type": "object",
                "properties": {
                  "export_id": {
                    "$ref": "#/$defs/Uuid"
                  },
                  "session_id": {
                    "type": "string",
                    "pattern": "^[A-Za-z0-9][A-Za-z0-9_.:-]{0,127}$"
                  },
                  "document_id": {
                    "type": "string",
                    "pattern": "^[A-Za-z0-9][A-Za-z0-9_.:-]{0,127}$"
                  },
                  "stream_epoch": {
                    "type": "string",
                    "pattern": "^[A-Za-z0-9][A-Za-z0-9_.:-]{0,127}$"
                  },
                  "event_id": {
                    "type": "string",
                    "pattern": "^[A-Za-z0-9][A-Za-z0-9_.:-]{0,127}$"
                  },
                  "accepted_at": {
                    "$ref": "#/$defs/Timestamp"
                  },
                  "expired": {
                    "type": "boolean"
                  },
                  "event": {
                    "anyOf": [
                      {
                        "type": "object",
                        "properties": {
                          "event_id": {
                            "type": "string",
                            "pattern": "^[A-Za-z0-9][A-Za-z0-9_.:-]{0,127}$"
                          },
                          "seq": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 9007199254740991
                          },
                          "occurred_at": {
                            "type": "string",
                            "format": "date-time",
                            "pattern": "^\\d{4}-\\d\\d-\\d\\dT\\d\\d:\\d\\d:\\d\\d(?:\\.\\d{3})?Z$"
                          },
                          "type": {
                            "enum": [
                              "node_added",
                              "node_deleted",
                              "edge_added",
                              "edge_deleted",
                              "param_changed",
                              "tile_added",
                              "tile_deleted",
                              "tile_edited",
                              "sim_tick",
                              "run"
                            ]
                          },
                          "actor": {
                            "enum": [
                              "student",
                              "system",
                              "teacher",
                              "simulator",
                              "unknown"
                            ]
                          },
                          "target": {
                            "type": "object",
                            "properties": {
                              "tile_id": {
                                "type": "string",
                                "pattern": "^[A-Za-z0-9][A-Za-z0-9_.:-]{0,127}$"
                              },
                              "node_id": {
                                "type": "string",
                                "pattern": "^[A-Za-z0-9][A-Za-z0-9_.:-]{0,127}$"
                              },
                              "from": {
                                "type": "string",
                                "pattern": "^[A-Za-z0-9][A-Za-z0-9_.:-]{0,127}$"
                              },
                              "to": {
                                "type": "string",
                                "pattern": "^[A-Za-z0-9][A-Za-z0-9_.:-]{0,127}$"
                              }
                            },
                            "required": [
                              "tile_id"
                            ],
                            "additionalProperties": false
                          },
                          "detail": {
                            "type": "object",
                            "properties": {
                              "field": {
                                "type": "string",
                                "pattern": "^[A-Za-z0-9][A-Za-z0-9_.:-]{0,127}$"
                              },
                              "before": {
                                "anyOf": [
                                  {
                                    "type": "null"
                                  },
                                  {
                                    "type": "boolean"
                                  },
                                  {
                                    "type": "number",
                                    "minimum": -1000000000000,
                                    "maximum": 1000000000000
                                  },
                                  {
                                    "type": "string",
                                    "maxLength": 128,
                                    "pattern": "^[^\\u0000-\\u001f\\u007f]*$"
                                  }
                                ]
                              },
                              "after": {
                                "anyOf": [
                                  {
                                    "type": "null"
                                  },
                                  {
                                    "type": "boolean"
                                  },
                                  {
                                    "type": "number",
                                    "minimum": -1000000000000,
                                    "maximum": 1000000000000
                                  },
                                  {
                                    "type": "string",
                                    "maxLength": 128,
                                    "pattern": "^[^\\u0000-\\u001f\\u007f]*$"
                                  }
                                ]
                              },
                              "run_id": {
                                "type": "string",
                                "pattern": "^[A-Za-z0-9][A-Za-z0-9_.:-]{0,127}$"
                              },
                              "unit_version": {
                                "type": "string",
                                "pattern": "^[A-Za-z0-9][A-Za-z0-9_.:-]{0,127}$"
                              },
                              "device_type": {
                                "enum": [
                                  "Light Bulb",
                                  "Servo",
                                  "Grabber",
                                  "Gripper",
                                  "Gripper 2.0",
                                  "unknown"
                                ]
                              },
                              "device_mode": {
                                "enum": [
                                  "binary",
                                  "proportion",
                                  "degrees",
                                  "unknown"
                                ]
                              },
                              "outcome": {
                                "enum": [
                                  "changed",
                                  "unchanged",
                                  "unexpected",
                                  "not_recorded"
                                ]
                              },
                              "signal_min": {
                                "type": "number",
                                "minimum": -1000000000000,
                                "maximum": 1000000000000
                              },
                              "signal_max": {
                                "type": "number",
                                "minimum": -1000000000000,
                                "maximum": 1000000000000
                              },
                              "output_min": {
                                "type": "number",
                                "minimum": -1000000000000,
                                "maximum": 1000000000000
                              },
                              "output_max": {
                                "type": "number",
                                "minimum": -1000000000000,
                                "maximum": 1000000000000
                              }
                            },
                            "required": [],
                            "additionalProperties": false
                          }
                        },
                        "required": [
                          "event_id",
                          "seq",
                          "occurred_at",
                          "type",
                          "actor",
                          "target",
                          "detail"
                        ],
                        "additionalProperties": false,
                        "allOf": [
                          {
                            "if": {
                              "type": "object",
                              "properties": {
                                "type": {
                                  "const": "param_changed"
                                }
                              }
                            },
                            "then": {
                              "type": "object",
                              "properties": {
                                "detail": {
                                  "type": "object",
                                  "properties": {
                                    "field": {
                                      "type": "string",
                                      "pattern": "^[A-Za-z0-9][A-Za-z0-9_.:-]{0,127}$"
                                    },
                                    "before": {
                                      "anyOf": [
                                        {
                                          "type": "null"
                                        },
                                        {
                                          "type": "boolean"
                                        },
                                        {
                                          "type": "number",
                                          "minimum": -1000000000000,
                                          "maximum": 1000000000000
                                        },
                                        {
                                          "type": "string",
                                          "maxLength": 128,
                                          "pattern": "^[^\\u0000-\\u001f\\u007f]*$"
                                        }
                                      ]
                                    },
                                    "after": {
                                      "anyOf": [
                                        {
                                          "type": "null"
                                        },
                                        {
                                          "type": "boolean"
                                        },
                                        {
                                          "type": "number",
                                          "minimum": -1000000000000,
                                          "maximum": 1000000000000
                                        },
                                        {
                                          "type": "string",
                                          "maxLength": 128,
                                          "pattern": "^[^\\u0000-\\u001f\\u007f]*$"
                                        }
                                      ]
                                    }
                                  },
                                  "required": [
                                    "field",
                                    "before",
                                    "after"
                                  ]
                                }
                              }
                            }
                          },
                          {
                            "if": {
                              "type": "object",
                              "properties": {
                                "type": {
                                  "const": "sim_tick"
                                }
                              }
                            },
                            "then": {
                              "type": "object",
                              "properties": {
                                "detail": {
                                  "type": "object",
                                  "properties": {
                                    "run_id": {
                                      "type": "string",
                                      "pattern": "^[A-Za-z0-9][A-Za-z0-9_.:-]{0,127}$"
                                    }
                                  },
                                  "required": [
                                    "run_id"
                                  ]
                                }
                              }
                            }
                          }
                        ],
                        "x-max-serialized-utf8-bytes": 4096
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": [
                  "export_id",
                  "session_id",
                  "document_id",
                  "stream_epoch",
                  "event_id",
                  "accepted_at",
                  "expired",
                  "event"
                ],
                "additionalProperties": true
              }
            },
            "next_cursor": {
              "$ref": "#/$defs/Cursor"
            }
          },
          "required": [
            "items",
            "next_cursor"
          ],
          "additionalProperties": false,
          "description": "Optional when Attention storage is ready; separate pagination chain. Expired raw event payloads are null."
        }
      },
      "required": [
        "sessions",
        "profile_data",
        "memory_data",
        "next_cursor",
        "request_id"
      ],
      "additionalProperties": false
    },
    "ConsoleExportPage": {
      "type": "object",
      "properties": {
        "sessions": {
          "type": "array",
          "maxItems": 100,
          "items": {
            "$ref": "#/$defs/ExportSession"
          }
        },
        "profile_data": {
          "type": "object",
          "additionalProperties": true
        },
        "memory_data": {
          "type": "object",
          "properties": {
            "sessions": {
              "type": "array"
            }
          },
          "required": [
            "sessions"
          ],
          "additionalProperties": true,
          "description": "Stored user memory object. No server model, provider, diagnostic or financial configuration is exported."
        },
        "next_cursor": {
          "$ref": "#/$defs/Cursor"
        },
        "request_id": {
          "$ref": "#/$defs/Id"
        },
        "operation_id": {
          "$ref": "#/$defs/ConsoleOperationId"
        }
      },
      "required": [
        "sessions",
        "profile_data",
        "memory_data",
        "next_cursor",
        "request_id",
        "operation_id"
      ],
      "additionalProperties": false
    },
    "ConsoleOperationRequest": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "operation_id": {
          "$ref": "#/$defs/ConsoleOperationId"
        }
      },
      "required": [
        "operation_id"
      ]
    },
    "DemoEnrollmentReceipt": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "status": {
          "enum": [
            "applied",
            "already"
          ]
        },
        "org_id": {
          "$ref": "#/$defs/ConsoleOperationId"
        },
        "assignment_id": {
          "$ref": "#/$defs/ConsoleOperationId"
        },
        "publication_id": {
          "$ref": "#/$defs/ConsoleOperationId"
        },
        "listing_id": {
          "$ref": "#/$defs/ConsoleOperationId"
        },
        "release_id": {
          "$ref": "#/$defs/ConsoleOperationId"
        },
        "rate_id": {
          "$ref": "#/$defs/ConsoleOperationId"
        },
        "environment": {
          "const": "staging"
        },
        "mode": {
          "const": "test"
        }
      },
      "required": [
        "status",
        "org_id",
        "assignment_id",
        "publication_id",
        "listing_id",
        "release_id",
        "rate_id",
        "environment",
        "mode"
      ]
    },
    "SafetyWebhook": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "id": {
          "$ref": "#/$defs/ConsoleOperationId"
        },
        "key_id": {
          "$ref": "#/$defs/ConsoleOperationId"
        },
        "url": {
          "type": "string",
          "maxLength": 2048,
          "pattern": "^https://"
        },
        "enabled": {
          "type": "boolean"
        },
        "updated_at": {
          "$ref": "#/$defs/Timestamp"
        }
      },
      "required": [
        "id",
        "key_id",
        "url",
        "enabled",
        "updated_at"
      ]
    },
    "SafetyWebhookRead": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "webhook": {
          "anyOf": [
            {
              "$ref": "#/$defs/SafetyWebhook"
            },
            {
              "type": "null"
            }
          ]
        },
        "delivery": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "pending": {
              "type": "integer",
              "minimum": 0
            },
            "delivered": {
              "type": "integer",
              "minimum": 0
            },
            "dead_letter": {
              "type": "integer",
              "minimum": 0
            }
          },
          "required": [
            "pending",
            "delivered",
            "dead_letter"
          ]
        }
      },
      "required": [
        "webhook",
        "delivery"
      ]
    },
    "SafetyWebhookRequest": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "operation_id": {
          "$ref": "#/$defs/ConsoleOperationId"
        },
        "url": {
          "type": "string",
          "minLength": 1,
          "maxLength": 2048,
          "pattern": "^https://"
        },
        "enabled": {
          "type": "boolean"
        },
        "rotate_secret": {
          "type": "boolean"
        }
      },
      "required": [
        "operation_id",
        "url",
        "enabled"
      ]
    },
    "SafetyWebhookReceipt": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "webhook": {
          "anyOf": [
            {
              "$ref": "#/$defs/SafetyWebhook"
            },
            {
              "type": "null"
            }
          ]
        },
        "delivery": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "pending": {
              "type": "integer",
              "minimum": 0
            },
            "delivered": {
              "type": "integer",
              "minimum": 0
            },
            "dead_letter": {
              "type": "integer",
              "minimum": 0
            }
          },
          "required": [
            "pending",
            "delivered",
            "dead_letter"
          ]
        },
        "status": {
          "enum": [
            "applied",
            "already"
          ]
        },
        "signing_secret": {
          "type": "string",
          "pattern": "^[a-f0-9]{64}$"
        },
        "secret_unavailable": {
          "const": true
        }
      },
      "required": [
        "webhook",
        "delivery",
        "status"
      ]
    },
    "AttentionEvent": {
      "type": "object",
      "properties": {
        "event_id": {
          "type": "string",
          "pattern": "^[A-Za-z0-9][A-Za-z0-9_.:-]{0,127}$"
        },
        "seq": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        },
        "occurred_at": {
          "type": "string",
          "format": "date-time",
          "pattern": "^\\d{4}-\\d\\d-\\d\\dT\\d\\d:\\d\\d:\\d\\d(?:\\.\\d{3})?Z$"
        },
        "type": {
          "enum": [
            "node_added",
            "node_deleted",
            "edge_added",
            "edge_deleted",
            "param_changed",
            "tile_added",
            "tile_deleted",
            "tile_edited",
            "sim_tick",
            "run"
          ]
        },
        "actor": {
          "enum": [
            "student",
            "system",
            "teacher",
            "simulator",
            "unknown"
          ]
        },
        "target": {
          "type": "object",
          "properties": {
            "tile_id": {
              "type": "string",
              "pattern": "^[A-Za-z0-9][A-Za-z0-9_.:-]{0,127}$"
            },
            "node_id": {
              "type": "string",
              "pattern": "^[A-Za-z0-9][A-Za-z0-9_.:-]{0,127}$"
            },
            "from": {
              "type": "string",
              "pattern": "^[A-Za-z0-9][A-Za-z0-9_.:-]{0,127}$"
            },
            "to": {
              "type": "string",
              "pattern": "^[A-Za-z0-9][A-Za-z0-9_.:-]{0,127}$"
            }
          },
          "required": [
            "tile_id"
          ],
          "additionalProperties": false
        },
        "detail": {
          "type": "object",
          "properties": {
            "field": {
              "type": "string",
              "pattern": "^[A-Za-z0-9][A-Za-z0-9_.:-]{0,127}$"
            },
            "before": {
              "anyOf": [
                {
                  "type": "null"
                },
                {
                  "type": "boolean"
                },
                {
                  "type": "number",
                  "minimum": -1000000000000,
                  "maximum": 1000000000000
                },
                {
                  "type": "string",
                  "maxLength": 128,
                  "pattern": "^[^\\u0000-\\u001f\\u007f]*$"
                }
              ]
            },
            "after": {
              "anyOf": [
                {
                  "type": "null"
                },
                {
                  "type": "boolean"
                },
                {
                  "type": "number",
                  "minimum": -1000000000000,
                  "maximum": 1000000000000
                },
                {
                  "type": "string",
                  "maxLength": 128,
                  "pattern": "^[^\\u0000-\\u001f\\u007f]*$"
                }
              ]
            },
            "run_id": {
              "type": "string",
              "pattern": "^[A-Za-z0-9][A-Za-z0-9_.:-]{0,127}$"
            },
            "unit_version": {
              "type": "string",
              "pattern": "^[A-Za-z0-9][A-Za-z0-9_.:-]{0,127}$"
            },
            "device_type": {
              "enum": [
                "Light Bulb",
                "Servo",
                "Grabber",
                "Gripper",
                "Gripper 2.0",
                "unknown"
              ]
            },
            "device_mode": {
              "enum": [
                "binary",
                "proportion",
                "degrees",
                "unknown"
              ]
            },
            "outcome": {
              "enum": [
                "changed",
                "unchanged",
                "unexpected",
                "not_recorded"
              ]
            },
            "signal_min": {
              "type": "number",
              "minimum": -1000000000000,
              "maximum": 1000000000000
            },
            "signal_max": {
              "type": "number",
              "minimum": -1000000000000,
              "maximum": 1000000000000
            },
            "output_min": {
              "type": "number",
              "minimum": -1000000000000,
              "maximum": 1000000000000
            },
            "output_max": {
              "type": "number",
              "minimum": -1000000000000,
              "maximum": 1000000000000
            }
          },
          "required": [],
          "additionalProperties": false
        }
      },
      "required": [
        "event_id",
        "seq",
        "occurred_at",
        "type",
        "actor",
        "target",
        "detail"
      ],
      "additionalProperties": false,
      "allOf": [
        {
          "if": {
            "type": "object",
            "properties": {
              "type": {
                "const": "param_changed"
              }
            }
          },
          "then": {
            "type": "object",
            "properties": {
              "detail": {
                "type": "object",
                "properties": {
                  "field": {
                    "type": "string",
                    "pattern": "^[A-Za-z0-9][A-Za-z0-9_.:-]{0,127}$"
                  },
                  "before": {
                    "anyOf": [
                      {
                        "type": "null"
                      },
                      {
                        "type": "boolean"
                      },
                      {
                        "type": "number",
                        "minimum": -1000000000000,
                        "maximum": 1000000000000
                      },
                      {
                        "type": "string",
                        "maxLength": 128,
                        "pattern": "^[^\\u0000-\\u001f\\u007f]*$"
                      }
                    ]
                  },
                  "after": {
                    "anyOf": [
                      {
                        "type": "null"
                      },
                      {
                        "type": "boolean"
                      },
                      {
                        "type": "number",
                        "minimum": -1000000000000,
                        "maximum": 1000000000000
                      },
                      {
                        "type": "string",
                        "maxLength": 128,
                        "pattern": "^[^\\u0000-\\u001f\\u007f]*$"
                      }
                    ]
                  }
                },
                "required": [
                  "field",
                  "before",
                  "after"
                ]
              }
            }
          }
        },
        {
          "if": {
            "type": "object",
            "properties": {
              "type": {
                "const": "sim_tick"
              }
            }
          },
          "then": {
            "type": "object",
            "properties": {
              "detail": {
                "type": "object",
                "properties": {
                  "run_id": {
                    "type": "string",
                    "pattern": "^[A-Za-z0-9][A-Za-z0-9_.:-]{0,127}$"
                  }
                },
                "required": [
                  "run_id"
                ]
              }
            }
          }
        }
      ],
      "x-max-serialized-utf8-bytes": 4096
    },
    "AttentionContext": {
      "type": "object",
      "properties": {
        "schema_version": {
          "const": "clue.attention_context.v1"
        },
        "document_id": {
          "type": "string",
          "pattern": "^[A-Za-z0-9][A-Za-z0-9_.:-]{0,127}$"
        },
        "stream_epoch": {
          "type": "string",
          "pattern": "^[A-Za-z0-9][A-Za-z0-9_.:-]{0,127}$"
        },
        "batch_id": {
          "type": "string",
          "pattern": "^[A-Za-z0-9][A-Za-z0-9_.:-]{0,127}$"
        },
        "capture_channel": {
          "const": "clue_workspace_observer_v1"
        },
        "since_turn": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        },
        "from_revision": {
          "type": "string",
          "pattern": "^[A-Za-z0-9][A-Za-z0-9_.:-]{0,127}$"
        },
        "to_revision": {
          "type": "string",
          "pattern": "^[A-Za-z0-9][A-Za-z0-9_.:-]{0,127}$"
        },
        "window_start_seq": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        },
        "window_end_seq": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        },
        "complete": {
          "type": "boolean"
        },
        "dropped_events": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        }
      },
      "required": [
        "schema_version",
        "document_id",
        "stream_epoch",
        "batch_id",
        "capture_channel",
        "since_turn",
        "from_revision",
        "to_revision",
        "window_start_seq",
        "window_end_seq",
        "complete",
        "dropped_events"
      ],
      "additionalProperties": false
    },
    "AttentionRequest": {
      "type": "object",
      "properties": {
        "session_id": {
          "type": "string",
          "pattern": "^[A-Za-z0-9][A-Za-z0-9_.:-]{0,127}$"
        },
        "context": {
          "type": "object",
          "properties": {
            "schema_version": {
              "const": "clue.attention_context.v1"
            },
            "document_id": {
              "type": "string",
              "pattern": "^[A-Za-z0-9][A-Za-z0-9_.:-]{0,127}$"
            },
            "stream_epoch": {
              "type": "string",
              "pattern": "^[A-Za-z0-9][A-Za-z0-9_.:-]{0,127}$"
            },
            "batch_id": {
              "type": "string",
              "pattern": "^[A-Za-z0-9][A-Za-z0-9_.:-]{0,127}$"
            },
            "capture_channel": {
              "const": "clue_workspace_observer_v1"
            },
            "since_turn": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            "from_revision": {
              "type": "string",
              "pattern": "^[A-Za-z0-9][A-Za-z0-9_.:-]{0,127}$"
            },
            "to_revision": {
              "type": "string",
              "pattern": "^[A-Za-z0-9][A-Za-z0-9_.:-]{0,127}$"
            },
            "window_start_seq": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            "window_end_seq": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            "complete": {
              "type": "boolean"
            },
            "dropped_events": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            }
          },
          "required": [
            "schema_version",
            "document_id",
            "stream_epoch",
            "batch_id",
            "capture_channel",
            "since_turn",
            "from_revision",
            "to_revision",
            "window_start_seq",
            "window_end_seq",
            "complete",
            "dropped_events"
          ],
          "additionalProperties": false
        },
        "events": {
          "type": "array",
          "minItems": 1,
          "maxItems": 100,
          "items": {
            "type": "object",
            "properties": {
              "event_id": {
                "type": "string",
                "pattern": "^[A-Za-z0-9][A-Za-z0-9_.:-]{0,127}$"
              },
              "seq": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              "occurred_at": {
                "type": "string",
                "format": "date-time",
                "pattern": "^\\d{4}-\\d\\d-\\d\\dT\\d\\d:\\d\\d:\\d\\d(?:\\.\\d{3})?Z$"
              },
              "type": {
                "enum": [
                  "node_added",
                  "node_deleted",
                  "edge_added",
                  "edge_deleted",
                  "param_changed",
                  "tile_added",
                  "tile_deleted",
                  "tile_edited",
                  "sim_tick",
                  "run"
                ]
              },
              "actor": {
                "enum": [
                  "student",
                  "system",
                  "teacher",
                  "simulator",
                  "unknown"
                ]
              },
              "target": {
                "type": "object",
                "properties": {
                  "tile_id": {
                    "type": "string",
                    "pattern": "^[A-Za-z0-9][A-Za-z0-9_.:-]{0,127}$"
                  },
                  "node_id": {
                    "type": "string",
                    "pattern": "^[A-Za-z0-9][A-Za-z0-9_.:-]{0,127}$"
                  },
                  "from": {
                    "type": "string",
                    "pattern": "^[A-Za-z0-9][A-Za-z0-9_.:-]{0,127}$"
                  },
                  "to": {
                    "type": "string",
                    "pattern": "^[A-Za-z0-9][A-Za-z0-9_.:-]{0,127}$"
                  }
                },
                "required": [
                  "tile_id"
                ],
                "additionalProperties": false
              },
              "detail": {
                "type": "object",
                "properties": {
                  "field": {
                    "type": "string",
                    "pattern": "^[A-Za-z0-9][A-Za-z0-9_.:-]{0,127}$"
                  },
                  "before": {
                    "anyOf": [
                      {
                        "type": "null"
                      },
                      {
                        "type": "boolean"
                      },
                      {
                        "type": "number",
                        "minimum": -1000000000000,
                        "maximum": 1000000000000
                      },
                      {
                        "type": "string",
                        "maxLength": 128,
                        "pattern": "^[^\\u0000-\\u001f\\u007f]*$"
                      }
                    ]
                  },
                  "after": {
                    "anyOf": [
                      {
                        "type": "null"
                      },
                      {
                        "type": "boolean"
                      },
                      {
                        "type": "number",
                        "minimum": -1000000000000,
                        "maximum": 1000000000000
                      },
                      {
                        "type": "string",
                        "maxLength": 128,
                        "pattern": "^[^\\u0000-\\u001f\\u007f]*$"
                      }
                    ]
                  },
                  "run_id": {
                    "type": "string",
                    "pattern": "^[A-Za-z0-9][A-Za-z0-9_.:-]{0,127}$"
                  },
                  "unit_version": {
                    "type": "string",
                    "pattern": "^[A-Za-z0-9][A-Za-z0-9_.:-]{0,127}$"
                  },
                  "device_type": {
                    "enum": [
                      "Light Bulb",
                      "Servo",
                      "Grabber",
                      "Gripper",
                      "Gripper 2.0",
                      "unknown"
                    ]
                  },
                  "device_mode": {
                    "enum": [
                      "binary",
                      "proportion",
                      "degrees",
                      "unknown"
                    ]
                  },
                  "outcome": {
                    "enum": [
                      "changed",
                      "unchanged",
                      "unexpected",
                      "not_recorded"
                    ]
                  },
                  "signal_min": {
                    "type": "number",
                    "minimum": -1000000000000,
                    "maximum": 1000000000000
                  },
                  "signal_max": {
                    "type": "number",
                    "minimum": -1000000000000,
                    "maximum": 1000000000000
                  },
                  "output_min": {
                    "type": "number",
                    "minimum": -1000000000000,
                    "maximum": 1000000000000
                  },
                  "output_max": {
                    "type": "number",
                    "minimum": -1000000000000,
                    "maximum": 1000000000000
                  }
                },
                "required": [],
                "additionalProperties": false
              }
            },
            "required": [
              "event_id",
              "seq",
              "occurred_at",
              "type",
              "actor",
              "target",
              "detail"
            ],
            "additionalProperties": false,
            "allOf": [
              {
                "if": {
                  "type": "object",
                  "properties": {
                    "type": {
                      "const": "param_changed"
                    }
                  }
                },
                "then": {
                  "type": "object",
                  "properties": {
                    "detail": {
                      "type": "object",
                      "properties": {
                        "field": {
                          "type": "string",
                          "pattern": "^[A-Za-z0-9][A-Za-z0-9_.:-]{0,127}$"
                        },
                        "before": {
                          "anyOf": [
                            {
                              "type": "null"
                            },
                            {
                              "type": "boolean"
                            },
                            {
                              "type": "number",
                              "minimum": -1000000000000,
                              "maximum": 1000000000000
                            },
                            {
                              "type": "string",
                              "maxLength": 128,
                              "pattern": "^[^\\u0000-\\u001f\\u007f]*$"
                            }
                          ]
                        },
                        "after": {
                          "anyOf": [
                            {
                              "type": "null"
                            },
                            {
                              "type": "boolean"
                            },
                            {
                              "type": "number",
                              "minimum": -1000000000000,
                              "maximum": 1000000000000
                            },
                            {
                              "type": "string",
                              "maxLength": 128,
                              "pattern": "^[^\\u0000-\\u001f\\u007f]*$"
                            }
                          ]
                        }
                      },
                      "required": [
                        "field",
                        "before",
                        "after"
                      ]
                    }
                  }
                }
              },
              {
                "if": {
                  "type": "object",
                  "properties": {
                    "type": {
                      "const": "sim_tick"
                    }
                  }
                },
                "then": {
                  "type": "object",
                  "properties": {
                    "detail": {
                      "type": "object",
                      "properties": {
                        "run_id": {
                          "type": "string",
                          "pattern": "^[A-Za-z0-9][A-Za-z0-9_.:-]{0,127}$"
                        }
                      },
                      "required": [
                        "run_id"
                      ]
                    }
                  }
                }
              }
            ],
            "x-max-serialized-utf8-bytes": 4096
          }
        }
      },
      "required": [
        "session_id",
        "context",
        "events"
      ],
      "additionalProperties": false,
      "x-max-serialized-utf8-bytes": 131072,
      "description": "Enabled CLUE v0.15 releases only. Runtime additionally enforces unique event IDs/sequences, inclusive sequence range below 10000, valid calendar timestamps, paired min/max ordering, per-event/body UTF-8 bounds and authenticated existing-session ownership. Caller actor labels never grant verified capture authority."
    },
    "AttentionReceipt": {
      "type": "object",
      "properties": {
        "status": {
          "enum": [
            "accepted",
            "duplicate"
          ]
        },
        "receipt_id": {
          "$ref": "#/$defs/Uuid"
        },
        "accepted": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        },
        "duplicates": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        },
        "rejected": {
          "const": 0
        },
        "processing": {
          "enum": [
            "pending",
            "disabled",
            "not_required"
          ]
        },
        "document_id": {
          "type": "string",
          "pattern": "^[A-Za-z0-9][A-Za-z0-9_.:-]{0,127}$"
        },
        "stream_epoch": {
          "type": "string",
          "pattern": "^[A-Za-z0-9][A-Za-z0-9_.:-]{0,127}$"
        },
        "batch_id": {
          "type": "string",
          "pattern": "^[A-Za-z0-9][A-Za-z0-9_.:-]{0,127}$"
        },
        "window_status": {
          "enum": [
            "pending_verification",
            "late",
            "incomplete"
          ]
        },
        "memory_applied": {
          "const": false
        },
        "request_id": {
          "$ref": "#/$defs/Id"
        }
      },
      "required": [
        "status",
        "receipt_id",
        "accepted",
        "duplicates",
        "rejected",
        "processing",
        "document_id",
        "stream_epoch",
        "batch_id",
        "window_status",
        "memory_applied",
        "request_id"
      ],
      "additionalProperties": true
    },
    "ConsoleEraseRequest": {
      "type": "object",
      "properties": {
        "assignment_id": {
          "$ref": "#/$defs/Uuid"
        },
        "external_user_id": {
          "$ref": "#/$defs/ExternalUserId"
        },
        "operation_id": {
          "$ref": "#/$defs/ConsoleOperationId"
        },
        "subject_namespace": {
          "type": "string",
          "enum": [
            "api",
            "sandbox"
          ],
          "default": "api",
          "description": "Sandbox selects only the verified actor’s test user. Omission addresses the API user."
        }
      },
      "required": [
        "assignment_id",
        "external_user_id",
        "operation_id"
      ],
      "additionalProperties": false
    }
  }
}
