{
  "openapi": "3.1.0",
  "info": {
    "title": "MINT Cohort Definitions",
    "version": "0.1.0",
    "summary": "Read-only HTTP access to reviewed MINT cohort definitions.",
    "description": "Read-only discovery of MINT cohort and asset definitions. No live asset values or purchase operations."
  },
  "jsonSchemaDialect": "https://json-schema.org/draft/2020-12/schema",
  "servers": [
    {
      "url": "/",
      "description": "The origin serving this specification. Configure your running docs origin when importing a downloaded file."
    }
  ],
  "security": [],
  "tags": [
    {
      "name": "Cohort definitions",
      "description": "Versioned commercial-structure definitions and their supporting source references."
    }
  ],
  "paths": {
    "/cohorts.json": {
      "get": {
        "operationId": "getCohortRegistry",
        "tags": [
          "Cohort definitions"
        ],
        "summary": "Get the complete cohort definition registry",
        "description": "Returns all twelve reviewed records in registry version 0.1.0. No authentication, query parameters, request body, filtering, or pagination. Use the existing JavaScript or Python client to retrieve an exact ID or search the downloaded records.",
        "responses": {
          "200": {
            "description": "The complete reviewed registry, including stable IDs, definitions, asset structures, evidence requirements, null rule fields, aliases, and source hashes.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CohortRegistry"
                },
                "examples": {
                  "reviewedRegistry": {
                    "summary": "The actual reviewed registry served by this docs host",
                    "externalValue": "./cohorts.json"
                  }
                }
              }
            }
          },
          "default": {
            "description": "Documentation-host error response. Status and body are host-specific; no MINT JSON error envelope is defined."
          }
        }
      }
    },
    "/asset-definitions.json": {
      "get": {
        "operationId": "getAssetDefinitions",
        "tags": [
          "Cohort definitions"
        ],
        "summary": "Get all asset definitions",
        "description": "Return the twelve source-backed asset structure definitions. This response contains no receivable values or membership assignments.",
        "responses": {
          "200": {
            "description": "Complete asset definition catalog.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AssetDefinitionCatalog"
                },
                "examples": {
                  "catalog": {
                    "summary": "Current asset definition catalog",
                    "externalValue": "/asset-definitions.json"
                  }
                }
              }
            }
          },
          "default": {
            "description": "Documentation-host error response. Status and body are host-specific; no MINT JSON error envelope is defined."
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "CohortRegistry": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "title": "MINT cohort definition registry 0.1.0",
        "type": "object",
        "additionalProperties": false,
        "required": [
          "catalogId",
          "version",
          "scope",
          "records"
        ],
        "properties": {
          "catalogId": {
            "const": "mint-shadow-cohorts"
          },
          "version": {
            "const": "0.1.0"
          },
          "scope": {
            "const": "definition-discovery"
          },
          "records": {
            "type": "array",
            "minItems": 12,
            "maxItems": 12,
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "id",
                "version",
                "name",
                "assetStructure",
                "definition",
                "aliases",
                "legacyIds",
                "evidenceToInspect",
                "decisionQuestion",
                "entryRule",
                "exclusionRule",
                "amountRule",
                "releaseRule",
                "referenceScenario",
                "sourceRefs",
                "assetStructureAliases"
              ],
              "properties": {
                "id": {
                  "type": "string",
                  "pattern": "^[a-z]+(?:-[a-z]+)*$"
                },
                "version": {
                  "const": "0.1.0"
                },
                "name": {
                  "type": "string",
                  "minLength": 1
                },
                "assetStructure": {
                  "type": "string",
                  "minLength": 1
                },
                "definition": {
                  "type": "string",
                  "minLength": 1
                },
                "aliases": {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "minLength": 1
                  },
                  "uniqueItems": true
                },
                "legacyIds": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "shadowDashboard"
                  ],
                  "properties": {
                    "shadowDashboard": {
                      "type": "string",
                      "pattern": "^0[1-9]$|^1[0-2]$"
                    }
                  }
                },
                "evidenceToInspect": {
                  "type": "array",
                  "minItems": 1,
                  "items": {
                    "type": "string",
                    "minLength": 1
                  }
                },
                "decisionQuestion": {
                  "type": "string",
                  "minLength": 1
                },
                "entryRule": {
                  "type": "null"
                },
                "exclusionRule": {
                  "type": "null"
                },
                "amountRule": {
                  "type": "null"
                },
                "releaseRule": {
                  "type": "null"
                },
                "referenceScenario": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "nextReleaseEvent",
                    "sourceId"
                  ],
                  "properties": {
                    "nextReleaseEvent": {
                      "type": "string",
                      "minLength": 1
                    },
                    "sourceId": {
                      "const": "shadow-dashboard"
                    }
                  }
                },
                "sourceRefs": {
                  "type": "array",
                  "minItems": 2,
                  "items": {
                    "type": "object",
                    "additionalProperties": false,
                    "required": [
                      "sourceId",
                      "sha256",
                      "startLine",
                      "endLine"
                    ],
                    "properties": {
                      "sourceId": {
                        "type": "string",
                        "minLength": 1
                      },
                      "sha256": {
                        "type": "string",
                        "pattern": "^[a-f0-9]{64}$"
                      },
                      "startLine": {
                        "type": "integer",
                        "minimum": 1
                      },
                      "endLine": {
                        "type": "integer",
                        "minimum": 1
                      }
                    }
                  }
                },
                "assetStructureAliases": {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "minLength": 1
                  },
                  "uniqueItems": true
                }
              }
            }
          }
        }
      },
      "AssetDefinitionCatalog": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "title": "MINT asset definition catalog",
        "type": "object",
        "additionalProperties": false,
        "required": [
          "catalogId",
          "version",
          "scope",
          "fieldStatus",
          "valueStatus",
          "records"
        ],
        "properties": {
          "catalogId": {
            "const": "mint-asset-definitions"
          },
          "version": {
            "const": "0.1.0"
          },
          "scope": {
            "const": "definition-discovery"
          },
          "fieldStatus": {
            "const": "proposed-source-backed-descriptors"
          },
          "valueStatus": {
            "const": "no-observed-values"
          },
          "records": {
            "type": "array",
            "minItems": 12,
            "maxItems": 12,
            "items": {
              "$ref": "#/components/schemas/AssetDefinitionCatalog/$defs/record"
            },
            "allOf": [
              {
                "contains": {
                  "properties": {
                    "id": {
                      "const": "return-window-survivors"
                    }
                  }
                },
                "minContains": 1,
                "maxContains": 1
              },
              {
                "contains": {
                  "properties": {
                    "id": {
                      "const": "late-delivery-claims"
                    }
                  }
                },
                "minContains": 1,
                "maxContains": 1
              },
              {
                "contains": {
                  "properties": {
                    "id": {
                      "const": "partially-fulfilled-pos"
                    }
                  }
                },
                "minContains": 1,
                "maxContains": 1
              },
              {
                "contains": {
                  "properties": {
                    "id": {
                      "const": "delivered-awaiting-acceptance"
                    }
                  }
                },
                "minContains": 1,
                "maxContains": 1
              },
              {
                "contains": {
                  "properties": {
                    "id": {
                      "const": "retail-chargebacks"
                    }
                  }
                },
                "minContains": 1,
                "maxContains": 1
              },
              {
                "contains": {
                  "properties": {
                    "id": {
                      "const": "volume-rebates"
                    }
                  }
                },
                "minContains": 1,
                "maxContains": 1
              },
              {
                "contains": {
                  "properties": {
                    "id": {
                      "const": "promotional-allowances"
                    }
                  }
                },
                "minContains": 1,
                "maxContains": 1
              },
              {
                "contains": {
                  "properties": {
                    "id": {
                      "const": "predictable-short-pays"
                    }
                  }
                },
                "minContains": 1,
                "maxContains": 1
              },
              {
                "contains": {
                  "properties": {
                    "id": {
                      "const": "delivered-not-invoiced"
                    }
                  }
                },
                "minContains": 1,
                "maxContains": 1
              },
              {
                "contains": {
                  "properties": {
                    "id": {
                      "const": "milestones-retainage"
                    }
                  }
                },
                "minContains": 1,
                "maxContains": 1
              },
              {
                "contains": {
                  "properties": {
                    "id": {
                      "const": "formula-priced-shipments"
                    }
                  }
                },
                "minContains": 1,
                "maxContains": 1
              },
              {
                "contains": {
                  "properties": {
                    "id": {
                      "const": "setoff-netting"
                    }
                  }
                },
                "minContains": 1,
                "maxContains": 1
              }
            ]
          }
        },
        "$defs": {
          "sourceRef": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "sourceId",
              "sha256",
              "startLine",
              "endLine"
            ],
            "properties": {
              "sourceId": {
                "type": "string",
                "minLength": 1
              },
              "sha256": {
                "type": "string",
                "pattern": "^[a-f0-9]{64}$"
              },
              "startLine": {
                "type": "integer",
                "minimum": 1
              },
              "endLine": {
                "type": "integer",
                "minimum": 1
              }
            }
          },
          "field": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "key",
              "scope",
              "type",
              "unit",
              "description",
              "sourceBasis"
            ],
            "properties": {
              "key": {
                "type": "string",
                "pattern": "^[a-z][A-Za-z0-9]*$"
              },
              "scope": {
                "enum": [
                  "shared",
                  "asset-type"
                ]
              },
              "type": {
                "enum": [
                  "decimal-string",
                  "date"
                ]
              },
              "unit": {
                "enum": [
                  "source-currency",
                  "ISO-8601-date"
                ]
              },
              "description": {
                "type": "string",
                "minLength": 1
              },
              "sourceBasis": {
                "type": "array",
                "minItems": 1,
                "items": {
                  "$ref": "#/components/schemas/AssetDefinitionCatalog/$defs/sourceRef"
                }
              }
            },
            "allOf": [
              {
                "if": {
                  "properties": {
                    "type": {
                      "const": "decimal-string"
                    }
                  }
                },
                "then": {
                  "properties": {
                    "unit": {
                      "const": "source-currency"
                    }
                  }
                },
                "else": {
                  "properties": {
                    "unit": {
                      "const": "ISO-8601-date"
                    }
                  }
                }
              }
            ]
          },
          "record": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "id",
              "version",
              "cohortId",
              "name",
              "purpose",
              "evidenceToInspect",
              "fields",
              "sourceRefs",
              "entryRule",
              "exclusionRule",
              "amountRule",
              "releaseRule"
            ],
            "properties": {
              "id": {
                "enum": [
                  "return-window-survivors",
                  "late-delivery-claims",
                  "partially-fulfilled-pos",
                  "delivered-awaiting-acceptance",
                  "retail-chargebacks",
                  "volume-rebates",
                  "promotional-allowances",
                  "predictable-short-pays",
                  "delivered-not-invoiced",
                  "milestones-retainage",
                  "formula-priced-shipments",
                  "setoff-netting"
                ]
              },
              "version": {
                "const": "0.1.0"
              },
              "cohortId": {
                "enum": [
                  "return-window-survivors",
                  "late-delivery-claims",
                  "partially-fulfilled-pos",
                  "delivered-awaiting-acceptance",
                  "retail-chargebacks",
                  "volume-rebates",
                  "promotional-allowances",
                  "predictable-short-pays",
                  "delivered-not-invoiced",
                  "milestones-retainage",
                  "formula-priced-shipments",
                  "setoff-netting"
                ]
              },
              "name": {
                "type": "string",
                "minLength": 1
              },
              "purpose": {
                "type": "string",
                "minLength": 1
              },
              "evidenceToInspect": {
                "type": "array",
                "minItems": 1,
                "items": {
                  "type": "string",
                  "minLength": 1
                }
              },
              "fields": {
                "type": "array",
                "minItems": 5,
                "items": {
                  "$ref": "#/components/schemas/AssetDefinitionCatalog/$defs/field"
                }
              },
              "sourceRefs": {
                "type": "array",
                "minItems": 2,
                "items": {
                  "$ref": "#/components/schemas/AssetDefinitionCatalog/$defs/sourceRef"
                }
              },
              "entryRule": {
                "type": "null"
              },
              "exclusionRule": {
                "type": "null"
              },
              "amountRule": {
                "type": "null"
              },
              "releaseRule": {
                "type": "null"
              }
            },
            "allOf": [
              {
                "if": {
                  "properties": {
                    "id": {
                      "const": "return-window-survivors"
                    }
                  }
                },
                "then": {
                  "properties": {
                    "cohortId": {
                      "const": "return-window-survivors"
                    }
                  }
                }
              },
              {
                "if": {
                  "properties": {
                    "id": {
                      "const": "late-delivery-claims"
                    }
                  }
                },
                "then": {
                  "properties": {
                    "cohortId": {
                      "const": "late-delivery-claims"
                    }
                  }
                }
              },
              {
                "if": {
                  "properties": {
                    "id": {
                      "const": "partially-fulfilled-pos"
                    }
                  }
                },
                "then": {
                  "properties": {
                    "cohortId": {
                      "const": "partially-fulfilled-pos"
                    }
                  }
                }
              },
              {
                "if": {
                  "properties": {
                    "id": {
                      "const": "delivered-awaiting-acceptance"
                    }
                  }
                },
                "then": {
                  "properties": {
                    "cohortId": {
                      "const": "delivered-awaiting-acceptance"
                    }
                  }
                }
              },
              {
                "if": {
                  "properties": {
                    "id": {
                      "const": "retail-chargebacks"
                    }
                  }
                },
                "then": {
                  "properties": {
                    "cohortId": {
                      "const": "retail-chargebacks"
                    }
                  }
                }
              },
              {
                "if": {
                  "properties": {
                    "id": {
                      "const": "volume-rebates"
                    }
                  }
                },
                "then": {
                  "properties": {
                    "cohortId": {
                      "const": "volume-rebates"
                    }
                  }
                }
              },
              {
                "if": {
                  "properties": {
                    "id": {
                      "const": "promotional-allowances"
                    }
                  }
                },
                "then": {
                  "properties": {
                    "cohortId": {
                      "const": "promotional-allowances"
                    }
                  }
                }
              },
              {
                "if": {
                  "properties": {
                    "id": {
                      "const": "predictable-short-pays"
                    }
                  }
                },
                "then": {
                  "properties": {
                    "cohortId": {
                      "const": "predictable-short-pays"
                    }
                  }
                }
              },
              {
                "if": {
                  "properties": {
                    "id": {
                      "const": "delivered-not-invoiced"
                    }
                  }
                },
                "then": {
                  "properties": {
                    "cohortId": {
                      "const": "delivered-not-invoiced"
                    }
                  }
                }
              },
              {
                "if": {
                  "properties": {
                    "id": {
                      "const": "milestones-retainage"
                    }
                  }
                },
                "then": {
                  "properties": {
                    "cohortId": {
                      "const": "milestones-retainage"
                    }
                  }
                }
              },
              {
                "if": {
                  "properties": {
                    "id": {
                      "const": "formula-priced-shipments"
                    }
                  }
                },
                "then": {
                  "properties": {
                    "cohortId": {
                      "const": "formula-priced-shipments"
                    }
                  }
                }
              },
              {
                "if": {
                  "properties": {
                    "id": {
                      "const": "setoff-netting"
                    }
                  }
                },
                "then": {
                  "properties": {
                    "cohortId": {
                      "const": "setoff-netting"
                    }
                  }
                }
              }
            ]
          }
        }
      }
    }
  },
  "externalDocs": {
    "description": "MINT cohort definition setup, client functions, and individual cohort reference pages.",
    "url": "./cohorts-for-agents"
  }
}
