{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "MCRP local synthetic agent task v0.1",
  "description": "Structural guide only; bounded CLI additionally enforces byte/node/depth limits, authorization assertions, content versions and stateful reference constraints.",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "schema",
    "synthetic_fixture",
    "task_id",
    "commands"
  ],
  "properties": {
    "schema": {
      "const": "mcrp-agent-task/0.1"
    },
    "synthetic_fixture": {
      "const": true
    },
    "task_id": {
      "type": "string",
      "minLength": 1,
      "maxLength": 4096
    },
    "commands": {
      "type": "array",
      "minItems": 1,
      "maxItems": 64,
      "items": {
        "oneOf": [
          {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "id",
              "action",
              "agent_id",
              "now",
              "input"
            ],
            "properties": {
              "id": {
                "type": "string",
                "minLength": 1,
                "maxLength": 4096
              },
              "action": {
                "const": "offer"
              },
              "agent_id": {
                "type": "string",
                "minLength": 1,
                "maxLength": 4096
              },
              "now": {
                "type": "integer",
                "minimum": 0,
                "maximum": 1000000
              },
              "input": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "claim_id": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 4096
                  },
                  "claim": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 4096
                  },
                  "evidence": {
                    "type": "object"
                  },
                  "scope": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 4096
                    },
                    "minItems": 1,
                    "maxItems": 128,
                    "uniqueItems": true
                  },
                  "dependencies": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 4096
                    },
                    "minItems": 0,
                    "maxItems": 128,
                    "uniqueItems": true
                  },
                  "required_groups": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 16
                  }
                },
                "required": [
                  "claim_id",
                  "claim",
                  "evidence",
                  "scope",
                  "dependencies",
                  "required_groups"
                ]
              }
            }
          },
          {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "id",
              "action",
              "agent_id",
              "now",
              "input"
            ],
            "properties": {
              "id": {
                "type": "string",
                "minLength": 1,
                "maxLength": 4096
              },
              "action": {
                "const": "check"
              },
              "agent_id": {
                "type": "string",
                "minLength": 1,
                "maxLength": 4096
              },
              "now": {
                "type": "integer",
                "minimum": 0,
                "maximum": 1000000
              },
              "input": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "offer": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 4096
                  },
                  "scope": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 4096
                    },
                    "minItems": 1,
                    "maxItems": 128,
                    "uniqueItems": true
                  },
                  "method": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 4096
                  },
                  "outcome": {
                    "enum": [
                      "support",
                      "contradiction",
                      "unknown"
                    ]
                  },
                  "limits": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 4096
                  },
                  "units": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 1000000
                  }
                },
                "required": [
                  "offer",
                  "scope",
                  "method",
                  "outcome",
                  "limits",
                  "units"
                ]
              }
            }
          },
          {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "id",
              "action",
              "agent_id",
              "now",
              "input"
            ],
            "properties": {
              "id": {
                "type": "string",
                "minLength": 1,
                "maxLength": 4096
              },
              "action": {
                "const": "rely"
              },
              "agent_id": {
                "type": "string",
                "minLength": 1,
                "maxLength": 4096
              },
              "now": {
                "type": "integer",
                "minimum": 0,
                "maximum": 1000000
              },
              "input": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "offer": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 4096
                  },
                  "checks": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 4096
                    },
                    "minItems": 1,
                    "maxItems": 128,
                    "uniqueItems": true
                  },
                  "purpose": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 4096
                  },
                  "scope": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 4096
                    },
                    "minItems": 1,
                    "maxItems": 128,
                    "uniqueItems": true
                  },
                  "kind": {
                    "enum": [
                      "scientific",
                      "publication"
                    ]
                  },
                  "expires": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 1000000
                  },
                  "required_groups": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 1000000
                  }
                },
                "required": [
                  "offer",
                  "checks",
                  "purpose",
                  "scope",
                  "kind",
                  "expires"
                ]
              }
            }
          },
          {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "id",
              "action",
              "agent_id",
              "now",
              "input"
            ],
            "properties": {
              "id": {
                "type": "string",
                "minLength": 1,
                "maxLength": 4096
              },
              "action": {
                "const": "amend"
              },
              "agent_id": {
                "type": "string",
                "minLength": 1,
                "maxLength": 4096
              },
              "now": {
                "type": "integer",
                "minimum": 0,
                "maximum": 1000000
              },
              "input": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "offer": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 4096
                  },
                  "reason": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 4096
                  }
                },
                "required": [
                  "offer",
                  "reason"
                ]
              }
            }
          },
          {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "id",
              "action",
              "agent_id",
              "now",
              "input"
            ],
            "properties": {
              "id": {
                "type": "string",
                "minLength": 1,
                "maxLength": 4096
              },
              "action": {
                "const": "availability"
              },
              "agent_id": {
                "type": "string",
                "minLength": 1,
                "maxLength": 4096
              },
              "now": {
                "type": "integer",
                "minimum": 0,
                "maximum": 1000000
              },
              "input": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "offer": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 4096
                  },
                  "available": {
                    "type": "boolean"
                  },
                  "reason": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 4096
                  }
                },
                "required": [
                  "offer",
                  "available",
                  "reason"
                ]
              }
            }
          },
          {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "id",
              "action",
              "agent_id",
              "now",
              "input"
            ],
            "properties": {
              "id": {
                "type": "string",
                "minLength": 1,
                "maxLength": 4096
              },
              "action": {
                "const": "observe"
              },
              "agent_id": {
                "type": "string",
                "minLength": 1,
                "maxLength": 4096
              },
              "now": {
                "type": "integer",
                "minimum": 0,
                "maximum": 1000000
              },
              "input": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "reliance": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 4096
                  },
                  "observed_at": {
                    "anyOf": [
                      {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 1000000
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "max_age": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 1000000
                  }
                },
                "required": [
                  "reliance",
                  "observed_at",
                  "max_age"
                ]
              }
            }
          },
          {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "id",
              "action",
              "agent_id",
              "now",
              "input"
            ],
            "properties": {
              "id": {
                "type": "string",
                "minLength": 1,
                "maxLength": 4096
              },
              "action": {
                "const": "adapt_legacy"
              },
              "agent_id": {
                "type": "string",
                "minLength": 1,
                "maxLength": 4096
              },
              "now": {
                "type": "integer",
                "minimum": 0,
                "maximum": 1000000
              },
              "input": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "source": {
                    "type": "object"
                  }
                },
                "required": [
                  "source"
                ]
              }
            }
          }
        ]
      }
    }
  }
}
