{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/useorgx-com/json-schema/useorgx-com-initiative-proposal-request-schema.json",
  "title": "InitiativeProposalRequest",
  "x-generated": "2026-11-27",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/useorgx-com-openapi.yml#/components/schemas/InitiativeProposalRequest",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "title"
  ],
  "properties": {
    "workspace_id": {
      "type": "string",
      "format": "uuid"
    },
    "title": {
      "type": "string",
      "minLength": 1,
      "maxLength": 200
    },
    "summary": {
      "type": [
        "string",
        "null"
      ],
      "maxLength": 4000
    },
    "prompt": {
      "type": "string",
      "maxLength": 4000,
      "description": "Small-prompt carrier folded into the generation intent"
    },
    "goal_ids": {
      "type": "array",
      "maxItems": 20,
      "items": {
        "type": "string",
        "format": "uuid"
      }
    },
    "context": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "audience": {
          "type": "string",
          "maxLength": 500
        },
        "constraints": {
          "type": "array",
          "maxItems": 10,
          "items": {
            "type": "string"
          }
        },
        "success_criteria": {
          "type": "array",
          "maxItems": 10,
          "items": {
            "type": "string"
          }
        },
        "links": {
          "type": "array",
          "maxItems": 10,
          "items": {
            "type": "string",
            "format": "uri"
          }
        },
        "notes": {
          "type": "string",
          "maxLength": 4000
        }
      }
    },
    "depth": {
      "type": "string",
      "enum": [
        "initiative",
        "workstreams",
        "full"
      ],
      "default": "full"
    },
    "workstreams": {
      "type": "array",
      "maxItems": 20,
      "description": "When present, generation only fills gaps in your explicit lanes",
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "name"
        ],
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 240
          },
          "goal": {
            "type": "string",
            "maxLength": 4000
          },
          "domain_hint": {
            "type": "string",
            "enum": [
              "product",
              "engineering",
              "marketing",
              "sales",
              "operations",
              "design",
              "orchestration"
            ]
          },
          "agent_id": {
            "type": "string"
          },
          "depends_on": {
            "type": "array",
            "maxItems": 20,
            "items": {
              "type": "string"
            }
          },
          "deliverables": {
            "type": "array",
            "maxItems": 20,
            "items": {
              "type": "string"
            }
          },
          "expected_tokens": {
            "type": "integer",
            "minimum": 1
          },
          "expected_duration_hours": {
            "type": "number",
            "exclusiveMinimum": 0
          },
          "expected_budget_usd": {
            "type": "number",
            "exclusiveMinimum": 0
          },
          "milestones": {
            "type": "array",
            "maxItems": 10,
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "title"
              ],
              "properties": {
                "title": {
                  "type": "string"
                },
                "tasks": {
                  "type": "array",
                  "maxItems": 15,
                  "items": {
                    "$ref": "#/$defs/InitiativePlanTask"
                  }
                }
              }
            }
          }
        }
      }
    },
    "agent_assignment": {
      "type": "string",
      "enum": [
        "auto",
        "none"
      ],
      "default": "auto"
    },
    "generation": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "model_tier": {
          "type": "string",
          "enum": [
            "standard",
            "balanced",
            "precision"
          ],
          "default": "standard",
          "description": "Generation-time tier only; run-time forcing lives on launch and runs"
        },
        "max_workstreams": {
          "type": "integer",
          "minimum": 1,
          "maximum": 12
        }
      }
    },
    "source_evidence": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "target_url",
        "verification_state"
      ],
      "properties": {
        "target_url": {
          "type": "string",
          "format": "uri"
        },
        "verification_state": {
          "type": "string",
          "enum": [
            "verified",
            "partial",
            "unverified"
          ],
          "description": "unverified pins the committed initiative to draft and blocks launch"
        },
        "evidence_urls": {
          "type": "array",
          "maxItems": 20,
          "items": {
            "type": "string",
            "format": "uri"
          }
        },
        "notes": {
          "type": "string",
          "maxLength": 4000
        }
      }
    }
  },
  "$defs": {
    "InitiativePlanTask": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "title"
      ],
      "properties": {
        "title": {
          "type": "string",
          "minLength": 1,
          "maxLength": 240
        },
        "detail": {
          "type": [
            "string",
            "null"
          ],
          "maxLength": 4000
        },
        "type": {
          "type": "string",
          "enum": [
            "research",
            "create",
            "review",
            "implement"
          ]
        },
        "depends_on": {
          "type": "array",
          "maxItems": 15,
          "items": {
            "type": "string"
          },
          "description": "Titles of sibling tasks in the same milestone"
        },
        "agent_id": {
          "type": "string",
          "description": "Canonical '-agent' id"
        },
        "expected_tokens": {
          "type": "integer",
          "minimum": 1
        },
        "expected_duration_hours": {
          "type": "number",
          "exclusiveMinimum": 0
        },
        "expected_budget_usd": {
          "type": "number",
          "exclusiveMinimum": 0
        }
      }
    }
  }
}