# Correctness

Record: `arch:correctness`
Kind: quality-attribute
Layer: [Computation Core](https://banes-lab.com/records/layer/computation-core.md)
Severity: mandatory
Scope: function, module, system
Canonical: https://banes-lab.com/ontology#arch-correctness

## Repair

- Refactored by: Add Tests, Fix Logic, Add Contracts
- Detected by: failing tests, invariant violations
- Violated by: behavior diverging from specification
- Measured by: defect rate, spec coverage
- Enforced by: CI, formal/static checks

## requires

- [Specification](https://banes-lab.com/records/lex/specification.md)
- [Validation](https://banes-lab.com/records/arch/validation.md)
- [Tests](https://banes-lab.com/records/lex/tests.md)

## reinforces

- [Design by Contract](https://banes-lab.com/records/arch/design-by-contract.md)

## enables

- [Safe Operation](https://banes-lab.com/records/lex/safe-operation.md)

## conflicts-with

- [Undefined Behavior](https://banes-lab.com/records/lex/undefined-behavior.md)

## tensions-with

- [Delivery Speed](https://banes-lab.com/records/lex/delivery-speed.md)

## tensions

- [Correctness Delivery Speed](https://banes-lab.com/records/tension/correctness-delivery-speed.md)

## referenced-by

- [Design Review](https://banes-lab.com/records/arch/design-review.md)
- [First-Principles Design](https://banes-lab.com/records/arch/first-principles-design.md)
- [Finite State Machine](https://banes-lab.com/records/arch/finite-state-machine.md)
- [Happens-Before Relationship](https://banes-lab.com/records/arch/happens-before-relationship.md)
- [Design by Contract](https://banes-lab.com/records/arch/design-by-contract.md)
- [Semantic Contracts](https://banes-lab.com/records/arch/semantic-contracts.md)
- [Preconditions](https://banes-lab.com/records/arch/preconditions.md)
- [Postconditions](https://banes-lab.com/records/arch/postconditions.md)
- [Invariants](https://banes-lab.com/records/arch/invariants.md)
- [Formal Verification](https://banes-lab.com/records/arch/formal-verification.md)
- [Specification-Based Testing](https://banes-lab.com/records/arch/specification-based-testing.md)
- [Property-Based Testing](https://banes-lab.com/records/arch/property-based-testing.md)
- [Validation](https://banes-lab.com/records/arch/validation.md)
- [Verification](https://banes-lab.com/records/arch/verification.md)
- [Domain Model](https://banes-lab.com/records/arch/domain-model.md)
- [Fail Fast](https://banes-lab.com/records/arch/fail-fast.md)
- [Error Handling](https://banes-lab.com/records/arch/error-handling.md)
- [Model Evaluation](https://banes-lab.com/records/arch/model-evaluation.md)
- [Schema Validation](https://banes-lab.com/records/arch/schema-validation.md)
- [Type Safety](https://banes-lab.com/records/arch/type-safety.md)
- [Single Source of Truth](https://banes-lab.com/records/arch/single-source-of-truth.md)
- [Semantic Consistency](https://banes-lab.com/records/arch/semantic-consistency.md)
- [Input Validation](https://banes-lab.com/records/arch/input-validation.md)
- [Atomicity](https://banes-lab.com/records/arch/atomicity.md)
- [ACID](https://banes-lab.com/records/arch/acid.md)
- [Consistency](https://banes-lab.com/records/arch/consistency.md)
- [Isolation](https://banes-lab.com/records/arch/isolation.md)
- [Concurrency Control](https://banes-lab.com/records/arch/concurrency-control.md)
