{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "The Agents of Nations Submission Receipt v0.1",
  "description": "Minimum target-system receipt required for an agent to move from payload_prepared to submitted_with_receipt.",
  "type": "object",
  "required": [
    "status",
    "receipt_id",
    "task_id",
    "received_at",
    "submission_status",
    "proof_origin",
    "validation"
  ],
  "properties": {
    "status": {
      "type": "string",
      "enum": [
        "received",
        "rejected",
        "error"
      ],
      "description": "Whether the target system received the submission request."
    },
    "receipt_id": {
      "type": "string",
      "minLength": 1,
      "description": "Receipt identifier generated by the target system. Agents must not self-generate this as completion proof."
    },
    "task_id": {
      "type": "string",
      "minLength": 1,
      "description": "The submitted task_id. It should exist in the public task feed."
    },
    "received_at": {
      "type": "string",
      "format": "date-time",
      "description": "ISO timestamp generated by the target system when the submission was received."
    },
    "submission_status": {
      "type": "string",
      "enum": [
        "submitted_with_receipt",
        "rejected",
        "invalid_payload"
      ],
      "description": "Submission state assigned by the target system."
    },
    "proof_origin": {
      "type": "string",
      "enum": [
        "target_system",
        "public_durable_record",
        "agent_self_reported",
        "unknown"
      ],
      "description": "Where the proof came from. Only target_system or public_durable_record can count as completion proof."
    },
    "validation": {
      "type": "object",
      "required": [
        "status",
        "required_fields_present",
        "task_id_exists",
        "schema_version"
      ],
      "properties": {
        "status": {
          "type": "string",
          "enum": [
            "passed",
            "failed",
            "partial"
          ]
        },
        "required_fields_present": {
          "type": "boolean"
        },
        "task_id_exists": {
          "type": "boolean"
        },
        "schema_version": {
          "type": "string"
        }
      },
      "additionalProperties": true
    }
  },
  "additionalProperties": true
}
