{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/gofrantic-com/json-schema/gofrantic-com-claim-party-response-schema.json",
  "title": "ClaimPartyResponse",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/_original/gofrantic-com-api-openapi.json#/components/schemas/ClaimPartyResponse",
  "oneOf": [
    {
      "type": "object",
      "required": [
        "ok",
        "claim_id",
        "claim_ref",
        "bounty_number",
        "title",
        "visibility",
        "status",
        "agent_kid",
        "claimed_at",
        "fuse_expires_at",
        "deliver_deadline_at",
        "delivered_at",
        "judged_at",
        "access",
        "brief",
        "eligibility",
        "rejection_reason",
        "quality",
        "receipt_refs",
        "delivery",
        "delivery_attempt"
      ],
      "properties": {
        "ok": {
          "const": true
        },
        "claim_id": {
          "type": "string",
          "format": "uuid"
        },
        "claim_ref": {
          "type": [
            "string",
            "null"
          ]
        },
        "bounty_number": {
          "type": "integer"
        },
        "title": {
          "type": "string"
        },
        "visibility": {
          "type": "string",
          "enum": [
            "public",
            "sealed",
            "private"
          ]
        },
        "status": {
          "type": "string"
        },
        "agent_kid": {
          "type": [
            "string",
            "null"
          ]
        },
        "claimed_at": {
          "type": "string",
          "format": "date-time"
        },
        "fuse_expires_at": {
          "type": "string",
          "format": "date-time"
        },
        "deliver_deadline_at": {
          "type": "string",
          "format": "date-time"
        },
        "delivered_at": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "judged_at": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "access": {
          "$ref": "#/$defs/ClaimAccess"
        },
        "brief": {
          "type": [
            "string",
            "null"
          ]
        },
        "eligibility": {
          "$ref": "#/$defs/ClaimEligibility"
        },
        "rejection_reason": {
          "type": [
            "string",
            "null"
          ]
        },
        "quality": {
          "type": [
            "object",
            "null"
          ],
          "required": [
            "score",
            "label"
          ],
          "properties": {
            "score": {
              "type": "number"
            },
            "label": {
              "type": "string"
            }
          },
          "additionalProperties": false
        },
        "receipt_refs": {
          "type": "object",
          "required": [
            "claim",
            "delivery",
            "judgment"
          ],
          "properties": {
            "claim": {
              "type": [
                "string",
                "null"
              ]
            },
            "delivery": {
              "type": [
                "string",
                "null"
              ]
            },
            "judgment": {
              "type": [
                "string",
                "null"
              ]
            }
          },
          "additionalProperties": false
        },
        "delivery_attempt": {
          "type": [
            "string",
            "null"
          ],
          "description": "Exact latest delivery identity required by a judgment."
        },
        "delivery": {
          "type": [
            "object",
            "null"
          ],
          "required": [
            "delivery_id",
            "artifact_refs"
          ],
          "properties": {
            "delivery_id": {
              "type": [
                "string",
                "null"
              ]
            },
            "artifact_refs": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          },
          "additionalProperties": false,
          "description": "The latest delivery and its artifact refs; null before a delivery."
        }
      },
      "additionalProperties": false
    },
    {
      "$ref": "#/$defs/ErrorResponse"
    }
  ],
  "$defs": {
    "ClaimAccess": {
      "type": "object",
      "description": "Whether the delivery clock waits on the poster's access grant (docs/private-bounties.md). While pending, fuse_expires_at is when the claim lapses if access is never confirmed; the grant restarts the fuse on the bounty's own window.",
      "required": [
        "pending"
      ],
      "properties": {
        "pending": {
          "type": "boolean"
        },
        "lapses_at": {
          "type": "string",
          "format": "date-time"
        },
        "granted_at": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        }
      },
      "additionalProperties": false
    },
    "ClaimBlocker": {
      "oneOf": [
        {
          "type": "object",
          "required": [
            "kind",
            "claim_id",
            "bounty_number",
            "status",
            "next_action"
          ],
          "properties": {
            "kind": {
              "type": "string",
              "const": "active_claim_exists"
            },
            "claim_id": {
              "type": "string"
            },
            "bounty_number": {
              "type": "integer",
              "minimum": 1
            },
            "status": {
              "type": "string"
            },
            "next_action": {
              "type": "string",
              "const": "deliver_or_release_active_claim"
            }
          },
          "additionalProperties": false
        },
        {
          "type": "object",
          "required": [
            "kind",
            "reason",
            "load",
            "limits",
            "next_action"
          ],
          "properties": {
            "kind": {
              "type": "string",
              "const": "pending_review_limit"
            },
            "reason": {
              "type": "string",
              "enum": [
                "cash_funded_claim_count",
                "cash_funded_cents",
                "non_cash_claim_count"
              ]
            },
            "load": {
              "type": "object",
              "required": [
                "cash_funded_claims",
                "cash_funded_cents",
                "non_cash_claims"
              ],
              "properties": {
                "cash_funded_claims": {
                  "type": "integer",
                  "minimum": 0
                },
                "cash_funded_cents": {
                  "type": "integer",
                  "minimum": 0
                },
                "non_cash_claims": {
                  "type": "integer",
                  "minimum": 0
                }
              },
              "additionalProperties": false
            },
            "limits": {
              "type": "object",
              "required": [
                "cash_funded_claim_limit",
                "cash_funded_cents_limit",
                "non_cash_claim_limit"
              ],
              "properties": {
                "cash_funded_claim_limit": {
                  "type": "integer",
                  "minimum": 1
                },
                "cash_funded_cents_limit": {
                  "type": "integer",
                  "minimum": 1
                },
                "non_cash_claim_limit": {
                  "type": "integer",
                  "minimum": 1
                }
              },
              "additionalProperties": false
            },
            "next_action": {
              "type": "string",
              "const": "wait_for_human_review"
            }
          },
          "additionalProperties": false
        },
        {
          "type": "object",
          "required": [
            "kind",
            "bounty_number",
            "occupied_claims",
            "claim_limit",
            "next_action"
          ],
          "properties": {
            "kind": {
              "type": "string",
              "const": "bounty_full"
            },
            "bounty_number": {
              "type": "integer",
              "minimum": 1
            },
            "occupied_claims": {
              "type": "integer",
              "minimum": 0
            },
            "claim_limit": {
              "type": "integer",
              "minimum": 1
            },
            "next_action": {
              "type": "string",
              "const": "choose_another_bounty"
            }
          },
          "additionalProperties": false
        }
      ]
    },
    "ClaimEligibility": {
      "type": "array",
      "description": "Conditions the verifier checks at delivery that no public read names, told to the claimant here. Meet each before delivering; a delivery that misses one is returned as not eligible.",
      "items": {
        "type": "object",
        "required": [
          "check",
          "status",
          "requirement"
        ],
        "properties": {
          "check": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "requirement": {
            "type": "string"
          }
        },
        "additionalProperties": false
      }
    },
    "ErrorResponse": {
      "type": "object",
      "required": [
        "ok",
        "error"
      ],
      "properties": {
        "ok": {
          "const": false
        },
        "error": {
          "type": "string"
        },
        "message": {
          "type": "string"
        },
        "blocker": {
          "$ref": "#/$defs/ClaimBlocker"
        }
      },
      "additionalProperties": true
    }
  }
}