{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/zeronoise-ai/json-schema/zeronoise-ai-proposal-schema.json",
  "title": "Proposal",
  "x-generated": "2026-11-29",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/zeronoise-ai-openapi.yaml#/components/schemas/Proposal",
  "type": "object",
  "required": [
    "id",
    "object",
    "chat_id",
    "agent_id",
    "status",
    "base_configuration_etag",
    "changes"
  ],
  "properties": {
    "id": {
      "$ref": "#/$defs/OpaqueId"
    },
    "object": {
      "type": "string",
      "enum": [
        "proposal"
      ]
    },
    "chat_id": {
      "$ref": "#/$defs/OpaqueId"
    },
    "agent_id": {
      "$ref": "#/$defs/OpaqueId"
    },
    "status": {
      "type": "string",
      "x-extensible-enum": [
        "pending_review",
        "stale",
        "applied",
        "declined",
        "failed"
      ]
    },
    "summary": {
      "type": "string"
    },
    "base_configuration_etag": {
      "type": "string"
    },
    "changes": {
      "$ref": "#/$defs/AgentConfigurationPatch"
    },
    "changed_paths": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "outcome": {
      "type": [
        "object",
        "null"
      ],
      "additionalProperties": true
    }
  },
  "$defs": {
    "AgentConfigurationPatch": {
      "type": "object",
      "additionalProperties": false,
      "description": "Sparse RFC 7396 merge patch over AgentConfiguration.",
      "properties": {
        "name": {
          "type": [
            "string",
            "null"
          ],
          "minLength": 1,
          "maxLength": 120
        },
        "description": {
          "type": [
            "string",
            "null"
          ],
          "minLength": 1,
          "maxLength": 2000
        },
        "goal": {
          "type": [
            "string",
            "null"
          ],
          "minLength": 1,
          "maxLength": 4000
        },
        "instructions": {
          "type": [
            "string",
            "null"
          ],
          "minLength": 1,
          "maxLength": 16000
        },
        "discovery_instructions": {
          "type": [
            "string",
            "null"
          ],
          "minLength": 1,
          "maxLength": 16000
        },
        "output": {
          "$ref": "#/$defs/AgentOutputPatch"
        },
        "tasks": {
          "$ref": "#/$defs/AgentTasksPatch"
        },
        "schedule": {
          "$ref": "#/$defs/AgentSchedulePatch"
        },
        "transcription_mode": {
          "type": "string",
          "enum": [
            "budget",
            "premium"
          ]
        },
        "briefing_preset": {
          "type": "string",
          "enum": [
            "economy",
            "standard",
            "advanced",
            "expert"
          ]
        },
        "evidence_capabilities": {
          "$ref": "#/$defs/AgentEvidenceCapabilitiesPatch"
        }
      }
    },
    "AgentEvidenceCapabilitiesPatch": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "external_web": {
          "type": "string",
          "enum": [
            "disabled",
            "on_demand"
          ]
        },
        "image_analysis": {
          "type": "string",
          "enum": [
            "disabled",
            "on_demand"
          ]
        }
      }
    },
    "AgentOutputPatch": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "style": {
          "type": [
            "string",
            "null"
          ],
          "minLength": 1,
          "maxLength": 4000
        },
        "language": {
          "type": [
            "string",
            "null"
          ],
          "pattern": "^[a-z]{2}$"
        }
      }
    },
    "AgentSchedulePatch": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "frequency": {
          "type": "string",
          "enum": [
            "daily",
            "weekly"
          ]
        },
        "time": {
          "type": "string",
          "pattern": "^(?:[01]\\d|2[0-3]):[0-5]\\d$"
        },
        "weekday": {
          "type": [
            "string",
            "null"
          ],
          "enum": [
            "monday",
            "tuesday",
            "wednesday",
            "thursday",
            "friday",
            "saturday",
            "sunday"
          ]
        },
        "timezone": {
          "type": "string",
          "minLength": 1,
          "maxLength": 255
        }
      }
    },
    "AgentTaskPatch": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "instructions": {
          "type": [
            "string",
            "null"
          ],
          "minLength": 1,
          "maxLength": 16000
        }
      }
    },
    "AgentTasksPatch": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "extract_information": {
          "$ref": "#/$defs/AgentTaskPatch"
        },
        "generate_brief": {
          "$ref": "#/$defs/AgentTaskPatch"
        }
      }
    },
    "OpaqueId": {
      "type": "string",
      "minLength": 1,
      "maxLength": 255,
      "description": "Opaque identifier; clients must not parse its format."
    }
  }
}