{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://agent-gst-pilot-checklist.constalabs.com/acceptance-pack.schema.json",
  "title": "GST Pilot Acceptance Pack",
  "description": "A draft, non-binding scope and acceptance specification for a GST integration pilot.",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "schemaVersion",
    "status",
    "projectReference",
    "input",
    "output",
    "transformationRules",
    "acceptance",
    "commercial",
    "outOfScope",
    "safety",
    "agreementRequiredBeforeWork"
  ],
  "properties": {
    "schemaVersion": {
      "const": "1.0"
    },
    "generatedAt": {
      "type": "string",
      "format": "date-time"
    },
    "status": {
      "const": "draft-not-an-order"
    },
    "projectReference": {
      "type": "string",
      "minLength": 1,
      "maxLength": 80
    },
    "input": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "format",
        "requiredFields",
        "syntheticFixture",
        "monthlyVolume"
      ],
      "properties": {
        "format": {
          "enum": [
            "JSON",
            "CSV",
            "XML",
            "Documented API response"
          ]
        },
        "requiredFields": {
          "type": "array",
          "minItems": 1,
          "uniqueItems": true,
          "items": {
            "type": "string",
            "minLength": 1
          }
        },
        "syntheticFixture": {
          "type": "string",
          "minLength": 1
        },
        "monthlyVolume": {
          "type": "string",
          "minLength": 1
        }
      }
    },
    "output": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "description",
        "expectedFixtureResult"
      ],
      "properties": {
        "description": {
          "type": "string",
          "minLength": 1
        },
        "expectedFixtureResult": {
          "type": "string",
          "minLength": 1
        }
      }
    },
    "transformationRules": {
      "type": "array",
      "minItems": 1,
      "uniqueItems": true,
      "items": {
        "type": "string",
        "minLength": 1
      }
    },
    "acceptance": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "fixtureMustBeSyntheticOrRedacted",
        "reproducibleRunRequired",
        "deliveryFormat",
        "includedRevisions"
      ],
      "properties": {
        "fixtureMustBeSyntheticOrRedacted": {
          "const": true
        },
        "reproducibleRunRequired": {
          "const": true
        },
        "deliveryFormat": {
          "enum": [
            "Source archive",
            "Repository branch",
            "Patch"
          ]
        },
        "includedRevisions": {
          "type": "integer",
          "minimum": 0,
          "maximum": 2
        }
      }
    },
    "commercial": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "fixedPrice",
        "deliveryTiming",
        "paymentTiming"
      ],
      "properties": {
        "fixedPrice": {
          "type": "string",
          "minLength": 1
        },
        "deliveryTiming": {
          "type": "string",
          "minLength": 1
        },
        "paymentTiming": {
          "type": "string",
          "minLength": 1
        }
      }
    },
    "outOfScope": {
      "type": "array",
      "minItems": 1,
      "uniqueItems": true,
      "items": {
        "type": "string",
        "minLength": 1
      }
    },
    "safety": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "noCredentials",
        "noProductionInvoices",
        "noPersonalOrTaxpayerSecrets"
      ],
      "properties": {
        "noCredentials": {
          "const": true
        },
        "noProductionInvoices": {
          "const": true
        },
        "noPersonalOrTaxpayerSecrets": {
          "const": true
        }
      }
    },
    "agreementRequiredBeforeWork": {
      "const": true
    }
  }
}
