{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "urn:owp:eval-local:0.1",
  "title": "owp-eval-local/0.1",
  "$comment": "Definition library: select a named $defs entry. Never validate a payload against the unconstrained library root.",
  "$defs": {
    "ProfileResponse": {
      "$schema": "https://json-schema.org/draft/2020-12/schema",
      "type": "object",
      "properties": {
        "profile": {
          "type": "string",
          "const": "owp-eval-local/0.1",
          "description": "Exact supported local evaluation profile."
        },
        "instance_id": {
          "type": "string",
          "allOf": [
            {
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
            },
            {
              "pattern": "^[a-f0-9-]{36}$"
            }
          ],
          "description": "UUID, lowercase on the wire."
        },
        "transport": {
          "type": "string",
          "const": "loopback-http-ed25519"
        },
        "synthetic_only": {
          "type": "boolean",
          "const": true
        },
        "capability": {
          "type": "string",
          "const": "writing/brief"
        },
        "output_schema": {
          "type": "string",
          "const": "Summary"
        },
        "limits": {
          "type": "object",
          "properties": {
            "body_bytes": {
              "type": "number",
              "const": 16384
            },
            "session_seconds": {
              "type": "number",
              "const": 900
            },
            "job_seconds": {
              "type": "number",
              "const": 300
            },
            "clock_skew_seconds": {
              "type": "number",
              "const": 300
            },
            "sessions": {
              "type": "number",
              "const": 100
            },
            "receipts_per_session": {
              "type": "number",
              "const": 64
            }
          },
          "required": [
            "body_bytes",
            "session_seconds",
            "job_seconds",
            "clock_skew_seconds",
            "sessions",
            "receipts_per_session"
          ],
          "additionalProperties": false
        }
      },
      "required": [
        "profile",
        "instance_id",
        "transport",
        "synthetic_only",
        "capability",
        "output_schema",
        "limits"
      ],
      "additionalProperties": false,
      "description": "Public discovery response. Pin instance_id; never replace it automatically after an uncertain mutation.",
      "title": "ProfileResponse",
      "$comment": "owp-eval-local/0.1; synthetic loopback evaluation only."
    },
    "RegistrationRequest": {
      "$schema": "https://json-schema.org/draft/2020-12/schema",
      "type": "object",
      "properties": {
        "profile": {
          "type": "string",
          "const": "owp-eval-local/0.1",
          "description": "Exact supported local evaluation profile."
        },
        "name": {
          "type": "string",
          "minLength": 1,
          "maxLength": 80,
          "pattern": "^[\\x20-\\x7E]+$",
          "description": "ASCII display name for this fixture profile."
        },
        "version": {
          "type": "string",
          "maxLength": 40,
          "pattern": "^[0-9]+\\.[0-9]+\\.[0-9]+$"
        },
        "capability": {
          "type": "string",
          "const": "writing/brief"
        },
        "synthetic_only": {
          "type": "boolean",
          "const": true
        },
        "public_key": {
          "type": "string",
          "pattern": "^[A-Za-z0-9_-]{59}$",
          "description": "Canonical unpadded base64url of the 44-byte Ed25519 SubjectPublicKeyInfo DER. Server verifies key type, length and canonical re-encoding."
        }
      },
      "required": [
        "profile",
        "name",
        "version",
        "capability",
        "synthetic_only",
        "public_key"
      ],
      "additionalProperties": false,
      "description": "Agent-owned registration. Sign with this public key’s private key; no private key is transmitted. Synthetic enrollment is not identity verification.",
      "title": "RegistrationRequest",
      "$comment": "owp-eval-local/0.1; synthetic loopback evaluation only."
    },
    "RegistrationResponse": {
      "$schema": "https://json-schema.org/draft/2020-12/schema",
      "type": "object",
      "properties": {
        "profile": {
          "type": "string",
          "const": "owp-eval-local/0.1",
          "description": "Exact supported local evaluation profile."
        },
        "agent_id": {
          "type": "string",
          "pattern": "^agent_[a-f0-9]{24}$",
          "description": "agent_ followed by 24 lowercase hexadecimal characters."
        },
        "session_id": {
          "type": "string",
          "allOf": [
            {
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
            },
            {
              "pattern": "^[a-f0-9-]{36}$"
            }
          ],
          "description": "UUID, lowercase on the wire."
        },
        "instance_id": {
          "type": "string",
          "allOf": [
            {
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
            },
            {
              "pattern": "^[a-f0-9-]{36}$"
            }
          ],
          "description": "UUID, lowercase on the wire."
        },
        "expires_at": {
          "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": "UTC date-time at second precision, ending in Z."
        }
      },
      "required": [
        "profile",
        "agent_id",
        "session_id",
        "instance_id",
        "expires_at"
      ],
      "additionalProperties": false,
      "description": "One in-memory session and one fixture job per key per server instance. Repeating the successful registration request returns this same receipt.",
      "title": "RegistrationResponse",
      "$comment": "owp-eval-local/0.1; synthetic loopback evaluation only."
    },
    "JobSnapshot": {
      "$schema": "https://json-schema.org/draft/2020-12/schema",
      "oneOf": [
        {
          "type": "object",
          "properties": {
            "profile": {
              "type": "string",
              "const": "owp-eval-local/0.1",
              "description": "Exact supported local evaluation profile."
            },
            "job_id": {
              "type": "string",
              "pattern": "^job_[a-f0-9]{24}$",
              "description": "job_ followed by 24 lowercase hexadecimal characters."
            },
            "agent_id": {
              "type": "string",
              "pattern": "^agent_[a-f0-9]{24}$",
              "description": "agent_ followed by 24 lowercase hexadecimal characters."
            },
            "agent_version": {
              "type": "string"
            },
            "mode": {
              "type": "string",
              "const": "evaluation"
            },
            "capability": {
              "type": "string",
              "const": "writing/brief"
            },
            "deadline": {
              "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": "UTC date-time at second precision, ending in Z."
            },
            "output_schema": {
              "type": "string",
              "const": "Summary"
            },
            "state": {
              "type": "string",
              "enum": [
                "OFFERED",
                "ACCEPTED",
                "RUNNING"
              ]
            }
          },
          "required": [
            "profile",
            "job_id",
            "agent_id",
            "agent_version",
            "mode",
            "capability",
            "deadline",
            "output_schema",
            "state"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "profile": {
              "type": "string",
              "const": "owp-eval-local/0.1",
              "description": "Exact supported local evaluation profile."
            },
            "job_id": {
              "type": "string",
              "pattern": "^job_[a-f0-9]{24}$",
              "description": "job_ followed by 24 lowercase hexadecimal characters."
            },
            "agent_id": {
              "type": "string",
              "pattern": "^agent_[a-f0-9]{24}$",
              "description": "agent_ followed by 24 lowercase hexadecimal characters."
            },
            "agent_version": {
              "type": "string"
            },
            "mode": {
              "type": "string",
              "const": "evaluation"
            },
            "capability": {
              "type": "string",
              "const": "writing/brief"
            },
            "deadline": {
              "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": "UTC date-time at second precision, ending in Z."
            },
            "output_schema": {
              "type": "string",
              "const": "Summary"
            },
            "state": {
              "type": "string",
              "const": "SCORED"
            },
            "output_id": {
              "type": "string",
              "pattern": "^out_[a-f0-9]{24}$",
              "description": "out_ followed by 24 lowercase hexadecimal characters."
            },
            "score": {
              "type": "object",
              "properties": {
                "passed_checks": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 3
                },
                "total_checks": {
                  "type": "number",
                  "const": 3
                },
                "checks": {
                  "type": "object",
                  "properties": {
                    "garden_name": {
                      "type": "boolean"
                    },
                    "opening_day": {
                      "type": "boolean"
                    },
                    "activity": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "garden_name",
                    "opening_day",
                    "activity"
                  ],
                  "additionalProperties": false
                }
              },
              "required": [
                "passed_checks",
                "total_checks",
                "checks"
              ],
              "additionalProperties": false,
              "description": "Deterministic fixture check: case-insensitive substring matches for Elm Garden, Saturday, and planting workshop. This is not production reputation or a semantic quality assessment."
            }
          },
          "required": [
            "profile",
            "job_id",
            "agent_id",
            "agent_version",
            "mode",
            "capability",
            "deadline",
            "output_schema",
            "state",
            "output_id",
            "score"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "profile": {
              "type": "string",
              "const": "owp-eval-local/0.1",
              "description": "Exact supported local evaluation profile."
            },
            "job_id": {
              "type": "string",
              "pattern": "^job_[a-f0-9]{24}$",
              "description": "job_ followed by 24 lowercase hexadecimal characters."
            },
            "agent_id": {
              "type": "string",
              "pattern": "^agent_[a-f0-9]{24}$",
              "description": "agent_ followed by 24 lowercase hexadecimal characters."
            },
            "agent_version": {
              "type": "string"
            },
            "mode": {
              "type": "string",
              "const": "evaluation"
            },
            "capability": {
              "type": "string",
              "const": "writing/brief"
            },
            "deadline": {
              "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": "UTC date-time at second precision, ending in Z."
            },
            "output_schema": {
              "type": "string",
              "const": "Summary"
            },
            "state": {
              "type": "string",
              "enum": [
                "DECLINED",
                "FAILED",
                "EXPIRED"
              ]
            },
            "reason": {
              "type": "string",
              "enum": [
                "AGENT_DECLINED",
                "UNSUPPORTED_INPUT",
                "EXECUTION_FAILED",
                "DEADLINE_EXCEEDED"
              ]
            }
          },
          "required": [
            "profile",
            "job_id",
            "agent_id",
            "agent_version",
            "mode",
            "capability",
            "deadline",
            "output_schema",
            "state",
            "reason"
          ],
          "additionalProperties": false
        }
      ],
      "description": "Coordinator-owned job. SCORED, DECLINED, FAILED and EXPIRED are terminal. Grant revocation is separate; production and settlement states are invalid.",
      "title": "JobSnapshot",
      "$comment": "owp-eval-local/0.1; synthetic loopback evaluation only."
    },
    "JobRequest": {
      "$schema": "https://json-schema.org/draft/2020-12/schema",
      "type": "object",
      "properties": {
        "profile": {
          "type": "string",
          "const": "owp-eval-local/0.1",
          "description": "Exact supported local evaluation profile."
        },
        "job_id": {
          "type": "string",
          "pattern": "^job_[a-f0-9]{24}$",
          "description": "job_ followed by 24 lowercase hexadecimal characters."
        }
      },
      "required": [
        "profile",
        "job_id"
      ],
      "additionalProperties": false,
      "description": "Exact job identity for accept, decline, or fixture grant issuance. The authenticated session must own this job.",
      "title": "JobRequest",
      "$comment": "owp-eval-local/0.1; synthetic loopback evaluation only."
    },
    "GrantRequest": {
      "$schema": "https://json-schema.org/draft/2020-12/schema",
      "type": "object",
      "properties": {
        "profile": {
          "type": "string",
          "const": "owp-eval-local/0.1",
          "description": "Exact supported local evaluation profile."
        },
        "job_id": {
          "type": "string",
          "pattern": "^job_[a-f0-9]{24}$",
          "description": "job_ followed by 24 lowercase hexadecimal characters."
        },
        "scope": {
          "type": "array",
          "prefixItems": [
            {
              "type": "string",
              "const": "fixture.brief"
            }
          ]
        }
      },
      "required": [
        "profile",
        "job_id",
        "scope"
      ],
      "additionalProperties": false,
      "description": "Request the fixed synthetic fixture scope after acceptance. The test coordinator applies its pre-approved synthetic consent fixture.",
      "title": "GrantRequest",
      "$comment": "owp-eval-local/0.1; synthetic loopback evaluation only."
    },
    "GrantReceipt": {
      "$schema": "https://json-schema.org/draft/2020-12/schema",
      "type": "object",
      "properties": {
        "profile": {
          "type": "string",
          "const": "owp-eval-local/0.1",
          "description": "Exact supported local evaluation profile."
        },
        "grant_id": {
          "type": "string",
          "pattern": "^grant_[a-f0-9]{24}$",
          "description": "grant_ followed by 24 lowercase hexadecimal characters."
        },
        "job_id": {
          "type": "string",
          "pattern": "^job_[a-f0-9]{24}$",
          "description": "job_ followed by 24 lowercase hexadecimal characters."
        },
        "agent_id": {
          "type": "string",
          "pattern": "^agent_[a-f0-9]{24}$",
          "description": "agent_ followed by 24 lowercase hexadecimal characters."
        },
        "state": {
          "type": "string",
          "enum": [
            "ACTIVE",
            "REVOKED"
          ]
        },
        "scope": {
          "type": "array",
          "prefixItems": [
            {
              "type": "string",
              "const": "fixture.brief"
            }
          ]
        },
        "expires_at": {
          "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": "UTC date-time at second precision, ending in Z."
        },
        "synthetic_consent": {
          "type": "string",
          "const": "fixture-owner-approved"
        }
      },
      "required": [
        "profile",
        "grant_id",
        "job_id",
        "agent_id",
        "state",
        "scope",
        "expires_at",
        "synthetic_consent"
      ],
      "additionalProperties": false,
      "description": "Grant receipt, not a bearer credential. The server checks current ownership, state and deadline every time.",
      "title": "GrantReceipt",
      "$comment": "owp-eval-local/0.1; synthetic loopback evaluation only."
    },
    "InputRequest": {
      "$schema": "https://json-schema.org/draft/2020-12/schema",
      "type": "object",
      "properties": {
        "profile": {
          "type": "string",
          "const": "owp-eval-local/0.1",
          "description": "Exact supported local evaluation profile."
        },
        "job_id": {
          "type": "string",
          "pattern": "^job_[a-f0-9]{24}$",
          "description": "job_ followed by 24 lowercase hexadecimal characters."
        },
        "grant_id": {
          "type": "string",
          "pattern": "^grant_[a-f0-9]{24}$",
          "description": "grant_ followed by 24 lowercase hexadecimal characters."
        }
      },
      "required": [
        "profile",
        "job_id",
        "grant_id"
      ],
      "additionalProperties": false,
      "description": "Read the fixture with an active grant. Repeated reads are safe; this endpoint still requires a signed mutation identity because first read advances the job to RUNNING.",
      "title": "InputRequest",
      "$comment": "owp-eval-local/0.1; synthetic loopback evaluation only."
    },
    "FixtureInput": {
      "$schema": "https://json-schema.org/draft/2020-12/schema",
      "type": "object",
      "properties": {
        "profile": {
          "type": "string",
          "const": "owp-eval-local/0.1",
          "description": "Exact supported local evaluation profile."
        },
        "job_id": {
          "type": "string",
          "pattern": "^job_[a-f0-9]{24}$",
          "description": "job_ followed by 24 lowercase hexadecimal characters."
        },
        "source_id": {
          "type": "string",
          "const": "fixture_garden01"
        },
        "title": {
          "type": "string",
          "const": "Elm Garden"
        },
        "opening_day": {
          "type": "string",
          "const": "Saturday"
        },
        "activity": {
          "type": "string",
          "const": "planting workshop"
        },
        "instruction": {
          "type": "string",
          "const": "Write a short invitation using all three facts. This is fictional evaluation data."
        }
      },
      "required": [
        "profile",
        "job_id",
        "source_id",
        "title",
        "opening_day",
        "activity",
        "instruction"
      ],
      "additionalProperties": false,
      "description": "Fixed synthetic input. No user information, tools, models, attachments or external fetches.",
      "title": "FixtureInput",
      "$comment": "owp-eval-local/0.1; synthetic loopback evaluation only."
    },
    "Summary": {
      "$schema": "https://json-schema.org/draft/2020-12/schema",
      "type": "object",
      "properties": {
        "summary": {
          "type": "string",
          "minLength": 30,
          "maxLength": 600,
          "pattern": "^[\\x20-\\x7E\\n\\r]+$",
          "description": "A 30–600 character ASCII brief (line breaks allowed). This bounded fixture profile uses ASCII for identical cross-language length rules. Mention the garden name, opening day and activity."
        },
        "source_ids": {
          "type": "array",
          "prefixItems": [
            {
              "type": "string",
              "const": "fixture_garden01"
            }
          ],
          "description": "Exactly one source: fixture_garden01. No invented provenance."
        }
      },
      "required": [
        "summary",
        "source_ids"
      ],
      "additionalProperties": false,
      "description": "Output content contract. The coordinator validates this exact shape before scoring.",
      "title": "Summary",
      "$comment": "owp-eval-local/0.1; synthetic loopback evaluation only."
    },
    "OutputRequest": {
      "$schema": "https://json-schema.org/draft/2020-12/schema",
      "type": "object",
      "properties": {
        "profile": {
          "type": "string",
          "const": "owp-eval-local/0.1",
          "description": "Exact supported local evaluation profile."
        },
        "job_id": {
          "type": "string",
          "pattern": "^job_[a-f0-9]{24}$",
          "description": "job_ followed by 24 lowercase hexadecimal characters."
        },
        "grant_id": {
          "type": "string",
          "pattern": "^grant_[a-f0-9]{24}$",
          "description": "grant_ followed by 24 lowercase hexadecimal characters."
        },
        "content": {
          "type": "object",
          "properties": {
            "summary": {
              "type": "string",
              "minLength": 30,
              "maxLength": 600,
              "pattern": "^[\\x20-\\x7E\\n\\r]+$",
              "description": "A 30–600 character ASCII brief (line breaks allowed). This bounded fixture profile uses ASCII for identical cross-language length rules. Mention the garden name, opening day and activity."
            },
            "source_ids": {
              "type": "array",
              "prefixItems": [
                {
                  "type": "string",
                  "const": "fixture_garden01"
                }
              ],
              "description": "Exactly one source: fixture_garden01. No invented provenance."
            }
          },
          "required": [
            "summary",
            "source_ids"
          ],
          "additionalProperties": false,
          "description": "Output content contract. The coordinator validates this exact shape before scoring."
        }
      },
      "required": [
        "profile",
        "job_id",
        "grant_id",
        "content"
      ],
      "additionalProperties": false,
      "description": "Submit a result while RUNNING with current access. The server assigns output identity and atomically scores and revokes the grant.",
      "title": "OutputRequest",
      "$comment": "owp-eval-local/0.1; synthetic loopback evaluation only."
    },
    "EvaluationScore": {
      "$schema": "https://json-schema.org/draft/2020-12/schema",
      "type": "object",
      "properties": {
        "passed_checks": {
          "type": "integer",
          "minimum": 0,
          "maximum": 3
        },
        "total_checks": {
          "type": "number",
          "const": 3
        },
        "checks": {
          "type": "object",
          "properties": {
            "garden_name": {
              "type": "boolean"
            },
            "opening_day": {
              "type": "boolean"
            },
            "activity": {
              "type": "boolean"
            }
          },
          "required": [
            "garden_name",
            "opening_day",
            "activity"
          ],
          "additionalProperties": false
        }
      },
      "required": [
        "passed_checks",
        "total_checks",
        "checks"
      ],
      "additionalProperties": false,
      "description": "Deterministic fixture check: case-insensitive substring matches for Elm Garden, Saturday, and planting workshop. This is not production reputation or a semantic quality assessment.",
      "title": "EvaluationScore",
      "$comment": "owp-eval-local/0.1; synthetic loopback evaluation only."
    },
    "CompletionResponse": {
      "$schema": "https://json-schema.org/draft/2020-12/schema",
      "type": "object",
      "properties": {
        "profile": {
          "type": "string",
          "const": "owp-eval-local/0.1",
          "description": "Exact supported local evaluation profile."
        },
        "job": {
          "oneOf": [
            {
              "type": "object",
              "properties": {
                "profile": {
                  "type": "string",
                  "const": "owp-eval-local/0.1",
                  "description": "Exact supported local evaluation profile."
                },
                "job_id": {
                  "type": "string",
                  "pattern": "^job_[a-f0-9]{24}$",
                  "description": "job_ followed by 24 lowercase hexadecimal characters."
                },
                "agent_id": {
                  "type": "string",
                  "pattern": "^agent_[a-f0-9]{24}$",
                  "description": "agent_ followed by 24 lowercase hexadecimal characters."
                },
                "agent_version": {
                  "type": "string"
                },
                "mode": {
                  "type": "string",
                  "const": "evaluation"
                },
                "capability": {
                  "type": "string",
                  "const": "writing/brief"
                },
                "deadline": {
                  "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": "UTC date-time at second precision, ending in Z."
                },
                "output_schema": {
                  "type": "string",
                  "const": "Summary"
                },
                "state": {
                  "type": "string",
                  "enum": [
                    "OFFERED",
                    "ACCEPTED",
                    "RUNNING"
                  ]
                }
              },
              "required": [
                "profile",
                "job_id",
                "agent_id",
                "agent_version",
                "mode",
                "capability",
                "deadline",
                "output_schema",
                "state"
              ],
              "additionalProperties": false
            },
            {
              "type": "object",
              "properties": {
                "profile": {
                  "type": "string",
                  "const": "owp-eval-local/0.1",
                  "description": "Exact supported local evaluation profile."
                },
                "job_id": {
                  "type": "string",
                  "pattern": "^job_[a-f0-9]{24}$",
                  "description": "job_ followed by 24 lowercase hexadecimal characters."
                },
                "agent_id": {
                  "type": "string",
                  "pattern": "^agent_[a-f0-9]{24}$",
                  "description": "agent_ followed by 24 lowercase hexadecimal characters."
                },
                "agent_version": {
                  "type": "string"
                },
                "mode": {
                  "type": "string",
                  "const": "evaluation"
                },
                "capability": {
                  "type": "string",
                  "const": "writing/brief"
                },
                "deadline": {
                  "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": "UTC date-time at second precision, ending in Z."
                },
                "output_schema": {
                  "type": "string",
                  "const": "Summary"
                },
                "state": {
                  "type": "string",
                  "const": "SCORED"
                },
                "output_id": {
                  "type": "string",
                  "pattern": "^out_[a-f0-9]{24}$",
                  "description": "out_ followed by 24 lowercase hexadecimal characters."
                },
                "score": {
                  "type": "object",
                  "properties": {
                    "passed_checks": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 3
                    },
                    "total_checks": {
                      "type": "number",
                      "const": 3
                    },
                    "checks": {
                      "type": "object",
                      "properties": {
                        "garden_name": {
                          "type": "boolean"
                        },
                        "opening_day": {
                          "type": "boolean"
                        },
                        "activity": {
                          "type": "boolean"
                        }
                      },
                      "required": [
                        "garden_name",
                        "opening_day",
                        "activity"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "passed_checks",
                    "total_checks",
                    "checks"
                  ],
                  "additionalProperties": false,
                  "description": "Deterministic fixture check: case-insensitive substring matches for Elm Garden, Saturday, and planting workshop. This is not production reputation or a semantic quality assessment."
                }
              },
              "required": [
                "profile",
                "job_id",
                "agent_id",
                "agent_version",
                "mode",
                "capability",
                "deadline",
                "output_schema",
                "state",
                "output_id",
                "score"
              ],
              "additionalProperties": false
            },
            {
              "type": "object",
              "properties": {
                "profile": {
                  "type": "string",
                  "const": "owp-eval-local/0.1",
                  "description": "Exact supported local evaluation profile."
                },
                "job_id": {
                  "type": "string",
                  "pattern": "^job_[a-f0-9]{24}$",
                  "description": "job_ followed by 24 lowercase hexadecimal characters."
                },
                "agent_id": {
                  "type": "string",
                  "pattern": "^agent_[a-f0-9]{24}$",
                  "description": "agent_ followed by 24 lowercase hexadecimal characters."
                },
                "agent_version": {
                  "type": "string"
                },
                "mode": {
                  "type": "string",
                  "const": "evaluation"
                },
                "capability": {
                  "type": "string",
                  "const": "writing/brief"
                },
                "deadline": {
                  "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": "UTC date-time at second precision, ending in Z."
                },
                "output_schema": {
                  "type": "string",
                  "const": "Summary"
                },
                "state": {
                  "type": "string",
                  "enum": [
                    "DECLINED",
                    "FAILED",
                    "EXPIRED"
                  ]
                },
                "reason": {
                  "type": "string",
                  "enum": [
                    "AGENT_DECLINED",
                    "UNSUPPORTED_INPUT",
                    "EXECUTION_FAILED",
                    "DEADLINE_EXCEEDED"
                  ]
                }
              },
              "required": [
                "profile",
                "job_id",
                "agent_id",
                "agent_version",
                "mode",
                "capability",
                "deadline",
                "output_schema",
                "state",
                "reason"
              ],
              "additionalProperties": false
            }
          ],
          "description": "Coordinator-owned job. SCORED, DECLINED, FAILED and EXPIRED are terminal. Grant revocation is separate; production and settlement states are invalid."
        },
        "grant": {
          "anyOf": [
            {
              "type": "object",
              "properties": {
                "profile": {
                  "type": "string",
                  "const": "owp-eval-local/0.1",
                  "description": "Exact supported local evaluation profile."
                },
                "grant_id": {
                  "type": "string",
                  "pattern": "^grant_[a-f0-9]{24}$",
                  "description": "grant_ followed by 24 lowercase hexadecimal characters."
                },
                "job_id": {
                  "type": "string",
                  "pattern": "^job_[a-f0-9]{24}$",
                  "description": "job_ followed by 24 lowercase hexadecimal characters."
                },
                "agent_id": {
                  "type": "string",
                  "pattern": "^agent_[a-f0-9]{24}$",
                  "description": "agent_ followed by 24 lowercase hexadecimal characters."
                },
                "state": {
                  "type": "string",
                  "enum": [
                    "ACTIVE",
                    "REVOKED"
                  ]
                },
                "scope": {
                  "type": "array",
                  "prefixItems": [
                    {
                      "type": "string",
                      "const": "fixture.brief"
                    }
                  ]
                },
                "expires_at": {
                  "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": "UTC date-time at second precision, ending in Z."
                },
                "synthetic_consent": {
                  "type": "string",
                  "const": "fixture-owner-approved"
                }
              },
              "required": [
                "profile",
                "grant_id",
                "job_id",
                "agent_id",
                "state",
                "scope",
                "expires_at",
                "synthetic_consent"
              ],
              "additionalProperties": false,
              "description": "Grant receipt, not a bearer credential. The server checks current ownership, state and deadline every time."
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "required": [
        "profile",
        "job",
        "grant"
      ],
      "additionalProperties": false,
      "description": "Result of output or failure: terminal snapshot plus current revoked grant, if one existed.",
      "title": "CompletionResponse",
      "$comment": "owp-eval-local/0.1; synthetic loopback evaluation only."
    },
    "FailureRequest": {
      "$schema": "https://json-schema.org/draft/2020-12/schema",
      "type": "object",
      "properties": {
        "profile": {
          "type": "string",
          "const": "owp-eval-local/0.1",
          "description": "Exact supported local evaluation profile."
        },
        "job_id": {
          "type": "string",
          "pattern": "^job_[a-f0-9]{24}$",
          "description": "job_ followed by 24 lowercase hexadecimal characters."
        },
        "code": {
          "type": "string",
          "enum": [
            "UNSUPPORTED_INPUT",
            "EXECUTION_FAILED"
          ]
        }
      },
      "required": [
        "profile",
        "job_id",
        "code"
      ],
      "additionalProperties": false,
      "description": "Report a bounded failure after acceptance. No free-form exception, process arguments or private content.",
      "title": "FailureRequest",
      "$comment": "owp-eval-local/0.1; synthetic loopback evaluation only."
    },
    "EventItem": {
      "$schema": "https://json-schema.org/draft/2020-12/schema",
      "type": "object",
      "properties": {
        "sequence_id": {
          "type": "integer",
          "minimum": 1,
          "maximum": 9007199254740991
        },
        "type": {
          "type": "string",
          "enum": [
            "agent.registered",
            "job.offered",
            "job.accepted",
            "job.declined",
            "grant.issued",
            "input.delivered",
            "output.submitted",
            "job.scored",
            "job.failed",
            "job.expired",
            "grant.revoked"
          ]
        },
        "at": {
          "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": "UTC date-time at second precision, ending in Z."
        },
        "job_id": {
          "type": "string",
          "pattern": "^job_[a-f0-9]{24}$",
          "description": "job_ followed by 24 lowercase hexadecimal characters."
        }
      },
      "required": [
        "sequence_id",
        "type",
        "at",
        "job_id"
      ],
      "additionalProperties": false,
      "description": "Session-scoped ordered event, without content. Local evaluation events are not a signed or hash-chain audit log.",
      "title": "EventItem",
      "$comment": "owp-eval-local/0.1; synthetic loopback evaluation only."
    },
    "EventsResponse": {
      "$schema": "https://json-schema.org/draft/2020-12/schema",
      "type": "object",
      "properties": {
        "profile": {
          "type": "string",
          "const": "owp-eval-local/0.1",
          "description": "Exact supported local evaluation profile."
        },
        "events": {
          "maxItems": 16,
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "sequence_id": {
                "type": "integer",
                "minimum": 1,
                "maximum": 9007199254740991
              },
              "type": {
                "type": "string",
                "enum": [
                  "agent.registered",
                  "job.offered",
                  "job.accepted",
                  "job.declined",
                  "grant.issued",
                  "input.delivered",
                  "output.submitted",
                  "job.scored",
                  "job.failed",
                  "job.expired",
                  "grant.revoked"
                ]
              },
              "at": {
                "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": "UTC date-time at second precision, ending in Z."
              },
              "job_id": {
                "type": "string",
                "pattern": "^job_[a-f0-9]{24}$",
                "description": "job_ followed by 24 lowercase hexadecimal characters."
              }
            },
            "required": [
              "sequence_id",
              "type",
              "at",
              "job_id"
            ],
            "additionalProperties": false,
            "description": "Session-scoped ordered event, without content. Local evaluation events are not a signed or hash-chain audit log."
          }
        },
        "next_cursor": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        }
      },
      "required": [
        "profile",
        "events",
        "next_cursor"
      ],
      "additionalProperties": false,
      "description": "All events after a session-local cursor, in sequence order. At most 16 events in this one-job profile. Persist the returned cursor only after processing the batch.",
      "title": "EventsResponse",
      "$comment": "owp-eval-local/0.1; synthetic loopback evaluation only."
    },
    "ErrorResponse": {
      "$schema": "https://json-schema.org/draft/2020-12/schema",
      "type": "object",
      "properties": {
        "profile": {
          "type": "string",
          "const": "owp-eval-local/0.1",
          "description": "Exact supported local evaluation profile."
        },
        "request_id": {
          "anyOf": [
            {
              "type": "string",
              "allOf": [
                {
                  "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                },
                {
                  "pattern": "^[a-f0-9-]{36}$"
                }
              ],
              "description": "UUID, lowercase on the wire."
            },
            {
              "type": "null"
            }
          ]
        },
        "error": {
          "type": "object",
          "properties": {
            "code": {
              "type": "string",
              "enum": [
                "INVALID_REQUEST",
                "UNSUPPORTED_PROFILE",
                "AUTH_REQUIRED",
                "INVALID_SIGNATURE",
                "CLOCK_SKEW",
                "UNKNOWN_SESSION",
                "SESSION_EXPIRED",
                "FORBIDDEN",
                "GRANT_REQUIRED",
                "GRANT_REVOKED",
                "NOT_FOUND",
                "METHOD_NOT_ALLOWED",
                "INSTANCE_CHANGED",
                "IDEMPOTENCY_CONFLICT",
                "REGISTRATION_EXISTS",
                "INVALID_STATE",
                "DEADLINE_EXCEEDED",
                "PAYLOAD_TOO_LARGE",
                "UNSUPPORTED_CAPABILITY",
                "INVALID_OUTPUT",
                "CAPACITY_REACHED",
                "INTERNAL_ERROR"
              ]
            },
            "retryable": {
              "type": "boolean"
            }
          },
          "required": [
            "code",
            "retryable"
          ],
          "additionalProperties": false
        }
      },
      "required": [
        "profile",
        "request_id",
        "error"
      ],
      "additionalProperties": false,
      "description": "All non-2xx responses. Only INTERNAL_ERROR is retryable with the same request identity and body. Network uncertainty follows the same retry rule.",
      "title": "ErrorResponse",
      "$comment": "owp-eval-local/0.1; synthetic loopback evaluation only."
    }
  }
}
