# Schema Contract

Record: `arch:schema-contract`
Kind: constraint
Layer: [Contracts Core](https://banes-lab.com/records/layer/contracts-core.md)
Severity: mandatory
Scope: data, API, message
Canonical: https://banes-lab.com/ontology#arch-schema-contract

## Repair

- Refactored by: Add JSON Schema, Protobuf, Avro, OpenAPI
- Detected by: schema diff failures
- Violated by: unvalidated payloads, undocumented field changes
- Measured by: schema validation coverage
- Enforced by: schema registry, CI schema checks

## requires

- [Canonical Schema](https://banes-lab.com/records/arch/canonical-schema.md)
- [Schema Validation](https://banes-lab.com/records/arch/schema-validation.md)

## reinforces

- [Data Contract](https://banes-lab.com/records/arch/data-contract.md)
- [Compatibility](https://banes-lab.com/records/lex/compatibility.md)

## enables

- [Automated Validation](https://banes-lab.com/records/lex/automated-validation.md)

## conflicts-with

- [Ad-Hoc Payloads](https://banes-lab.com/records/lex/ad-hoc-payloads.md)

## tensions-with

- [Schema Flexibility](https://banes-lab.com/records/lex/schema-flexibility.md)

## tensions

- [Schema Contract Schema Flexibility](https://banes-lab.com/records/tension/schema-contract-schema-flexibility.md)

## referenced-by

- [Contract-First Design](https://banes-lab.com/records/arch/contract-first-design.md)
- [Schema Validation](https://banes-lab.com/records/arch/schema-validation.md)
- [Canonical Schema](https://banes-lab.com/records/arch/canonical-schema.md)
