{
  "$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."
    },
    "task_type": {
      "type": "string",
      "minLength": 1,
      "maxLength": 80
    },
    "subtype": {
      "type": "string",
      "minLength": 1,
      "maxLength": 80
    },
    "description": {
      "type": "string",
      "minLength": 1,
      "maxLength": 8000,
      "description": "Sanitized objective visible only at execution tier."
    },
    "budget": {
      "type": "object",
      "properties": {
        "currency": {
          "type": "string",
          "const": "USD",
          "description": "Draft examples support USD only. Multi-currency and exponent rules require adoption."
        },
        "amount": {
          "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": [
        "currency",
        "amount"
      ],
      "additionalProperties": false,
      "description": "Proposed serialization only; the source does not specify a canonical money representation."
    },
    "time_constraint": {
      "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 chooses an absolute deadline. Source §9.2 uses a duration expression; review-window arithmetic is unresolved."
    },
    "cost_model": {
      "type": "string",
      "enum": [
        "fixed",
        "shared",
        "hourly"
      ],
      "description": "§6.2 default is fixed. Draft serializers must send the value explicitly; validators do not inject defaults."
    },
    "attachments": {
      "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."
      }
    },
    "sensitivity_tier_override": {
      "description": "Requested tier; coordinator must not allow it to weaken actual data classification.",
      "type": "integer",
      "minimum": 1,
      "maximum": 4
    },
    "evaluation_criteria": {
      "type": "object",
      "properties": {
        "optimize_for": {
          "type": "string",
          "enum": [
            "speed",
            "visual_polish",
            "narrative",
            "brand_consistency",
            "conversion",
            "cost_efficiency"
          ],
          "description": "Exactly one primary dimension (§6.3)."
        },
        "secondary": {
          "description": "Optional supporting dimensions; primary takes precedence.",
          "maxItems": 5,
          "type": "array",
          "items": {
            "type": "string",
            "enum": [
              "speed",
              "visual_polish",
              "narrative",
              "brand_consistency",
              "conversion",
              "cost_efficiency"
            ]
          }
        },
        "user_hint": {
          "description": "Draft: sanitized hint only. Raw phrase in §6.3 conflicts with sanitization in §8.7; no transcript disclosure.",
          "type": "string",
          "minLength": 1,
          "maxLength": 2000
        }
      },
      "required": [
        "optimize_for"
      ],
      "additionalProperties": false,
      "description": "Source-defined dimensions; the OWCS envelope/version is unresolved."
    },
    "discovery_context": {
      "description": "Opaque optional OWCS document. Validate against a negotiated OWCS version separately; no OWCS schema is invented here.",
      "anyOf": [
        {
          "type": "object",
          "propertyNames": {
            "type": "string"
          },
          "additionalProperties": {
            "$ref": "#/$defs/__schema0"
          }
        },
        {
          "type": "null"
        }
      ]
    }
  },
  "required": [
    "profile",
    "task_type",
    "subtype",
    "description",
    "budget",
    "time_constraint",
    "cost_model",
    "attachments",
    "evaluation_criteria"
  ],
  "additionalProperties": false,
  "description": "Execution-tier work specification. This draft is not the missing authoritative v0.4 JSON Schema.",
  "$defs": {
    "__schema0": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "number"
        },
        {
          "type": "boolean"
        },
        {
          "type": "null"
        },
        {
          "type": "array",
          "items": {
            "$ref": "#/$defs/__schema0"
          }
        },
        {
          "type": "object",
          "propertyNames": {
            "type": "string"
          },
          "additionalProperties": {
            "$ref": "#/$defs/__schema0"
          }
        }
      ]
    }
  },
  "title": "JobSpec",
  "$comment": "owp-docs-draft/0.1: proposed documentation shape only. Source: https://app.notion.com/p/338ed9cb3201819d96e9fc7b8e88594a §6. No production conformance claim."
}
