{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "profile": {
      "type": "string",
      "const": "owp-docs-draft/0.1",
      "description": "Draft discriminator. This value is not OWP v0.4 conformance or an alpha wire profile."
    },
    "created_at": {
      "type": "string",
      "format": "date-time",
      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:Z))$",
      "description": "Draft: UTC date-time, second precision, ending in Z."
    },
    "updated_at": {
      "type": "string",
      "format": "date-time",
      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:Z))$",
      "description": "Draft: UTC date-time, second precision, ending in Z."
    },
    "metadata": {
      "type": "object",
      "propertyNames": {
        "type": "string",
        "minLength": 1,
        "maxLength": 40
      },
      "additionalProperties": {
        "type": "string",
        "maxLength": 500
      },
      "description": "Source metadata dictionary; draft limits keys to 40 and values to 500 characters. Never put secrets here."
    },
    "id": {
      "type": "string",
      "pattern": "^out_[A-Za-z0-9]{8,64}$",
      "description": "Source defines the prefix; this draft chooses an 8–64 character alphanumeric suffix."
    },
    "job_id": {
      "type": "string",
      "pattern": "^job_[A-Za-z0-9]{8,64}$",
      "description": "Source defines the prefix; this draft chooses an 8–64 character alphanumeric suffix."
    },
    "agent_id": {
      "type": "string",
      "pattern": "^agent_[A-Za-z0-9]{8,64}$",
      "description": "Source defines the prefix; this draft chooses an 8–64 character alphanumeric suffix."
    },
    "agent_version": {
      "type": "string",
      "minLength": 1,
      "maxLength": 80
    },
    "content": {
      "type": "object",
      "properties": {
        "media_type": {
          "type": "string",
          "const": "text/plain"
        },
        "text": {
          "type": "string",
          "minLength": 1,
          "maxLength": 50000
        }
      },
      "required": [
        "media_type",
        "text"
      ],
      "additionalProperties": false,
      "description": "Draft starter supports bounded plain text. Other output formats need a versioned schema."
    },
    "artifacts": {
      "maxItems": 20,
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "uri": {
            "type": "string",
            "maxLength": 2048,
            "pattern": "^https:\\/\\/",
            "description": "Draft HTTPS artifact reference; fetching still requires authorization and destination checks."
          },
          "media_type": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120
          },
          "sha256": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$",
            "description": "SHA-256, lowercase hexadecimal. Encoding is a draft choice."
          }
        },
        "required": [
          "uri",
          "media_type",
          "sha256"
        ],
        "additionalProperties": false,
        "description": "Draft artifact descriptor; no bearer credentials or inline private content."
      }
    },
    "cost_breakdown": {
      "description": "Required by policy for shared-cost jobs; schema alone cannot inspect the linked job.",
      "type": "object",
      "properties": {
        "compute_seconds": {
          "type": "number",
          "minimum": 0
        },
        "compute_cost_usd": {
          "type": "string",
          "pattern": "^(0|[1-9][0-9]{0,8})\\.[0-9]{2}$",
          "description": "Draft exact decimal USD string, e.g. 25.00. Never convert through floating point for accounting."
        },
        "api_calls": {
          "maxItems": 1000,
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "provider": {
                "type": "string",
                "minLength": 1,
                "maxLength": 80
              },
              "model": {
                "type": "string",
                "minLength": 1,
                "maxLength": 120
              },
              "tokens": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              "cost_usd": {
                "type": "string",
                "pattern": "^(0|[1-9][0-9]{0,8})\\.[0-9]{2}$",
                "description": "Draft exact decimal USD string, e.g. 25.00. Never convert through floating point for accounting."
              }
            },
            "required": [
              "provider",
              "model",
              "tokens",
              "cost_usd"
            ],
            "additionalProperties": false
          }
        },
        "storage_bytes": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        },
        "storage_cost_usd": {
          "type": "string",
          "pattern": "^(0|[1-9][0-9]{0,8})\\.[0-9]{2}$",
          "description": "Draft exact decimal USD string, e.g. 25.00. Never convert through floating point for accounting."
        },
        "human_labor_minutes": {
          "type": "number",
          "minimum": 0
        },
        "human_labor_cost_usd": {
          "type": "string",
          "pattern": "^(0|[1-9][0-9]{0,8})\\.[0-9]{2}$",
          "description": "Draft exact decimal USD string, e.g. 25.00. Never convert through floating point for accounting."
        },
        "total_usd": {
          "type": "string",
          "pattern": "^(0|[1-9][0-9]{0,8})\\.[0-9]{2}$",
          "description": "Draft exact decimal USD string, e.g. 25.00. Never convert through floating point for accounting."
        }
      },
      "required": [
        "compute_seconds",
        "compute_cost_usd",
        "api_calls",
        "storage_bytes",
        "storage_cost_usd",
        "human_labor_minutes",
        "human_labor_cost_usd",
        "total_usd"
      ],
      "additionalProperties": false
    }
  },
  "required": [
    "profile",
    "created_at",
    "updated_at",
    "metadata",
    "id",
    "job_id",
    "agent_id",
    "agent_version",
    "content",
    "artifacts"
  ],
  "additionalProperties": false,
  "description": "Submitted result. Submission does not choose a winner, authorize payment or complete a job.",
  "title": "Output",
  "$comment": "owp-docs-draft/0.1: proposed documentation shape only. Source: https://app.notion.com/p/338ed9cb3201819d96e9fc7b8e88594a §3 · §6.4 · §9.2. No production conformance claim."
}
